Latest Entries »


By nature, WordPress sites generate a huge amount of database queries, which can slow down the page rendering, especially on a busy site. REDIS is a great choice to complement MySQL as a caching layer to speed up delivery of frequently used data; it’s an open source Key/Value store which can significantly improve performance by reducing load on MySQL – think of it as analogous in database terms to Varnish-Cache or Squid in web servers.

For RHEL, CentOS and other RH derived distros

Install REDIS.

yum -y install redis php-redis

Edit the Redis config file with your editor of choice (I use vim)

vim /etc/redis.conf

find the following parameters in there, uncomment and adjust such that they read:

maxmemory 256mb

maxmemory-policy allkeys-lru

Now start up redis

service redis start

and set it to start at boot

chkconfig --level 35 redis on

Download the 3rd party object-cache.php script from DigitalOcean here or use the following command line on your server…


copy the file to the wp-content subdirectory of your wordpress site’s base directory and make sure the webserver process has permission to read it

Edit wp-config.php in the wordpress base directory and add these lines in the “Authentication Unique Keys and Salts” section.

define('WP_CACHE_KEY_SALT', '');

define('WP_CACHE', true);

and change “” to your domain name

restart apache

service httpd restart

if you are using php-fpm you may need to restart that also, I use mod_php so I don’t need to.

now you can monitor the cache hits with:

redis-cli monitor




Today I wore my ‘Better Call Saul’ T-Shirt (Breaking Bad). In the lift going down, a couple joined us in there, and commented on the shirt – turns out they were from Albuquerque, New Mexico !

In order to comply with our friend Sheila’s strict orders, we embarked on a mission and headed down Avenida de Liberdade to Pastelaria Suiça in Rossio Square; there to sample a traditional Portuguese custard tart.

I managed to interpret enough of the instructions on the screen of a ticket machine in the Picaos Metro to buy 24 hour travel passes, and we finally made it onto a bus which wasn’t even the wrong one – a minor miracle in itself for us.




We ambled around the end of Rossio Square, which seems to be beggar and hawker central for Lisbon – and unknowingly ended up outside the instructed destination – Pastelaria Suiça, where we sat down at a table and I fiddled with Google Maps trying to find it. Aideen interrupted me, pointing out that we were actually sat outside the ****ing place!


We ventured inside to buy coffee, custard tart and a beer. Heading back outside, the heavens opened and we dived under an umbrella covering one of the tables. Another group of people were also clamouring in, and one lady bumped into Aideen’s chair. She apologised, and A told her no problem, you’re grand. The bumper then looked at A and immediately said “you’re from Dublin…” – turns out she was from county Clare and a conversatin ensued. She was over with her (English) husband, grown up son and daughter (who were deep in conversation with some apparently local guy, poring over maps).


We talked about a few things, and the husband says he reckons Breaking Bad was the all time best TV series, I’m not gonna argue that one –  and best ending to a series even though he is gutted it had to end. Damn right. Hopes the new ‘Better Call Saul’ is as good though he is sceptical. I hope so too.


I have hit a snag with the hotel TV, as it’s actually an older model and has no HDMI port, and I don’t have any way of getting an input signal into it from the laptop. I’ve decided that we can just about live with the small screen on my laptop as long as we have some audible sound. So – I need a pluggable USB speaker. We decide to enlist the help of the local guy who has by now just about finished helping our new friends son & daughter, and I explain to him what I need to buy. He just says, simply – “no problem, I’ll walk you there – it’s easier than trying to translate and you will just get lost.”.

He was bloody right. We walk south and along a few blocks, then we turn into this doorway that looks like it would lead to apartments. Honest to God, if I’d taken AIdeen there she would have ripped me apart! We are wondering whether to be suspicious, but other locals are also heading in there, and there are lifts there. We get in, head up a number of floors and emerge right into a shopping centre – weird!

