ThinkPad X40 with Ubuntu 10.04 (Lucid Lynx)

I’m writing this from Ubuntu 10.04 (Lucid Lynx) on my “travel” laptop, a venerable ThinkPad X40. There were two things I needed to fix to make it work:

The Intel Corporation 82852/855GM Integrated Graphics Device [PCI 8086:3582] needed Workaround A: Re-enable KMS found on Lucidi8xxFreezes to start X.

My Huawei E620 USB Modem [USB 12d1:1446/12d1:1001] for mobile broadband worked after removing the /etc/udev/rules.d/15-huawei-e1551.rules file I used to get the same device working in Ubuntu 9.10 (Karmic Koala).

Now on IPv6

I configured a bunch of IPv6 addresses on my GleSYS VPS and got it working after setting the proper route.

After that I added AAAA records for the .se domains I buy through Loopia, including this one. Some of my domains are on easyDNS and they do not appear to support AAAA records until the new member interface launches. According to 1,5 years old information it should add AAAA support.

For testing I added an IPv6-only record for this server:

Remote control of XBMC, but not too much

Yesterday and today I have scripted a small web interface for remote control of XBMC using its HTTP API. (BTW, That API could really use a redesign!)

It’s actually just a page showing a screen shot and the name of the file that is currently playing, together with some commands to remote control XBMC.

Available commands are pause/resume, stop, play another file, and shutdown.

I also implemented support for showing notifications on the XBMC screen, which gave me an idea:

The Google Calendar can e-mail reminders for appointments. If XBMC is running, the reminder could be shown as a notification on the XBMC monitor.

I was just about to start implementing this calendar-reminder-in-XBMC when I reminded myself that there are many other small and big projects that would be more valuable for me. But instead of throwing this idea right down the trashcan I decided to blog about it first. Done!

Now I’ll spend some valuable time with my son!

Mark as junk in Evolution, train SpamAssassin on server

Evolution has a feature for marking e-mail as junk. This will set an IMAP keyword “Junk” on those messages. On my mail server I run Dovecot as IMAP server and Spamassassin through Amavis to filter spam. How could I get Spamassassin to learn that all e-mails marked as junk in Evolution are spam? With a shell script, of course. I currently run it as root but maybe it is possible to give the amavis user permissions to read my Maildir…


if [ `whoami` != 'root' ]; then
  exec sudo $0 [email protected]

find ~david/Maildir -name dovecot-keywords | (
while read keywords; do

  DIR=`dirname $keywords`
  #echo $DIR >&2
  # XXX only supports 10 keywords
  CHAR=`awk '$2 == "Junk" { print $1; quit;  }' $keywords |
    tr '0-9' 'a-j'`

  if [ "$CHAR" ]; then
    find $DIR/cur $DIR/new -regex "[^,]*,[^,]*$CHAR.*" |
      xargs sa-learn --dbpath /var/lib/amavis/.spamassassin/ --spam

/etc/init.d/spamassassin reload

Helpful pages: Maildir format used by Dovecot, Spamassassin with amavis: Tips and tricks.

Ubuntu upgrade behind firewall

I’m currently upgrading my Ubuntu-in-VirtualBox at work from Jaunty to Karmic, but at first it didn’t work at all. Update Manager got stuck when I clicked the “Upgrade” button.

Due to the Big Corporate Firewall all Internet access must go through the the Enterprisey Proxy so I immediately suspected a firewall/proxy issue. However, Update Manager, apt, etc have worked fine for a long time, so it must be something upgrade-specific.

Some debugging and googling led me to the url_downloadable ignores proxy settings bug report. Maybe I should have enabled jaunty-proposed but to get going I simply applied the attached patch and was able to get started with the upgrade.

TaskFreak hacking part 2: date format

My TaskFreak hacking goes on. In Sweden we often use ISO 8601 format for dates (year-month-day), but TaskFreak does not offer this out of the box.

Most date formatting comes from the DATE FORMATS section in include/config.php but even after changing these date formats I still don’t get all dates displayed as I would like.

For example, the text box for the date when editing an item is using the TZN_DATE_FRM constant defined in include/classes/tzn_generic.php. There’s a pretty naïve comment in the source code, saying that there is a “US format” for dates and a “rest of the world” format. Fortunately (for the US), the rest of the world is not united in opposition.

To get the date format I wanted I changed the constant definition like this:


Facebook mail servers blacklisted by Spamhaus XBL!

To be more exact, some Facebook mail servers are listed in the Composite Blocking List (CBL), including but probably not limited to these:

  • –
  • –
  • –
  • –
  • –

CBL is not very informative, but writes:

ATTENTION: If you are running IPSwitch Imail, or similar shared hosting software, please contact the CBL by email. If you are running Ensim, please read this for a workaround. Otherwise, this IP is infected with/emitting spamware/spamtrojan traffic and needs to be fixed.

This will prevent me and others using from receiving some Facebook e-mails. Good thing they are not so important! 🙂

Update This was corrected around midnight (UTC) between Saturday and Sunday.

TaskFreak hacking: changing first day of week to Monday

I have two personal TaskFreak installations now: one at work and a personal one for everything else.

Usually I run all my applications in English but the personal TaskFreak is in Swedish so the first thing I changed was a couple of things I didn’t agree with in the Swedish translation.

Then there was the issue with the calendar having Sunday as the first day of the week. For me, and probably 99.99% of all Swedes, it’s like wearing your trousers the wrong way round. Our weeks start on Mondays.

Assuming all users of the TaskFreak installation agree on this, it is very easy to fix:

  1. Open taskfreak/jscalendar/calendar-setup.php in your favorite text editor
  2. Find the line
  3. Change 0 to 1
  4. Reload your TaskFreak web page

I hope to write a separate blog post about my coolest TaskFreak hack: a script that receives e-mails and creates a corresponding task in TaskFreak.