Categories
Blogging TITGIG

Malware removal

Google notified me that my site has apparently contained malware for a few days. And indeed it has – at some point after publishing Summer Calendar some miscreant apparently gained access to the WordPress admin account and inserted an iframe to some dodgy site hosted on usrv03.ru.

I have now deleted the admin account and removed the iframe (obviously) and requested that Google reindex my site to check that everything is good now.

Might be worth checking your own WordPress site for unexpected iframes.

Categories
Blogging

Turnover

The oldest version of this site on archive.org is from January 2003, more than five and a half years ago. Of the 42 sites on my “blogroll” back then, 15 of them are still active. And a further 4 of them were written by people whom I happen to know are still blogging, albeit at a different location.

This is a higher percentage than I was expecting.

Categories
Blogging Computing Guidance Useful Information

My del.icio.us bookmarklets

I used the del.icio.us Complete extension to assist me in posting to del.icio.us. I could right-click a page, choose “Post this to del.icio.us” and a handy dialog came up, prepopulated with the URL, title, and description (populated from whatever text was selected on the page at the time). This was perfect for my needs.

Since upgrading to Firefox 3.0, it seems that the only compatible extensions are the ones that “integrate” your bookmarks in an intrusive fashion. I don’t want integration. I want the exact opposite. I want total disintegration. So I’ve gone back to using bookmarklets.

I basically use del.icio.us for two things. Firstly, I use it as a todo list. I post links with the “do not share this” flag set, and tagged “todo”, so that I can look at them later. This is the bookmarklet that I now use for this task:

Bookmarklet #1

I got it here. It’s not perfect though. It doesn’t seem to work the first time you use it in a session. I guess this is related to the fact that it uses https. It also pops up an alert at the end that says “OK, tagged as todo” whether it actually succeeded or not. I tried removing this alert, and the bookmarklet stopped working. Can’t fathom why.

On to the second bookmarklet:

Bookmarklet #2

This one is much more straightforward. It just opens a window containing a small “post” dialog, prepopulated in the same way as the old del.icio.us Complete extension. It doesn’t use https, so it never asks me for my login details. The window closes when you post it.

I just thought that I’d post these bookmarklets here, partly for my own reference, and maybe because someone else might find them useful at some point.

Categories
Blogging Guidance TITGIG

Possible WordPress date formatting bug

As you have noticed, I do not display the time on my posts – just the date. However, anything published between midnight and 5am gets the words “in the small hours” appended to the datestamp, to indicate that even though it was technically posted on date D according to some atomic clock in a large city in Europe, it was posted on D-1 according to my internal daily rhythms.

To implement this, I use the function `get_the_time(‘G’)`. This should return a number between 0 and 23 which indicates the hour of the post’s timestamp. However, this stopped working, and it would actually return a very large number (of the order of about 1.1 billion) so the test failed. I don’t know whether this was caused by the upgrade to WordPress 2.5, or my recent move to a different server.

I managed to “fix” the problem by commenting out the following few lines near the top of `mysql2date` (defined in `wp-includes/functions.php`)

if( ‘G’ == $dateformatstring ) {
return gmmktime(
(int) substr( $m, 11, 2 ), (int) substr( $m, 14, 2 ), (int) substr( $m, 17, 2 ),
(int) substr( $m, 5, 2 ), (int) substr( $m, 8, 2 ), (int) substr( $m, 0, 4 )
);
}

However, this is not the ideal solution. Firstly, it’s hard to know if this change is causing a breakage elsewhere in the system (where the code relies upon this apparent bug). Secondly, when I upgrade to a new version of WordPress, I have to remember to fix the new `functions.php`

I discovered a better solution to the problem. I put `functions.php` back to its original state, and then replaced my calls to `get_the_time(‘G’)` with `get_the_time(‘G ‘)` – note the added space. `$dateformatstring != ‘G’` but the function returns the desired result. Get in.

I would report this on the WordPress support forums but I can’t be bothered to create an account.

*Update: I’ve discovered that the offending block of code was added for WordPress 2.5 to address this issue.*

Categories
Blogging Computing TITGIG

Wouldn’t it be cool if…

For a while, I’ve been thinking “wouldn’t it be cool if Google Reader could automatically generate a blogroll from my subscription list?” Obviously, I’d want to be able to choose whether each individual subscription appears on the list or not.

Well, it seems like Steve Lacey, a developer at Google, has also wanted this. And so he did it.

It’s currently only available as a JavaScript include, which goes against my usual stance of avoiding using JavaScript for core functionality, but I’m making an exception in this case. Because, for the first time in years (at least four, by my reckoning), I have a public blogroll on my site! And it requires very little additional maintenance on my part ((all I need to remember to do is add the label “blogroll” to new subscriptions that I wish to share)).

Categories
About Me Blogging Music

Resolution Conclusions 2007

