The image itself was taken from the Android bios boot animation – I haven’t been able to find
the name of the author but all credits go to him (or her)

Ascii Android

Use fastboot to install the image

$ fastboot flash splash1 splash1.img
sending 'splash1' (750 KB)... OKAY
writing 'splash1'... OKAY
$ fastboot reboot

Get the file

For a long time, in the olden days, I ran Xubuntu – mainly because I loved the simplicity of the desktop (and also because it was a lot lighter on my machine, a Thinkpad T40, than GNOME. And I just have no love for KDE). Then some changes were made to the menu system (or the way to edit it) which annoyed the hell out of me – that combined with a new, more powerful machine, I decided to switch to GNOME, which I’ve been running for a couple of years.

Recently two things have happened

  • Ubuntu decided to switch to Unity as the default graphical environment
  • GNOME released 3.0 and announced that GNOME 2.x will no longer be actively developed (bug fixes only)

While both Unity and gnome-shell look nice and definitely have their place (I’m guessing they will both appeal much more to new users than GNOME2 ever did as well as work a lot better on netbooks and tablets) they both felt like they were hindering me in actually using my computer. Enter Xubuntu. Xfce felt like home :)

Now that I’m done rambling, let’ get down to business.

Google Chrome does not support Xfce, in the sense that it normally uses the proxy settings from GNOME or KDE; when running neither the proxy settings are simply not available. There are some hacks available to utilize the GNOME preferences infrastructure, but it seems cumbersome.

Chrome also support configuring proxy settings on the command line, in a rather neat way actually

  • –proxy-server=”foopy:99″
    Use the HTTP proxy “foopy:99” to load all URLs.
  • –proxy-server=”https=proxy1:80;http=socks4://baz:1080″
    Load https://* URLs using the HTTP proxy “proxy1:80″. And load http://* URLs using the SOCKS v4 proxy baz:1080”.

neat indeed, but not very efficient if you have a lot of rules – Normally one could use Proxy Switchy! but since it relies on the proxy configuration in Chrome it also does not work in Xfce. Proxy Auto Config to the rescue.

A PAC file, in essence, is a Javascript which returns what proxy to use for a given URL or IP (if any).

An example

function FindProxyForURL(url,host)
{

        var resolved_ip = dnsResolve(host);

        if (isPlainHostName(host))
        return "DIRECT";
        else if (host == "server1.my.corp" ||
                host == "server2.my.corp")
        return "PROXY proxy.my.corp:8080";
        else if (isInNet(resolved_ip, "192.168.1.0", "255.255.255.0") ||
                        isInNet(resolved_ip, "192.168.4.0", "255.255.255.0")
                        )
        return "DIRECT";
        else
        return "PROXY localhost:18080";
}

I use Dropbox to keep the proxy config in sync between machines.

To use the proxy pac, I created a copy of the Chrome launcher

$ cp /usr/share/applications/google-chrome.desktop ~/.local/share/applications

Now, locate all lines containing

Exec=/opt/google/chrome/google-chrome

and change it to

Exec=/opt/google/chrome/google-chrome --proxy-pac-url=file:///path/to/proxy.pac %U

or

Exec=/opt/google/chrome/google-chrome --proxy-server="https=proxy1:80;http=socks4://baz:1080 %U

That’s it. The next time you launch Google Chrome, it will use the proxy settings configured in the application shortcut.

Percona XtraBackup is an open-source hot backup utility for MySQL that doesn’t lock your database during the backup. It can back up data from InnoDB, XtraDB, and MyISAM tables on MySQL 5.0 and newer servers, and it has many advanced features. Commercial support contracts are available. For a high-level overview of the features, including a feature comparison, please see the XtraBackup homepage.

Luckily installing XtraBackup is pretty easy

$ sudo apt-key adv --keyserver keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A
$ echo "deb http://repo.percona.com/apt maverick main" | sudo tee -a /etc/apt/sources.list
$ sudo apt-get update
$ sudo apt-get install xtrabackup

I wrapped the backup program in a small shell script

#!/bin/bash
BDIR="/home/backup/mysql"

# Run backup
/usr/bin/innobackupex-1.5.1 --stream=tar --defaults-file=/etc/mysql/my.cnf ./ | gzip -c -9 > $BDIR/backup.`date +%m%d%Y%H%M%S`.tar.gz

# Remove backups older than 7 days
find $BDIR -name backup.\* -ctime +7 -exec rm {} \;

I prefer to have the the username and password for MySQL in my.cnf (add these lines under [client])

user           = root
password    = Secreeet

Finally, add the script to root’s crontab (you know, sudo crontab -e)

0 2 * * * bash /usr/local/bin/mysql_backup.sh > /dev/null 2>&1

After upgrading to Natty Narwhal I couldn’t connect to my Linux based jump host (connected via VPN):

OpenSSH_5.8p1 Debian-1ubuntu2, OpenSSL 0.9.8o 01 Jun 2010
debug1: Reading configuration data /home/alj/.ssh/config
debug1: Applying options for *
debug1: Applying options for smallpox.xxx.dk
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to smallpox.xxx.dk [xxx.xxx.xxx.xxx] port 22.
debug1: Connection established.
debug1: identity file /home/alj/.ssh/id_rsa type -1
debug1: identity file /home/alj/.ssh/id_rsa-cert type -1
debug1: identity file /home/alj/.ssh/id_dsa type 2
debug1: Checking blacklist file /usr/share/ssh/blacklist.DSA-1024
debug1: Checking blacklist file /etc/ssh/blacklist.DSA-1024
debug1: identity file /home/alj/.ssh/id_dsa-cert type -1
debug1: identity file /home/alj/.ssh/id_ecdsa type -1
debug1: identity file /home/alj/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.5p1 Debian-4ubuntu4
debug1: match: OpenSSH_5.5p1 Debian-4ubuntu4 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.8p1 Debian-1ubuntu2
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 [email protected]
debug1: kex: client->server aes128-ctr hmac-md5 [email protected]
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
Read from socket failed: Connection reset by peer

