Automatically remove dead AutoScale nodes from Chef Server

So you’ve created an autoscaling group in Amazon AWS, when it scales up you’re nodes automatically authenticate with Chef, configure and deploy successfully. That’s great! At least until you need to scale down again. Chef nodes are good at telling the server they exist, but not so great at telling it they’ve checked out. This becomes a real problem if you try to use knife to issue commands to all servers of a particular role for example. You’ll end up with ever increasing stale data about nodes that no longer exist. So what can you do to fix this? Luckily, AWS provides most of the tools for you, you just need to stitch them together. What you will need An … Continue reading

2013: Of dreams and nightmares

The year that triskaidekaphobes had been dreading for decades has finally come and gone. No longer will they be reminded of their peril every time they have to write down the current date. The rest of us can draw a line for a new start and reflect on another year past. Not soon enough for some, and tragically too soon for others. An ode to Judith Pote The year didn’t get off to a good start, with the news that my aunt, who had been bravely battling cancer for several years, was finally succumbing to its vice grip. Having lost my own mother to cancer many years ago, I can empathise deeply with my cousins and what they have been through … Continue reading

Getting started with Amazon Python AWS CLI tool

The new Amazon AWS CLI tool coded in Python is far superior to the old Java implementation. The official docs can be found at https://github.com/aws/aws-cli but here’s a quick run down of how I install and configure: Installation

or if you’re not using a virtual environment

You can also use easy_install in the same way if you prefer Configure Environment Variables Add the following to your .bash_profile, .bashrc, or .profile:

The key ID and secret key are required, the default region means you do not need to specify the region for every command, and the default output, changes the output type; it is set to JSON by default, which is fine for scripting, but not the best for reading … Continue reading

iTerm2 Keybindings for OS X

Word Jumping If you use a mac and tried the iTerm2 application, you may have noticed that the keybindings for word jumping and deletion are not set up correctly. Here’s how to fix that: From the iTerm2 menu select Preferences > Profiles and from the right select Keys. Now add the following key bindings by clicking (+) for each: Alt + Left Send Escape Sequence, Esc + b Alt + Right Send Escape Sequence, Esc + f Alt + Backspace Send Hex Code, 0×17 Split Terminals: Creating and Navigating I also like to bind keys to split the terminal vertically and horizontally and move focus between them. From the iTerm2 menu select Preferences > Profiles and from the right select Keys. Now add … Continue reading

A simple cloud-init trick

If you use Amazon Web Services or other cloud providers that make use of cloud-init, you may occasionally have reason to re-trigger the initial cloud-init run; usually because something didn’t work quite right the first time round. Rather than having to kill the cloud instance and booting a fresh one, you can try this simple trick to trigger cloud-init on reboot:

 

The Cliff

I found myself standing on the edge of a cliff, The turbulent sea crashing at its rocky base, I had been on an adventure through beautiful countryside, The simplest things bring the greatest pleasures. As I travelled I came across a beautiful butterfly, She danced in front of me and settled for a moment, Waving her beautiful wings, which shimmered in the sun, Before she fluttered off again away from me. I followed her as best I could, dancing among the trees, But she fluttered ever onwards towards the cliff, There I could follow her no longer; she was free but I was not, I could only watch as she flew away from the cliff into the distance. I looked … Continue reading

Sleep Paralysis: Of Hags and Horses

Last week I experienced sleep paralysis for the first time; I am not sure what brought this about, but I had been sleeping poorly all week which probably didn’t help. Sleep paralysis is a phenomenon which causes the sufferer, usually when transitioning between sleep and wakefulness, to experience hallucinations and paralysis with a sensation of weight pushing down upon them. Many sufferers report seeing an intruder in the room to whom they cannot react due to paralysis. I had heard of this before, several of my friends had described their experiences to me. I had no idea how real and terrifying it was. This is what happened to me: I had been unable to sleep again that night; I remember looking … Continue reading

So long 2012 and thanks for all the memories

Well another year is overe, so here is yet another retrospective of 2012. I won’t dwell on the negative and just share some of my personal highlights. I had ended 2011 in a swing dance club surrounded by friends and more prosecco than I could drink. I began 2012 with a dreadful hangover still half dressed in my tuxedo, a sure sign of a good night the night before. Well, that’s not strictly true, I didn’t get home until well gone 5am but you get what I mean. Anyway, I digress, so these were my highlights of 2012. Aerials Workshops For the uninitiated, “aerials” is a part of swing dancing usually reserved for the elite or rehearsed performances. They involve high-adrenaline moves where the … Continue reading

VNC at graphical login for Ubuntu 12.10 or 12.04

It sounds trivial; create an upstart script to start on boot, but this had me googling for a little while. I used x11vnc as the vnc server. The main issue was that x11vnc needed to bind to an Xauthority file. In order to get it running for graphical login, the Xauthority needed to be for the desktop manager (in this case, lightdm) . It took me a while to find the right location ( ⁄var ⁄run ⁄lightdm ⁄root ⁄); once I had found the answer, the script was easy. I created a file in the upstart init script directory,  ⁄etc⁄init ⁄x11vnc.conf

Lets take a look at what this does; lines 1 and 3 are self explanatory, line 5, ensures that the vnc server is started at … Continue reading

EDL vs Walthamstow: Why a 30 day protest ban was not a victory

On the 1st of September this year (2012), the English Defense League, an extreme right political group with a passion for hating muslims, attempted to hold a rally in Walthamstow. They were given permission by the police and the local council, however, their rally was derailed due to the overwhelming numbers of local opposition. For some extra detail, watch this video: EDL Defeat in Walthamstow The clashes were mostly peaceful (mostly!) but the EDL were truly thwarted and humiliated; managing a pathetic 300 strong mob that was faced with 3-4k local protesters who blocked their route to the rally point. The EDL planned another march for today (27th October 2012), presumably with intent of enacting reprisals for their previous defeat. The local … Continue reading