Ramblings from MostlyChris

Tech stuff and a bit more

Browsing Posts published in April, 2009

Changing the timezone on a server (replace Europe/Amsterdam with your faviorite zone file) mv /etc/localtime  /etc/localtime-old cp /usr/share/zoneinfo/Europe/Amsterdam  /etc/localtime /usr/bin/rdate -s (tick|tock).greyware.com —or— /etc/init.d/ntpd stop; ntpdate tick.greyware.com; /etc/init.d/ntpd start Set the ZONE entry in the file /etc/sysconfig/clock file vi /etc/sysconfig/clock Sync the hardware clock /sbin/hwclock –systohc

Postfix has some spam fighting abilities built in. However, you will need to enable them for them to work. Just throw the code below into your main.cf file and restart Postfix. Voila. smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_pipelining, reject_non_fqdn_recipient, reject_non_fqdn_sender, reject_unknown_recipient_domain, reject_unauth_destination, reject_invalid_hostname, reject_rbl_client sbl.spamhaus.org, reject_rbl_client xbl.spamhaus.org, permit

qmHandle is a handy tool to aid in administering the queue on qmail enabled servers. Get and install qmHandle wget http://ns.nywtc.co.uk/qmHandle && chmod +x qmHandle && cp -a qmHandle /usr/local/bin/ Get and replace existing qmHandle wget http://ns.nywtc.co.uk/qmHandle && chmod +x qmHandle && cp qmHandle `which qmHandle` Usage is simple. After installing, just issue qmHandle without [...]

I recently ran across a request to place all vhost configurations in separate files. Here are the steps I followed to make this happen. Step 4 is only necessary if you have existing virtual hosts in the main or a single apache configuration file. 1. I created the virtual_sites directory under /etc/httpd/conf.d/ 2. I set [...]

Here is a handy little snippet for deleting all the tables in a database. Replace 'uname' and 'dbname' as required. mysql -u uname dbname -e "show tables" | grep -v Tables_in | grep -v "+"  | gawk '{print "drop table " $1 ";"}' | mysql -u uname dbname