Double the Fist

The excellent show Double the Fist is being rerun on ABC on Thursday nights at 11:15pm.

Even though the show won an AFI award last year, it was pretty easy to miss because it was initially shown on ABC 2 (the digital-only channel, which only a fraction of the population can tune into) and then late at night on the main channel.

I’ve been wanting to see the rest of the series ever since catching it part way through when it was shown last.

Re: Pixmap Memory Usage

Glynn: I suspect that the Pixmap memory usage has something to do with image rendering rather than applets in particular doing something stupid. Notice that most other GTK programs seem to be using similar amounts of pixmap memory.

To help test this hypothesis, I used the following Python program:

import gobject, gtk
win = gtk.Window()
win.set_title('Test')
win.connect('destroy', lambda w: gtk.main_quit())
def add_image():
    img = gtk.image_new_from_stock(gtk.STOCK_CLOSE,
                                   gtk.ICON_SIZE_BUTTON)
    win.add(img)
    img.show()
gobject.timeout_add(30000, add_image)
win.show()
gtk.main()

According to xrestop, this program has low pixmap memory usage when it starts, but jumps up to similar levels to the other apps after 30 seconds.

Update: of course, this issue has already been debugged by markmc. It is the SHM segment allocated for drawing pixbufs.

Switch users from XScreenSaver

Joao: you can configure XScreenSaver to show a “Switch User” button in it’s password dialog (which calls gdmflexiserver when run). This lets you start a new X session after the screen has locked. This feature is turned on in Ubuntu if you want to try it out.

Of course, this is not a full solution, since it doesn’t help you switch to an existing session (you’d need to guess the correct Ctrl+Alt+Fn combo). There is code in gnome-screensaver to support this though, giving you a list of sessions you can switch to.

OpenSSH support in bzr

I updated my bzr openssh plugin to be a proper patch against bzr.dev, and got it merged. So if you have bzr-openssh-sftp.py in your ~/.bazaar/plugins directory, you should remove it when upgrading.

Unfortunately there was a small problem resolving a conflict when merging it, which causes the path to get mangled a little inside _sftp_connect(). Once this is resolved, the mainline bzr should fully follow settings in ~/.ssh/config, because it will be running the same ssh binary as you normally use.

One thing I learnt when adding the support code was a quirk in the SFTP URI spec‘s interpretation of paths, which differs to gnome-vfs’s interpretation. The uri sftp://remotehost/directory is interpreted as /directory on remotehost by gnome-vfs, while the spec says that it should be interpreted as ~/directory.

To refer to /directory on remotehost, the spec says you should use sftp://remotehost/%2Fdirectory. I filed this as bug 322394.

PSP

On my way to UBZ, I bought a PlayStation Portable at the airport duty free store. It was being sold as the value pack and Ridge Racer game together, which came out at roughly the retail price of the two individual items minus 10% GST.

As well as playing games it can be used as a portable audio or video player and photo viewer, using memory stick duos as storage. As the device doesn’t come with any computer software, the manual provides all the details about what formats to use for audio/video and where to put the files on the memory stick. This is quite useful for people using minority operating systems like Linux :).

I wrote a little FDI file for the PSP to expose the portable_audio_player capability via HAL, but there doesn’t seem to be any standard properties to expose the other capabilities.

One of the more annoying aspects of the PSP is text entry. It seems as if they looked at the text entry used by consoles and mobile phones and combined the worst aspects of both:

  • There is a grid of buttons, each of which corresponds to 3 or 4 letters which can be selected by pressing the button multiple times.
  • You use the direction pad to select the button to press.
  • No predictive text input or similar.

For games this isn’t that big a problem, since they don’t generally require much text entry. It is more of a problem for the web browser where it is a lot more important. Something like Dasher might have been a much more useful text entry system, but I guess they decided to go with a more conventional approach.

Using OpenSSH with bzr

One of the transports available in bzr is sftp. This is implemented using the Paramiko SSH and SFTP library. Unfortunately there are a few issues I experienced with the code:

  • Since it is an independent implementation of SSH, none of my OpenSSH settings in ~/.ssh/config were recognised. The particular options I rely on include:
    1. User: when the remote username doesn’t match my local one. One less thing to remember when connecting to a remote machine.
    2. IdentityFile: use different keys to access different machines.
    3. ProxyCommand: access work machines that are behind the firewall.
  • Paramiko does not currently support SSH compression. This is a real pain for larger trees.

The easiest way to fix all these problems would be to use OpenSSH directly, so wrote a small plugin to do so. I decided to follow the model used to do this in gnome-vfs and Bazaar 1.x: communicate with an ssh subprocess via pipes and implement the SFTP protocol internally.

