Ryanair 0wn Aer Lingus

Ryanair are making a bid for Aer Lingus! The former national carrier, Aer Lingus, went public a few days ago. Ryanair snapped up 16% of the company and are now offering “an all cash offer of €2.80 per share.”

I can just imagine the gnashing of teeth of Aer Lingus employees as they contemplate the cuts and cost savings Michael O’Leary would introduce!

Killing off PHP

Do you know why Apache processes get stuck and stop responding when serving pages on a WordPress site?

I’ve seen this happen here and on my previous host on a regular basis. I don’t know what happens. It can’t be a PHP script gone into an infinite loop because the normal Apache timeout should kill it. It’s not MySQL as a quick inspection of the process list usually shows it’s empty.

It could be plugins, some of them haven’t been written to the high standards that is expected in WordPress core. It could be some strange interaction between plugins and core code and memory limits and PHP extensions.

Whatever causes it, this will fix it. It’s brutal, it’s crude, but it’ll stop the load average going up on your box and it will ensure that every Apache child process is listening and responding. Add this to the crontab of your nobody or www-data user. Pick whichever user runs the webserver because you want to limit the damage in case something bad happens and the command malfunctions!
*/10 * * * * ps auxw|grep apache2| awk '$10 !~ /0:00/ {print $2":"$10}'|awk -F ':' '$2 !~ 0 {print $1}'|xargs kill -9 2> /dev/null
What this does is it uses the ps, grep, and awk tools to find processes that are using anything more than the minimum CPU time. It is very crude, but it works.

If you use Litespeed, then replace “apache2” with “lsphp”. I have found that this is very necessary as those processes get stuck quite often, especially in low memory situations.

Where's the evil in top posting?

Where is the evil in top posting when replying to a message on a mailing list? It’s something I’ve never understood, even after reading the many “why top posting is evil” posts and FAQs around the interweb.

Inspired by yet another email complaining about a top post to the GIMP mailing list I briefly searched Google, the source of all information in the world, and found this enlightening page on the evils of top-post complaints.

Regardless, top-posting flame wars are always fun to watch from the sidelines. People on both sides of the arguement will fight for their own side in what is a subjective matter and way of writing. Flame away!

I'll be there too

See you tomorrow at BarCamp Ireland! There’s going to be a big crowd and great speakers. Tom will be there and he has volunteered to speak twice. I won’t be talking, but come up to me and ask me about WordPress MU and wordpress.com, I’ll be the one wearing the WordPress tshirt!

I see that the wiki has been updated with the following message:

All attendees, whether you have signed up already or not, please send your contact email address to barcampireland at gmail dot com. Thanks.

It’s a public wiki and I haven’t seen the same message on the BarCamp Ireland Blog so maybe hold off sending that email until there’s a similar announcement tomorrow. Me paranoid? Never!

While I’m here, blogging at 23:30, this will be of interest to the rest of Automattic and anyone else who works at home – Myths About Working From Home. You never really leave the job do you? (via)

Drowning in the flood

I have noticed a strange thing in the past week or so. Google has referred legitimate looking browser user agents to this blog and In Photos.org and within seconds that browser tries to download all my feed links, and several months of my archives. I have a little flood protection built in and it stops them with a 403 after several of these requests but it’s annoying. It’s some sort of pre-fetching plugin to “speed up” browsing isn’t it? Firefox has a similar thing in the form of the “Fasterfox” extension if memory serves. Ben Metcalfe has a good write up on the evils of pre-fetching. It could kill your database or use all your credits in online stores!

Whatever you’re using, welcome to my kill file.

64.136.27.227 … “GET /index.php?tag=suicide-girls HTTP/1.1” 200 36422 “http://www.google.com/search?q=suicide+girls&hl=en&lr=&start=20&sa=N” “Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)”
64.136.27.227 … “GET /wp-content/plugins/widgets/rss.png HTTP/1.1” 200 3341 “https://inphotos.org/index.php?tag=suicide-girls” “Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)”
64.136.27.227 … “GET /feed/atom/ HTTP/1.1” 200 35775 “https://inphotos.org/index.php?tag=suicide-girls” …
64.136.27.227 … “GET /feed/ HTTP/1.1” 200 35449 …
64.136.27.227 … “GET /feed/rss/ HTTP/1.1” 200 4636 …
64.136.27.227 … “GET /wp-content/themes/whiteasmilk/style.css HTTP/1.1” 200 9639 “-” …
64.136.27.227 … “GET /xmlrpc.php HTTP/1.1” 200 42 …
64.136.27.227 … “GET /2006/07/ HTTP/1.1” 200 68150 …
64.136.27.227 … “GET /2006/09/ HTTP/1.1” 200 68150 …
64.136.27.227 … “GET /2006/08/ HTTP/1.1” 200 68150 …
64.136.27.227 … “GET /2006/06/ HTTP/1.1” 200 68150 …

Simple UTW Performance Boost

