Fix udevd warnings after hplip installation

After installation of the latest hplip package (for HP printer support on GNU/Linux systems) you might see boot warnings like this:

udevd[281]: SYSFS{}= will be removed in a future udev version, please use ATTR{}= to match the event device, or ATTRS{}= to match a parent device, in /etc/udev/rules.d/86-hpmud-hp_laserjet_p1008.rules:6

To fix the problem I did this (on a Debian system):

sudo sed -i -e "s|SYSFS|ATTRS|g" -e "s|sysfs|attrs|g" /etc/udev/rules.d/*hpmud*.rules

APT pinning, Iceweasel upgrade, hide Facebook Ads

I am a pretty happy user of Debian 5 stable (“Lenny”). But some Lenny packages are a little too old for my taste.

For example, Iceweasel is version 3.0.6 in Lenny. But the latest Adblock Plus (1.1.1 and later) requires Firefox/Iceweasel 3.0.12 and Adblock Element Hiding Helper does not work correctly with Adblock Plus versions older than 1.1.1 (keeps ignoring the configured hiding patterns).

So I decided that I want Iceweasel 3.0.14 from Debian testing (“Squeeze”). I googled for APT Pinning and found this page

http://wiki.debian.org/AptPinning

The lower half of it explains a “conservative approach” to pinning that only installs testing packages when the user explicitly requests it. I created /etc/apt/preferences to look like this:

Package: *
Pin: release a=stable
Explanation: prefer stable
Pin-Priority: 900

Package: *
Pin: release o=Debian
Explanation: require approval
Pin-Priority: -10

Then I added the Debian testing repository to /etc/apt/sources.list, told apt to update itself and installed Iceweasel from testing:

apt-get update
apt-get install -t testing iceweasel

That worked nicely and upgraded only the Iceweasel package, nothing else.

Now I can use Adblock Plus with the Element Hiding Helper to get rid of the ads in Facebook by adding these Element Hiding Rules:

facebook.com##DIV.adcolumn
facebook.com##DIV.UIEMUASFrame.UIEMUASSLikeFrame
facebook.com##DIV.UIEMUASFrame

Yay! That was worth the effort …

Virtualbox clipboard workaround

With Virtualbox OSE 1.5.2, host Kubuntu 7.10 and guest Win XP I have intermittent clipboard problems: Garbled text, often even from one Linux app to another.

I tried upgrading to VirtualBox 1.5.4 non-free but had network problems with it.

Finally I came up with the following workaround. The idea is to write/read the clipboard using a temporary shared file. Prerequisites:

  • Install xclip in Kubuntu.
  • Put the cat, pclip and gclip commands in the PATH of the Windows system.
  • Set up a Samba share that both guest and host can read and write to.

In my setup the share is /share in the guest and mounted as network drive S: in the guest. The temporary file will be in /share/clipboard/.

Create an application shortcut in Kubuntu with the Application command

xclip -o > /share/clipboard/clip.txt

and drag it on the taskbar so that you can execute it with one click. To avoid annoying startup notifications disable them in the “Advanced Options” in the “Application” tab of the shortcut. Now you should be able to copy the content of the X clipboard to the temporary file with one click.

In the guest system (Windows) you do the same thing in reverse but with a keyboard shortcut: Put a file clip-in.bat into a safe location (where you won’t accidentally delete it) with the following one line of code:

cat S:\clipboard\clip.txt | gclip

Create a desktop shortcut pointing to clip-in.bat and define a keybard shortcut for it (under right-click, Properties..), e.g. ALT-CTRL-C.

Now you should be able to mark and paste from the host to the guest system in the following way:

  • Mark some text in the host (Kubuntu) system
  • Click the shortcut in the KDE taskbar
  • In the host system press CTR-ALT-C and then CTRL-V (to paste)

The return of the console mailer: ALPINE

ALPINE start screenMany students had to use it at the university in the early years of the Internet: PINE, the text mode mail client. I was one of those students and I actually liked it and configured it to the maximum.

Somehow I later switched to Mozilla Thunderbird and haven’t used a text mode mailer since. But this week I discovered “ALPINE”. It is sort of “PINE reloaded”, as Open Source under the Apache License (think Apache License PINE).

I set it up for Gmail with IMAP (thanks to the author of this blog entry):

  1. Start ALPINE and type S L A (Setup > collectionLists > Add)
  2. Enter something like the following but replacing “id” with your gmail name:
  3. Nickname : Gmail
    Server : imap.gmail.com/ssl/user=id@gmail.com
    Path :
    View :

  4. Press CTRL-X and then E to save the setting.
  5. Type S C (Setup > Configuration) and set up SMTP to use the gmail server:
  6. SMTP Server = smtp.gmail.com:587/tls/user=id@gmail.com

I noticed that I had to install the package “ca-certificates” on my Kubuntu system. Otherwise I got a certificate error.

Learning Mac OS X

At my job I am now working to some extent with Mac OS X. My overall impression: Looks good but like Windows it is built on the assumption that “the user should not know how things work”. Some things are done quite elegantly but others are just too dumbed down for my taste.

On the command line the first thing that I noticed was that all the standard folder names start with a capital letter and are more verbose than on Unix. The default shell is bash which is nice for me since I am used to it and know it quite well from Linux.

The version of the Vim editor that comes with OS X is outdated and not very convenient to use. I installed a Vim 7.x build from macvim.org.

I learned about DMG images and that it’s not easy or sometimes even impossible to mount them on Linux. Otherwise mounting was pretty straightforward, for example the SMB share that I use to export my Linux home directory. I could have tried to do the same with NFS but SMB was just easier and I didn’t want to go into the details of uid and guid mapping. Plus, the SMB share is also accessible from the Windows that runs inside a Virtualbox.

One small thing that I don’t like on the Mac is the lack of a “Maximize window” function that maximizes the current window as much as possible. I guess I am not the only one.

Windows in a box

Until quite recently I did not use any operating system virtualization software. On my main PC I ran only Kubuntu and on my laptop I had a dual boot setup with the Windows XP installation that came pre-installed and Kubuntu.

VMware was not very appealing to me since it is proprietary software, not Open Source. A few weeks ago I gave VirtualBox a try. It is available as an Open Source Edition (OSE). There are packages included in the Ubuntu distribution so it was quite easy to install.

I must say that I am very impressed. The UI is intuitive, well documented and straightforward to use. I installed Windows XP Professional as a guest system and it worked without problems.

I had to realize, though, that “Shared Folders” are only supported in the Commercial Edition. That is not a problem since Folder Sharing can be done with Samba.

“Seamless mode” makes the experience even better: The windows from the Win XP desktop and the Kubuntu desktop appear as parts of one united desktop, with the taskbar and desktop background changing according to what window is currently active.

VirtualBox is developed by the German company InnoTek. Keep up the good work, guys!

Make Bugzilla’s whine.pl work on Ubuntu or Debian

I use Bugzilla as a taskplanner. The “Products” include “Household”, “Bureaucracy”, “Career” and so on. The “Components” are used to further refine these fields of activity.

For each task that I assign to myself I choose a priority to set a timeframe within which I want to tackle the task. To do that I have changed the default priorities (“P1”, “P2”, etc.) to “Today”, “Tomorrow”, “1 week”, “2 weeks” and so on.

I want Bugzilla to remind me that I have to work on the task before the specified time is over. To do that I have set up so-called “Whining events”. (see Bugzilla’s online documentation)

I have defined one search for each priority, using “Advanced Searching Using Boolean Charts”. For example the search for “New, assigned or reopened bugs where Priority is equal to 1 week and Days since bug changed is greater than 5” is saved under the name “5d unchanged (1w)” and matches everything I wanted to do within a week but didn’t touch for 5 days. The whining event for this search is set up to send me an hourly email if there are any bugs that match this search.

But to make this actually work, the Perl script “whine.pl” has to be executed every 15 minutes. I have set up a system cron job to do this (as the system user “www-data”). The entry in /etc/crontab looks like this:

*/15 * * * * www-data cd /usr/share/bugzilla/; /usr/local/share/bugzilla/whine.pl

Unfortunately, the file “whine.pl” is not included in the bugzilla packages of Kubuntu and Debian GNU/Linux, although it is part of the upstream Bugzilla distribution (see my Bug report). So I had to download the official tar.gz of the matching version (Bugzilla 2.22.1 in my case) from bugzilla.org, unpack it and copy whine.pl to /usr/local/share/bugzilla.

At first the execution of whine.pl aborted with an error which is due to a bug of the Perl DBD package that enables MySQL access. See this Thread on the mozilla.support.bugzilla newsgroup and this Bug report for Perl DBD MySQL.

It turned out I had to slightly upgrade the libdbd-mysql-perl package (from 3.0006-1 to 3.0007-1) to get rid of the bug. I downloaded libdbd-mysql-perl_3.0007-1_i386.deb from the Debian testing repositories and edited its control file to change the Perl depency to “perl (>= 5.8.8-6)” (the version in Edgy) rather than the slightly newer Perl version in Debian testing at the time (5.8.8-6.1).

After all that I finally got the whining feature working.