I hate vi. (aka Changing your default crontab editor)
I'm trekking into the unknown - CentOS, but thats off topic. For some reason, even the latest version stuck in 1982 - vi as the default editor for cron etc. Argh! I hate vi!
Find text within files
Stuck trying to find text within files on Linux?
cd /directory_tree_you_want_to_search
find . -type f -exec grep -l "string to find" {} \; -print
Easy!
.htaccess redirect based on requested domain
Imagine you have a selection of domain names that point to the same site, are some of those domains specific to certain areas of your site?
Here's how I redirect a domain name to a specific area on a site
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?cubecartexperts\.co.uk
Rewriterule ^(.*)$ http://www.i9000networks.com/landing-page/cubecart-experts/ [L]
You'll also need the domain set in your virtualhost config like this
ServerName www.i9000networks.com ServerAlias www.cubecartexperts.co.uk ServerAlias cubecartexperts.co.uk
It is a much more helpful way of helping your users navigate your site.
Using rsync to maintain backups on Linux
Following on from my previous article, regarding Setting up and using NFS on Ubuntu, here's how I keep backups for quite a few clients.
On a particular site I maintain a single backup server that several clients backup to on a nightly basis.
Redirecting WordPress index.php to root
If you check the Page Rank of http://bloke.org against http://bloke.org/index.php, which are both, to a human, obviously the same page you'll see two different results. My domain carries a PR3 whilst the latter carries a PR0.
We know they are both the same, but do the crawlers? No, they don't.
Setting up and using NFS on Ubuntu
Network File System, NFS, has been around since Noah first networked his ark.
Setting up and using NFS on Ubuntu is surprisingly easy. i9000 Networks needed a slightly revised backup solution in one of it's sites.
Obviously you'll need two or more servers. One I'll refer to as the server which will host the backups and the second/subsequent servers, which are the clients, ie. the live servers that need backing up.
Here's how I did it.
Auto Updating GeoIP Binary Databases
Here's how I keep on top of updating the GeoIP binary databases used by various scripts and applications I use.
Installing VMware Server & MUI on Ubuntu 7.10
Installing VMware on Ubuntu 7.10 isn't as easy as Ubuntu usually makes things out to be. None the less, my handy how to will sort you out.
FuzzyOCR inspired PDF scanning for SpamAssassin
I've just stumbled over a PDF scanning engine for SpamAssassin. In light of the recent PDF spam making it's way round the internet I figured I'd give it a try.
This plug in scans the PDF pdf body and embedded images. Great, huh?
Here's how I did it.
FuzzyOCR for SpamAssassin on Ubuntu
FuzzyOCR is a plugin for SpamAssassin that analyzes the content and properties of images to distinguish between normal mail and spam.
I've been running it on some mail servers for a few months now and I'm very happy with the results.



