Exim DB Problem

No Comments

If you find that incoming mail is rejected by Exim, and you see the following in your logfile, move /var/spool/exim/db/ratelimit out of the way, and then restart Exim. Problem solved.

failed to open DB file /var/spool/exim/db/ratelimit: Bad file descriptor
Berkeley DB error: memp_fopen: page sizes must be a power-of-2

Change I.P. address on Ubuntu Server

No Comments

sudo pico /etc/network/interfaces
If your device name is eth0, the configuration block should look like the following-

iface eth0 inet static
address 192.168.1.110
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
dns-nameservers 208.67.222.222 208.67.220.220 127.0.0.1

If you wish to add another I.P. address, you can add a block similar to this-

iface eth0:1 inet static
address 192.168.1.111
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

All that is needed now is a restart of networking-

sudo /etc/init.d/networking restart

Downgrade MySQL 5.x to MySQL 4.x on Ubuntu Server

No Comments

If you ever need to downgrade from MySQL 5.x to MySQL 4.x (hope you don’t), chances are you are going to run into a problem with apt-get. You will most likely receive cryptic, unhelpful dpkg errors.

If this is the case, try the command below.

sudo aptitude purge mysql-common mysql-client mysql-server && sudo aptitude install mysql-server-4.1 mysql-client-4.1

This should purge whatever is left of the MySQL 5.x installation, and then install the MySQL 4.x version. If this fails, proceed to bang head against nearest hard object.

Tuning Swap Usage with Linux

No Comments

Those of you with lots of RAM could benefit from this tweak. There is a value controlled by sysctl called “vm.swappiness”. This is a value from 0-100 which tells the system how aggressively to use the swap space on your system.

Setting this value to 0 will tell the system to avoid writing anything to swap if at all possible, and a value of 100 will have your system almost immediately write out your memory to a swap file.

The default on Ubuntu and most other Linux systems is 60. If you don’t have more than 1GB of RAM I would not recommend altering this value. On my workstations with 2GB of RAM or more I usually go 10 or 0.

To set the swappiness value:

sudo sysctl vm.swappiness=10

To make the change stick after reboots, edit /etc/sysctl.conf with your favorite editor, and add the line “vm.swappiness=10″ if it does not already exist.

Block a single IP address

No Comments

As super user:

iptables -I INPUT -s 1.2.3.4 -j DROP