Categories
Blogging Computing TITGIG

Precondition Failed when trying to leave a comment on WordPress

A reader emailed me a little while back to tell me that he’d been having difficulty leaving a comment on my site – he’d get the error “412 Precondition Failed”.

I did some investigation and found that sentences such as *”However, its a far cry to be able to create a food sample from scratch.”* and *”As a computer programmer yourself, you’d probably find it easy to program a computer to create hit songs from scratch, right?”* were causing the problem, and if I reworded them, the comment would be allowed through.

I did a bit of digging around and came to the conclusion that these sentences were being rejected because they looked like an attempt to hack the site. I consulted my web hosts, 34sp, and they confirmed that mod_security was rejecting them because they took the format “create blah blah blah from”, which could be construed as an attempt at a SQL command.

Leaving aside how unintuitive the error was (surely 403 Forbidden would be much more appropriate than 412 Precondition Failed?), there is a solution. You can disable this particular rule by putting the following line into your .htaccess file:

SecFilterRemove 300013

The side-effect of this is that you will also lose additional protection against SQL injection attacks, so use it at your own discretion.

*UPDATE: I realise now how much of a misnomer this post’s title is, as this problem has nothing to do with WordPress.*

Categories
Computing

An idea for an email hoax detector

I’ve had a nifty idea.

I propose a piece of software that automatically scans messages as they arrive at your email server. It attempts to find a match between the text of the email message, and any article on Snopes.

If a sufficiently good match is found, and the article in question is marked as “False”, then the email is rejected, with a message explaining why.

If some of the big webmail providers could implement this facility by default, it would make the world a much better place.

Categories
Blogging Computing

Bye Bye, SiteMeter

I was doing some changes to my site when I noticed a completely unexpected message in the status bar. Upon further investigation, I discovered that Site Meter have started incorporating services from specificclick.net into their javascript. It’s your common or garden site-tracking cookie-based bollocks, and I don’t feel that my users should have to endure that, so I’ve removed the Site Meter code from this site, and it will not be coming back.

I’m going to try surviving without a stats tracking package for a little while, and we’ll see how it goes.

Apologies for all the meta, but I felt that it was important to get the word out about this, so that other Site Meter users are aware of it.

Categories
Blogging Computing

Buy Shaggy Blog Stories

Mike’s book, as mentioned here, is now available to purchase.

If you want to buy it, go to http://www.shaggyblogstories.co.uk/. If you want to find out more first, Mike’s written a summary on his site.

Kudos, by the pint, to Mike for making this happen.

Categories
Blogging

Shaggy Blog Stories

Mike‘s plan to raise money for Red Nose Day is to compile a book (real thing, paper, once trees, ink on it) of funny blog entries. An anthology, if you will.

If you want to contribute, go here to be briefed.

I’m in. Are you?

Categories
Computing Displeasure

Pipex Don’t Care Anymore

Back on the 27th October I told you about the trouble that I’d been having with [Pipex][]. Here’s a short update.

[pipex]: http://www.pipex.net

> **Sent:** 30 October 2006 16:31
> **From:** billing@dial.[pipex][].com
>
> Dear Mr P [redacted],
>
> Thank you for your reply.
>
> I can confirm that the credit of £35.19 for the security suite invoiced in error (on your new account) has been refunded back to your card today on 30.10.06. Please allow 3-5 working days for this to clear with your card issuer.
>
> I have arranged a pro-rata credit on your cancelled account for the period of paid subscription after your cancellation date. The total credit of £9.38 shall be refunded back to you within the next 28 days.
>
> Please accept our apologies for any confusion / inconveniences which may have been caused by this matter and if you have any further queries please do not hesitate to contact us.
>
> Kind Regards,
> JR
> Finance Team

I replied, of course.

> **Sent:** 30 October 2006 16:55
> **To:** billing@dial.[pipex][].com
>
> *Dear Mr P [redacted],*
> *Thank you for your reply.*
> *I can confirm that the credit of £35.19 for the security suite invoiced in error (on your new account) has been refunded back to your card today on 30.10.06. Please allow 3-5 working days for this to clear with your card issuer.*
>
> Thank you
>
> *I have arranged a pro-rata credit on your cancelled account for the period of paid subscription after your cancellation date. The total credit of £9.38 shall be refunded back to you within the next 28 days.*
>
> As I wrote in an email on Friday, I requested a cancellation date of 15th September, but for some reason it seems that the cancellation actually occurred a few weeks later, on 3rd October. I believe this to be an error on the part of someone at Pipex, and I feel that I am entitled to a refund from my requested cancellation date of 15th September.
>
> Regards,
> Pete

Categories
Computing Displeasure

Pipex Taking Their Sweet Time

Here are the emails that have been exchanged between [Pipex][] and myself so far (automated responses excluded). Names have been replaced by initials.

[pipex]: http://www.pipex.co.uk/

> **Sent:** 14 September 2006 11:53
> **To:** customerservices@pipex.net
>
> Customer Services,
>
> I have a payment from my credit card to PIPEX INTERNET to the value of £35.19, dated 11 September 2006. This payment for such a high value is completely unexpected. I am concerned that it might not be legitimate, in which case I will have to phone my bank and cancel my cards. Please get back to me as soon as possible regarding this payment.

The reply came six days later.

