Archiv für November 2009

Nicht mehr aufzuhalten: Weihnachten

Am Samstag waren wir wie schon viele Jahre zuvor bei Anne zum traditionellen Plätzchen/Pfefferkuchenhaus backen. Es ist wieder einiges zusammengekommen, und leeecker geworden!

Netti hat das halbe Wochenende damit verbracht, einen Adventskalender für mich zu basteln. Kann es kaum noch erwarten, morgen die erste Rolle aufzumachen!

Adventskalender 2009_Vorschau

Tags: , , , , , ,

“hello dbus” in vala

On the long flight back from UDS-Lucid I read the Vala tutorial on my ebook, and did some of the exercises. I was curious about Vala because it combines the speed and memory efficiency of C in a sane C#-like language with proper memory management, exceptions, and without the silly “close to the metal” faff that is usually required in C.

And indeed I wasn’t disappointed. It’s not as convenient as Python, but really not far from it, and it’s faaaast!

Today I finally got back to this and wrote my first D-Bus example in vala which does a call to DeviceKit-disks:

using DBus;

int main(string[] args)
    Connection con = Bus.get(BusType.SYSTEM);

    dynamic DBus.Object dk = con.get_object(

    ObjectPath[] devs = dk.EnumerateDevices();
    foreach (ObjectPath o in devs)
	stdout.printf("%s\n", o);

    return 0;

Compile and run it with

valac --pkg dbus-glib-1 dbus-dk.vala && ./dbus-dk

and voila!

Tags: , , ,

sudo dpkg -P hal

The day has come!

Yesterday I dropped the superfluous hal dependency from gparted, today I uploaded gdm to stop using hal for getting the keyboard layout and use libxklavier instead.

I also applied Julian Cristau’s udevified branch to our xorg-edgers packages into my halsectomy PPA, created some udev rules for udev-based input detection ([1], [2]), and off we go: that was the last hal reverse dependency. My system now fully boots and works without hal.


Tags: , , , ,

Nicer Launchpad upstream releases with lp-project-upload

A while ago I introduced a script lp-project-upload to automate tarball release uploads to Launchpad.

Many people asked for further features, two of which I added now: First, it automatically invokes gpg to create a tarball signature (unless one is already present), and second it invokes an editor to specify changelog and release notes (just keep the files empty if you don’t need them).

Uploaded to lucid’s ubuntu-dev-tools, enjoy!

You know that you are in the U.S. …

when you go to dinner in a car^Wtank^Wbattleship^Wrazy something like this:

Hummer limo

I savely arrived in our hotel in Dallas, Texas this afternoon, after a rather uneventful 14 hour trip from Dresden via Frankfurt. On the way I emptied my laptop battery with some small hacking and catching up on bug report email, and did a lot of reading. I also tried to watch Harry Potter 6, but the headphones they give you were so hideous that I hardly understood anything, so I gave up after some ten minutes.

In the early evening a small group of us went to the center to have a light Mexican style dinner (yummy), and someone came up with the monster above. Was quite an experience, veeery comfortable interior with leather couches and champagner glasses. Almost as comfortable as on my bicycle at home. 😛

Naturally I feel the jetlag and are pretty groggy now, but I still managed to stay conscious until now, after having a beer and two hours of chatting in the bar. It’s so great to see everyone again!

I’m looking forward to the Ubuntu Developer Summit next week.

Tags: , , , , ,

My desktop backup solution


Through the last years I have used various own hacks for backing up my desktop(s). There are dozens of packaged backup solutions in Debian/Ubuntu already, but none of them did quite fit my requirements:

  • KISS! no fancy web UI, storage formats, or millions of plugins and configuration files; backups should just be a normally accessible directory
  • Supports standard backup strategy: daily backups for last week, weekly backups for last month, permanent monthly backups. This must not require my computer to be switched on all the time.
  • Runs as my own user, so that I don’t need to set it up each time I reinstall my box
  • No interactivity; any backup solution that requires me to do anything regularly is doomed to fail.
  • Push-style backup to my server through ssh (or derived, like scp or rsync)
  • Supports per-directory filtering to avoid backing up unnecessary stuff; my upload bandwidth is very small. (e. g. I don’t want to include ~/.cache and in ~/evolution I want to ignore the cache subdir).


I have used rsnapshot as a basis for about a year now. It was originally intended to be used with pull-style, but that does not work for home setups behind a NAT. But it’s easy to use push-style with it (details later). It is by and large a fancy wrapper around good old trusted rsync, which is why I liked it from the start: It by and large just creates a full tree copy of your data for each snapshot, and uses hardlinks to avoid duplicate files. So restoring is easy and robust, you can use any file browser to get to your data.

File selection

If in doubt, backup should include a file rather than exclude it. I value completeness over small storage size, and I just check the volume of a snapshot from time to time to ensure that it doesn’t grow too big (it’s currently in the magnitude of 200 MB, which is small enough for daily deltas to be pushed through a slow DSL uplink without much pain). So my approach is to backup everything in /home/martin except explicitly configured files. For configuring the blacklist I use per-directory .rsync-filter files (which have builtin support by rsync).

Excerpt of my ~/.rsync-filter:

# global ignores
– *.log
– *.cache
– .*.swp
– .swp
– .*.lock
# only direct subdirectories/files
– /.ICEauth*
– /.Trash

(In case you wonder, everything in ubuntu/ is either in the Ubuntu archive or in bzr, so no need to include this.)

Another example is ~/.Private/mozilla/firefox/t3znsw4q.default/.rsync-filter:

– /url*.sqlite*
– /*.bak
– /Cache
– /adblockplus
– /OfflineCache

Please see man rsync, section “FILTER RULES” for the details of the syntax.

Having and maintaining a sensible arrangement of your home directory is by far the most difficult aspect of backup, if you need to be stingy with bandwidth.

rsnapshot configuration

You need a central configuration file ~/.rsnapshotrc. The most important settings are the paths to back up, the destination directory, and the modes (daily/weekly/monthly). In addition I include my crontab into the backup, and add a post-backup action to rsync the backup tree to my server. Backups go to /var/backups/$USER on my systems, which is a different partition than /home (can’t stress that enough; today’s file systems are good, but not infallible).

config_version 1.2
snapshot_root /var/backups/martin
cmd_rsync /usr/bin/rsync

link_dest 1
one_fs 1
lockfile /home/martin/.rsnapshot.lock
rsync_long_args -F –delete –numeric-ids –delete-excluded
cmd_preexec /bin/sh -c ‘crontab -l > ~/.crontab’
cmd_postexec /bin/rm ~/.crontab
cmd_postexec /usr/bin/rsync -e ‘ssh -i /home/martin/.ssh/id-backup_rsa’ -aHzvPy –delete /var/backups/martin/

interval daily 7
interval weekly 4
interval monthly 6

backup /home/martin martin-home


The last piece of the puzzle is a script which calls rsnapshot regularly with the desired mode. I wrote a small shell script (which lives in ~/bin/backup) which determines the age of the last daily/weekly/monthly backup, and calls rsnapshot with the correct mode argument. It doesn’t do anything if the last backup was done less than a day ago, so it’s designed to be called very often.

The actual cron job just needs to call it every hour:

$ crontab -l
# m h dom mon dow command
05 * * * * $HOME/bin/backup >/dev/null

And voila, from now on I have e. g. yesterday’s backup on

Tags: , ,

Photo Quiz

Vor einer Weile habe ich ein wirklich interessantes und schönes Motiv gefunden und fotografiert. Errät jemand, was das ist?

A while ago I found a really interesting and beautiful motif and shot a photo of it. Can anyone guess what it is?


Natürlich habt Ihr es rausbekommen, es ist gefrorener Spinat in einer Schachtel. Ich habe das nur durch Zufall entdeckt, und fand die Eiskristalle einfach wunderschön.

Of course you got it right; it’s frozen spinach in a box. I just discovered it by accident, and found the ice crystals marvellous.

Tags: ,

Hello Ween!

Ein gruselig schönes Halloween an Euch alle! Gestern haben Netti und ich wieder gebastelt:


Wir hatten mit einigen Freunden eine sehr schöne Feier. Danke nochmal an Sonni und Knäcke!

Happy Halloween everyone! Netti and I made some nice pumpkin yesterday, and had a great party with some friends.

Tags: , , ,