Archiv der Kategorie ubuntu

ubuntu-bug audio

Thanks to the work of David Henningsson, we now have a proper Apport symptom for audio bugs. It just got updated again to set default bug titles, which include the card/codec name and the problem, so that Launchpad’s suggested duplicates should work much more reliably.

So from now on you are strongly encouraged to report sound problems with

$ ubuntu-bug audio

instead of trying to guess the package right.

Tags: , , , , , , ,

GNOME commit powers

I finally listened to Sebastien Bacher and applied for GNOME commit rights yesterday, after hassling Seb once more about committing an approved patch for me. Surprisingly, it only took some 4 hours until my application was approved and my account created, wow! Apparently 71 patches are enough. :-)

With my new powers, I fixed a crash in gdm, and applied two stragglers into gvfs’ build system today.

More to come!

Tags: , , , , ,

lpshell – convenient launchpadlib script

These days I often use launchpadlib in my projects for scripting access/modifications in Launchpad. While launchpadlib has quite a good API documentation, this only covers the method calls, not the attributes or collections. So it often takes some poking and trying until you figure out how to access/change things.

I found myself typing the same things over and over, so I finally wrote a little script called lpshell:

#!/usr/bin/python -i
import code, os, sys
from launchpadlib.launchpad import Launchpad, STAGING_SERVICE_ROOT, EDGE_SERVICE_ROOT
lp = Launchpad.login_with('test', STAGING_SERVICE_ROOT)

This logs into Launchpad and gives you an interactive Python shell with an “lp” object:

$ lpshell
>>> lp.bugs[439482].duplicate_of

Update: I committed this to ubuntu-dev-tools now, renamed to lp-shell for consistency with the other lp-* commands.

Tags: , , , ,

Easier offline bug reporting with Apport

The days before Chistmas are a wonderfully quiet time to catch up on old work which otherwise just drowns in the daily noise. I got a lot of Apport cleanups and improvements done.

One particular highlight of 1.11 is that it is now easy and consistent to collect information for a bug report on one place/at one time and save it into a file

$ apport-bug --save /tmp/argh.apport udev

… and report that later on with

$ apport-bug /tmp/argh.apport

This can happen on an entirely different machine.

Tags: , ,

New PostgreSQL releases need testing

Yesterday PostgreSQL released new security/bug fix microreleases 8.4.2, 8.3.9, and 8.1.19, which fix two security issues and a whole bunch of bugs.

Updates for all supported Ubuntu releases are built in the ubuntu-security-proposed PPA. They pass the upstream and postgresql-common test suites, but more testing is heavily appreciated! Please give feedback in bug LP#496923.

Thanks!

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(
            "org.freedesktop.DeviceKit.Disks",
	    "/org/freedesktop/DeviceKit/Disks",
	    "org.freedesktop.DeviceKit.Disks");

    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 X.org branch to our xorg-edgers packages into my halsectomy PPA, created some udev rules for udev-based X.org input detection ([1], [2]), and off we go: that was the last hal reverse dependency. My system now fully boots and works without hal.

Hooray!

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. :-P

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

Requirements

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).

rsnapshot

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
/.aptitude
/.ccache
[...]
/download
/ubuntu
[...]

(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/ piware.de:backup/tick-home

interval daily 7
interval weekly 4
interval monthly 6

backup /home/martin martin-home

cronnery

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 piware.de:backup/tick-home/daily.1/.

Tags: , ,