> **Sent:** 22 September 2006 11:10
> **From:** customerservices@pipex.net
>
> Dear Sir,
>
> Thank you for your email
>
> This includes the zone alarm fee which has been charged in error, I have sent a request to my finance team who will have this refunded back to you, please allow 28 days
>
> I thank you in advance for your patience
>
> Kind regards
>
> SS
> Customer Services

All good. Three days later, I noticed another erroneous transaction on my account. The snowball starts to roll down the hill…

Categories
Blogging Computing Original Software TITGIG

Related post

Weblogs are very time-sensitive, as you probably know. They attempt to capture the *here* and the *now* and the *this* and the *that* and the *wow* and the *yeah* and the *groovy* and the ilk.

There are caveats however. Certain time-sensitive data is just not worth reporting on.

Firstly, the “hey, do you like my new design?” post. You just know that this is going to look daft in three years time when someone is browsing through your archive and they come across it. If you really must publish a post like this, at least have the decency to include “before” and “after” screenshots.

A variation on this is the “I’ve added a small rotating badger to my sidebar” post. Rotating badgers are cool, so I’m going to forgive this particular instance, but as a general rule I feel that if you publish a post when you *add* the small rotating badger, then you should then really delete that post once you’ve *removed* the small rotating badger. Or include “before” and “after” screenshots. Whatever.

The second example of time-sensitive data that’s not worth reporting on is:

> I’ve now had 100 comments on this site!

…and…

> I’ve now had 200 comments on this site!

…and…

> I’ve now had 307 comments on this site!

…and all the variations like…

> I’ve just checked, and I’ve now written 10,000 words on this site!

…or…

> I’ve written 38,000 characters on this site, not including whitespace, HTML markup, links to small rotating badgers and punctuation other than exclamation marks!!!!!!!!!!!!!!

And onwards, to my actual point

My **actual point** is that I’ve added a “More from the same category” thing. If you are viewing the [individual entry archive page for this post][], then you should be seeing it at the end of this post ((oh boy, if I delete it and then forget to update this post then I’ll never hear the end of it now.)). It basically digs a random entry out of the archive that is under the same category as the post which you are viewing. I’m quite meticulous ((note my use of the term “quite”: there is still a lot of stuff in “Uncategorised”)) about categorising posts, but generally I don’t make them visible to readers. This changes that.

[individual entry archive page for this post]: http://pete.nu/blog/2006/10/related-post/

Posts can belong to multiple categories, so it’s theoretically possible to browse the entire site just by following the trail that starts below. It only appears at the bottom of individual entry archives – I could put it at the end of each post on the front page ((or search results page, or monthly archive page… you get the jist)), but I’m currently leaning towards keeping the front page free of clutter.

The “More from the same category” thing is in the form of a small WordPress plugin, which I can make available if you so desire.

Now, my minions – feel free to go back in time, and leave daft comments on old posts. Back when it was good.

Categories
Computing Photos

Jerker

Jerker

I’m now the proud owner of a Jerker desk.

Categories
Computing Displeasure

GWhine

I’m having doubts about the competence of the programmers at Google.

As you are probably aware, GMail is a free service, so this isn’t going to be an angry rant about how they’ve let me down blah blah blah. Rather, it’s an observation based upon how they’ve handled a particular query of mine.

A lot of the time, when I’m not feeling in the mood for AJAX, I use the “Basic HTML” view. A few months ago, I noticed that if you configured a different default “from” address, the Basic HTML mode would not pick up on this, and it would continue to use the default username@gmail.com address.

So I sent a little message to the GMail team, not so much a bug report as a suggestion for an improvement.

A few weeks later I remembered this incident, so I set up a little test to see if they had implemented my suggestion. However, I was getting inconsistent results. I probed a little deeper and found that if you clicked on the “reply” link then it appeared that the change had been made, but if you dared to use the “Quick Reply” feature, it still used the defaults. To illustrate, the standard Reply field sent emails as:

> Pete <username@yourdomain.com>

…and the Quick Reply sent emails as:

> Pete <username@gmail.com>

This was my first alarm bell. The initial state of affairs could easily have been an oversight during development, but this new observation suggested to me that there was insufficient abstraction in the replying mechanism. Rather than having one supreme “reply” function, with the two possible reply methods hooking into it at different places, it looked like the “Quick Reply” and the standard “Reply” were both using totally different functions, which is why it was possible to fix a bug in one of them but not the other. Generally, and specifically in this scenario, a bad thing.

So I sent another message to the GMail team detailing the new situation, and in the meantime I accustomed myself to avoiding the “Quick Reply” box.

Another few weeks have passed since then, so I ran my little test again. They’ve partly fixed it. The “Quick Reply” box now uses the specified default email address, which is good, but it doesn’t use the specified default “from” name. To illustrate, the standard Reply field still sends emails as:

> Pete <username@yourdomain.com>

…and the Quick Reply now sends emails as:

> <username@yourdomain.com>

Two observations. Firstly, there’s still no abstraction of the replying mechanism, which doesn’t really surprise me. But secondly, this kind of oversight is characteristic of someone who is (a) drunk, (b) habitually slapdash or (c) inexperienced as a programmer.

I’ve been led to believe that Google only hire talented, experienced programmers. What gives?

*UPDATE: It’s now fixed.*