citizen428.blog()

Try to learn something about everything

Move EC2 AMIs Between Regions

Today I spent some time figuring out how to move EBS-backed AMIs between different EC2 regions. To save you the effort, here’s a quick summary:


  • create a volume from the snapshot backing the AMI

  • attach this volume to a running instance and mount it

  • create a new volume in the target region

  • attach to a running instance, format and mount

  • in the source region, connect to your instance

  • rsync (over ssh, so no messing with security groups) the mounted volume to the target volume

  • once the rsync is done, create a snapshot in the target region

  • register this snapsho as new AMI with ec2-register

Not rocket science, but definitely not as good as just being able to share your own AMIs between regions…

Update: Robert J. Berger wrote this detailed step by step guide based on my short summary, you should go check it out!

Plot EC2 Instance Usage With Clojure and Incanter

Have you ever wondered which instance types you use most when dealing with Amazon’s EC2? I have, so I came up with a short Clojure/Incanter program to plot a nice chart like this:

EC2 usage plotted by #incanter (@liebke) on Twitpic
(full size image)

Here’s the code, if you have any feedback please leave a comment, this was the first time I used Incanter.

Comprehensive List of Cloud-related Links

Lately a lot of my working time is spent on cloud technologies, most notably the Amazon Web Services. In recent month I compiled a rather comprehensive list of cloud-related links which I now decided to share with you all.

Cloud Links

It’s just a markdown file copied into a Gist, so if you want to add any links just fork away! :-)

Major Changes in ClojureX

When ClojureX was started it tried to be everything for everybody. Not only did it checkout and compile the git HEADs of clojure, clojure-contrib and jline, it also (optionally) downloaded packages for Clojure support in TextMate or Emacs, configured and installed them. This has two obvious drawbacks. First off, people end up downloading stuff they don’t need. With current disk sizes and connection speeds that’s probably not much of a problem, but some users may still find annoying. More importantly though it was hard to keep up with the upstream changes, e.g. clojure-contrib’s recent switch to Maven.

So now instead of trying to provide a one-size-fits-all solution I’m taking a totally different approach: from now on ClojureX will only contain the most recent stable releases of clojure, clojure-contrib and jline, as well as a very full-featured clj script:

I know that this potentially makes ClojureX less useful to some people, but I do believe that it’s one of the fastest and most painless ways to set up a Clojure development environment.

OpenSolaris Cheat Sheet

I’ve always been a big fan of the handy little utility cheat and recently became interested in OpenSolaris (which btw runs fine on my Thinkpad x200s), so I did the obvious and created an OpenSolaris cheat sheet:

http://cheat.errtheblog.com/s/open_solaris

It’s still missing information regarding ZFS, but I guess I’ll eventually add that too. And who knows, maybe I even get motivated enough for a nicely formatted Latex version…

Scary Ruby

We all know that Ruby’s a flexible beast, but just how much you can bend it is almost scary. How about inheriting from a class randomly chosen at runtime? Sure, no problem:

I dare you to find a use case for this ;-) And in case random isn’t good enough for you, why not have the user choose the superclass for you?

Bored? Don’t Worry, Here’s a New Programming Language…

Recently – for various degrees of recent that is – people really seem to be into programming language design and development. You’ve probably all heard about Scala, Clojure and Go already, but here are some more new languages which may be new to you (descriptions taken from the projects’ websites):


  • ANI, the experimental, high-performance, statically-safe, fully implicitly parallel, object-oriented, general-purpose dataflow programming language.

  • CoffeeScript is a little language that compiles into JavaScript. […] it compiles into clean JavaScript (the good parts) that can use existing JavaScript libraries seamlessly, and passes through JSLint without warnings. The compiled output is quite readable — pretty-printed, with comments preserved intact.

  • Factor is a concatenative programming language where references to dynamically-typed values are passed between words (functions) on a stack. [It] is expressive, fast, supports interactive development and has a full-featured library.

  • ooc, a modern, object-oriented, functional-ish, high-level, low-level, sexy programming language. It’s translated to pure C with a source-to-source compiler. It strives to be powerful, modular, extensible, portable, yet simple and fast.

  • Yeti, ML style functional programming language, that runs on the JVM.