Since SFTP is layered fairly cleanly on top of SSH, and the paramiko code was also quite modular, it was possible to use the paramiko SFTP implementation with openssh. The result is a small plugin that monkey-patches the existing SFTP transport:

http://people.ubuntu.com/~jamesh/bzr-openssh-plugin/

Just copy openssh-sftp.py into the ~/.bazaar/plugins directory, and use bzr as normal. The compression seems to make a noticable difference to performance, but it should be possible to improve things further with a pipelined SFTP client implementation.

Of course, the biggest performance optimisation will probably come from the smart server, when that is implemented.

Moving from Bugzilla to Launchpad

One of the things that was discussed at UBZ was moving Ubuntu’s bug tracking over to Launchpad. The current situation sees bugs in main being filed in bugzilla while bugs in universe go in Launchpad. Putting all the bugs in Launchpad is an improvement, since users only need to go to one system to file bugs.

I wrote the majority of the conversion script before the conference, but made a few important improvements at the conference after discussions with some of the developers. Since the bug tracking system is probably of interest to people who weren’t at the conf, I’ll outline some of the details of the conversion below:

  • We are only migrating the open bugs — the existing bugzilla will remain available to read those bugs though.
  • Any bugzilla user account associated with an open bug (asignee, reporter, cc, qa contact or commenter) will be imported into Launchpad. If you already have a Launchpad account but use a different email for your bugzilla account, you have the following options:
    1. Add your bugzilla email to your Launchpad account.
    2. In bugzilla, change your email to one of the addresses registered to your Launchpad account.
    3. After the migration, merge the extra account into your existing account.

    Note that passwords are not migrated, because Launchpad uses a different password hashing algorithm to Bugzilla

  • All comments and attachments are imported.
  • Bugs are filed against the appropriate package under the “Ubuntu” distribution in Launchpad.
  • A bug watch is created, pointing at the original Bugzilla bug, so you can see any information not migrated.
  • If the bug was marked UPSTREAM and a bug tracker URL is included in the bugzilla URL field, then we attempt to create a bug task against the upstream product and link it to the remote bug. This depends on the upstream product existing and being linked to the package, so doesn’t always succeed. This feature was implemented to keep Sebastien happy, 68% of the UPSTREAM bugs are assigned to him.
  • Some of the bugzilla bugs are actually imported from debbugs. For these bugs, a bug task will be filed against Debian linked to the appropriate debbugs bug.

There are a few other things that need completing on the production Launchpad server before we can do the migration, but we should have a test import done on the staging server tomorrow some time.

Avahi on Breezy followup

So after I posted some instructions for setting up Avahi on Breezy, a fair number of people at UBZ did so. For most people this worked fine, but it seems that a few people’s systems started spewing a lot of network traffic.

It turns out that the problem was actually caused by the zeroconf package (which I did not suggest installing) rather than Avahi. The zeroconf package is not needed for service discovery or .local name lookup, so if you are at UBZ you should remove the package or suffer the wrath of Elmo.

Avahi on Breezy

During conferences, it is often useful to be able to connect to connect to other people’s machines (e.g. for collaborative editing sessions with Gobby). This is a place where mDNS hostname resolution can come in handy, so you don’t need to remember IP addresses.

This is quite easy to set up on Breezy:

  • Install the avahi-daemon, avahi-utils and libnss-mdns packages from universe.
  • Restart dbus in order for the new system bus security policies to take effect with “sudo invoke-rc.d dbus restart“.
  • Start avahi-daemon with “sudo invoke-rc.d avahi-daemon start“.
  • Edit /etc/nsswitch.conf, and add “mdns” to the end of the “hosts:” line.

Now your hostname should be advertised to the local network, and you can connect to other hosts by name (of the form hostname.local). You can also get a list of the currently advertised hosts and services with the avahi-discover program.

While the hostname advertising is useful in itself, it should get a lot more useful in Dapper, as more programs are built with mDNS support.

Ubuntu Below Zero

I’ve been in Montreal since Wednesday for Ubuntu Below Zero.

As well as being my first time in Canada, it was my first time in transit through the USA. Unlike in most countries, I needed to pass through customs and get a visa waiver even though I was in transit. The visa waiver form had some pretty weird questions, such as whether I was involved in persecutions associated with Nazi Germany or its allies.

I am getting up to speed with Bazaar NG, which looks like it should solve some of the scalability problems in bazaar. The main Launchpad tree had more than 600 branches merged in, comprising about 15,000 revisions). The equivalent bzr tree is significantly smaller, and contains the full revision history for the line of development. As well as the performance improvements, the tool feels a lot nicer to use.