Michael's Domain

The fact that everything looks different doesn't mean that all has changed

Ubuntu

Permanent static route in Ubuntu Karmic Koala (9.10)

To add a permanent static route to a system with one NIC, you need to edit the
/etc/network/interfaces file:

The following section needs to be replaced:

# The primary network interface
auto eth0
#iface eth0 inet dhcp

Modify as follows:

# The primary network interface
auto eth0
iface eth0 inet dhcp
up route add -net 10.8.0.0 netmask 255.255.255.0 gw 192.168.0.3
down route del -net 10.8.0.0 netmask 255.255.255.0 gw 192.168.0.3


Startup sequence for my server

After e reboot (e.g. after upgrading the kernel) I need to execute a couple of commands to get the server working. The first ones (those in brackets) were only previously necessary as I exchanged the hardware and the registration of the new MAC adress took a while:


/etc/inti.d/backuppc stop
rm -rf /var/lib/backuppc/*
(macchanger --mac=00:B0:D0:20:A5:D9 eth0)
(ifconfig eth0 down)
(ifconfig eth0 up)
ping mcblserver.hi.helsinki.fi (just to see whether the serever is online)
cryptsetup create cryptodata /dev/mapper/defaultvolumegroup-data


mysql server restart

My mysqld runs on Ubuntu Hardy and after replaceing the complete mysql data with a dump from another server the "/etc/init.d/mysql stop" command fails, because the system administration account doesn't work anymore. So I had to recreate it again:

GRANT ALL PRIVILEGES ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;

The password can be obtained from /etc/mysql/debian.cnf.


Encrypted backup using BackupPC, LVM and cryptsetup

I do offsite backups using BackupPC. The amount of data increases constantly so I need to add occasionally hard disks. Additionally I want the data to be encrypted, at least after powering off the system that is running the BackupPC application. So I decided to use logical volume management (LVM) and block device encryption (cryptsetup). The following steps were needed (on Ubuntu Feisty):


cryptsetup on lvm on Ubuntu Feisty

I wanted to encrypt my Documents. My home folder is on a logical volume. So I made some space by removing another logical volume and creating a new one, which gets encrypted by cryptsetup. Here are the commands:

  • lvdisplay Display all logical volumes on the system
  • lvremove defaultvolumegroup/data Remove the logical volume "data" from the volume group "defaultvolumegroup"
  • lvcreate -L 53.66G --name data defaultvolumegroup Create the logical volume "data" with a size of 53.66 GB in the volume group "defaultvolumegroup"

E-mail: migrating from kmail to Evolution

I recently switched from kde to gnome and at the same time from kmail to Evolution. There is no easy way to transfer you mail if you have organized it in several mailboxes in kmail. You need to select all messages in a folder and then right-click and save them in mbox format. This step you need to repeat for every folder. Then you can use the import function of Evolution (import from single file). If you can accept that all files end up in the same folder, you can concatenate your .mbox files to save you the trouble of importing multiple files:

cat *.mbox > allmail.mbox


Installing awstats on ubuntu feisty

I started to use awstats for creating the site statistics on our server. After installing the ubuntu package, there are still a few things that I had to do:

1. Install libnet-ip-perl and libgeo-ipfree-perl in order to map the dns entries to countries.

Download
http://www.maxmind.com/download/geoip/api/c/GeoIP-1.4.2.tar.gz
http://www.maxmind.com/download/geoip/api/perl/Geo-IP-1.27.tar.gz
http://www.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
http://www.maxmind.com/download/geoip/database/GeoIP.dat.gz
http://www.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz


© Michael Jeltsch 2006

Powered by Drupal - Design by Artinet