Our guide/new friend’s name is Sorin, and his help is again enlisted in translating what I need. I finally (thanks to him) manage to pick up a decent TDK mini rechargeable USB bluetooth speaker which should work fine for what we need. We offer to buy him a beer and lunch for his help, and he says he is more than happy to join us for lunch, but will pay his own way. We ask where he would recommend, and he says he knows just the place. We follow, and he leads on, out of the shopping centre and down a hill back towards Avenida da Liberdade, according to Sorin passing the world’s smallest shop (which sells gloves)


World’s smallest shop

We walk past a lot of restaurants, with owners standing outside desperate to drag in anyone they can. Sorin just rolls past them, the owners ignore him and focus on us – we seem to have ‘the look about us’. We stop to look in a church, which apparently was burned, and is fabulous inside but also has beggar turf wars going on at its door. Sorin recommends a bar, but entering it requires climbing some pretty steep stairs, and whilst A can cope with going up them, there is no way she will be able to get down them after a drink – they are evil. We tell Sorin and he is relaxed about it – we walk on, back to the main Avenida da Liberdade stretch, just as the heavens open and we almost run for a pavement cafe/bar with umbrellas to ride out the storm. I grab some beers for us all, and A explains her condition (MS) to Sorin. He says he understands and it’s no problem, it’s really not much further but ‘real’ Portuguese.


Lisboa Monsoon and Sorin, right

The pic above is mild – to see the real intensity of the rain, look HERE and HERE 😉

Anyway, it took about 40 minutes for it to recede to a level where our little umbrella would not be snatched away by the wind. We venture off again, but we cross L. and the ***ing monsoon notices us and comes back to get us – AGAIN. We try to shelter under some shop canopies, but it’s not much use – all of us are totally bloody soaked now, me especially. Sorin promises it’s only 3 minutes more, so we head out into the deluge. We turn off the main drag onto a side street, and finally end up in the Floresta Restaurant…


Floresta Restaurant – our port in the storm

It’s PACKED – but Sorin knows the family who own it and a table is quickly cleared for us. I end up with steak with madeira sauce Aideen has some beef dish and Sorin goes for ‘Black Pork’ – all come with very thin cut potatoes which I have to say are pretty good. The local wine is of course a great feature also.


Been in Maderia Sauce

After a very boozy and pleasant lunch, we manage to grab a taxi back to the hotel, but not before Sorin has invited us to a ‘Tea Dance’ with him and his girlfriend on Thursday – I mean – US at a Tea Dance. What next?



We’ve managed to leave our umbrella behind in the restaurant, which will knock on into day 5. We’re really amazed how friendly people are in this town, what a funny day.

For now though we are pretty knocked out from all the walking by the time we get back to base, so just order room service and crash.

After barely making it for the 11am breakfast cut-off, we ventured out locally on foot, embarking on a futile search for the Portuguese equivalent of an off license so we could stock up the room with some wine, only to find that in the part of town we are in almost nothing opens on a Sunday, and especially not at lunch times. Google Maps directs me to 3 possible suspects but on arrival at each one they appear to be residential addresses. Weird.

We return to the hotel for some beer and a light lunch of delicious tapas again and more beer and wine. We discover that the hotel shop sells local wine at very reasonable prices, so stock up on postcards, tourist tat for various friends and the always essential wine.

Todat is Spa day for us, having booked aromatherapy massages for both of us in advance – and what a treat. The hotel spa facilities are utterly amazing, and we both enjoyed the experience so much we’ve booked in again for Friday, and for a longer session this time. We are so chilled out now we struggle to the lounge for evening happy hour, but only last about 20 minutes before heading back to the sanctuary of our lovely room and some room service. Omelette for A, burger for me. All very good. Impression so far, very laid back attitude, friendly, helpful people.


Spa treatment room

We came down the two flights of stairs from our flat at 05:35 at Aideen’s behest, a minor sense of panic descending as the taxi, booked for 05:40 was not here yet. We decided to walk out of the courtyard and up to the end of the drive to meet the taxi. I try calling taxi company to check, but no answer. It’s now 05:40 and Aideen is commencing flap mode:


AIdeen in decfon 3 panic mode

