SSH Timeouts on DOCSIS 3 (Virgin Media 50Mb, 100Mb, 120Mb)
Since moving to Virgin's 120Mb Broadband my SSH connections would drop after 30 seconds of inactivity. This made some grey hairs appear on the side of my head.
This happens due to the way Virgin handle the Internet traffic on their DOCSIS 3 network, as opposed to lower broadband speeds that use the DOCSIS 1 network.
I've managed to solve this by altering the client time out parameters in the SSHD config on each server.
Automatic Photo Blogging with WordPress
My latest WordPress challenge was to automate a photo blog site. The photo blog post content would just consist of a title and a featured image. No content. As per normal photo blog style sites.
This solution takes an image at random from a folder and posts it in WordPress. It relies on a healthy collection of images to work from.
Really simply, it needed to select a photo at random and post it. Sounds easy, until to you start to code it.
Here's my solution.
Server Side PNG Optimisation with TimThumb
A little known feature of TimThumb is that is supports server side PNG optimisation.
Using the OptiPNG program (Available for Linux and Windows) TimThumb can losslessly compress PNGs on the fly.
Quick tests showed an original clients PNG came in at 671Kb, OptiPNG compressed that with no visible difference to 580Kb and nominal server load.
So lets go ahead and use it.
Caching TimThumb images in memory
TimThumb, properly configured & secured is a very useful tool for image manipulation. Amidst all it's old security flaws, the new version is pretty secure.
Sometimes it can be pretty slow though. By default it only caches images for 24 hours. Probably not long enough if you are just creating static thumbnails of larger images that don't change.
I'd recommend changing it to 31,556,926 seconds - one year.
MySQL 5.0 or 5.1 to 5.5 Upgrade Traumas on CentOS
Ignoring all the panic-mongers on the rest of the internet upgrading MySQL from 5.0 or 5.1 to 5.5 shouldn't be that difficult. My task was to upgrade from 5.0 to 5.5 on CentOS (Remi Repos). It was to fix a bug with MySQL 5.0 ignoring the wait_timeout parameter in my.cnf.
Five to five on a Friday, I dive into the swamp, which turns out to be full of alligators.
Alligator 1: Version depenencies
Alligator 2: /usr/libexec/mysqld: unknown option '--skip-locking'
Alligator 3: [ERROR] Error message file '/usr/share/mysql/english/errmsg.sys' had only 481 error messages,
but it should contain at least 641 error messages.
Or some other variation of numbers.
Install the Remi Repo in CentOS
The Remi Repo is a yum repository maintained by a French dude - Remi Collet. It contains much more up to date packages (January 2012) such as MySQL 5.5 and PHP 5.3.
Heres how I installed it on CentOS.
Installing FFmpeg and ffmpeg-php on CentOS
Whilst installing FFmpeg and ffmpeg-php for a client that required server-side MP4 processing, I ran into a few errors.
The error I came across was while compiling ffmpeg-php
How to install the nslookup, host OR dig commands in Linux?
Sometimes you are unable to use the nslookup, host OR dig command on your Linux server and receives the following message
- -bash: nslookup: command not found -bash: host: command not found -bash: dig: command not found
The reason is the package required for the commands to work isn’t installed during the OS installation.
These are all DNS related commands useful to check the DNS report of a domain/IP.
You need to install the package bind-utils which offer the commands like nslookup, host, dig and others.
SSH to your server as root and execute
- yum install bind-utils
Done!
[Snippet] Whois Client on CentOS
I can never remember how to install a whois client on CentOS.
- yum install jwhois
Thats it!


