A chronological documentation test project, nothing serious, really!

28 Sep 2007 Ubuntu Linux 7.10 Beta on HP Compaq 8510p (laptop)

I experienced problems booting the install-CD for both Ubuntu 7.04 and Fedora Core 7 on my HP Compaq 8510p laptop because the kernel didn’t have the correct SATA driver, so I decided to try the beta of Ubuntu 7.10.

The booting problem was fixed on 7.10 Beta and the installation process halted at 88% “importing documents and settings”.

The solution I came up with was to disable the migration tool and then run the installer from a terminal window with the following option:

ubiquity --no-migration-assistant

Tags: , , , , , , ,

Posted by

17 May 2007 Courier-IMAP to Dovecot Migration Script

I’ve just migrated a couple of servers from Courier-IMAP to Dovecot, and am very happy with the latter so far. I thought I’d share the courier2dovecot shell script I whipped together (based on the instructions I found in the migration how-to), for converting Courier-IMAP maildirs to Dovecot format.

While the script is rather simple, it can save a fair bit of typing when migrating some hundreds of mail accounts, especially since Courier stores some of its own state files recursively in each folder of the maildir hierarchy, making it a real pain to otherwise manually rename or remove all of them.

Here’s a plain-English summary of what the script currently does, when given a Courier maildir path as an argument:

  • Check that the given path is indeed a valid Courier maildir, and exit if not.
  • Rename the file ‘courierimapsubscribed’ to ‘subscriptions’, and strip the ‘INBOX.’ prefix from its contents.
  • Recursively rename all of files of the name ‘courierimapuiddb’ to ‘dovecot-uidlist’.
  • Recursively delete all of files of the name ‘courierimaphieracl’, ‘courierimapacl’ and ‘courierimapkeywords’.

The script will also verbosely print out each action it performs, handy for redirecting the output to a log file for a large migration.

Hopefully people about to jump ship from Courier to Dovecot find this useful. If anyone comes up with improvements to the script, please send them my way.

# courier2dovecot -- Converts a Courier maildir to Dovecot format.
# Copyright (c) 2005 Arto Bendiken. Released under the GNU GPL.
# Newest version available from
# 2005-10-21 initial version for Dovecot 1.0.
if [ -z "$dir" ] || [ "$dir" = "-?" ] || [ "$dir" = "-h" ] || [ "$dir" = "--help" ]; then
  echo "Usage: $0 maildirpath"
  exit 1
if [ ! -d "$dir" ] || [ ! -e "$dir/courierimapsubscribed" ]; then
  echo "$dir is not a path to a Courier maildir"
  exit 1
find $dir -name courierimapsubscribed -print0 | xargs -0r rename -v 's/courierimapsubscribed/subscriptions/'
find $dir -name subscriptions -print0 | xargs -0r sed -i 's/INBOX\.//'
find $dir -name courierimapuiddb -print0 | xargs -0r rename -v 's/courierimapuiddb/dovecot-uidlist/'
find $dir -name courierimaphieracl -print0 | xargs -0r rm -vrf
find $dir -name courierimapacl -print0 | xargs -0r rm -vf
find $dir -name courierimapkeywords -print0 | xargs -0r rm -vrf

Comment to the script:
Hey Arto & everyone using this script:

Be careful when trying to run this on Red Hat Enterprise Linux or CentOS 4 systems. These operating systems ship with a different rename command than the Debian systems. You can also tell them apart based on the output when running ‘rename’ with no arguments.

This is the perl version which works:
Usage: rename [-v] [-n] [-f] perlexpr [filenames]

This is the RHEL/CentOS version that doesn’t:
call: rename.orig from to files…

Hope this helps someone out there, and thanks for the script Arto!


Tags: , , , , , , , , , ,

Posted by

27 Apr 2007 Howto install Fedora Core 5 (FC5) from a USB stick

Download the Fedora disk image from a mirror:

# wget
Make sure that the USB device is unmounted:
# sudo umount /dev/sda1

Copy the img to the usb key device:

# dd if=diskboot.img of=/dev/sda

Reboot and then select a network based install by typing:

linux askmethod

Tags: , , , ,

Posted by

18 Apr 2007 Open a range of ports with iptables

In RedHat/Fedora you can define firewall rules in the file /etc/sysconfig/iptables.
By adding this line you open ports in the range 5920-5960
-A RH-Firewall-1-INPUT -p tcp --destination-port 5920:5960 -j ACCEPT

Tags: , ,

Posted by

06 Feb 2007 rpm and yum stop working on Fedora Core 5

yum and rpm stop doing their magic because of corrupt files etc and no updates can be performed on the system. A simple, but maybe not recommended solution is to delete the files located in /var/lib/rpm

-rw-r--r-- 1 root root        0 Jan 22 10:10 __db.000
-rw-r--r-- 1 root root    24576 Jan 19 17:12 __db.001
-rw-r--r-- 1 root root  1318912 Jan 19 17:12 __db.002
-rw-r--r-- 1 root root   450560 Jan 19 17:12 __db.003

This solution does most likely work in other rpm based distributions.

Tags: , , , ,

Posted by