2009 Reading List

Here’s what I read in 2009, in the order I read them:

Brick Lane: Monica Ali
Die Angst des Tormanns beim Elfmeter: Peter Handke
Soweto Stories: Miriam Tzali
The Eighth Day: John Case
A Language in Common: Marion Molteno
The Lover: A. B. Yehoshua
Everything Is Illuminated: Jonathan Safran Foer
Ali Smith’s Supersonic 70s: Ali Smith
Die Memoiren des Rodriguez Fazantas: Helge Schneider
German Amok: Feridun Zaimoglu
Imaginings of Sand: Andre Brink
Leinwand: Feridun Zaimoglu
Bitter Fruit: Achmat Dangor
Die Betrogene: Thomas Mann
The Crow Road: Iain Banks
The White Tiger: Aravind Adiga
Kali: Eine Vorwintergeschichte: Peter Handke
The Icarus Girl: Helen Oyeyemi
Der Hund aus Terracotta: Andrea Camilleri
Ansichten eines Clowns: Heinrich Böll
Lust: Elfriede Jelinek
Transmission: Hari Kunzru
Zwölf Gramm Glück: Feridun Zaimoglu
Hokkaido Highway Blues: Will Ferguson
Never Let Me Go: Kazuo Ishiguro
Lunar Park: Bret Easton Ellis
The Burial Brothers: Simon Mayle
Ruby in Practice: Jeremy McAnally
An der Arche um Acht: Ulrich Hub
Ubik: Philip Kindred Dick
A Loyal Character Dancer: Qiu Xiaolong
Bartleby The Scrivener: Herman Melville
2 B R 0 2 B: Kurt Vonnegut
Handbuch des Kriegers des Lichts: Paulo Coelho
The Well-Grounded Rubyist: David A. Black
The Accidental: Ali Smith
Rice Boy: Evan Dahm
South Africa: The Rise and Fall of Apartheid: Nancy L. Clark
Squeak by Example: Andrew P. Black
Rabbit, Run: John Updike
Heartland: Joey Goebel
Guards! Guards!: Terry Pratchett
Die Girls von Riad: Rajaa Alsanea
Angela’s Ashes: Frank McCourt
Verblendung: Stieg Larsson
Der Tote im Sumida: Sujata Massey
Crime: Irvine Welsh
Interesting Times: Terry Pratchett
Sacred Games: Vikram Chandra
The God of Small Things: Arundhati Roy
Programming Clojure: Stuart Halloway
Armageddon: Leon Uris
Small Gods: Terry Pratchett
The Dice Man: Luke Rhinehart
Verdammnis: Stieg Larsson
Oranges Are Not the Only Fruit: Jeanette Winterson
Vergebung: Stieg Larsson
JavaScript: The Good Parts: Douglas Crockford
Going Postal: Terry Pratchett

Started in 2009 but not finished:

Gödel, Escher, Bach: Douglas R. Hofstadter
Brückenkurs Mathematik: Guido Walz

This list is not taking into account stuff that didn’t have ISBNs like some eBooks or scientific papers.

Simple AWS Scripting With Boto

boto is a very nice Python interface to the Amazon Web Services which I can heartily recommend for your cloud scripting needs. Here’s a quick example program I whipped up around 2 weeks ago (be gentle, I’m not a Python guy and this is just a throwaway quickie), which will list all your AMIs (excluding public ones), used S3 buckets plus a list of currently running instances with some information like instance type, start time etc. The nice part is that you can connect to any instance via SSH directly from this lsit which I find more convenient than copy/pasting the public DNS name from the AWS console:

Android and Me

Last Monday I got an Android phone from work (unfortunately A1 still only has the HTC Magic, but I don’t want to be ungrateful) and I obviously had to get into the whole community firmware thing and all. Here are some links that I hope are interesting and/or useful:

One last word of advice: save your APN settings before you flash your phone!