Case study: how not to handle unsubscribes

Generally I don’t like to publicly point the finger in cases like this, but this time I will: Tesco Compare, it’s your turn.

I last used Tesco Compare a couple of years ago while looking for car insurance. About a year ago they began sending me promotional email, clearly realising they had a list they had not been using. I’ve moved to France and I’m really not interested in UK car insurance any more, so I wanted to unsubscribe.

The message they sent me shows they are handling my data correctly to some extent – they have my email address right, they addressed me by name. It also contains an unsubscribe link. That’s the good bit over – It all goes downhill from there.

Continue reading “Case study: how not to handle unsubscribes”

Basic Linux-HA heartbeat and pound config

I’ve had trouble in the past setting up Linux-HA a.k.a heartbeat to create a redundant front-end for a web service. The HA documentation is quite thorough and detailed, but it’s lacking realistic examples to get a working system up and running. This is a quick guide to creating a 2-way cluster with one or more floating IP addresses and automatic failover on Ubuntu 9.04. I also include a quick config for pound, a reverse proxy / load balancer.

Continue reading “Basic Linux-HA heartbeat and pound config”

MySQL backups with Percona’s XtraBackup

MySQL backup is sometimes very hard to do effectively. MySQL provides various options for backup, but many of them are simply unsuitable for large systems, particularly if they need to remain active during backups. Percona’s XtraBackup is an open-source clone of InnoBase’s InnoDB Hot Backup utility. So what makes XtraBackup a better solution, and how does it work?

Update: on December 10th 2009, Percona released Xtrabackup 1.0.

Continue reading “MySQL backups with Percona’s XtraBackup”

Google Charts API Simple and Extended Encoders in PHP

Google’s charting API has been around for quite a while now, but I’ve only just needed to actually look at it. It became immediately obvious that I needed a PHP encoding function, so off to google I went. Though I found several implementations, they were all incomplete or deficient in one way or another (and it didn’t help that there was an error in google’s extended encoding docs), so I’ve written my own based on several different ones. Both simple and extended encoders support automatic scaling, inflated maximum and lower-bound truncation, so you can pretty much stuff whatever data you like in, with no particular regard for pre-scaling and you’ll get a usable result out. They have an identical interface, so you can use either encoding interchangeably according to the output resolution you need (contrary to popular belief, the encoding to use has very little to do with the range of values you need to graph). By default, the full range of possible values is used as it just seems silly not to. I deliberately omit the ‘s:’ and ‘e:’ prefixes so that you can call these functions for multiple data series, and I include a function that does just that. You still need to generate your own URLs and other formatting, but that’s a different problem. Read on for the code… Continue reading “Google Charts API Simple and Extended Encoders in PHP”