Archive for the 'Coding' Category

libpam-mount automounts SMB shares at login, just like Windows

Monday, October 8th, 2007

Now my Ubuntu workstation, part-way upgraded to the 7.10 “Gutsy Gibbon” release, works almost as elegantly as my Windows machines have worked forever. My network music store now auto-mounts into my home directory when I login. Finally. I’ve been beating away at this, on and off, for bloody years. I’m just not a great sysadmin, I guess!

Method follows.

(more…)

(My)SQL Infection

Friday, October 5th, 2007

What could I do with this?


CREATE TABLE child (
  id BIGINT NOT NULL AUTO_NUMBER PRIMARY KEY
, parent_table VARCHAR(64) NOT NULL
, parent_id BIGINT NOT NULL
, FOREIGN KEY parent_table REFERENCES INFORMATION_SCHEMA.tables(name)
, FOREIGN KEY parent_id DEREFERENCES parent_table(id)
) ENGINE=fantasy COMMENT=’Don’t run this at home, folks!’;

AND
(more…)

Scraping the Scottish Parliament Official Record

Friday, June 15th, 2007

My friends know that I’m a bit of a political geek and like to keep abreast of what our elected representatives are doing, so I follow the Official Reports of the UK Parliaments with an almost religious fervour, although I’ve been a bit lazy recently and just been watching the BBC Parliament channel.

I’m also a huge fan of theyworkforyou.com, a volunteer-run website which republishes the Official Reports of the House of Commons, House of Lords and the Northern Ireland Assembly in a far friendlier form than the “official” sites, with the added bonus of public commentary and statistical analysis of the MP’s performance.

Missing from theyworkforyou.com is the Official Report of the Scottish Parliament, all the more sorely missing due to the now very interesting constitution of that body with its minority SNP government. Republishing an official record is no easy task, for a number of reasons that I’ll go into later, but I know for sure that I have all the requisite skills and tools to do it.

I’ve had this project on the back-burner for some months now and since I’m starting a new job soon, any spare time I might have to work on hobby projects is going to vanish.

So here I go. I don’t need to get it perfect - just far enough along so that someone else can pick up and complete the task.
(more…)

Christmas Bogus Bogus PHP PDO Bug

Wednesday, January 10th, 2007

The following code works on Linux (3 rows returned) but not on Windows, which returns a SQL syntax error citing LIMIT "0", "3". See PHP bug 35801 closed as “bogus” by an idiot on Christmas Day 2005 for the bogus reason:

Limit statements cannot be part of prepared statements.

Anyone care to confirm?

(more…)

Dive Log Update

Saturday, September 16th, 2006

I logged my first dive for the third time today. I’ve paid £3.95 for one month in which time I can log as many dives, write as many stories and make as many changes as I please.

Protected: Howto: Dynamic HTML Forms With PHP Arrays And “Loopy Magic” (in real time)

Monday, September 11th, 2006

This post is password protected. To view it please enter your password below:

Zeitgeist (Pre-release)

Saturday, September 9th, 2006

Now that Zeitgeist has been released on WPPlugins.org, its page here has been set aside for the release manual and discussion. This post contains the contents and comments from the pre-release page.

(more…)

Anti-spam Plugin for WordPress

Friday, September 8th, 2006

I have released a spam-fighting plugin for WordPress, based on Akismet over at WPPlugins.org.

Threaded Comments

Friday, September 1st, 2006

You can now reply to other people’s comments as well as the main post. Have a go.

“Programming? It’s All Chinese To Me…”

Monday, August 21st, 2006

<span xml:lang=”zh” lang=”zh”>中文</span>

Me too, mate :)

(more…)