Google Earth and IPv6 DNS lookups

January 22, 2011 Leave a comment

Apparently the combination of a WLAN router that blocks IPv6 DNS queries of type AAAA (in my case, it was a Siemens S1621-Z220-A sold as Alice Modem 1121 WLAN) and the current version of Google Earth for Linux (I am using 5.1.3533.1731 from Medibuntu) do not work well together. The problem is that the router simply throws away AAAA queries (or generally, any type it does not know), so the DNS query times out. However, Google Earth does not seem to fall back to IPv4 queries (type A) in this case, and shows a message about network connectivity errors. I don’t know if it’s Google Earth’s fault or if the underlying eglibc resolver of my Linux system does something wrong, anyhow there is a fairly well-commented bug report on Launchpad for Ubuntu Karmic and Lucid which explains the issue.

Anyway, I got rid of the problem by manually configuring a nameserver on my local machine (for example the nameserver(s) of your internet provider, or the ones of OpenDNS), and not using the WLAN router as a resolver. NetworkManager allows you to do this by editing a connection and choosing “Automatic DHCP (Addresses only)” on the IPv4 register tab; or you can write the settings directly to your /etc/resolv.conf (here for the OpenDNS servers):


Flattr this

Change partition type without reformatting

January 2, 2011 Leave a comment

Note to myself: it is possible to change the partition type of a already formatted (and used) partition. For example, if you have already formatted the partition with NTFS, but accidentally had created it with partition type 0x83 (Linux), so Windows can’t read it, since it expects 0x07 (HPFS/NTFS). On Linux, you can use sfdisk for that purpose:

# Be root
dd if=/dev/sdb of=sdb-bootsector count=1  # backup boot sector
sfdisk -d /dev/sdb | sed -e 's/Id=83/Id=07/' > /tmp/sdb.txt   
sfdisk /dev/sdb < /tmp/sdb.txt

(fill in the right values for your case)

Of course, good old fdisk works also, use the t command.


Flattr this

Flattr me!

November 14, 2010 Leave a comment

Some of you may have noticed that I have put flattr buttons below my posts. For those who are not familiar with flattr: It is a micropayment service which allows you to show your appreciation for (free) content by making small donations to its author. Basically it works by spending only a fixed (but adjustable) amount of money per month, so you don’t have to worry about how much you can afford; and clicking flattr buttons for things you like. At the end of the month, the money you decided to spend is divided by the number of flattr buttons you clicked in this month, and the fractions are given to the respective authors. So if you decide to spend $4 each month, and you click four flattr buttons of four different authors, every author gets $1. There is also a nice video on the flattr homepage that explains the idea:

So, from now on, if you like, you can flattr me. Just sign up on and click the buttons below each post 🙂

<commercial />

Note: The standard click-on-the-fly-and-show-how-many-users-have-flattrd-this button needs JavaScript, which is bad, so I only use the static button which directs you to the thing on the flattr site.

Flattr this

Categories: Uncategorized Tags: , ,

Windows Device Manager: Code 39 with CDROM drive

November 14, 2010 Leave a comment

My sister asked me to have a look at her notebook (a Medion Akoya P6612 with Windows Vista) because the CDROM drive wouldn’t work, and it was not even displayed in the Windows Explorer. I looked into the Device Manager and noticed that the CDROM device (TSSTCorp SN-S083a) was displayed with a small yellow exclamation mark besides its icon, and it said on the Properties page that the device could not be started and referred to Code 39. Reinstalling the drivers had no effect, but after I had a little chat with Big Blue G, I found a howto entry which suggested the following:

  1. Be logged in with an administrator account
  2. Open the Registry Editor (choose it from the Start Menu or press Win+R and type regedit)
  3. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E965-E325-11CE-BFC1-08002BE10318}
  4. Then, in the right pane, delete all of the following keys:
    • UpperFilters
    • LowerFilters
    • UpperFilters.bak
    • LowerFilters.bak
  5. Restart your computer

This worked fine for me.

Flattr this

Bluetooth tethering via PAN with Windows Mobile and Ubuntu

November 8, 2010 2 comments

