Making a staging database with sed

Quick one – thought was was cute and useful.  I take a copy of live databases once in a while for use in the staging environments, but some apps have references to the live url in the there (WordPress does this and makes all its redirects using it, making it particularly difficult to test in staging).

This is a simple little way to change all the urls in the db as you clone it:

mysqldump -h live_db_host -u user -pmypass live_db | sed -e '{s/www.example.com/staging.example.com/g}' | mysql -h staging_db_host -u user -pmypass staging_db

Though depending on your MySQL table type you might want to dump to disk first, then pipe it through sed as your live tables might be locked (I’m not actually sure if mysqldump will block waiting for the other processes to catch up)

Broken Bus Window

Broken Bus Window Photo

Broken Bus Window form back in 2005.

Speaking at the Manchester Free Software Meeting

I’m speaking next Tuesday (15th April 2008) at the Manchester Free Software about my geeky web comic, Everybody Loves Eric Raymond. Apparently people are still interested in it even though it hasn’t been updated since December! Hooray!

It’ll be a bit of a mix of the two talks I’ve done before on ELER, so some stuff about the history of the comic and how I make it, plus some ranting about free software, free markets and leaders.

I was asked by the then organiser (and my friend) Matt Lee who was then extraordinarily renditioned to North America with his new wife, leaving the new organisers to pick up the pieces. Luckily most of the pieces were found and it’s all go, though I do now appear to be talking about my new Rails hosting company too and my name is spelt differently. If there is time, I’ll talk about some of the stuff we’re doing at Brightbox with Free Software.

Talk starts at 7pm at the Manchester DDA. More details on the Manchester Free Software website.

6 year old Gnome bug picks up pace

This bug regarding the Nautilus image thumbnailer performance was reported almost 6 years ago.  It had input on it at the rate of around one message every two months, up until the end of 2003 – then nothing until 2006, where duplicate bug reports start coming in pretty regularly until the end of 2006.  All pretty quiet until then, kind of suddenly, Michael Chudobiak writes a patch that speeds up Nautilus almost 3400%

I used a test folder that had four 15000x400 tif images and four
15000x400 png images (solid colors). Without the patch, it took
Nautilus 4 minutes and 30 seconds to thumbnail the folder. With
the patch, it took 8 seconds.

I'm not clever enough to touch the actual pixop codebase. But
these numbers suggest there is enormous room for improvement!
This bug has been open for 6 years - nudge, nudge.

Because free software is forever we can just afford to get there in the end :)

Euruko Ruby Conference 2008 in Prague

I’m in Prague with Brightbox for the Euruko Ruby Conference 2008 from tomorrow evening until Monday morning. I’ll post photos to the Brightbox Flickr photostream as we go along.  If anyone wants to meet up for a drink, email me at john at johnleach dotty co dotty uk.

UPDATE: Photos here.

BBC Racism

The public can see for themselves the ‘neutral’ media language used to describe Israeli actions: ‘incursion’, ‘retaliation’, ‘military operations’. By contrast, Israel endures ‘terrorist attacks’, ‘slaughter’, ‘a bloodbath’. Careful analysis by Greg Philo and Mike Berry, of the Glasgow University Media Group, found a persistent, ugly pattern:

“In our samples of news content, words such as ‘mass murder’, ‘savage cold-blooded killing’ and ‘lynching’ were used by journalists to describe Israeli deaths but not those of Palestinians/Arabs. The word ‘terrorist’ was used to describe Palestinians, but when an Israeli group was reported as trying to bomb a Palestinian school, they were referred to as ‘extremists’ or ‘vigilantes’.” (Philo and Berry, ‘Bad News From Israel’, Pluto Press, London, 2004, p. 259)

http://www.medialens.org/alerts/08/080311_israeli_deaths_matter.php

Leeds Ruby Thing #2, Thursday 6th March

The Leeds offshoot of the North West Ruby User Group is meeting again this Thursday, 6th March, 7:00 PM – 11:00 PM.  This time at Mr. Foley’s
Cask Ale House
, on The Headrow (formerly Dr. Okells).

Expect unstructured discussion of Ruby, Ruby on Rails and other random stuff plus nice people, great beer and coffee and geeky tshirts.

The balcony back room of Mr Foley’s has been booked.  Announce that you’re coming on the upcoming page.

Oh, and we now have a website: http://leedsrubything.org/

UK Earthquake, February 2008, Magnitude 4.7

quakewhitet.jpgJust felt what at first I thought was a heavy gust of wind but what then very quickly became an earthquake. We’re in Leeds but quickly got reports from friends over instant messenger, irc and twitter that it’s been felt elsewhere in Leeds, Bradford, Huddersfield and Nottingham.

I’m hearing the collective throat clearing of every geologist in the country in preparation for various TV and radio interviews.

I personally have been expecting the end of days for a few years now and am well prepared in the form of:

  • 5 torches
  • high capacity Internet link
  • several comfortable cushions
  • a good stock of tea
  • prayer books for all the best gods

(more…)

Wikileaks Censored by US Judge

A controversial website that allows whistle-blowers to anonymously post government and corporate documents has been taken offline in the US.

BBC News

WikiLeaks and its domain registrar for the wikileaks.org domain name, Dynadot, have been sued by the Swiss Bank Julius Baer, because of leaks claiming illegal activities at the bank’s Cayman Island branch.

The Judge order the DNS registrar to freeze the domain. The main servers are in Sweden though, so the cover names still work (such as the UK one: http://wikileaks.org.uk). There are also mirror sites. This is a good example of why you shouldn’t rely on US domain names (and why we need more diversity of root server control no doubt). Not sure how much better the UK system is though.

The Tor network has hidden services for this kind of thing and though not perfect, helps protect against this kind of attack (the Tor website is censored by my Vodafone ISP btw). A good time as any to volunteer to host a Tor router server.

Cryptome has a Wikileak archive and more information.

Valentines poem

Roses are red,
Violets are blue,
I tried to buy some for you but an error occurred during a connection to www.valentinesflowers4u.co.uk SSL received a record that exceeded the maximum permissible length error code ssl_error_rx_record_too_long.

Our dominant system of economics is unstable

The dominant system of economics is unstable, inimical to social justice and lethally damaging to the environmental support systems on which we all depend. A major failure in professional journalism has been the refusal to analyse this; or even to report that real growth rates in the developed world have been declining since the 1970s. Instead, corporate-employed journalists and mainstream analysts frequently extol the alleged spectacular achievements of an ‘unparalleled’ rise in wealth.

Medialens – a UK based media analysis project.

That quote is from one of their latest alerts, “‘CREATIVE DESTRUCTION’ – THE MADNESS OF THE GLOBAL ECONOMY”. Find it here: part 1 and part 2.  You can buy their book, Guardians of Power, from here.

Beautiful Southport sunset

Louisa took it, but I’m in it.