mount.at up again aka how to export ejabberd userdatabases from a harddrive connected to a different host

Posted on January 25th, 2008

by siyb

We decided to upgrade the hardware on mount.at today and therefore had to shutdown the server for several hours. Hades is running again now, but not all services are restored to their full extend, the jabber server (jabber.mount.at) has been recovered already and should be usable again. Due to the fact that the bootloader was installed on a hdd that had a total breakdown and I/O errors that prevented a reinstallation of bootloader on the system drive, we had to setup the server again.

The main problem was that our backups of the Mnesia database where outdated, they had to be recovered from the old hdd (the one not broken :>). This procedure turned out to be far more complicated / frustrating than expected. Due to the fact that the control interface ejabberdctl relies on RPC, which require a valid hostname to function properly, the recovery wasn’t as simple as calling the program from the host we connected the old harddrive to. I wrote a small howto for anyone stuck in the same situation:

Solution: chroot

Mounting the harddrive

mkdir /mnt/hdd && mount /dev/sdaX /mnt/hdd

Mounting proc

mount -t proc proc /mnt/hdd/proc/

Change the hostname on the box to the hostname of the machine Mnesia was used on (changing the hostname within the chroot didn’t work), this is necessary because RPC will not work if you do not use the hostname of your old box

$editor /etc/hostname

Chrooting

chroot /mnt/hdd

Starting up the ejabberd daemon and executing backup procedure

/etc/init.d/ejabberd start && ejabberd_ctl backup /tmp/ejabberd.backup

Exit the chroot and copy the backup from /mnt/hdd/tmp/ejabberd.backup to the box you wish to apply it to, use

ejabberd_ctl restore /tmp/ejabberd.backup

to finally restore the backup …

You may need to follow this tutorial when porting the database to a host with a different hostname -> http://www.ejabberd.im/migrate-host

Mount.at will be unavailable for some time tomorrow as well, because the hardware upgrade could not be finished in today’s session, please stand by and sorry for any inconvenience caused.

Konfigurationen synchronisieren und verwalten mit git

Posted on August 28th, 2007

by jesse

Wir sind gerade dabei, auf unserer wootstube eine Versionskontrolle mit git einzurichten. Eigentlich wollten wir ja Subversion einsetzen und eigentlich ist das ja für unsere Entwicklungsprojekte gedacht. Aber weil der Linus sagt, dass Subversion scheisse und git so viel toller ist habe ich es mir einfach mal angeschaut und bin dabei auf einen ganz netten Nebeneffekt gestossen: die Möglichkeit, Konfigurationen über meine Boxen ohne viel Aufwand zu synchronisieren. So habe ich jetzt zum Beispiel auf Server, Workstation und Notebook immer dieselben Configs.

Ich versuche das im Folgenden ein wenig zu dokumentieren. Dieser Walkthrough eignet sich nämlich prima, um die ersten Umgangsformen von git zu verstehen. Übrigens, ich arbeite hauptsächlich mit gentoo. Auf debian heisst das git Paket git-core und die apache vhosts organisiert sowieso jeder auf seine eigene Art & Weise. Der Rest sollte ziemlich gleich sein.

SERVER-SIDE [+]

# git und gitweb für die Weboberfläche installieren USE="-vhosts" emerge -av dev-utils/git gitweb # ins Verzeichnis der apache vhosts wechseln cd /etc/apache2/vhosts.d/ # neue vhost anlegen cat > git.conf << EOF <VirtualHost DEINE_IP:80> ServerName git.DEINE_DOMAIN.de DocumentRoot /var/www/localhost/htdocs/gitweb/ RewriteEngine on RewriteRule ^/(.*\.git/(?!/?(info|objects|refs)).*)?$ \ /cgi-bin/gitweb.cgi%{REQUEST_URI} [L,PT] SetEnv GITWEB_CONFIG /etc/gitweb.conf <Directory '/var/www/localhost/htdocs/gitweb/'> Options FollowSymLinks -SymLinksIfOwnerMatch Indexes +MultiViews Order allow,deny Allow from all AllowOverride None </Directory> </VirtualHost> EOF # in Standard cgi Verzeichnis springen cd /var/www/localhost/cgi-bin # symlink für gitweb script anlegen (damit es durch portage aktualisiert werden kann) ln -s ../htdocs/gitweb.cgi # neue vhost laden /etc/apache2 reload # Verzeichnisse für git und User Verzeichnis anlegen mkdir -p /var/git/jesse # User Berechtigungen geben chown -R jesse.users /var/git/jesse # Von jetzt an machen wir als User weiter su jesse # Wir stellen uns git vor (sind ja höflich) git config --global user.name "jesse keys" git config --global user.email jesse@teranetworks.de" # Wir springen in unser Verzeichnis cd /var/git/jesse # Und initialisieren darin unser Repository git init # Jetzt können wir auch schon mit ner dummy Datei testen: echo "bar" > foo # git tracks content, not files: jede zu verfolgende Datei muss git erst # gezeigt werden (alternativ mit "git add ." alle Dateien im Verzeichnis) git add foo # Neue Datei mit Kommentar ins Repository übertragen git commit -a -m "inital commit for my repo"

CLIENT-SIDE [+]

