Moving ejabberd 2.1.x to a different server

Both server running ejabberd 2.1.x

Sync the config files.

# rsync -avP oldhost:/etc/ejabberd/ /etc/ejabberd/

Maybe also copy ssl-certs and allow ejabberd to access the pem file.

On the old server. ejabberd must be still running.

# ejabberdctl backup /tmp/ejabberd-oldhost.backup

On the new server. ejabberd must be already running.

# ejabberdctl restore /tmp/ejabberd-oldhost.backup

sign data with your ssh-key

This is just a kind of stub. But however ;)

>>> import paramiko.agent

>>> a = paramiko.agent.Agent()
>>> k = a.get_keys()[0]
>>> d = k.sign_ssh_data(None, 'Hello World')
### Transfer d
>>> from paramiko import Message
>>> from paramiko.rsakey import RSAKey
>>> with open('id_rsa.pub') as f:
...     keytype, b64key, _ = f.next().strip().split(None, 2)
...
>>> import base64
>>> pkey = RSAKey(data=base64.b64decode(b64key))
>>> msg=Message(d)
>>> pkey.verify_ssh_sig('Hello World', msg)
True
>>> pkey.verify_ssh_sig('Hellö World', msg)
False

ssh-agent should run.

Integration of pylint into jenkins

I integrated pylint into Jenkins to get a better code quality overview. Most of the integrations is quite easy and straightforward.

  1. Install the violations plugin for Jenkins.

Jenkins -> Manage Jenkins -> Manage Plugins, or just /pluginManager

  1. Create a pylint config and added it to my repo. Using output-format=parseable
$ pylint --generate-rcfile > pylint.cfg

$ ... customize pylint.cfg
$ git add pylint.cfg
$ git commit -a -m "added pylint"
$ git push
  1. Added the pylint run to my Jenkins build job.

Jenkins -> MyJob -> Configure

Add build step -> Execute shell

if [ ! -d venv ] ; then

   virtualenv --python=python2.7 venv
fi
source venv/bin/activate
export PYTHONPATH="$PWD:$PYTHONPATH"

pip install pylint

cd repo
### Need this because some strange control sequences when using default TERM=xterm
export TERM="linux"

## || exit 0 because pylint only exits with 0 if everything is correct
pylint --rcfile=pylint.cfg $(find . -maxdepth 1 -name "*.py" -print) MYMODULE/ > pylint.log || exit 0
  1. Add the Violation reporting

Jenkins -> MyJob -> Configure

Add post-build Action -> Report Violations

Filled the field pylint with the pattern **/pylint.log

/posts/pylint.thumbnail.png

So the next build also performed the pylint run, and generated the report with graphs.

/posts/pylintgraph1.thumbnail.png

... with the list of source files.

/posts/pylintgraph2.thumbnail.png

Unfortunately, on click onto the filename, I got an empty page, where I expected the source view, including detected warnings and errors.

I quick search on the jenkins server showed the xml results of the pylint run. The xml was valid, and seemed to be correct. So the reneration of the report should not be the problem.

A web search just gave me some defects, similar to my problem, but the tickets all are still open. So I digged around in the Violations cofiguration in MyJob. Just by "educated guess", I filled the field "Source Path Pattern" with **/

/posts/pylintsourcefiles.thumbnail.png

et voila, the the results for each file were available after the next build.

Arch Linux update error because of poppler-qt

Maybe just because I did not update that often in the last weeks, I ran into this error:

# pacman -Suy

:: Synchronizing package databases...
 core is up to date
 extra is up to date
 community is up to date
 multilib is up to date
error: failed to prepare transaction (could not satisfy dependencies)
:: Starting full system upgrade...
:: poppler-qt: requires poppler=0.22.5

First updating poppler-qt, or to be more exact poppler-qt4, and poppler-glib solved the problem.

# pacman -S poppler-qt

resolving dependencies...
looking for inter-conflicts...
:: poppler-qt4 and poppler-qt are in conflict. Remove poppler-qt? [y/N] y
error: failed to prepare transaction (could not satisfy dependencies)
:: poppler-glib: requires poppler=0.22.5

# pacman -S poppler-qt poppler-glib
resolving dependencies...
looking for inter-conflicts...
:: poppler-qt4 and poppler-qt are in conflict. Remove poppler-qt? [y/N] y

Packages (4): poppler-0.24.0-1  poppler-qt-0.22.5-1 [removal]
              poppler-glib-0.24.0-1  poppler-qt4-0.24.0-1

Total Download Size:    1.18 MiB
Total Installed Size:   5.90 MiB
Net Upgrade Size:       0.08 MiB

:: Proceed with installation? [Y/n]
:: Retrieving packages ...
 poppler-0.24.0-1-x86_64  922.3 KiB   657K/s 00:01 [----------------------] 100%
 poppler-qt4-0.24.0-...   130.0 KiB   395K/s 00:00 [----------------------] 100%
 poppler-glib-0.24.0...   158.3 KiB   697K/s 00:00 [----------------------] 100%