Thankfully taxi arrives exactly 45 seconds late – mercifully just 15 before main DEFCON 3 panic mode begins. We’re off. Taxi driver is terrified by Aideen and stays almost silent for the whole trip to Heathrow.

The great M25 car park is for once untroubled and we arrive into T3 without even having had a fight. We head for Club Europe checkin to drop our one bag, and A, having insisted on taking the Passports and Boarding Passes has to rummage through her cabin bag to extract her handbag, and then rummage through said handbag to find documents. I would have just kept them in my pocket as I usually do on my many business flights – oh well. That done, we drop the bag and continue upstairs and through security, where we both get stopped. I nudged the scanner as I went through and made it beep, resulting in the removal of my shoes and a rescan. A just made it beep anyway and had to take off her shoes also.

We now make our way to the BA Galleries Lounge, where I forgo the usual bacon roll challenge where my record is a massive 9 and consume only 3, along with a rather pleasant Bloody Mary and a brace of Cappuccinos. We decide to move to the gate before it’s officially open as it’s the dreaded #24 in T3, the furthest possible one away. This is annoying, especially since you have to walk all the way there only to get on a damn bus for the remote stands which BA are relegated to here. As Club passengers we are supposed to have a priority bus, but everyone else just piles on anyway and no-one stops them, so it’s a bunfight getting off and up the steps to the aircraft, but then we’re in row 2, so all is good and we get a very friendly welcome from the cabin crew.

The flight was very pleasant, and excellent crew who could not have done more. We had a glass of champagne each to celebrate finally getting to holiday time intact after moving and family crises. We arrive into Lisbon at a remote stand again, and the same thing in reverse happens – the priority bus for Club passengers is invaded by the great unwashed from behind us, and we end up behind them all at border control. The, all but one agent decides to go for a siesta, leaving only the crew channel open and over 100 passengers waiting. After about 10 minutes of nothing happening, 2 other agents arrive and we finally make it through.


Crazy Taxis

We find the taxi rank, and a game of live ‘Crazy Taxi’ ensues. Haven’t seen driving like this since Malta – the guy is more concerned with grooming his ample facial hair and luxuriant dark locks than the road as we drift sideways around corners, taking off over hill crests and bottoming out the suspension as it lands. A and I are almost in each other’s laps at times. After about 10 minutes of white knuckle fun we arrive at the Sheraton. Bloody glad we had that Champers as anaesthetic on the flight!

At reception, there is an American couple already there who were on the same flight as us. They must have had an even crazier driver than ours! Our room isn’t ready, nor is theirs. This is where the marked difference between us and Americans is highlighted. They buy a 24 hour bus pass and head off into town to do ‘some touring’. WE head into the bar, have 2 beers, some utterly amazing local tapas type dishes and a bottle of fabulous Duoro wine – YUM! 😀

Vegetable Tempura

Vegetable Tempura

Well, the guy from reception finally finds our table in the bar, where we are pretty much fixed to our seats now. Anyway, the wait turned out to be worth it as we have an incredible suite with a HUGE lounge, two loos, fab walk-in shower and huge bedroom and huge bed.




What’s more there is a tray of snacks with cheese, vegetable chips and dips and another excellent bottle of Duoro with a card from the manager welcoming us. Way to go!

Manager's treat

Thanks Antonio!

View from the room on 23rd floor

View from the room on 23rd floor

In the evening we hit the club lounge for a swift glass of wine or 3, then move on to the Panorama Restaurant on the 26th floor. You walk in to the bar and are greeted with a spectacular view over the town, sea and the April 24 bridge.
I sup on a very pleasant bloody mary made with port before moving on into the main restaurant. Aideen orders Tiger prawns and I go for Lamb fillet.

The Lamb is delicious, and has a very nice, albeit mild pepper sauce with it and amazing saute potatoes with vwg. However Aideen’s Tiger Prawns turn out to be the size of two Lobsters, and she is a little perplexed by this. I shell them for her, knowing and I pull that I will end up eating at least one of these, they are HUGE. As it happens, she can only manage about 1/2 of one, so I luck out and pig out. Wine is also amazing, I picked one from the Alentejo region and it was a good choice. Exhausted from the early start and travelling, we pick ourselves up and collapse into bed. Surprisingly, we sleep all night, unusual for a first night in a new place, but Sheraton beds are legendary for comfort. A great start to the trip.

