dbus fix – ubuntu 11.10 (oneiric)

October 11, 2011 Leave a comment

In case you have installed Ubuntu oneiric and notice a dbus error at boot, here is the fix:

1) create directories /run and /run/lock,
2) move contents of /var/run into /run and /var/lock into /run/lock,
3) delete directories /var/run and /var/lock
4) create replacement simlinks; e.g. ‘ln -s /run /var/run’ and ‘ln -s /run/lock /var/lock’

Reboot, and things should be back to normal.

 

Categories: sysadmin

Transparent switching from apache2-mpm-prefork to apache2-mpm-worker (Debian Squeeze)

August 25, 2011 Leave a comment

If you install this configuration in /etc/apache2/conf.d + libapache2-mod-fcgid, then you can use either version of apache2 with php5.

First add the programs indicated and then add the script below to  /etc/apache2/conf.d:

apt-get install apache2-mpm-worker  libapache2-mod-fcgid
a2enmod fcgid
aptitude install php5-cgi php5-cli
###00-fcgi###
<Directory /var/www>
AddHandler fcgid-script .php
FCGIWrapper /usr/lib/cgi-bin/php5 .php
Options +ExecCGI
</Directory>
Alias /aptitude /usr/share/doc/aptitude/html/en
Alias /apt /usr/share/doc/apt-doc

<Directory /usr/share>
AddHandler fcgid-script .php
FCGIWrapper /usr/lib/cgi-bin/php5 .php
Options ExecCGI FollowSymlinks Indexes
</Directory>

<IfModule mod_actions.c>
Action application/x-httpd-php /cgi-bin/php5
</IfModule>

With the above additions,  you can run apache2-mpm-worker or apt-get install apache2-mpm-prefork and either will run. Of course if you prefer to use the php apache module with apache2-mpm-prefork, you can add that with apt and remove the above script from conf.d

 

Categories: sysadmin

Bash search and replace ip script

July 30, 2011 Leave a comment

You can search and replace and IP address in bind (named.conf) or name server records with this script:

Assign values as indicated.

#!/bin/bash
x=`cat oldip`
a=`cat newip`
cmd=”sed -e”
$cmd “s#$x#$a#g” oldconfigfie > new.configfile

Categories: sysadmin

Handy script to parse Postfix maillogs for failed login IP addresses

June 2, 2011 Leave a comment

You can use the script below to parse your maillog (mail.log on Debian based distros) for failed login attempts and place the results in your hosts.deny file or your IP tables config. The script deletes leading 0 IP addresses and filters out [brackets]. You can change the grep filter phrase to your liking.

grep “failed” /var/log/maillog | grep -Eo “([0-9]{1,3}.){3}[0-9]{1,3}” | sed ‘s/^[0]*//’ | uniq

Categories: sysadmin

Centos 5.6

April 9, 2011 Leave a comment

Centos 5.6 is out. Check out the announcement and upgrade info at:

 

http://lists.centos.org/pipermail/centos-announce/2011-April/017282.html

 

 

Categories: Uncategorized

2.6.38 kernel for squeeze

March 21, 2011 Leave a comment

Installing the new 2.6.38 kernel is pretty straightforward in Debian 6.

First make sure you have the following packages installed:

wget tar bzip2 build-essential libncurses-dev kernel-package fakeroot

Then do this:

wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.38.tar.bz2
tar jxvf linux-2.6.38.tar.bz2
cp /boot/config-$(uname -r) /usr/src/linux-2.6.38/.config
cd linux-2.6.38; make menuconfig
make-kpkg clean
fakeroot make-kpkg –initrd –revision=custom.1.0 kernel_image

to install

dpkg -i ../linux-image-2.6.38_custom.1.0_*.deb

Categories: Uncategorized

Debian 6 Released!

February 7, 2011 Leave a comment

Debian 6 is out.

I notice no problems at all. If you are getting remaining files not updated after apt-get update, try aptitude update and aptitude upgrade. That usually resolves any problems.

Categories: Uncategorized

Add dotdeb gpg key

January 28, 2011 Leave a comment

wget http://www.dotdeb.org/dotdeb.gpg
cat dotdeb.gpg |  apt-key add –

Categories: Uncategorized

Debian Squeeze sources.list with dotdeb

January 28, 2011 Leave a comment

deb http://ftp.us.debian.org/debian/ squeeze main
deb-src http://ftp.us.debian.org/debian/ squeeze main
deb http://security.debian.org/ squeeze/updates main
deb-src http://security.debian.org/ squeeze/updates main
deb http://packages.dotdeb.org squeeze all
deb-src http://packages.dotdeb.org squeeze all
deb-src http://debian.hands.com/debian/ squeeze main non-free contrib
deb http://mirror.home-dn.net/debian-multimedia squeeze main
deb http://liquorix.net/debian sid main

Categories: Uncategorized

minimal dovecot.conf for Ubuntu, Centos, and Debian

November 15, 2010 1 comment

Here is a minimal doveconf for Ubutnu Maverick. It includes sasl. This also works for Debian including squeeze, and Centos. Debian and Centos use dovecot.pem for both ssl_cert_file and ssl_key_file.

protocols = imaps pop3 pop3s imap
mail_privileged_group = mail
disable_plaintext_auth = no
ssl_cert_file = /etc/ssl/certs/dovecot.pem
ssl_key_file = /etc/ssl/private/dovecot.key
auth default {
mechanisms = plain login
passdb pam {
}
userdb passwd {
}
socket listen {
client {
path = /var/spool/postfix/private/auth
mode = 0660
user = postfix
group = postfix
}
}
}

Categories: Uncategorized