# Wir brauchen das git Paket natürlich auch emerge -av dev-utils/git # Danach arbeiten als User su jesse cd ~ # Wir stellen uns git vor git config --global user.email "jesse@teranetworks.de" git config --global user.name "jesse keys" # Jetzt wirds interessant: wir holen uns das Repository vom Server # und packen es in ~/myrepo git clone git+ssh://geekosphere.org/var/git/jesse myrepo cd myrepo # Wir legen eine Testdatei an echo "bar" >> foo commit -a -m "woot, i changed it" # Und schicken sie wieder zurück ins Repository git push # Das wars schon mit dem rudimentären git Zauber! # Wenn wir die *Dateien* auf dem Server aktualisieren wollen müssen wir # dort übrigens ein "git checkout -f" in /var/git/jesse ausführen # Anhand der .zshrc zeige ich jetzt, wie man damit die Configs verwaltet: # Wir gehen ins Home Verzeichnis cd ~ # Verschieben die zshrc in das Repo mv .zshrc myrepo/ # Und legen einen Symlink ln -s myrepo/.zshrc # Nicht vergessen, git die neue Datei vorzustellen cd myrepo git add .zshrc # Brav committen git commit -a -m "yay, teh zshrc" # Und ab damit auf den Server git push # Haben wir von einem anderen PC aus Änderungen durchgeführt # aktualisieren wir unsere lokale Kopie: git pull

Eigentlich recht simpel, meiner Meinung nach aber echt genial. Hast Du toll gemacht, lieber Linus :)

Und hier findet ihr noch ein paar zusammengetragene Links zu Dokumentationen und Tutorials. Viel Spass!

Modifying the grub splashscreen

Posted on August 15th, 2007

by siyb

girls are friggn evil

First of all, you need to convert the image of your choice so that it can be used as a grub splash screen (you need imagemagick to execute this command):

convert mypic.jpg -resize 640×480! -colors 14 -depth 8 mypic_out.xpm.gz

This command will resize the picture to 640×480 and will convert it, so that it uses 14 colors only.

Move mypic_out.xpm.gz to /boot/grub

mv mypic_out.xpm.gz /boot/grub/

Add the following line somewhere under the timeout option in your /boot/grub/menu.lst file (might need alteration, depending on the location of grub):

splashimage=(hd0,0)/boot/grub/mypic_out.xpm.gz

That’s it, reboot the box and check out the result

We travel back, way back in time …

Posted on July 23rd, 2007

by siyb

I recently had a nostalgic backflash of some kind when surfing the net. I found a page containing several DOS games I used to play when I was a small kid. Games like: Wolf3d, Blake Stone, Duke3d and Blood. Surprisingly, some of the games are not free of charge, but luckily you are able to get a shareware version, which contains the first episode of each game, although there are more limitations to that as well (for instance, if you use the cheat ‘dnstuff’ in Duke3d, not all weapons will be given to you).

I decided to use dosbox for the emulation as I have used it before and as it has proven itself to be a capable tool. First of all you will need to install dosbox on your system (kinda obvious Oo), I am using Debian SID, so you might need to alter the commands to fit your needs.

apt-get install dosbox

After dosbox is installed you will need to modify the configuration file so that it fits your needs. The config can be found at /usr/share/doc/dosbox/dosbox.conf.example.gz.

mv /usr/share/doc/dosbox/dosbox.conf.example.gz ~ && gunzip dosbox.conf.example.gz && mv dosbox.conf.example .dosboxrc

Now it’s time to edit the configuration file. You should really modify the cpu settings, otherwise games will run extremely slow. I altered core and cycles, if you know the exact value of cycles your system is capable of specify it, else use the auto setting instead.

core=full
cycles=auto
cycleup=500
cycledown=20

If you want to be able to play games over LAN, you will also need to enable the ipx setting, I have not personally tested network gaming yet, but I suppose it works well.

ipx=true

Now open a terminal and run dosbox. Installing programs is pretty simple. First of all you need to create a directory somewhere in your filesystem. I am using ~/bin/dos/ for instance. After that you need to mount this directory onto a virtual drive.

mount c ~/bin/dos
C:

In this case the dos dir will be mounted onto C: and after that the current dir will be set to C:, you may add those two lines in the [autoexec] section of your .dosboxrc file in order to execute them on startup. Now use ‘cd’ to change to the directory of your desired game and run the installer.

Blake Stone
Duke 3d
Wolf3d

Compiz Fusion under Debian SID/Unstable

Posted on July 5th, 2007

by siyb

I came across an unofficial depot and tried to install “Compiz Fusion” on my Debian SID, here is a small howto:

Configure your system so that you are using aiglx (there are tons of tuts discribing the procedure around!)

First add these sources to /etc/apt/sources.list

deb http://download.tuxfamily.org/osrdebian unstable compiz-fusion-git
deb-src http://download.tuxfamily.org/osrdebian unstable compiz-fusion-git

After you removed all Beryl/Compiz etc packages (might work without removal, but I got rid of the old packages anyway), run apt-get update and install the following packages:

compizconfig-settings-manager
compiz-gnome (KDE users: compiz-kde)
compiz-plugins
compiz-fusion-plugins-extra
compiz-fusion-plugins-unsupported
compiz-fusion-plugins-unofficial
compiz-fusion-plugins-main
compiz-dev
compiz-core
emerald
python-compizconfig
libcompizconfig-backend-gconf (KDE users: libcompizconfig-backend-kconfig)
libcompizconfig0

You will need to have PyGtk 2.10.0 installed in order to make “ccsm” (the compiz configuration tool) work, check on that by:

apt-cache policy python-gtk2

if you haven’t got the right version make sure you update the package with:

apt-get install python-gtk2

Quite a few buttons in the ccsm tool are not working for me and are causing strange behaviour. I have written an email to the developer of ccsm, who told me that those bugs have been fixed, but that it will take a while for the fixes to appear in the repository.

Here is a little startup script, which will run compiz and emerald when executed:

#!/bin/sh
compiz –replace -c emerald &

UPDATE: The ccsm button problem has been fixed yesterday.


design: makequick.com | modificashuns and bugfixes by jesse
bottom