Slow motion sneeze as scare campaign art

Awesome new ad from the South Australian Government that combines artfully executed slow motion video with some of the tell-tale signs of scare campaign advertising tactics…

“There’s a lot of competition to get attention so you need to have a very stark message, a sharp message, and I think this ad, in a very short amount of time, gets the message across in a very graphic way.”

– SA Health Minister, John Hill

http://www.abc.net.au/reslib/200904/r357181_1644198.flv

  • E-mail this story to a friend!
  • Print this article!
  • Twitter
  • Identi.ca
  • del.icio.us
  • Facebook
  • Digg

Replacing Apache with nginx for static file serving

This chart represents the regular activity of an Apache server from Monday to Thursday — a massive spike of non-idle processes starting around lunch time — and then an eerily quiet Friday. No, it wasn’t a public holiday, it’s just evidence of win. Notice the gaps late on the 2nd and early on the 3rd? Happy infrastructure hacking in the witching hours!

nginx vs. apache: open/sending

The problem with Apache processes is that they’re big: they chug a lot of memory, and take a long time to get started. Sure, Apache includes a number of slightly more modern process models than the traditional prefork MPM, unfortunately (and predictably enough), PHP keeps us mired in the land of suckage. So when it comes to memory abuse, I was delighted with the results of putting nginx in front of Apache, and giving it complete responsibility for static files:

nginx vs. apache: memory

Reduced memory usage, increased capacity for OS level disk caching, and of course, consistency. Consistency wins every time. Any sysadmin who has had to react to a sudden change in usage patterns will grok the importance of consistency — after all, it’s not being slashdotted or dugg that will kill you, it’s the hardware and software configuration designed for your everyday load.

That’s all very good for Mr. Server Administrator, but nothing is truly measured until we understand the impact on users. Friday lunch time? Business as usual…

nginx vs. apache: traffic

… maaaaybe just a little quicker if they were paying attention. Not that you can tell from this chart. ;-)

So, I’m pretty happy with nginx sitting in front of Apache. It totally changes the performance characteristics of the server (and website!) for the better, while allowing me to fall back on somewhat more mature and extensive Apache features when I need to. For instance, nginx’s rewrite module is pretty good, but Apache’s mod_rewrite is truly the original and the best (read: most insane). Surprisingly, nginx doesn’t support old school CGI, but I suppose most of the cool kids using it are opting for better process models such as FastCGI and proxied application servers anyway.

The biggest win in this instance was the conversion of a caching mod_proxy frontend — lot of static files, inefficiently served by Apache — to the new, inbuilt caching module in nginx 0.7. Initially I had tried the apparently popular ncache — must be a lot of people talking about it hypothetically, methinks — but it is probably best described as an “out-of-tree design, configuration and implementation fail”. Once I sucked up the fear-of-trunk and tried the caching support in nginx 0.7, there was no looking back.

(Finally, a quick shout-out for collectd 4.6.2 and the relatively new collection3 web frontend for it… sadly, I switched to it after these charts were saved, so you don’t get to see the new hotness. Maybe you should try it on your server?)

  • E-mail this story to a friend!
  • Print this article!
  • Twitter
  • Identi.ca
  • del.icio.us
  • Facebook
  • Digg

Case-insensitive mapping with mod_rewrite’s RewriteMap

Sometimes when you need to manage a massive pile of URL redirections — for instance, when you’re playing snatch-the-tablecloth with your web platform — it’s handy to mash them all together with mod_rewrite’s RewriteMap feature.

I hit a frustrating stumbling block with a recent project, however: What happens if you need your RewriteMap key to be case-insensitive? This is incredibly likely if you’re migrating away from an undisciplined Windows-based web platform.

It was immediately obvious that I’d have to match against consistent casing, but not at all obvious how this would work in the context of mod_rewrite. After some trial and error, here’s what I came up with:

RewriteMap lowercase int:tolower
RewriteMap urls dbm:/srv/www.example.com/urls.db
RewriteCond %{REQUEST_URI} ^(/.*\.html)$
RewriteCond ${lowercase:%1} ^(/.*\.html)$
RewriteCond ${urls:%1|NOT_FOUND} !NOT_FOUND
RewriteRule ^(/.*\.html)$ http://%{HTTP_HOST}${urls:%1}? [R=permanent,L]

Here’s how it works:

  1. First we set up the built in lowercase translation rewrite map… handy!
  2. Then we define our great big URL map, which is just a list of lowercase URLs (yes, they’re lowercased in the file) and their destinations.
  3. Make sure we’re only mucking around with html URLs, but also grab the REQUEST_URI for use further along (see the parentheses in the second parameter).
  4. We use Apache’s handy internal lowercase map to convert the previous line’s match to lowercase, and we grab the whole thing again… but this time, what we’re grabbing is the output of the lowercase map.
  5. Tricky little hack to make sure our URL is represented in the redirection map. If there’s no match, the default value returned is NOT_FOUND… but we only continue to the next line if the map does not return NOT_FOUND.
  6. Finally, permanently redirect to the destination URL, as matched against the lowercase original.

