The Fat Lady Sings

It’s been known to some for quite a while already, but now the cat is well and truly out of the bag. Sarah announced at work today that she is pregnant, so soon the whole world will know.

The estimated delivery date of our baby is 18th May 2005. The plan is to deliver the baby at home, using a midwife. Depending on your point of view, this is either entirely normal and conventional or radical and irresponsible. I’ll leave it to your imagination in which camp we are.

The news that a woman is pregnant seems to result in two particular questions (at least in the US), to which I’ll provide answers below:

Q. Do you know whether it’s a boy or a girl? A. Yes, we’re pretty sure it’s either a boy or a girl.

Q. Have you decided on a name? A. No.

Before Sarah would let me reveal our news, I’d already blogged a number of entries about the pregnancy. You might feel moved to read them; or then again you may not. More old entries may appear over time if I can persuade Sarah to share her musings with you. She’s a very private person.

Anyway, I can’t tell you how excited I am at the prospect of becoming a dad. It’s all the more surprising, given that I used to hate children; I really did. I never wanted to hold a baby or play with other people’s. I would grimace on a transatlantic flight if a child boarded and took a seat within five rows of my seat. Their crying and whinging drove me mental.

This is one of the few areas of life in which I’ve mellowed, however. I like children now; I really do. I have no idea why this transformation in me has taken place, but I first noticed the mellowing process occurring about seven years ago. It took a few more years before I decided I actually wanted children of my own, but when the moment arrived, there was no doubt in my mind.

Anyway, I’ve resolved not to be the kind of obnoxious prat who goes on about his children all the time, as if everyone else should fawn and drool over them the way their parents do. Stop me if I go too far. This time I’ll do the decent thing and stop myself.

Posted in Children | 4 Comments

The Garden Island

Sarah and I made our fourth trip to Hawai’i in November to spend a long Thanksgiving on Kaua’i, the so-called garden island. We had a very relaxing time, ambling around, snorkelling and viewing the island from the air.

I was surprised how little urbanisation there was on the island. It was very green, with only a couple of sleepy little towns encroaching on mother nature. As with all of the other Hawaiian islands, a trip to Kaua’i is more than recommended.

Photos of the trip are now on-line.

Posted in Travel | Leave a comment

Comment spam killing MT weblogs?

Slashdot has an article on how comment spammers are killing Movable Type blogs by introducing high load on servers. The report turns out to be talking about a bug in MT 3.x, whereby the server gets put under high load even if the comment is rejected by MT 3.x’s anti-spam measures.

What about MT 2.x users, though? Movable Type deliberately left MT 2.x users in the cold in this regard as gentle encouragement to upgrade to MT 3.x. For me and many others, this is more hassle than it’s worth, although we definitely don’t want to have to continue to fend off the torrential spam that is coming through these days. These fuckers will do anything to get their links crawled in an effort to increase their PageRank.

Below, you’ll find a simple patch to MT 2.661, the last of the 2.6 releases. Once this is applied and someone tries to post a comment, MT will read a couple of files, bad_words and bad_urls, and reject the comment if either the author name contains any of the bad words or the comment field contains any of the bad URLs. In fact, it doesn’t just reject the comment; it also auto-bans the IP address of the prospective poster.

The bad_words and bad_urls files can actually contain regular expressions, one per line. These files should be installed in the same location as Comment.pm. In the code below, the path is hard-coded as /var/www/cgi-bin/lib/MT/App.

It takes a very short while to build up the bad_words and bad_urls files. If you’re hit with spam anything like as often as I am, you’ll find this patch starts to save you a lot of arduous work very quickly.

By posting this here, I run the risk that spammers read the code and work around my current measures, but I think the benefit of posting the code outweighs the inconvenience of potentially tipping off the spammers.

One tip: when composing your bad_words file, include &#\d+; as one of your regular expressions, as this will stop spammers from using HTML entities to get around your traps for individual words.

Continue reading

Posted in This Site | 2 Comments

New Hampshire

Sarah and I spent a weekend with her folks in New Hampshire back in September. I’ve finally put up the photos from this trip.

Posted in Life | Leave a comment

ruby-ldap controls patch

I’ve put out a series of patches to ruby-ldap 0.8.3 to allow the easy use of controls. Controls take advantage of the extensible nature of LDAPv3 to provide functionality not part of the original protocol specification.

<

p>

Specifically, I had a need at work to use the Paged Results control, described in RFC2696. ruby-ldap 0.8.3 allows the client to set controls at the search level via LDAP::Conn#search_ext and LDAP::Conn#search_ext2, but it has no way to return controls sent by the server to the client as a side-effect of the search. Furthermore, I wanted to be able to set controls at the session level and have those be effective during

LDAP::Conn#search and LDAP::Conn#search2, which are methods I use much more frequently.

Anyway, if you need to use LDAP controls from Ruby (and let’s face it, who doesn’t?), this if for you.

Posted in Ruby | Leave a comment