Http spam?!

Over the last few days I’ve had thousands of requests from a small number of IP addresses. My bandwidth usage had doubled and when I logged on to find out why, I was dissapointed to find it wasn’t a huge surge in new visitors! :p

I’ve since blocked the IP’s in question but, is this common? The main culprit was but not a lot comes up in a search on google for it. The IP resolves to a russian website that looks like it could be a web host or a portal, nothing that looks suspect anyway! Very strange.

PHP script for call status when using linksys/sipura devices

At the office we recently upgraded out phone system to use sip phones and chose some linksys SPA-941’s. I was looking for a way to display the caller ID of an incoming call on our computers and potentially the office display screen.

Ideally I wanted something that would connect on the SIP protocol and although there is probably something out there I haven’t had time to find it yet. As a quick (and slightly cumbersome) solution I rewrote a perl script I found here in to PHP.

It’s basically a class that connects to a linksys/sipura phone configuration page at a specified IP and reads the status out of the HTML, also grabbing the callers name and number. You’ll have to adapt it as necessary to poll the phone every x seconds. I’ve included an example file on how to use the class; at the moment the script will just print out the caller ID but you can do whatever you want with it, some examples could be:

  • store it in a database for call records
  • send the information to growl (mac only) to pop-up a message on the desktop
  • integrate the script in to your intranet

If anybody knows of a better way to get the caller ID from these phones, or by using a SIP client on a PC, please let me know!

Download the script here:

P.S. You’ll need curl (probably already installed) and PHP5 for this to work.

Deleting duplicate mdir emails using php

In an attempt to speed up my imap access I moved old emails in to folders based on year. This speed up process majorly backfired when imap/mdir decided to make 7 copies of each email in the same folder. I ended up with 27,000 emails in my 2006 folder!

With my mailbox quota full I needed a quick solution… and couldn’t find one! Thunderbird has a plugin that will search for and delete duplicate messages but it runs over imap which crippled the server trying to handle all the requests.

Using Google I stumbled across this solution for finding and deleting duplicate messages using reformail but after getting reformail installed I found it to be very slow and the number of messages to delete didn’t add up so I had to abandon this approach.

In the end I decided to write my own PHP script that would cycle through the specific mail directory, search for duplicate messages based on the Message-Id (or a checksum of the email if not available) and then delete the unnecessary, duplicate emails. It worked a treat, and went through the 27,000 emails in less than 5 minutes! If anybody wants the code, its below!

Continue reading “Deleting duplicate mdir emails using php”

Back with wordpress 2.5 (RC1)

It has been a while since a post, I was hoping I wouldn’t slip in to a bad routine. Thanks for the comments so far, especially for the rb-internal-links plugin, can’t believe so many people are using it! Need to find a way to push it out there to more people if I can.

Back on topic, I’ve just installed release candidate 1 of the new version of wordpress. Matt mentioned on his blog that it would be a big one and it certainly is! From what I can tell the admin panel has been majorly revamped, both design wise and code wise. Logging in after the upgrade I had a few doubts but the new administration panel is impressively better (I liked the old one anyway). So far no major issues in upgrading from 2.4.x but I can see that I need to fix up the internal links plugin as the button has disappeared from the wysiwyg editor.

Changing the power supply unit on a powermac g5, after it blows up!

If the PSU on you’re powermac g5 has gone, or you think it may have, you aren’t the only one (see macintouch forums). When I was reading around on the subject I read the failure rate is around 11%, I can’t remember the exact figure but hopefully I’ll find it again later. Luckily Apple did acknowledge the problem and has extended the warranty on the power supply, which you can claim here: Power Mac G5 Repair Extension Program for Power Supply Issues

A relatively new customer phoned us up last week in a panic, claiming his server (the powermac) had stopped working and wouldn’t even switch on. We’d recently set-up a remote backup solution for him and installed an extra internal hard drive in the powermac for local backup. I’m guessing the extra load of the hard drive took it over the edge. Needless to say he needed the server back up asap.

Phoning around we found one supplier with a spare powermac psu in stock. None of the local apple stores did and most companies sounded confused, as if I was asking a silly question. We ended up paying £150-£200 for the psu, a little on the expensive side but desperate times call for desperate measures.

Continue reading “Changing the power supply unit on a powermac g5, after it blows up!”