It so happens that a colleague was chasing me for about the 3rd time on a piece of work I am struggling to complete. The problem is not that I can’t get my head around it, or that I lack the skills, or even that I’m waiting on someone else to complete their part.

It’s interruptions. Pure and simple.

So with this in mind, I put together the following reply:

Dear Colleauge,

Whether I can complete the module in time for next week depends on how many of the following interruptions I get this week while I am duty 3rd line engineer:

Major Incidents:rescue2 Mentoring 2nd line:panic
Oh, and last week there was a delay because I was on holiday:
So sorry it’s late, but we need to do this right over doing it fast, we don’t want this:
We need precision:


Yep! Wrong, wrong wrong!

They really are

So, by the Monday morning following the last insane week, I was pretty
shattered, my sleep pattern having been blasted to hell and I always tend
to be a little on edge when on call, never knowing when the phone might
ring again. It’s just not conducive to sound sleep. So, I crawled groggily
out of bed around 7am, grabbing the first set of clothes I could find and
headed out on my bicycle in the dark for the train station.

Unbeknownst to me, the trousers from that set of clothes were a pair
which, two weeks ago, I had discussed with my wife regarding a rip in the
seam; she had examined them and pronounced them beyond repair. They had
been lying on the top of the chest of drawers awaiting disposal. So, I was
now wearing the clothing equivalent of a ticking bomb. Wallace and Gromit
– Wrong trousers, eat your heart out!

Suffice it to say, that at some point during that day, I sat down heavily
in my chair, snagging the pocket of the already terminally weakened
trousers on the chair arm. This caused the rear seam to rip – a lot, and
as I stood up quickly to try to stop the tearing, I worsened the situation
terminally, ripping the seam all the way from my arse right down the leg
beyond the knee. Realising my plight, I ran for the toilets, pausing only
to grab a stapler, hoping I could effect some kind of temporary repair
sufficient to last long enough to get me to a shop.

I sat in the toilet, trousers off, waiting for people either side of me to
go out, fearing the noise of the staple gun would give them the impression
of some weird perversion – so I sit listening to the various noises,
waiting for a flush or dryer to mask my stapler clicks. I seemed to have
hit peak hour, and there is a bloody queue of people  using the cubicles
either side of me, but eventually after about 20 minutes and 200 staples I
think I’m in with a chance, so I put the wretched trousers back on and
leave the cubicle.

Unfortunately the material was so frayed that the staples gave up without
a fight, and as I emerge from a meeting, a colleague leans over saying
“you do realise, your trousers are split all the way from your arse to the
floor…” as I leave a trail of small metal objects in my wake.

After reaching my chair and taking cover there for a while, I’m starting
to think in terms of how I can roll the chair all the way home, and how I
can get onto a train with it. Eventually I run for the loo again, this
time collecting a roll of sticky tape as well as the stapler to use as a
sort of reinforcement. Wish I had some duck tape. Anyway I reach the loo,
same ritual as before except worse this time, because I now had the added
pervy sound of tape peeling off the roll, but eventually I emerge, and I
am seriously dreading what anyone in the adjacent cubicles is thinking
(actually I’ve given up now, so it’s pretty much click – screeeeeeaapsh –
well, that’s the best approximation I can give in words to sellotape
peeling off a roll) and I exit with what feels like a large staple stuck
in my bum.

I notice the female COO (who lives in a glass office right behind my desk)
is now giving me very strange looks – probably because she’s been mooned
at all morning and has seen far more of me than she feels is necessary –
she’s not been in her office since Monday now!

Finally it’s time to go home, and it seems the temporary repair has held
up. But then, disaster – my jacket sleeve has wound itself around the
wheel of my chair, and the only way to untangle it is to bend over and
pull it out. If i bend over there’s no telling what might happen.

