Building a plivo AMI

I’ve been experimenting with Amazon’s web services recently. I’ve also been playing with voice apps on both Twilio and Tropo. Then I found plivo. Happy days.

Plivo is an open source service that offers functionality comparable to the hosted services. The authors have also made it outrageously easy to install by packaging the whole thing into two easy to run scripts. There was no EC2 AMI so I set out to create one. It turns out to be fairly straightforward, and all possible through the web console.

Choose a base AMI

The first step is to choose a base AMI. I used the Ubuntu 10.04 amd64 standard AMI in the eu-west-1 region (ami-4290a636). Then I logged in, ran the plivo install commands, waited, waited some more, waited a little longer, and all was done.

Now, to secure the AMI before publishing it, I removed the ssh keys, authorized_keys, and the bash history. This is not as simple as it sounds. I also logged in from a host that I knew would show up in the “last logged in from” section.

I logged in and ran the following commands:

sudo shred -u /etc/ssh/ssh_host_*
shred -u ~/.ssh/authorized_keys
shred -u ~/.bash_history

Now I went into the web console, selected the instance, chose the Instance Actions menu and selected Create Image (EBS AMI). Then under AMIs, I selected my new image, and changed the permissions to public.

Note that in order to take a snapshot, the instance pauses for a second. During that pause, I lose my SSH connection, and having just destroyed SSH on the machine, I cannot get back in. So I have to terminate (kill) the instance and boot it a fresh from the new AMI. This creates new SSH host keys and puts my SSH key back into authorized_keys.


I’m sure there’s a more elegant (and potentially elaborate) way of doing this. But it worked for me. It was quick and painless. Now there’s a public plivo AMI in the eu-west-1 region. I’ll look into how I get it into other regions, and if I need to pay for the storage to have it publicly available.


The result is the new public ami-acd0e1d8 in the eu-west-1 region. If you choose to test the AMI, please let me know how you get on in the comments here.

An Ubuntu Kindle outside the US

I just bought a Kindle and successfully loaded my first book onto it in Canada, using only Ubuntu. The process I used should work anywhere outside the United States. Here’s a quick summary for overseas, would-be Kindle owners.

1] Buy the Kindle. You need a shipping address in the United States where a friend or forwarding service will receive the Kindle and send it on to you. You can use a credit card from any country to actually purchase the Kindle, but not the books.

2] Deregister the Kindle from your Amazon account.

3] Buy yourself an Amazon gift voucher (I started with $20). Just buy a gift card and have it sent to your own email address.

4] Create a new Amazon account with a new email address.

5] Register the Kindle onto your new Amazon account. The Kindle serial number is in tiny letters on the back of the device.

6] Load your gift voucher onto your new Amazon account.

7] Browse the Kindle book store, purchase a book. You’ll need to add a shipping address to your account, use a US shipping address.

8] Got Your Account > Manage My Kindle and scroll down. You’ll see a list of your purchases, choose Download to My Computer then save the file.

9] Plug your Kindle into your computer (Linux, Mac or Windows all work) and drop the file into the documents folder on the Kindle.

Voila, you have a Kindle outside of the USA.

Do not add a non-US credit card to your Amazon kindle account. Use the account only for your Kindle and only put money on the account via gift vouchers. Any non-US credit card will stop Amazon sending books to you on that account. You could repeat the process to register the Kindle to a new account, but you might run out of email addresses!

I’ll post some thoughts on the Kindle once I’ve had a chance to try it out. Right now it’s charging via USB. 🙂

For those of you still wondering what  Kindle is, go here. Think ipod for books. Here’s a picture to help you visualise:

Considering a Kindle

I’m considering the purchase of an Amazon Kindle 2. I like reading books but books a’re big and bulky which doesn’t fit very well with my current nomadic lifestyle. I’ve spoken to a few people who recommend the Kindle.

However, I just read this. Amazon has allowed publishers to restrict whether a book can be read aloud on the Kindle or not. There is no basis for this in law, but Amazon has conceded all the same.

I’m typically a hardliner on issues like this. I boycott all Apple products because of the company’s proprietary lock-in practices. I use Ubuntu GNU/Linux because it includes software freedoms not available on proprietary operating systems.

Is there a Kindle competitor out there? Is the same range of books available?

Before I make a purchase I want to find out if I can load books onto the Kindle via Ubuntu. The Kindle includes a cell phone wireless component that allows internet access, but only in the US. So outside of the US I need another way to load books. If that requires Windows or Mac then I won’t buy the Kindle.

Then I’d also like to research the selection of books that is available. I’m hoping that the type of non-fiction books I typically read are readily available on the Kindle, otherwise, again, no point getting one.

Do you have a Kindle? Do you use Ubuntu? Any feedback?

Simple Writing

I read a fascinating post about Amazon’s new text stats today (thanks Seth). Amazon provide some cool statistics comparing the sentence length, word complexity and even words per dollar of books.

It’s interesting to note that in Steven’s (admittedly unscientific) comparison, the more popular books have fewer words per sentence and less complex words. I’m reassured that I’m not the only person who prefers simpler texts.

I didn’t make it past the first page of my brother’s dissertation because of the academic style. I realise it’s what’s expected, even required, of academic writing, but personally, I find it unbearable. Apparently the numbers agree, simplicity sells!

Amazon EC2 Adds New Instances

Amazon EC2 has added two new instance types. Their standard instance has 1 virtual CPU and 1.7Gb of RAM for 10c (USD) per hour. The newly launched Large Instance has 4 virtual CPU cores (2 cores x 2 CPUs) and 7.5Gb of RAM for 40c per hour. The massive Extra Large Instance has a whopping 8 virtual CPU cores (2 cores x 4 CPUs) and a 15Gb of RAM for 80c an hour.

One of the beauties of the system is you can bring appliances on and off-line as you need them. You can even script your application to enlarge itself. However, the system is not without it’s drawbacks.

Amazon S3

Amazon S3 is a static file hosting service from Amazon. Storage costs $0.15 USD per Gb and data transfer (outgoing) costs $0.18 USD per GB up to 10TB. As an online backup solution, it would cost less than $20 / month to store 100Gb, assuming you’re not uploading / downloading more than 20% every month.

That’s pretty cheap by backup standards. But for commercial static file hosting, it’s insanely cheap. Particularly given the fact that it will scale from a few GBs today, to several TBs tomorrow.

I currently spend $5.40 / month for 3Gb of online backup with I might consider switching to Amazon S3, although probably not for my daily backups because I get unlimited bandwidth on and top notch support. For image archiving on the other hand, it looks very tempting.

The best thing, there’s no minimum spend. You don’t have to commit to spend hundreds of dollars to benefit from enterprise class storage.