This is an incredibly beautiful video via #TED. The magic starts about 3m16s, but the talk is also interesting. http://bit.ly/pLlbCz
Author Archives: Callum
Mum safely delivered to Anne and Bulente’s for their three week holiday in Turkeys leaving me with her car for the next three weeks…
I’ve just done my first ever copy paste within screen. Wow, it’s pure awesometastic. Well, within byobu technically, but who’s counting?
Force SSH password on lftp
When trying to connect to an sftp server in lftp, it automatically tries public key authentication first. In my case, because I have so many keys, I usually get “too many authentication failures” before it gets around to trying the password. Took me a while to find the solution, but it turns out to be fairly simple.
Once lftp is running, simply issue this command:
set sftp:connect-program "ssh -a -x -o PubkeyAuthentication=false"
This causes ssh to be run with public key authentication disabled, so it tries the password immediately, and succeeds. Yay.
Posting here for future reference.
The hankering for a cigarette is getting stronger, especially as I see people smoking, don\’t know if I\’ll make it through the night…
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.
Elegance
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.
Result
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.
Fixing NTFS on Ubuntu
James had a hard drive problem. He pulled the disk out of his laptop and brought it to me. Firstly I created a full image of the broken partition like so:
sudo dd if=/dev/sdb2 bs=1k conv=sync,noerror of=/path/to/image
Then I tried TestDisk. It worked like a charm and fixed the apparently broken NTFS boot sector. I thought that when James put the drive back in the laptop, it might “just work”, but apparently it didn’t. I had saved some of the most important files, but not all. James then wiped the drive to get a working machine again.
So now I had to restore files from an image of a broken partition. Turns out to be dead easy. The key ingredients were loopback and TestDisk.
sudo losetup /dev/loop0 /path/to/image
sudo testdisk /dev/loop0
It took me a while to figure out that I needed to choose partition table type none. I was dealing with an image of a single partition, so there was no partition table. After that, TestDisk behaved just like normal. I rebuilt the NFTS boot sector and then mounted the image like so:
sudo mkdir /mnt
sudo mount /dev/loop0 /mnt
This warned about the disk not having been shut down properly, ran something or other to clean it up, and then bingo, all the files were mounted and visible. I copied all the data from /mnt to an external drive, and will give that to James to restore from. Too easy!
So many rainbow gatherings, I just don’t know what to do with myself. I must visit at least one this summer, maybe the European in Portugal.
Watching an interesting assortment of dancing at dancebase on this sunny Edinburgh Friday afternoon.
Somewhat surprisingly we won Social Innovation Camp. Happy days. #sicamp
I\’m up and out unusually early today for the first working day of #sicamp. I\’m looking forward to sampling the vegan catering.
Sub Culture Hack has shut down for the night (morning?), back on from 9am…
#chs11_
Food is well on its way to being consumed, conversation is flowing, #chs11_ is underway.
Holy mackerel, I just bought a yoga ball stopper on eBay for £2.50. Expensive, but cheaper than a new ball. Soon I’ll be ball sitting again!
Sub Culture Hack venue pics
I went down to check out the venue for Sub Culture Hack yesterday. It’s an awesome barge kindly provided by the Leith Agency. The whole place is decked out in black leather, there’s even an executive foosball table with silver foosmen!
The barge looks like the perfect size for this event. Big enough to get everyone in, but small enough to keep it feeling cozy. There’s plenty of plugs, they’re providing extra switches and ethernet cables, and lots of places to sit. So we’re all set.
Here’s a few snaps.
Woke up to the sound of a mouse in the bed side cabinet. Successfully captured and released on the beach. I’m hoping that was the only one!
False alarm, no mouse in the trap. The trap must have been tipped somehow, but not by a mouse. Saves me going out, but the mouse is still…
There’s an alive mouse in the live mouse trap in the kitchen. Where do I release the little fella? Might need to take a trip to Leith Links.
Home after 4 days getting progressively muddier and muddier and one narcotic fuelled, all night party last night at Knockengorroch. Shower!!
Got the tent pitched during a little dry spell, now feeling very cozy. Long time since I was under canvas, and a very fine canvas she is!
Packed and ready to head off to Knockengorroch festival. I\’ll be mostly off the grid until Sunday I reckon. Good times ahead.
My new favourite TED talk. It’s <4 minutes and it could change your life, dramatically. http://ping.fm/kHHZ0
It’s 3:46am. Launched my first ever EC2 instance, deployed my first ever rails app, and finally got it working for @JournalEd. Bed time now.
The vegan meal at #dcedi11 is salad and two pieces of white something (tofu, soy cheese?). Crap compared to the meat / dairy spread.