I was on the train today, needed some of the Boost manuals, and had no internet connection. So I wanted to use my phone (an old HTC Prophet with Windows Mobile 6.1) as a network access point to browse over GPRS/EDGE. As I found out, it is fairly simple with Blueman and it even provides NetworkManager integration, so all NetworkManager-capable applications can be notified about the connectivity. Windows Mobile 6.1 allows tethering over a Bluetooth PAN (Personal Area Network); but there is another method called DUN (Dial Up Networking), which I will not describe here. So here is a step-by-step tutorial what I did for my PAN approach, with a few (german) screenshots, tested on Ubuntu 10.04 Lucid:

  1. Since my laptop was running on Ubuntu Lucid, there was already a recent Blueman version in the Ubuntu repos available. On older systems, you may want to add the Blueman Launchpad PPA.
    sudo apt-add-repository ppa:blueman/ppa  # only necessary on pre-lucid systems
    sudo aptitude update
    sudo aptitude install blueman

    Note that this also removes possibly installed gnome-bluetooth packages since Blueman is an adequate replacement for the GNOME Bluetooth UI.

  2. After the installation has finished, I had to enable the NMPANSupport plugin for NetworkManager 0.8 by right-clicking on the Blueman icon in the GNOME notification area and selecting “Plugins”. For older NetworkManager versions, there is also a plugin for NetworkManager 0.7, called NMIntegration.
    Blueman menu Blueman plugins
  3. Then I activated tethering on my phone (“Programs” → “Internet Sharing” on my Windows Mobile 6.1, but YMMV). Apparently this was neccesary with my model, because without tethering enabled I could not get a Bluetooth PAN connection in the next step.
    Windows Mobile 6.1: Programs menu Windows Mobile 6.1 Connection Sharing
  4. I paired the phone and my laptop via Bluetooth, and created a PAN (Personal Area Network) by connecting to the “Network Access Point” service on the phone. In Blueman, all you have to do after pairing is right-click on the device and select “Connect To: Network Access Point”. This creates a new network device bnep0 which is automagically configured through NetworkManager (using a stateless address autoconfiguration).
    Blueman: Connect to Network Access Point

    (Yes, my phone is called Leia… I also have another HTC Prophet that’s called Luke :-))

  5. However, in my setup, though I was able to ping certain IP adresses on the internet, DNS lookups timed out for some reason. It got better when I explicily set an IP address for the Bluetooth PAN driver on my phone, and did the tethering process all over again.
    Windows Mobile 6.1: Connactions menu Windows Mobile 6.1: Network Drivers Windows Mobile 6.1: Set up IP address
  6. And off I went with mobile internet access. Woo-hoo! \o/

I may also add that the NetUsage plugin in Blueman is very reasonable to use 😉 After activated, the network usage can be viewed by right-clicking on the Blueman icon and selecting “Network Usage”.

Flattr this

SSH key authentication with encrypted home directories

October 9, 2010 5 comments

Yesterday, I ran into an interesting problem: I tried to set up SSH public key authentication between two of my machines, c3po and r2d2, so I could log in from rohieb@r2d2 to rohieb@c3po without a passphrase. However, everytime I tried to login to c3po, I was prompted to enter the passwort for rohieb@c3po, and the debug output mentioned something that thekey could not be verified. More astonishing, when I established a second SSH connection while the first was still running, I was not prompted for a password, and debug output said that key authentication had been sucessful. I googled a bit, and after a while got to this comment on Launchpad, mentioning problems when the user on the remote machine had its home directory encrypted through ecryptfs – which was the case for me. Of course, since ecryptfs only encrypts the user’s home after he has been authenticated, the SSH daemon cannot read his ~/.ssh/authorized_keys at the first time, and falls back to password authentication.

The Launchpad comment proposes to first unmount the ecryptfs filesystem, then store ~/.ssh/authorized_keys unencrypted, and then mount the encrypted home again (note that no program should be running that could try to access your home directory):

 $ ecryptfs-umount-private
 $ cd $HOME
 $ chmod 700 .
 $ mkdir -m 700 .ssh
 $ chmod 500 .
 $ echo $YOUR_REAL_PUBLIC_KEY > .ssh/authorized_keys
 $ ecryptfs-mount-private

This works indeed, but has the drawback that key authentication only works for the first login, because ecryptfs hides the unencrypted files when it mounts the encrypted directory on login; and you had to synchronize the encrypted and the unencrypted version of authorized_keys everytime you add a new key. To circumvent that, I simply moved the file to /etc/ssh/authorized_keys/rohieb (with the file only readable and writable by me, and /etc/ssh/authorized_keys writeable for all users) and adjusting /etc/ssh/sshd_config appropriately:

