Quarterly Reading List: January-March 2013

I thought I’d start posting quarterly breakdowns of the books I’ve been reading, partly just to share stuff I’ve been enjoying, but mostly to shame myself into reading more my holding myself publicly accountable.

Here’s the first edition. Since the start of the year, I’ve finished four books. Pretty weak, I admit, but I’ve also had a child, so that’s my excuse:

Glasshouse, by Charles Stross. Possibly my new all-time favourite science fiction novel. Filled to bursting with ideas, it manages to create a plausible post-scarcity, post-”singularity” universe and a hugely compelling story at the same time. Can’t recommend it highly enough.

How Much Is Enough? Money And The Good Life, by Robert and Edward Sidelsky. A philosophical examination of modern Western society’s organisation, questioning how little of the gains in economic productivity of the last 50 years have gone towards improving average standards of living, framed in terms of “the good life”. The book was often overly academic in tone, but it drew on some interesting research and raised some (I think) very pertinent questions.

Carbon Zero: Imagining Cities that can Save the Planet, by Alex Steffen. A short book, available for free online in full, examining the role that urbanism can (and must) play in staving off the worst of the climate crisis. Steffen’s argument is compelling: converting the entire automobile fleet to hybrid or electric vehicles would take decades even if every car sold today were such a model, and likewise replacing the entire power generation grid with renewables is an enormous undertaking. But with the coming boom in urban development across the world, there’s real potential to make drastic reductions in carbon emissions with innovations in walkable urbanism, transport, and building technology.

The Last Policeman, by Ben Winters. (Currently for sale for $2.99 on the Kindle store.) A fun noir detective story, with the clever twist that it’s set in a world where a giant asteroid is months away from colliding with Earth and ending civilization as we know it. It took me a while to get into this one, as the noir tropes and first person narration felt a bit over the top, though in retrospect it’s clear that was the intent. All in all, it was a captivating mystery, and I’ve pre-ordered the next book in the trilogy, due to be released in July.

PostgreSQL System Trigger Error with Rails

PG::Error: ERROR:  permission denied: "RI_ConstraintTrigger_50931" is a system trigger

Just ran into this issue and had a hard time locating a solution, so just throwing it up here so others might be able to find it faster.

You might see this error message if:

  • You’re using PostgreSQL with Rails
  • You’re using foreign key constraints
  • You’re using database_cleaner to tear down your test databases

The problem is this: Postgres sets up foreign key constraints as “system triggers,” which can only be removed by a superuser. When database_cleaner tries to empty out your database between test runs, it tries to remove these keys, which causes the failure.

Currently there isn’t a “real” fix for this, but Sergey Potapov has bundled together the required hacks into a gem called rails3_pg_deferred_constraints. Pop it into your test group and you should be good to go.

Keeping Time on Frequently-suspended Virtual Machines

When everyone else’s git commits start showing up as “in the future,” you know something’s wrong.

It’s probably that your VM, having been suspended while your host OS was sleeping, has lost track of what time it is. You could /etc/init.d/networking restart every time you start work in the morning, but that’s a drag, and you’re likely to forget.

Instead, you want to use the NTP daemon to keep your clock in sync. By default, however, NTP will attempt to gradually and incrementally bring your clock back into sync, and will balk at large differences in time (like the 14 hours since you last opened your laptop). Fortunately, there’s a config setting for that.

Let’s do this thing:

sudo apt-get install ntp

Then replace your /etc/ntp.conf file with the following:

tinker panic 0

restrict 127.0.0.1
restrict default kod nomodify notrap

server 0.au.pool.ntp.org
server 1.au.pool.ntp.org
server 2.au.pool.ntp.org
server 3.au.pool.ntp.org

driftfile /var/lib/ntp/ntp.drift

Replace those server lines with NTP servers of your choosing.

The important line there is tinker panic 0, which is what tells NTP not to freak out if the difference in time between the local clock and the server is larger than it would normally be comfortable with. This line needs to come before all other config directives.

With that config in place, fire off a quick

sudo /etc/init.d/ntp restart

and you’re in business. Next time you bring your VM back up from a deep slumber, hit date and you’ll be pleasantly surprised.

They alone, therefore, of all the citizens are forbidden to touch or handle silver or gold; they must not come under the same roof as them, nor wear them as ornaments, nor drink from vessels made of them. Upon this their safety and that of the state depends. If they acquire private property in land, houses, or money, they will become farmers and men of business instead of Guardians, and harsh tyrants instead of partners in their dealings with their fellow citizens, with whom they will live on terms of mutual hatred and suspicion; they will be more afraid of internal revolt than external attack, and be heading fast for destruction that will overwhelm the whole community.
Plato, The Republic

The Narcicyst and Omar Offendum

This past Saturday I went to see “An evening with Aesop Rock and Kimya Dawson” at the Melbourne Festival. I’m not a huge fan of either artist, but figured the pairing would at least have to be interesting. Although I ended up leaving before the end of the set, the good news is that the opening act was stellar: the duo of Syrian-American Omar Offendum and Iraqi-Canadian (Montrealer, no less) The Narcicyst.

There’s a huge wave of great Arab hip-hop coming out at the moment, and these two guys are definitely fantastic examples. Both strong lyricists with impressive flow, Omar’s acappella was particularly jaw-dropping. Check out these videos to get a taste, then go out and buy their records:

As a bonus, here’s another amazing artist in this space, Shadia Mansour (featuring M1 from Dead Prez):

So just before Twitter was brought to its knees a few minutes ago, my whole stream was full of mourning for a successful business leader who made some really cool products and died today. I thought this was maybe a little much, so I went looking for a list of people who’ve died this year to provide some perspective, and found out that Wangari Maathai died last week, which doubly brought home the point I was trying to make in that I hadn’t heard about it until just now. RIP, Wangari. You did real good.