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.
Secure access to your SolusVM Admin Panel
SolusVM users really should protect their Admin Panel (/admincp/) . Although you can add IPs with Configuruation -> Admin CP Access. It didn't make me feel too safe.
Here's how I did it in lighttpd.
Protect wp-admin with Nginx
Are you running WordPress on nginx? A massive security win is securing your wp-admin area by limiting IP access. How? Easy.
Drop these lines into your nginx.conf or relevant vhost config file
Loading jQuery in the footer
Loading Javascript in the footer has many benefits such as speed, you give priority to visual elements of your site. Your site will render for the visitor, then it will load the Javascript.
By loading Javascript at the end of the page, it immediately has access to the whole DOM, no waiting. If you are really clever, you can do away with your document.ready() function too
With WordPress its really easy to move the Javascript into the footer.
Use the following in your functions.php file
- wp_deregister_script('jquery');
- wp_register_script('jquery', '/wp-includes/js/jquery/jquery.js', false, false, true);
- wp_enqueue_script('jquery');
Adding .html suffix to WordPress Rewrites
Here's a quick way to give your WordPress install a static look.
Add this code to your functions.php
Kieran’s Password Generator
Here's the random password generator script I wrote. It has a few different options like pronounceable, unpronounceable, Windows 2008 domain safe and outright mean passwords.
[Snippet] Adding your custom taxonomy to post/page list in WordPress
Custom Taxonomies are amazing for organising your post data. Here's a simple way of showing your custom taxonomies on the post/page list in wp-admin.
In the image below you can see we are now showing the custom taxo Brand in the post list.
Here's how I did it
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.




Removing all comment functionality in WordPress
Posted by kieran
As more and more people adopt WordPress as a CMS, more and more of the original blog functionality is becoming redundant. Comments are one of.
Here is how to conclusively remove all comment functions in WordPress