January 2010

An nginx/PHP gotcha

If you are allowing larger-than-default files to be uploaded to an nginx server with PHP FCGI, you need to alter both the php.ini and the nginx.conf.

In particular, for nginx.conf, you need to use the client_max_body_size directive to set the permissible maximum upload size.

Technical Notes

Comments (0)

Permalink

Buzzity buzz

A lot of folks on Facebook have been sending me links for a new website called “Menzies House”. According to the blurb, it’s the “leading Australian blog for conservative, centre-right and libertarian thinkers and activists”, which must come as news to the mob at Catallaxy (which is still in technical exile).

A perfunctory investigation reveals that the domain name is registered to one Henry Marsh on behalf of the Dallan Investment Trust. Who they are, Google doesn’t know. The Australian Business Register says they’re in SA.

I don’t want to sound like I’m putting down a good initiative, but nevertheless I will wait to see how it pans out. I dislike inorganic ventures, website-wise, and pre-emptively declaring yourself “the leading” anything before you even launch is suspiciously marketer-esque. Not my favourite profession.

Update: Tim Andrew spills the beans.

Cross Posted from Club Troppo
Metablogging

Comments (0)

Permalink

Staggering news

I’ve changed my main programming font from Bitstream Vera Sans Mono to Inconsolata.

The latter is slightly neater and more compact than the former, but I will always retain fond memories of Vera.

Geekery

Comments (0)

Permalink

The happy homestead

For so long as I can remember, Darwin has been a cosmopolitan small city. Of Australia’s capital cities it has the highest fraction of people born overseas. In particular there are large contingents of Darwinites from south east asia.

I saw this item in on the NT News website about Darwin’s burgeoning Indian community getting called by their relatives in the old country. This part struck me first:

Territory residents have had to explain how Darwin is actually a long way from Melbourne, where a series of attacks on people of Indian heritage has led to threats of reprisals from extremists in India.

I was tempted to make a snide comment, but in fairness I don’t know any Indian geography. I know that they have cities called Mumbai and Dehli, but I wouldn’t know where to point to on a map of India. So I can understand the confusion about Darwin and Melbourne.

This part rang true:

While Indian media has been attacking Australia over the bashings, Dr Sharma saw positives in the situation for the Territory – particularly for attracting Indian students to Charles Darwin University, where he works.

“I guess there will be positive spinoffs if Darwin is seen as a safe place,” he said.

He’s right. Charles Darwin University is still a small underachiever in Australia’s education market. Part of this is the simple realities of being in a remote capital and having a poor reputation. It doesn’t help that the administration is so Kafkaesque at times. But it already attracts a lot of students from overseas and a bit of carefully targeted advertising in India might attract some more. Perhaps they could link up with the local Indian community to work out how best to go about it.

Education
Politics - Northern Territory

Comments (0)

Permalink

Clearing the Debts

My calculations say that between expected expenses, required savings and HECS debt payments, I need about 90 weeks to “clear the deck” and get into positive net worth territory.

At which point I need to salary sacrifice like a madman, because my super is way behind the average.

Money
Thought Bubbles

Comments (0)

Permalink

Google develops moral minerals

Google’s announced that they were the subject of a precise and sophisticated attack, apparently aimed at getting access to the GMail accounts of pro-democracy critics of the Chinese Communist regime, both living in China and abroad.

Google don’t think that the accounts were compromised but can’t be sure.

In response Google have said that they are considering pulling out of China entirely — shutting down the self-censored Google.cn website and closing their China office.

It’s about bloody time they realised they’re dealing with gangsters and thugs.

Update: Google arch-rival Microsoft have said that the attack may have exploited a hitherto unknown flaw in Internet Explorer. They’ve been working with Google on the whole situation. It’s heartening.

Cross Posted from Club Troppo
IT and Internet
Politics - international

Comments (1)

Permalink

Two things I like about my resume

You can see a link to it on the left side (if you’re reading this on my blog, rather than Facebook).

The first thing I like is the style. I take no credit for this: it’s a template that comes with Pages plus some minor tweaks of my own.

