HTML and regular expressions

I sort of dislike regular expressions. They're usually annoying to read and not infrequently incomprehensible without reading a book (or two) first. Still, they're useful.

I wanted to apply some regex magic to HTML content, to change words that are not part of the HTML markup. However, anecdotally, regular expressions don't play well with HTML. Still, I wasn't interested in the tags, only what is between them, so it struck me as a not impossible task.

Drupal Downunder 2012

With voting for DrupalCon Denver sessions now open, I thought it would be good to remind people that session proposals for Drupal Downunder will close on Monday November 14th. If you have something you want to share, get your session proposals in!

For those of you who don't know what Drupal Downunder is, it's Australia's national Drupal conference. Running in Melbourne on 13, 14 and 15 January 2012, this will be the second Drupal Downunder. In January 2011, 160 drupalistas from near and far came together in Brisbane to create the biggest antipodean Drupal event to date, building on the success of DrupalSouth in Wellington in 2010.

Though run by Australians, it's run for everyone. Early bird tickets are still available, so if you're looking for a great Drupal event to attend in a warm climate early next year, come to Melbourne and join your friendly Aussies and New Zealanders.

"Drupal Downunder 2011 was a great event. A lot of people flew out from other parts of Australia and New Zealand to attend so it was very much a national event. There was a great vibe that reminded me of early Drupal events. It is clear that Australians are passionate about Drupal, and that Drupal is getting a lot of traction. — Dries Buytaert"

Integrating Aegir with Linux and FTP

Due to the insane cost of bandwidth (compared to the rest of the developed world) in Australia, I've recently decided to move some of our hosting clients to Linode. This means they can move more data more cheaply and I don't need to come up with (and administer) a bandwidth accounting system for my Australian based web VM.

We pretty much exclusively use Drupal for hosting clients, so to make management a bit easier I decided to use Ægir on the new Linode. Installation was a relative breeze, after a quick google to find out how to specify that I didn't want to use Apache and wanted to use a separate server as dedicated MySQL host.

The problem (there is always a problem) arose when I needed to give a hosting client access to their Drupal installation, so they could manage themes and site-specific modules. Just adding an account and providing SSH access was out of the question, as all sites are stored under a single system user. Anyone logging in with permissions to edit their own Drupal can then also edit all other sites and even the Ægir installation itself.

FTP would be a solution, as FTP accounts can be chrooted (locked into a specific directory) quite easily, but I didn't want to have to manage a list of FTP accounts separate from the Drupals in Ægir. That isn't the lazysysadmin way.

After a bit of thought I remembered that on an older web host, I had happily used libnss-mysql and libpam-mysql, which integrate accounts defined in a (any) MySQL database with the Linux system. The trick is to get MySQL to cough up the account information in the correct format, so the system can parse it as if these accounts were normal system users.