*Hey, I did this last year too! Maybe it’s turning into a “thing”?!*

1: Blitz “to do” and “to buy” lists

Karen and I have a big “todo” list. It used to be a handwritten sheet of paper, pinned to the notice board, divided up into “things to do” and “things to buy”. Nowadays, it’s on a wiki, and it is basically divided up into “tasks for Karen” and “tasks for Pete”. The principle is the same.

Anyway, over the course of the year we’ve really kept on top of this list. Sure, lots of things have been added to it, but we’ve managed to keep it at roughly the same size, and there are very few items on there that have been on since the start of the year. I’m quite pleased with this.

2: Less computer time, more films

The most crucial point here was to spend less time surfing the Internet, pretending that absorbing all this data is good for me. Instead, I wanted to spend more time watching films, basking in the unashamed brainlessness of it all. I think I’ve succeeded, more or less. I’m sure that next year’s resolution will be something along the lines of “Less films, more blah”. Maybe computer games. If Rockstar released a “GTA San Andreas Stories” for the PS2 I’d be in heaven.

3: Quality, not quantity. Less reading and writing blogs

I’ve certainly managed to write less, and I feel like the quality is higher. However, I’m still reading more blogs than I need to. But it’s hard to stop myself, when there’s so many well-written sites out there.

4: Make more music

My actual resolution set a much more specific target, which I am not going to print here, for reasons of my own. Suffice to say, I have failed to meet this target in the most magnificent manner possible, despite having revised it downwards twice during the year. Some things just aren’t meant to be.

5: Stop being afraid of strangers

Who are you? Get away from me! Argh!

6: Keep writing with my pen held properly

Back story here. Towards the end of last year, I started making an effort to improve my grip. Basically, this resolution has been an unquestionable success. I now hold a pen like a normal human being. This is so fucking awesome.

7: Less nostalgia

Another success. I used to dwell on the past, thinking about all those good times that passed me by in the blink of an eye. But now I realise that one day, I’ll look back on today (or hereabouts) and wish that I hadn’t wasted so much time being nostalgic. There was the threat of a vicious cycle there, but I’ve managed to break it, and now I am able to appreciate every moment as it happens.

8: Be a leader, not a follower

Hahahahahah.

9: Stop worrying about other peoples’ blogs. Their spam comments, botched templates and missing alt-tags are their own problems

Tick.

10: When someone sends you a link saying “Click this, it’s really funny/cute” then don’t, because it’s just that sneezing panda yet again.

As mentioned here. Haven’t seen the sneezing panda since.

11: Get some exercise

Sorted.

12: Get a project

Had one, but it went away again. I’m not sure whether that counts as a success or not. I should have been more explicit in my statement of the resolution (ie, “Get, and keep, a project”).

13: Improve posture

*Straightens back.*

Uhm… yes.

14: Don’t be so crap at making new friends. Actually, just see #5

Marginally better. But I’m still very bad at this whole “small talk” thing. Maybe I should see this as a strength, rather than a weakness.

15: Learn a bit of Polish

When we were contemplating a short weekend away in Warsaw, this seemed like a very worthwhile resolution. But then we changed our plan and decided to go to Center Parcs instead, so the resolution seemed less important. Still, I’d like to learn some Polish one day (I’m a quarter Polish, by the way) so it’s still something that I’d like to do.

16: Don’t keep getting up from the table in the middle of meals

On Karen’s request (though I added it to the resolutions list voluntarily). I am getting better at this, but I’m not yet perfect.

17: Take time in conversation

By which I mean, don’t just blurt out any old nonsense. Stop, think, come up with an intelligent response. This doesn’t really sit well with #14, as small talk needs to be relatively rapid-fire, so I don’t think that I’ll be able to do both. If you take too much time coming up with a carefully-executed reply, you tend to find that your audience has walked away. Meh, their loss.

18: When on the phone at work, replace “Cheers” with “Goodbye” and “No problem” with “You’re Welcome”

A bit more formality is probably appropriate in this environment. This one was quite a recent addition to the list, so will probably be carried over to next year.

Categories
Blogging Parenting

> Are we too creating worlds of words that will one day cause more heartache than the joy we now feel? By putting our children on a stage viewed by an endless audience are we providing the fodder of therapy sessions and acts of rebellion?

Thoughts on blogging about your offspring, from Dadcentric – “The House At Blog Corner

Categories
Blogging Computing Stunt 2007

A stunt

Karen and I were inspired by a comments thread on her site to perform a stunt.

Next week, from Monday to Friday, we will each write a post on the same topic, and we will publish them simultaneously without knowing what the other has written. So we need to think of five topics.

We already have one (if you inspect the linked comments thread, you may be able to work out what it is. Have you figured out what it is? Congratulations! You get a gold star!) but we need four more.

Please suggest topics here. If you can think of things that we will have differing opinions on, then that will make this stunt *so much more fun*, so I recommend that.

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