The second thing I like is the blurbs. I spent a few days chasing some up before putting the resume into wider circulation. The idea of having “testimonials” embedded in marketing materials is as old as dirt; but so far as I know it hasn’t been used on resumes before. Yet resumes are probably the most intimate and important bit of “brochureware” in a software engineer’s life. It can’t hurt to jazz it up a little with fuzzy subjectivity.

Thought Bubbles
Work

Comments (2)

Permalink

DadHacker should be a book, frankly

A great blog. I’ve been re-reading it from beginning to end. This sentence seemed particularly appropriate, given the current sturm und drang about “NoSQL” databases:

Databases make lousy file systems. File systems make lousy databases. There is a circle in Hell reserved for you if you forget this.

From here.

Geeky Musings

Comments (0)

Permalink

Automated backups for Ozblogistan

It’s a cliche amongst nerds that everyone preaches automated backups, and very few have it.

Partly because it’s surprisingly fiddly to set up “right”. And even fiddlier to do restoration testing.

Still, one thing at a time. I’ve just now finished putting together an automatic backup regime for Ozblogistan, the server I run hosting Skepticlawyer and Andrew Norton (and, at some time in the future, some other sites too).

Herewith my notes.

Tarsnap

I am using the tarsnap backup service. I am satisfied that it’s cheap, efficient, reliable and secure. The trickiest part to wrap my modest brain around is its snapshot-based nature. You don’t follow the full-and-incremental model with tarsnap: you simply list what you want to backup and let it sort out the details of the most efficient way to store that for you.

I have a very simple shell script which cron runs each day:

#!/bin/bash
# Quick and dirty script to backup files, settings and the database.

DATE=`date +%Y-%m-%d`
SQL_FILE="/var/backups/mysqldump/ozblogistan-wordpressmu-$DATE.sql"
BACKUP_ARCHIVE_NAME="ozblogistan-$DATE"

# Dump SQL
mysqldump --defaults-extra-file=/etc/tarsnap/mysqldump.cnf -eltn --dump-date --default-character-set="latin1" wordpressmu > $SQL_FILE

# Perform tarsnap backup
tarsnap -c -f $BACKUP_ARCHIVE_NAME --exclude *cache* --exclude *.svn* /home /etc /var/www/wordpressmu /var/backups/mysqldump

# Delete mysqldump

rm -f $SQL_FILE

This script performs a mysqldump of the database. It tells tarsnap to back that up in addition to /etc, /home and /var/www/wordpressmu, ignoring cache directories and SVN directories. It creates a “new” tarsnap archive each day; in practice tarsnap will only send a delta of the SQL plus any new files uploaded to the WordPress installation.

I’ve chosen not to compress the SQL, as I am unsure whether that will interfere with the delta process used by tarsnap. Compression can change the layout of a file.

Mysqldump settings

The mysqldump commandline in this shell script has two key features to note. Firstly, the use of the –default-character-set option, necessary to circumvent MySQL retardation. Secondly, the use of the –defaults-extra-file option to import settings from a custom configuration file.

The custom configuration file contains the username and password of a particular backup user. This backup user is distinct from the user supplied to WordPress Mu to access the wordpressmu database. The backup user has very limited privileges: essentially it can read but not alter the database, which is all the permissions it needs (ie. it has SELECT, LOCK TABLES on the database and RELOAD globally).

Placing those identifying details in a configuration file means that they will not be visible to someone running top, ps et al. A very modest security improvement, I grant you, but still.

Still to do

I still need to set up something similar for troppo. We have automated backups there but they’re not as efficient or reliable. Ideally I’d prefer to move troppo to the new server, but that may not be possible. This is done.

I also need to develop an automatic restoration testing facility. It’s common to think you have “flawless” backups, then discover after disaster that your backups were no good.

Finally I need to add code to delete old archives. Tarsnap’s snapshotting model is very efficient and the rate of change slow, so for now I will leave it open-ended to get a sense of how far back I can keep backups.

Technical Notes

Comments (0)

Permalink

Too many books

It turns out that I have so many books stuffed away in my Amazon cart’s “Saved Items” section that I’ve exceeded the maximum limit.

In case you’re wondering, Amazon won’t let you store more than 600 titles in that list.

All very annoying, as I use that feature as a kind of unofficial “read one day” list. When I hear about a good book, I go off to Amazon and add it to the cart. Now I will need to rethink my strategy.

Books

Comments (2)

Permalink