kieranbarnes Independent PHP, WordPress & CubeCart Programmer

SSH Timeouts on DOCSIS 3 (Virgin Media 50Mb, 100Mb, 120Mb)

Posted on May 15, 2012

Posted by kieran

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

Posted on March 5, 2012

Posted by kieran

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

Posted on March 4, 2012

Posted by kieran

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.

Tagged as: , Continue reading

Caching TimThumb images in memory

Posted on February 26, 2012

Posted by kieran

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

Posted on January 7, 2012

Posted by kieran

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

Posted on January 7, 2012

Posted by kieran

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.

Alternate ‘Messing with time and date on Linux’

Posted on December 20, 2011

Posted by kieran

Following up from a previous post, some hypervisors like Xen are a bit fruity when trying to control the time via NTP. Here's how we managed it.

Firstly, if your installation doesn't have ntp install. Install that.

  1. yum install ntp

Installing FFmpeg and ffmpeg-php on CentOS

Posted on December 5, 2011

Posted by kieran

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?

Posted on November 25, 2011

Posted by kieran

Sometimes you are unable to use the nslookup, host OR dig command on your Linux server and receives the following message

  1. -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

  1. yum install bind-utils

Done!

Tagged as: , , , No Comments

[Snippet] Whois Client on CentOS

Posted on November 10, 2011

Posted by kieran

I can never remember how to install a whois client on CentOS.

  1. yum install jwhois

Thats it!

Filed under: CentOS, Linux No Comments
Page 1 of 912345...Last »