The key seem to be that Natty uses OpenSSH 5.8p1 – This problem seem to affect clients newer than 5.7p1, when connecting to older servers. And the problem seem to be restricted to connecting through some firewalls, I have no problem on my home network and when connecting to hosts running iptables.

If have found this workaround. Apparently is has something to do with the length of the cipher list and is not isolated to Ubuntu.

Edit /etc/ssh/ssh_config or $HOME/.ssh/config and add this in the Host * stanza or for the host you have problems connecting to:

        Ciphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc
        MACs hmac-md5,hmac-sha1,hmac-ripemd160

In the pre-10.04 days it was possible to make a Gobi 200(0) modem work by installing gobi_loader and using it to load the firmware for the modem.

However, with the release of Ubuntu 10.04 (which sports a shiny 2.6.35 kernel) gobi_loader stopped working. Because gobi_loader (according to the homepage) does not support 2.6.32+ I stopped caring and used my Huwai stick instead.

Recently one my colleagues noted that after upgrading to 10.10 the wireless broadband connection seemed to be available from time to time – and having recently upgraded to Natty (11.04) I decided to see if I could get it to work again.

My system consists of:

  • Computer: HP Elitebook 2540p
  • Modem: Gobi 2000 with GPS
  • OS: Windows 7 and Ubuntu 11.04

The easiest way to get the modem working is to install HP Connection Manager in Windows to get the firmware and to make sure the modem works.

In Ubuntu, make sure the package gobi-loader

$ sudo apt-get install gobi-loader

Now mount your Windows partition

$ sudo mount /dev/sda1 /mnt

and copy the needed files

$ cd cd /mnt/Program\ Files\ \(x86\)/QUALCOMM/Images/HP/
$ sudo mkdir /lib/firmware/gobi
$ sudo cp 0/uqcn.mbn UMTS/* /lib/firmware/gobi

That’s it; Reboot or reload udev and the modem should now be available in Network Manager.

(I might have missed something, this article is done from memory; once VirtualBox is working again I will verify the details – and test of this fix also works in 10.10)

The performance of the site should have increased considerably – but since it meant disabling WordPress HTTPS you will probably see a warning about all elements of the page not being secured; I am working on that.

Update: This fix is now documented in the Ubuntu Wiki

After upgrading to Natty alpha 2 clicking left+right mouse no longer worked as middle mouse button (also known as Emulate3Buttons).

Since version 10.04 (and for real since 10.10) Ubuntu no longer sports a xorg.conf file; all configuration is done through udev and evdev – for some reason the “mouse” (track point) in my HP Elitebook 2540p is detected as a three button mouse

[    35.650] (**) PS/2 Generic Mouse: always reports core events
[    35.650] (**) PS/2 Generic Mouse: Device: "/dev/input/event8"
[    35.650] (--) PS/2 Generic Mouse: Found 3 mouse buttons
[    35.650] (--) PS/2 Generic Mouse: Found relative axes
[    35.650] (--) PS/2 Generic Mouse: Found x and y relative axes
[    35.650] (II) PS/2 Generic Mouse: Configuring as mouse

The fix is to add a couple of parameters to /usr/share/X11/xorg.conf.d/10-evdev.conf.

First, we make sure the file is not overwritten by package updates

 $ sudo dpkg-divert --add --rename --divert /usr/share/X11/xorg.conf.d/10-evdev.conf.real /usr/share/X11/xorg.conf.d/10-evdev.conf
$ sudo cp /usr/share/X11/xorg.conf.d/10-evdev.conf.real /usr/share/X11/xorg.conf.d/10-evdev.conf

Now, open /usr/share/X11/xorg.conf.d/10-evdev.conf and add the following lines to the section evdev pointer catchall

        Option "Emulate3Buttons" "True"
        Option "Emulate3Timeout" "50"

This will also add 3 button emulation for any external mouse added but I can live with that.

It’s been a while since I last had to run Windows on my laptop; back then I used Ext2 Installable File System For Windows to access data on my Linux-formated partitions.

In the meantime a few things have changed: Windows 7 and Ubuntu formating ext3 with a inode size of 256 – none of these are supported by ext3 ifs.

Ext2read supports Windows 7 (as well as ext4 and LVM2) but it’s more like a file browser and does not support assigning drive letters to Linux filesystems and since my /home is formatted with XFS it does not help me anyway.

Instead of going through reformatting the filesystems I wanted to access from Windows, I decided to build a virtual file server instead; that way I can access any filesystem type supported by Linux.

Software used: Windows 7, Virtualbox and Ubuntu (server edition)

This guide will work with other versions of Windows (and other OS’es as well), there are no ties to Virtualbox and the Linux version used can be anyone you like.

Continue reading

It might seem as if Nowhere.dk has been out of commission for a while. That is not the case – but a firewall configuration error (on my part) accidently blocked port 80; an error I did not see since I always use SSL.

Sorry,
Allan

xkcd.com/838/

A Christmas Cacophony – Epilogue

Too manee shinees fur my brain to handul!

Have yourselves a merry little Christmas – Have you ever thought about what Santa REALLY does while you’re asleep?