(3/3) checking keys in keyring                     [----------------------] 100%
(3/3) checking package integrity                   [----------------------] 100%
(3/3) loading package files                        [----------------------] 100%
(3/3) checking for file conflicts                  [----------------------] 100%
(4/4) checking available disk space                [----------------------] 100%
(1/1) removing poppler-qt                          [----------------------] 100%
(1/3) upgrading poppler                            [----------------------] 100%
(2/3) installing poppler-qt4                       [----------------------] 100%
(3/3) upgrading poppler-glib                       [----------------------] 100%

Mac OS X iTerm2, tmux and jump word

Currently I'm working on a MacBook. Not entirely by choice, however.

I'm trying to use my almost used environment, including tmux. As Terminal replacement I'm using iTerm2, since it seems to be faster. Unfortunately I was not able to use ALT-[left|right] to jump words backward and forward. The only thing I had to do to solve this... capturing the sequences of ALT-left and ALT-right and place them into ~/.inputrc

# Press ALT-left

$ read
^[^[[D
# and ALT-right
$ read
^[^[[C
$ vi ~/.inputrc
"\e\e[D": backward-word
"\e\e[C": forward-word

And open an new instance of iTerm2.

Sprechende Fehlermeldungen #2

Neues aus der Rubrik "Die sprechenste Fehlermeldung des Tages":

$ mplayer -dumpstream dvb:// -dumpfile test.ts

MPlayer SVN-r36285-4.8.0 (C) 2000-2013 MPlayer Team
Cannot test OS support for SSE, disabling to be safe.
205 audio & 424 video codecs
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing dvb://.
DVB CONFIGURATION IS EMPTY, exit
Failed to open dvb://.

Selbstverständlich bedeutet diese Meldung nicht, dass es keine Datei ~/.mplayer/channels.conf gibt. Oder selbige vielleicht leer ist. Mitnichten. In Wirklichkeit ist selbstverständlich gemeint, dass mein Benutzer keinen Zugriff auf /dev/dvb/adapter0 hat.

Sprechende Fehlermeldungen

 "errors": {

    "project": "Not given or wrong type",
    "team": "Not given or wrong type"
},

Erst einmal ist es blöd, dass die API mir nicht sagt ob ich den Parameter nun nicht angegeben oder ihn falsch gesetzt habe. Egal welche Kombination und Typen ich übergebe, die Meldung bleibt die selbe. Auch wenn ich die Parameter weg lasse.

Da bleibt wieder einmal nichts anderes übrig, als das Code-Repo zu suchen und den Codo zu durchforsten. Stellt sich heraus... die Parameter müssen id und projectid heißen.

Das ist doch böswillig!?

Über meinen letzten Versuch Musik online zu kaufen

Gestern war es mal wieder soweit. Nachdem ich vor einiger Zeit schon einmal erfolgreich Musik online gekauft habe, wollte ich mein Glück ein zweites mal strapazieren. Beim letzten mal konnte ich zum Glück einfach auf die Seite von Of Monsters and Men gehen und den dort verlinkten Store benutzen. Ich bekam einen Link und konne mir die Dateien auf ganz herkömmlichen Wege herunter laden. Auch kann ich sie auf allen meinen Geräten abspielen. Super geschichte.

Mein gestriger Versuch scheiterte hingegen kläglich. Im offiziellen Shop von Jake Bugg fand ich keine Download-Version. Daher entschied ich mich für amazon. Der Kaufprozess an sich ging ohne Probleme vonstatten. Knopf drücken, Geld weg. Danach bekam ich zwei Möglichkeiten, die Songs herunter zu laden. Einmal eine Datei für den Amazon Downloader, einmal über den Amazon Cloud Player. Der Amazon Downloader fiel eigentlich gleich flach, da es nur Versionen für Windows und Mac OS gibt. Trotzdem lud ich die Datei schicherheitshalber herunter.

Ich öffnete den Amazon Cloud Player. Nach erneuter Eingabe meines Passworts wurde ich erst einmal nach meinen Kreditkartendaten gefragt. Nungut, dachte ich so bei mir. Man kann über den Cloud Player schließlich weitere mp3s kaufen. Nach Eingabe der Daten bekam ich nur die Meldung:

Important Message
There was a problem with your address submission. Please fix all the areas below and try again.

Natürlich ohne weitere Angabe welche Felder oder Angaben falsch sind. Leider keine Möglichkeit über diesen Weg an die von mir bezahlte Musik zu kommen. Natürlich versuchte ich es mit zwei unterschiedlichen Browser.

Nun, am Abend habe ich eine Freundin besucht, von der ich wusste, dass sie einen Windows-PC besitzt. Ich hatte die Hoffnung, dass der Amazon Donwloader funktioniert, oder aber der Cloud Player vielleicht im Internet Explorer. Nichts davon war der Fall. Der Downloader meldet, die Dateien seien nicht mehr verfügbar. Der Cloud Player macht das selbe Problem wie auf meiner Linux Box. Einen Knopf "Bestellung zurückgeben" gibt es natürlich nicht.

Fazit: Geld weg, keine Musik, und die Erkenntnis, keine Musik mehr zu kaufen. .. Of Monsters and Men: http://www.ofmonstersandmen.com/ .. Store: http://ofmonstersandmen.cinderblock.com