Why is fate conspiring against me? Was I Genghis Khan or Atilla the Hun in
a previous life?

Finally I resolve the problem by picking the chair up, placing it on my
desk, and wrenching the damn sleeve out of the wheel. By now though,
everyone in the near vicinity, including the COO behind is looking at me
as if I am a complete lunatic wondering why on earth I am putting a chair
on my desk, yanking at a jacket while I am looking as if I’m about to
burst a major blood vessel and mincing around trying to keep my arse
tucked in.

Finally, I move stiffly, but as quickly as I can out the door heading for
the station.

The repair ½ lasts for the change of train at Surbiton, where the repairs
start giving way again, but I am able to conceal it by sitting until the
last second until the doors of the incoming train are about to close. By
the time I reach my stop, the flaps are wide open again, but I’m on home
ground now, and run for my bicycle. Amid quite a lot of hoots from
following cars, I pedal home frantically. Wife is just hysterical with
mirth, and I have to admit, even I at this stage see the humour in it,
though Daughter is actually chastising her mother for being so mean to me –
“poor daddy”.

On changing into a less damaged pair of trousers I find several strands of
sticky tape stuck to my underpants, and a number of staples to boot. They
doggedly remained attached to there, where they hadn’t been stuck, but
refused to  bind to the wrong trousers. Typical.

NOTE: As of 14 Jul 2011, some mirrors are still updating and don’t yet have all the RPMs and/or metadata uploaded. Your mileage may vary.

To get Vbox Guest Additions installed and running on CentOS 6, get a terminal up and enter the following:

  yum -y update

  yum -y install gcc kernel-headers-`uname -r` kernel-devel-`uname -r`

Now, from the VirtualBox top window menu, select Devices->Install Guest Additions

If the autorun window comes up, let it run the script. If not, go back to the terminal and do the following:

  cd /media/VBOXADDITIONS_4.0.10_72479/     (the version may be different – this is as of 14 July 2011)


or if you are not logged in as root,


Now check the vboxadd service is running with:

service vboxadd status


sudo service vboxadd status

If it’s running, now log out and back in of the CentOS virtual machine. That should do it.

Synopsis: If you have a Linux instance, on booting it will run fsck on disk partitions configured with default settings in /etc/fstab. If the check fails, the boot will halt before bringing up networking, and offer you the choice of continuing, ignoring the error by pressing ctrl-D, or entering the root password to attempt a manual fix. This is not helpful as AWS (and Eucalyptus) provide no interactive console service, so you can see the prompt, but not respond to it. However, all may not be lost.

Here I shall present a method for recovering an instance which is failing to boot because of failing disk integrity checks on non-root partitions when using an AWS instance store AMI.

The first thing to note however, is that if the fsck fails on the root device, you are royally screwed – as far as I can make out there is no way to recover from that. I’m looking into it though.

The second thing to note is how to prevent it happening in the first place. All you need to do is prevent fsck running at boot time, this can be accomplished by editing /etc/fstab and modifying field 6 of any mounted file system entries to 0 (zero) like so:

/dev/sda1  /         ext3    defaults        0 0
/dev/sdf   /var/www  ext3    defaults        0 0

If those fields are non-zero fsck is liable to run after a certain time duration or number of reboots. Setting it to zero means that fsck will consider the drive as not requiring checking.

So, I had a customer who had this problem while resizing a volume, the aim being to increase the size of an EBS partition. They had added additional volumes, mounted them manually, copied all the data across from the existing partition then swapped the mount points by editing /etc/fstab, then rebooted. Problem was, the instance then failed to boot as fsck failed on the old partition, which was running a RAID0 partition and somehow got damaged during the reboot, or before. Whichever, the problem only became apparent on boot. It could have been prevented by unmounting the partition and running fsck on it before the reboot, so there ‘s a lesson in itself.

Ironically, the old filesystem was not even required any more, since all the data had been successfully copied across to the new one, and it was now this redundant partition which was preventing the boot completing. Detatching the volumes is no good, since fsck will still obey /etc/fstab and complain that there is no superblock.