Rock and roll.

  • E-mail this story to a friend!
  • Print this article!
  • Twitter
  • Identi.ca
  • del.icio.us
  • Facebook
  • Digg

Devils and Penguins

Tux passes the baton to Tuz, the hastily-disguised Tasmanian Devil… at least for this release. Great to see one of the more high profile pledges of the madcap, ridiculous, wonderful and incredibly generous linux.conf.au 2009 auction being paid off. :-)

Tuz

linux.conf.au 2009: Tuz

Impact: help prevent extinction of species

The Tasmanian Devil is a shy iconic Australian creature named for its
spine-chilling screech.  It is threatened with extinction due to a
scientifically interesting but horrific transmissible facial cancer.

This one is standing in for Tux for one release using the far less-known
Devil Facial Tux Disguise.

Save The Tasmanian Devil http://tassiedevil.com.au

Signed-off-by: Linux.conf.au Hobart Team <contact@marchsouth.org>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • E-mail this story to a friend!
  • Print this article!
  • Twitter
  • Identi.ca
  • del.icio.us
  • Facebook
  • Digg

QotD: Guy Rundle

When your movement is being led by a 13-year-old child, the morbidly obese recovering benzodiazepine addict radio star Rush Limbaugh, and a mystical simpleton like Joe the Plumber, then you’re at the point medieval Europe reached around the time of the children’s crusade.

– Guy Rundle, US right on a long march to medievalism

  • E-mail this story to a friend!
  • Print this article!
  • Twitter
  • Identi.ca
  • del.icio.us
  • Facebook
  • Digg

Joining the Blackout

Internet Blackout NZ

I’m joining the Internet blackout today, and not just for my New Zealand friends who are combating this draconian copyright fundamentalism… I’m joining it because if this kind of legislation succeeds in New Zealand — who have a pretty good history of sticking it to The Man — it could succeed anywhere.

Here’s a great cartoon about the problematic legislation from Scoop which very neatly explains the issue:

Blackout Cartoon

Update: New Zealand Prime Minister John Key has announced that S92A will go on hold until March 27, apparently hoping that an agreement will be reached on a voluntary code of practice. The legislation isn’t dead, but this is more than “just a flesh wound”.

Congratulations to the Creative Freedom Foundation for a well-organised, multi-facted and effective campaign against S92A… thanks also to Brenda and Nat, who worked tirelessly to hyper-connect Kiwis and their friends around the world.

  • E-mail this story to a friend!
  • Print this article!
  • Twitter
  • Identi.ca
  • del.icio.us
  • Facebook
  • Digg

QotD: John McCain’s favourite joke

John McCain's favourite joke

I feel terrible for all the mothers in the state of Arizona because, as you know: Barry Goldwater from Arizona ran for President of the United States, Morris Udall from Arizona ran for President of the United States, Bruce Babbitt from Arizona ran for President of the United States, and I, John McCain from Arizona ran for President of the United States… Arizona may be the only state in the nation where mothers can no longer tell their children that some day they can grow up and be President of the United States.

– John McCain in May 2003, via ZUG’s 100 Senator Prank

  • E-mail this story to a friend!
  • Print this article!
  • Twitter
  • Identi.ca
  • del.icio.us
  • Facebook
  • Digg

Music is better with robots

YouTube Preview Image
  • E-mail this story to a friend!
  • Print this article!
  • Twitter
  • Identi.ca
  • del.icio.us
  • Facebook
  • Digg

QotD: John C. Dvorak

If it wasn’t already ludicrously obvious that John C. Dvorak is an asshat, here’s a snarly, clue-free piece of evidence from 1984:

Apple makes the arrogant assumption of thinking that it knows what you want and need. It, unfortunately, leaves the “why” out of the equation — as in “why would I want this?” The Macintosh uses an experimental pointing device called a ‘mouse’. There is no evidence that people want to use these things. I dont want one of these new fangled devices.

– John C. Dvorak in the San Francisco Examiner on February 19th, 1984 (via Philip Elmer-DeWitt’s time machine, 1984: How critics reviewed the Mac)

  • E-mail this story to a friend!
  • Print this article!
  • Twitter
  • Identi.ca
  • del.icio.us
  • Facebook
  • Digg

More mainstream media love for OpenAustralia

Totally awesome to see Matthew Moore covering OpenAustralia’s efforts to bring the register of members’ interests to the web:

Given the fortunes spent in the nation’s Parliament, and Kevin Rudd’s professed desired for more transparency in government, it seems absurd that volunteers are left to do the job any self-respecting parliament would have done long ago.

via Interests of MPs to go online – it’s about time.

  • E-mail this story to a friend!
  • Print this article!
  • Twitter
  • Identi.ca
  • del.icio.us
  • Facebook
  • Digg