The Ultimate Tag Warrior plugin for WordPress is a great plugin. It does the job of handling tags rather well. I’ve noticed many hits from Google searches that go to a tag page instead of a category page of the same name so there’s something there that Google likes. I love it! Christine Davis did a super job filling a niche with the “ultimate” tool that anyone could want.
Unfortunately what isn’t so good is what goes on behind the scenes:

  1. UTW ignores your default category when saving your posts. Why ignore the default category when that is probably the subject you care most about? On my photoblog, In Photos.org my default category is “photos” and I certainly want people to find my images.
  2. UTW does an expensive SQL JOIN when it can’t find any tags for a post. Remember what I said about the default category? If you primarily post to your default category then every time someone sends you a request your server will get bogged down trying to find a non-existant record. It’s really bad when you have several years of posts and thousands of records in there.
  3. If you’re not going to use the fancy AJAX tag search then don’t load the associated Javascript. It saves an extra request on the first page load, and the browser doesn’t have to process the file.

Here is a patch that addresses those issues. It needs to be edited before you use it because you have to add a default tag. Here’s how to install it:

  1. Decide on a useful default tag. For this blog I use “holy-shmoly”. Open your WordPress database with phpmyadmin and look in wp_post2tag (the name may be different depending on your prefix). If you have already used the tag then find it and note down the tag_id of that tag. Otherwise, add your tag and note the new tag_id.
  2. Edit utw-patch.diff and look for the strings DEFAULT_TAG_NAME and DEFAULT_TAG_ID and replace with the name and id you picked out in the last step.
  3. To apply the patch, copy it into your wp-content/plugins/UltimateTagWarrior/ directory and run the following command.

    patch -p0 < utw-patch.diff

  4. If you don’t have access to patch, then open utw-patch.diff in your favourite editor and make as much sense of it as you can. It’s not hard once you have the source files open as well.

I’ve noticed a significant drop in server spikes since I made those changes. It takes a while for the default tag to be populated as it’s done when posts are visited but once it’s finished you should see a marked improvement. Oh, and install WP-Cache 2.0 as well. That’ll help you ride out the occasional digg!

Download the patch: utw-patch.diff for UTW 3.14159 for WordPress 2.0

By request, here are the modified files. Rename .txt to .php and copy them into your plugins/UltimateTagWarrior/ directory, overwrite the originals:

  1. ultimate-tag-warrior-actions-wordpress2.txt
  2. ultimate-tag-warrior-actions.txt
  3. ultimate-tag-warrior-core.txt

News overload again

You go away for a few days and come back to a news aggregator that’s just brimming with posts and articles and teasing you with nuggets of information that you really don’t have time to read. 10 posts there, 20 here, 200 in boingboing. Time to be selective, I really should prune the number of blogs I’ve subscribed to. How many do you read? I have 190 feeds, plus about 10 feeds related to me, wordpress and Automattic. *phew*

It was worth it however. We were in Dingle for an extended weekend. Despite the warnings of a hurricane it only rained on us once on Saturday morning. For the rest of the time we could have been somewhere exotic under blue skies and fluffy white clouds. The number of tourists from the US and Canada was great to see. The price of the US Dollar in Euros certainly makes it expensive to visit here for Americans and the Canadian Dollar isn’t doing too well either. I can’t wait to get cracking on the photos I took. Check out my photoblog, In Photos.org, over the next week for those!

Hammond may have brain damage

Richard Hammond, one of the presenters on BBC’s Top Gear, crashed in a jet powered dragster while trying to break the British land speed record of 300.3mph. He had reached 300mph on his first go, and was doing a final run when, “one of the parachutes had deployed but it went on to the grass and spun over and over before coming to a rest about 100 yards from us.”

Sky news updated their news story about the accident a few minutes ago. Richard Hammond suffered a “significant brain injury” but they’re hopeful he will make a good recovery. Watching them do crazy things on Top Gear from time to time it’s easy to forget that they’re actually taking risks. Unfortunately this time something went wrong.

Hope you recover soon Richard!

Much later.. News is getting better.

Clarkson revealed he had made Hammond smile during the visit by calling him “a crap driver”.

He told The Sun: “He was lying peacefully with a black eye but didn’t react so I tried something else.

“I said, ‘The reason you’re here is because you’re a crap driver’. He then smiled at me. It was an amazing moment, very moving.”

Later.. I just watched the final episode of the last series of Top Gear. That’s the one with the white vans. In a final race against Stig in a police car, Richard tipped over the small van he was driving when he tried to take a corner too fast. The van skidded a few feet before coming to a stop and he climbed out safely. I wonder did what Jeremy and James say come back to haunt them when they joked, “Richard might be dead. If you want a job in Top Gear send your application to I’m better than Richard Hammond..”

The Wikipedia page on Richard Hammond has a summary of events including the good news,

In the early hours of 22 September, Hammond took his first steps, just 30 hours after the crash, according to Jeremy Clarkson, and was moved to a general ward on 23 September.

Jeremy Clarkson responds in his usual way, making fun of and light of what happened. I don’t doubt that they did as much as they could to make his land speed attempt safe but reading Jeremy’s quote below, one has to wonder how many children does it take to force a man to consider his fate? Obviously not two, maybe three? No, probably four children.

I have too many children these days to put myself voluntarily in harm’s way. Hammond, however, isn’t there yet.

Top Gear is a great show but when Jeremy Clarkson’s flippant attitude strays towards serious matters it really irks me. Thank God, Richard Hammond is well on his way to recovery.

TCAL has photos taken from Sky News of the crash. Looks bad. Lucky man to walk away from that!

Richard Hammond Crash