$ sudo vi /etc/ssh/sshd_config  # or use gedit instead of vi, or whatever...
[... some lines ...]
AuthorizedKeysFile /etc/ssh/authorized_keys/%u
[... some more lines ...]
$ sudo /etc/init.d/ssh restart


There is a better approach instead, which doesn’t need the SSHd config to be edited at all:

  • login to the user on the remote machine
  • create /home/.ecryptfs/$USER/.ssh and put your authorized_hosts there
  • symlink your encrypted version there:
    $ ln -s /home/.ecryptfs/$USER/.ssh/authorized_hosts ~/.ssh/authorized_hosts
  • symlink your unencrypted version there (as above, make sure no process wants to write to your home directory in the meantime):
    $ ecryptf-umount-private
    $ mkdir ~/.ssh
    $ ln -s /home/.ecryptfs/$USER/.ssh/authorized_hosts ~/.ssh/authorized_hosts
    $ ecryptfs-mount-private

The paths are for Ubuntu 9.10 (Karmic Koala) and later. On other systems, you might want to replace /home/.ecryptfs with /var/lib/ecryptfs.

Flattr this

ZSNES on AMD64 Ubuntu

October 6, 2010 11 comments

[ Update, 2013-10: This post post is not up to date anymore. On newer Debians (since 7.0/wheezy) and Ubuntus (at least since 12.04, Precise Pangolin), you should be able to install zsnes out of the box: sudo apt-get install zsnes:i386. For details see the MultiArch documentation for Debian and Ubuntu. ]

Before I had bought my current hardware, I was working on a 32-bit-based system, and I really appreciated ZSNES as an SNES emulator. But unfortunately, my new hardware was an AMD64 system, and there is currently no ZSNES package for 64-bit Ubuntu or Debian 😦 So I decided to google a bit about the issue, but it took me until now (a year later) to get ZSNES finally working on my machine. The problem is, if you build ZSNES on a 64-bit machine, all the application does is segfault at start, and if you try to compile for 32-bit systems, you get errors about missing 32-bit libs (in particular, configure does not find a suitable libsdl). Instead, if you just take the binary which was compiled on a 32-bit system, and install ia32-libs everything seems to work—at least I was able to play a few levels of Super Mario World succesfully 🙂

So here was my idea: take the 32-bit package from the Ubuntu repository, and just change the Architecture control field, and by this fool dpkg 😛 And as it turned out, this idea worked great. You can get the Debian package here if you want, it should work for Ubuntu Karmic and Lucid, as well as for Debian testing (but I only tested it on Lucid, so there is no warranty here—but I’m happy to hear if it works :)):

For the curious people reading here, here is what I actually did:

  1. wget
  2. ar x zsnes_1.510-2.2ubuntu3_i386.deb
  3. tar xzf data.tar.gz
  4. Edited usr/share/applications/zsnes.desktop and added -ad sdl to the Exec: field, otherwise it would just segfault on the first run:
    Exec=zsnes -ad sdl
  5. Edited usr/share/doc/zsnes/changelog.Debian.gz and added a new changelog entry for the version
  6. tar xzf control.tar.gz
  7. Edited the control file, changed the Version: and Architecture: field to amd64, added the ia32-libs dependency, and set myself as maintainer:
    Package: zsnes
    Version: 1.510-2.2ubuntu3~ppa1
    Architecture: amd64
    Maintainer: Roland Hieber <>
    Installed-Size: 4160
    Depends: ia32-libs, libao2 (>= 0.8.8), libc6 (>= 2.4), libgcc1 (>= 1:4.1.1), libgl1-mesa-glx | libgl1, libpng12-0 (>= 1.2.13-4), libsdl1.2debian (>= 1.2.10-1), libstdc++6 (>= 4.1.1), zlib1g (>= 1:
  8. Changed the md5sums file for the right values for usr/share/applications/zsnes.desktop and usr/share/doc/zsnes/changelog.Debian.gz (I used the md5sum command and copy-pasted it)
  9. tar czf control.tar.gz control md5sums postrm postinst
  10. tar czf data.tar.gz usr/
  11. ar r zsnes_1.510-2.2ubuntu3~ppa1_amd64.deb debian-binary control.tar.gz data.tar.gz

I’m afraid that I can’t put the package to PPA, Launchpad only accepts source packages for uploads, and builds the binary packages itself, both for i386 and AMD64. This approach can not be used here, since we needed the i386 binary for AMD64.

Flattr this