March 29th, 2012 | Tags:

Being a US centric business we really only care about english messages. Messages in any other language are spam for us. We decided to more accurately mark non-english emails as spam.

There are 2 methods of marking non-english messages as spam. One looks at the stated charset of the message, the other tries to determine the language used within the message itself. You will want to implement both of them.

edit /etc/mail/spamassassin/ so that we specify only english as our accepted language

# Mail using languages used in these country codes will not be marked
# as being possibly spam in a foreign language.
# – english
ok_languages en

# Mail using locales used in these country codes will not be marked
# as being possibly spam in a foreign language.
ok_locales en

edit /etc/mail/spamassassin/v310.pre so that the TextCat plugin is enabled

# TextCat – language guesser
loadplugin Mail::SpamAssassin::Plugin::TextCat

Be sure that Mail::SpamAssassin::Plugin::TextCat is installed:

perl -MMail::SpamAssassin::Plugin::TextCat -e 1

If you get no output then you already have the TextCat plugin installed. If an error message is displayed then you’ll need to install TextCat using CPAN.

Don’t forget to restart spamd if you’re running it, otherwise these changes will take effect immediately.

The TextCat plugin will look at the body of the message an attempt to determine the charset used. You could specify any amount of languages to allow, see the SpamAssassin documentation below:

ok_languages & TextCat

August 17th, 2011 | Tags:

In the process of upgrading my dev environment to OS X Lion I discovered that Tomcat failed to start up correctly.

I discovered the following in the log files:

2011-08-15 18:06:24,605 [] INFO  o.a.catalina.core.StandardEngine - Starting Servlet Engine: Apache Tomcat/6.0.32
2011-08-15 18:06:24,606 [] INFO  o.a.catalina.ha.tcp.SimpleTcpCluster - Cluster is about to start
2011-08-15 18:06:24,650 [] INFO  o.a.c.tribes.transport.ReceiverBase - Receiver Server Socket bound to:/
2011-08-15 18:06:24,660 [] INFO  o.a.c.tribes.membership.McastService - Attempting to bind the multicast socket to /
2011-08-15 18:06:24,668 [] INFO  o.a.c.tribes.membership.McastService - Setting multihome multicast interface to:/
2011-08-15 18:06:24,669 [] INFO  o.a.c.tribes.membership.McastService - Setting cluster mcast soTimeout to 500
2011-08-15 18:06:24,673 [] INFO  o.a.c.tribes.membership.McastService - Sleeping for 1000 milliseconds to establish cluster membership, start level:4
2011-08-15 18:06:25,675 [] INFO  o.a.c.tribes.membership.McastService - Done sleeping, membership established, start level:4
2011-08-15 18:06:25,681 [] ERROR o.a.catalina.ha.tcp.SimpleTcpCluster - Unable to start cluster.
org.apache.catalina.tribes.ChannelException: Can't assign requested address; No faulty members identified.

After some checking of my /etc/hosts file and a couple other things I found a very relevant Tomcat Cluster troubleshooting tip.

I added the following to my file for the JAVA_OPTS variable, and Tomcat started up as usual:

Turns out it was trying to setup the Tomcat cluster on my IPv6 interface and then I assume trying to access it via the IPv4 interface. Obviously they couldn’t communicate.

I’ve never had to do this on any prior version of OS X, nor any of my Linux machines.

December 21st, 2009 | Tags:

The following may be useful for test data or if you need to get data into a table that has a timestamp column included in the primary key requirement.