But, since this data plays no part in actually bringing the instance up to the state where an administrator can ssh in, we can spoof it.

My solution is as follows:

Create a new instance and 2 new small EBS partitions (you can use the AWS console or command line tools, whichever you prefer for this) of 1Gb each.

  1. Attach both volumes to a new instance.
  2. ssh in to the new instance
  3. create a new RAID0 array
  4. create a filesystem on the RAID0 array
  5. fsck the new filesystem
  6. check /etc/fstab settings
  7. mount the new filesystem to confirm error free
  8. unmount
  9. detach NEW volumes from NEW instance
  10. detach OLD volumes from OLD instance
  11. attach NEW volumes to OLD instance
  12. reboot OLD instance

Now it should boot, as fsck will fly through and find no errors.

Good luck.

Well, I’d spent a long time getting this beast up and running, and like an unbroken stallion – it wasn’t coming quietly. I had a mountain to climb, and I named it Bustboot Mountain.

Score to date, Gremlin: 2, me: 0

The beast in question was a supermicro blade server based monster, with 24 cpus, 28gb RAM and around 40Tb of RAID5 storage, controlled by 2 fast LSI Megraid cards. There will be more of these, so the task was to get the installation automated by Cobbler such that a minimal CentOS 5.6 was installed and reachable from the install server.

Of course, the limitation on the kickstart install did not help, an unhelpful message about the GPT partition not being usable as there were storage volumes over 2TB available – why does this matter when 2 system volumes had been created of 1TB each off the local SATA plane?

I finally breached the enemy’s defences by hacking the python anaconda partition manager script, and rebuilding the stage2 squashfs image – then re-inserting it into the package directory on the cobbler server.

Gremlin: 2, me: 1

However, it now installed, but then refused to boot, ending up in a cycle. Gremlin was far from finished yet.

The addition of a super grub image to the PXE menu helped cure the next ills simply by writing the MBR correctly. It now presented a boot menu, but failed to boot from the default option on hd(6,0)

Gremlin: 2, me: 2

So then a quick mod to the installed boot hd(6,0) to hd(0,0) finally made it wake up and reboot unattended. Victory was mine, this day. I just needed to mod the kickstart file for write the MBR to both individual RAID1

Gremlin: 2, me: 3

That done, I went to shut the kvm panel, only for the beast to have it’s final word and snap the screen shut – on my fingers. I know now that gremlin is still there, still waiting for his chance for vengeance.

Gremlin: 3, me: 3

Here are a list of danger signs to watch out for in adverts. I list the key phrases and their real meaning…

Strong team-player: We are looking for someone who is so desperate for a job that they’ll endure crap from lots of over-aggressive, lazy, annoying people whom you’ll have to continually chase to get off their arses and do the simplest things.

Ambitious and Energetic: Senior Management want another “Yes Man” so you must be a total brown-nosed bastard whose sole mission is sucking up.

Customer-focused: you will take all manner of abuse from customers without any backing from your own management (who will certainly throw you to the wolves if you challenge the customer on anything at all) and still be glad you have this shitty job.

Self-starter, must be able to work on your own initiative: – We have absolutely no inclination, time or resources to brief you, so we expect you to figure everything out for yourself, like yesterday.

Attentive to details: We have anally strict policies and processes and won’t hesitate to target you as a scapegoat as soon as a mistake is made.

Flexible and Innovative: – We are totally disorganized and indecisive, so you’ll need to be able to clean up our messes and do stuff that isn’t in your job description and/or you have no experience or training for at our whim.

Results Orientated: – you’ll be inheriting projects which have failed because of a group of influential people who won’t accept change.

Able to work under pressure: – Our managers are hopeless at prioritising, so they class absolutely everything as mission critical and will micro-manage your activities to a maddening level.

Goal-Oriented: – We have lots of utter messes we have no idea how to clear up so we need someone to figure out how to do it with zero guidance, in the face of considerable resistance and without any other resources.