Create a function that will allow you to specify a random number range (taken from the

CREATE OR REPLACE FUNCTION random(numeric, numeric
RETURNS numeric AS $$
SELECT ($1 + ($2 - $1) * random())::numeric;

I then used it to generate a range of timestamps for today:

select timestamp '2009-12-21' + random(0,86400) * interval '1 second' as timestamp;
September 19th, 2006 | Tags:
July 26th, 2006 | Tags:

The Fedora legacy project has announced that they will discontinue errata updates starting in October. I have a few clients with servers still running 7.3 and 9. RHEL or CentOS is the currently the obvious choice to replace these old Red Hat installs.

Red Hat will provide errata for RHEL4 until February 2010 and RHEL3 is covered until October of 2008. Red Hat has stated they will support each RHEL release for 5 years.

I determined the following release dates from the RHEL listing on

RHEL3: 2003/10/22
RHEL4: 2005/02/15

Comments Off
July 24th, 2006 | Tags:

Last year I migrated a large CVS repository over to Subversion. One of the issues I missed during the migration was that unlike CVS, Subversion did not automatically set new files to expand keywords such as $Id$ to the very useful string:

$Id: 12234 2004-05-21 00:23:08Z derek $

I did some research into the problem and unfortunately there wasn’t anything on the server side I could do to force this setting on all files as they are added and checked in to the SVN repository. To automatically enable keyword substitution you must do two things.

First, uncomment the enable-auto-props = yes line in ~/.subversion/config in each users home directory.

### Set enable-auto-props to 'yes' to enable automatic properties
### for 'svn add' and 'svn import', it defaults to 'no'.
### Automatic properties are defined in the section 'auto-props'.
enable-auto-props = yes

Then you must configure the file types to which you will apply keyword substitution:

### Section for configuring automatic properties.
### The format of the entries is:
###   file-name-pattern = propname[=value][;propname[=value]...]
### The file-name-pattern can contain wildcards (such as '*' and
### '?').  All entries which match will be applied to the file.
### Note that auto-props functionality must be enabled, which
### is typically done by setting the 'enable-auto-props' option.
*.c = svn:eol-style=native;svn:keywords=Date Author Id Revision HeadURL

I appended ;svn:keywords=Date Author Id Revision HeadURL to the entry for .c files in ~/.subversion/config. Uncomment other file types in the file and adjust them as needed. Feel free to add new lines to the file for other source files such as .php and .java. These settings will take effect for all new files that you add to the repository.

If you happen to have existing files in the repository that need to have the keyword property set you can set it by running the command:
svn propset svn:keywords 'Author Date Id Revision HeadURL'

svn:keyword documentation

July 23rd, 2006 | Tags:

When creating or reconstructing a Linux software RAID there is a default reconstruction rate at which the RAID will be created. On RHEL the default max speed at which it will reconstruct the array is 10000 KB/sec. This setting can easily be adjusted for the impatient among us.

echo -n 500000 > /proc/sys/dev/raid/speed_limit_max

The above command will set the max reconstruction speed to 500000 KB/sec (which will essentially max out at the speed of your drives, usually in the 50MB/sec zone from my experience).

Bumping the value up will tax the disk subsystem more than the default but often it’s worth it to get that warm fuzzy of having a consistent RAID.

July 7th, 2006 | Tags:

This page briefly describes the sequence of events that happen when Mac OS X boots.

June 28th, 2006 | Tags:

I run OS X on my desktop (settle down now, more on this later).

The default behavior of OS X does not mount external drives at boot time. This is very frustrating. The following command will configure your mac to mount all connected disks at startup (not just upon a user logging in).

sudo defaults write /Library/Preferences/SystemConfiguration/autodiskmount AutomountDisksWithoutUserLogin -bool true

Reboot and you’ll find all your disks already mounted if you ssh in remotely (even without having logged in via the GUI).

If you want to reverse this setting just change “true” to “false” at the end of the line.

April 11th, 2006 | Tags:

For those of you interested in using CentOS instead of RHEL you don’t need to reinstall. By following these instructions you will convert an existing RHEL4 server over to CentOS 4:

I downloaded the following files from a CentOS mirror into an empty directory:


Then ran:

rpm –import RPM-GPG-KEY-centos4
rpm -e –nodeps redhat-release
rpm -Uvh *.rpm


yum upgrade