16 Things About A Trip To Charleston

  1. It turns out that RVs sometimes decide that they want to be the lane you’re in. And they don’t care that you’re in it. My first experience with being run off onto the hard shoulder, everybody!
  2. Horse-drawn carriages sound so romantic, don’t they? Nobody really seems to think about the consequences of having lots of horses in 30˚C+ weather and high humidity. Always work out where downwind is, and don’t stand there!
  3. At some point in the mid 1980s, an architect stood in the middle of Middleton Plantation and said: “FATHER, IN THE MIDDLE OF THIS LUSH SCENERY, I WILL BUILD A BRUTALIST HOTEL!” And fair play to the owners for not having said person carried off the grounds. I’m now trying to work out if I can replicate part of the bathroom design at home.
  4. Apparently, I can detect a Library Book Sale from miles away (though I did have help in this one, so you can blame the second upcoming bookcase on Tammy and Robert)
  5. SO HOT. SO HOT. AND HUMID. OH GOD THE HUMIDITY.
  6. Okay, technically, I had pancakes at Hominy Grill. But then a fusion chicken biscuit at Xiao Bau Biscuit and more fried chicken at Cru Café. I had to restrain myself at Husk the next day. And the fries at The Glass Onion tasted like fried chicken, too.
  7. I like to place all the blame for hating audience participation on the time I was abandoned as a small child in the middle of London and taken in by performers who tried to get me to beat one of them over the head with a plastic hammer. (this really happened, though my parents dispute how long they were away. They still left me in the middle of Covent Garden, though.)
  8. It’s odd walking through a lovely planned garden knowing that it’s very existence is due to slave labour. And that the family who owned it went from signing the Declaration of Independence to signing the Declaration of Secession within a hundred years. Also, apparently three-year vacations to Europe were a thing.
  9. Jeni’s Ice Creams are indeed quite splendid.
  10. If anybody knows just why there was a three-float parade in the middle of downtown Charleston on Saturday afternoon, do let us know. We were quite surprised.
  11. You’d be surprised just how much it can rain in an hour. Especially if you’re outside at the time.
  12. Steve Mcmanananananananananan is during the commentary for ESPN’s World Cup coverage. On the one hand, things like ‘HYUNDAI HALFTIME!” On the other: no Phil Neville.
  13. The trip ended up being focused on a very small part of downtown but with lots of circles around it. But great company on the Saturday!
  14. THE BRIDGES. WHY DO THEY GET HIGHER? WHY? WHY?
  15. Stingrays get quite animated when taken out of the water.
  16. There. Are. Snakes.

Driver - One Year Later

This time last year, I was high on Vicodin and signing lots of legal papers. The prospect of owing $120,000 to a bank seemed less remote than the worry I was going to lose my leg. And for a further week after that, I had a house, but I couldn’t actually visit it, because I couldn’t walk more than a few steps.

But eventually (thanks to the quick eye of Tammy, who got me to the hospital before the cellulitis got too problematic), I recovered and we moved across Durham to @314Driver. The house is pretty much the same as it was when I signed the papers back last year; a door has moved, and of course there’s a lot more bookcases, but we’ve spent the first year settling in.

The second year is probably going to involve a few changes. I keep looking at the big bathroom and feel like it all needs to be ripped out so a proper second shower can be installed. But don’t worry, I have decided that the clawfoot tub should stay after all. People like baths, it seems! Also, maybe in the coming year, we’ll rip up the carpet tile in the back room and put down kitchen tile, giving us more space for food preparation. The dream of taking an axe to all the knotty pine and replacing it with stainless steel and concrete as far as the eye can see is however still a way off.

On the whole, then, a successful first year in the house. Here’s to a few more at least.

Twister, SC

It was a great idea. A Memorial Day trip down to South Carolina to visit Tammy and Robert, go to IKEA to pick up some things, and add to my driving experience. When I left Durham on Friday afternoon, it was spitting a little, but by the time I was approaching Mebane, that had gone and it was brilliant sunshine once more. However, at that point, I was finally facing the daunting prospect of driving two hundred miles…and my first thought was to turn back and spend the weekend hating myself in Durham.

But I pushed on. And until I reached South Carolina, it was okay. I was still incredibly nervous and locked to the speed-limit on the right-hand side of the road, but I was still moving. But then I crossed the border and things started to get a little odd.

Firstly, there was what seemed like smoke on both sides of the road, swirling and changing directions. Then the interstate was filled with bits of tree. And then? Well, my car started veering left and right rather quickly, and I realised that I was in for an interesting drive. At least it didn’t get much worse than that. In terms of wind anyway.

Brilliant sunshine again. But then, as I got closer to Columbia, the skies darkened again, and rain began falling. And then came the hail. Which was terrifying, as it wasn’t your common European hail, which is bad enough. Oh no. This hail varied from golf ball to tennis ball and rained down upon my roof with a loud THUD-THUD-THUD. Really, I should have probably pulled over to the side and waited for the storm to pass…but by this time I just wanted to get to where I was going (also, I would have been exposed for the second round of hail).

The last twenty minutes or so of the drive were basically hail and thick rain preventing me from seeing more than five feet in front of the car, but somehow, when I pulled up to the house, it eased off enough to let me get my things inside.

Of course, then the clouds above started shifting in all directions rather rapidly, so, fearing a tornado strike, we all huddled in the downstairs bathroom until the next hailstorm passed.

And that was how I got to South Carolina. And this is now my roof:

the dented roof

I’m happy to say that the rest of the weekend passed by without any further weather incidents (though Robert and Tammy’s house took a battering with hail, as did our cars). Sadly, IKEA didn’t have the bookcase I was looking for, so I will have to head back in the months to come. But we had a great weekend of Bakewell Tarts, pizzas, camouflaged sticks (camouflaged as…a stick!), the difficulties of parking in downtown Columbia, and a 2012 CGI animated series of Pac-Man, dubbed Mission: IMPACABLE. It is as bad as you could imagine. And then some more.

Now back in Durham, where the ambient temperature is 27.4˚C inside and the air conditioning is still not fixed. I may take to ice baths before the week is out…

I Shall Diminish And Listen To Radio 2

A rather disturbing fact jumped out at me this weekend. I hadn’t updated my Smart Playlists in iTunes to include a separate one for 2014. Once I had rectified that, I discovered to my horror that I had only bought one album all year. And that was something that came out last year in the UK and I pre-ordered the US release by mistake (Lanterns On The Lake, in case you’re interested). What had happened? I used to buy at least an album a week, sometimes more. Now, it’s true that I’ve been busy and that most of the new music I’ve found myself exposed to in the past few months has been bland electro-pop that makes Sarah McLachlan seem like the front of the avant-garde. But I also haven’t been seeking any new act out which has led to a bit of a dearth of new music around my speakers.

There’s another thing nagging at my brain, too, which mostly occurred whilst looking to see if New Order were playing anywhere near me this summer (the answer: not really). While I’d go see them regardless, it popped into my head that going to see New Order in 2014 is like going to see Bill Haley and The Comets in 1984. Which is terrifying.

Anyway, I am old. But, having a trawl about, I did discover that Ronika’s album is out next week, plus I finally got around to hearing Martha and on the basis of this, I ordered their debut album (also out next week):

Boston has less snow in it these days, but I didn’t really get much further than the hotel and its environs this time. That will hopefully change in June…

MAY DAY UPRISING

This week’s title is brought to you by the department of "Wait, it’s May Day Bank Holiday and I have to work? After not getting any time off over Easter either? STORM THE BARRICADES!“

So, I’ve been sick this week. I was going to write a fun post about how High Point, NC is a bizarre town filled with amazing buildings and then left fallow all year around except for twice a year when the world comes to buy furniture, but I think the moment has passed now. But High Point is pretty bizarre, take it from me.

Instead, I felt recovered enough this weekend to get back in the car. I am currently averaging one drive per week at the moment, which I feel is not enough to be getting used to driving around the area (and leads to building up anxiety of getting in the driver’ sweat again). Also, I have to drive Stacie to the airport on Wednesday, so I thought I would give that a test run and also and buy food things. I ended up getting lost, almost driving off a bridge, and headed in the general direction of, well, I think Greensboro. Although it could have been Virginia.

Come on, who wants to ride in a car with me? WE’LL HAVE ADVENTURES.

Also, pressure-cooked caramelized carrot soup is pretty awesome. Aside from standing nervously around the hob for twenty minutes wondering if the pot is going to explode.

Been a while...

Things have been a bit busy. Firstly, this happened yesterday:

me and a car!' width=480

Yes, I now own a car. It surprises me almost as much as it does you. As of yesterday, I have finally given up the long experiment of getting around the Triangle by public transport. It worked out better than most would expect, but I am a little tired of having two hour round-trips to Whole Foods.

I will, of course, still walk to work. Because I’m strange.

When I last wrote, I was in Hawaii. This week, my family have been here in NC instead. Their week here has mostly consisted of eating, meeting my friends, and putting up shelves. Oh, and Mum spent most of the day today cooking and cursing American ovens and pans.

Will be sad to see them go tomorrow, but at least in this day and age, we have FaceTime.

Hawaii!

On Friday, I was told by a ten year old boy that my bedroom is what he’d want when he grows up. I’m not sure exactly if that’s a revelation about my stunted emotional growth or just that I have a lot of cool things. Despite that, I still didn’t let him transform Jetfire. Flattery only goes so far, people.

Anyway, two days of travel later, I’m in Hawaii. Which is weird, but I’m grateful that they eased me in via an airport that is still emblazoned with 1970s-era Eurostile and Helvetica, plus concrete walls as far as the eye can see. Bizarrely, it reminded me a lot of LAX circa 1994, on my first-ever trip to America (yes, it’s been twenty years. I am old). LAX, on the other hand, was selling macarons and being all fancy.

So far, we have driven along a road for a while, had some Korean BBQ, taken the family on a supermarket visit, bought spam, accidentally found a hipster burger place, and almost got swept out into the ocean while trying to rescue the flip-flops that I had bought less than an hour earlier. Eventful, and we still haven’t gone very far yet…

Spot Instances With Ansible

One of my favourite new technologies of the moment is Ansible. It’s the new kid on the block alongside stalwarts like Puppet or Chef, but it wants to do more with less. Both Puppet or Chef are great for configuration management, but take some getting used to if you’re a sysadmin coming across them for the first time. In addition, they require extra servers, extra overhead on the servers that they maintain configuration, and you still might find yourself resorting to cluster ssh in order to send a command to a bunch of servers there and then. In addition, you’ll often find Puppet or Chef shops using a different tool for application deployment (Capistrano for Rails, Fabric for Django). Ansible is a step back in some ways, but steps forward in others. It sidesteps the declarative model of Puppet, and abandons the idea of running agents on servers; instead, everything runs over standard SSH (and for those of you sceptical that SSH can scale on that front, Rackspace is currently using Ansible across tens of thousands of virtual machines). In addition, workflows like orchestration, deployment, and ad-hoc commands to groups of servers are all present and fully supported. It’s a great tool for the devops basket.

Ansible is still pretty new (it’s just about to celebrate its second birthday), but is coming along at a fast and furious pace and is ready for production right now. Indeed, development is so active that many simply track the GitHub repo rather than waiting for the point releases. One of the features I’ve been looking froward to landing is the ability to create spot instances in the Amazon cloud. It was merged into the main branch just under two weeks ago and while it’ll be available in Ansible 1.6, it’s ready for use today with a handy git pull.

Here’s a stripped-down playbook (the equivalent of a Puppet manifest or Chef recipe) that launches a number of spot instances at a specified price (spot_count and spot_price are passed in on the command-line using the extra-vars argument).


---
- name: Spin up spot instances
  hosts: 127.0.0.1
  connection: local
  tasks:
    - name: create  {{ "{{ spot_count " }}}} spot instances with spot_price of ${{ "{{ spot_price " }}}}      
      local_action:
        module: ec2
        region: us-west-2
        spot_price:  '{{ "{{ spot_price " }}}}'
        spot_wait_timeout: 180
        keypair: example-keypair
        instance_type: t1.micro
        image: ami-ccf297fc
        wait: yes
        group: test-group
        count:  '{{ "{{ spot_count " }}}}'
      register: ec2

    - name: Tag instances
      local_action: ec2_tag resource={{ item.id }} region=us-west-2 state=present
      with_items: ec2.instances
      args:
        tags:
          Spot: '{{ "{{ spot_price " }}}}'

As you can see, it’s pretty straightforward. The hosts/connections preamble makes sure that the following commands run on my local box instead of a remote machine, and then we get into the list of tasks that need to be performed (Ansible takes the approach that tasks are run in the order they’re specified. Which seems obvious, but if you’re coming in from the Puppet/Chef world, you may have already just cried a huge sigh of relief).

Anyway, onto the tasks themselves. The first creates the spot requests. Ansible takes a ‘batteries included’ approach, supplying a boatload of modules that do everything from running shell commands to altering hardware routers. Here, we’re using the ec2 module to talk to Amazon Web Services. The options passed into the module should make sense if you’re familiar with the AWS setup; we need to specify a region where our instances will live (Oregon/us-west-2 in this example), our instance_type (we’re being cheap and using micro instances), security groups, AMI image (just using the stock Amazon Linux AMI) and the SSH keypair. We also set our suggested spot price and how many instances we would like, and we do that by using Ansible’s templating functions; the ‘{{ }}’ sections ensure that our variables that we specify on the command-line will be filled into the right place at run-time. We also need a waiting period to be set, as AWS won’t fulfill the request instantly, so we’re waiting three minutes to get our machines or else we’ll terminate.

Assuming that our spot request bid succeeds, the ec2 module will return information back to Ansible about the instances that have been created. We capture that information with the register: ec2 line, and then use it in our next task, which tags the newly-created instances with the spot price we used to create them (as you can imagine, the chaining of output from the previous task into further tasks is a very useful feature that reoccurs throughout Ansible’s design).

And here’s the output from running this play:


$ ansible-playbook spot.yml -i spot.ini --extra-vars "spot_price=0.005 spot_count=2" 

PLAY [Spin up spot instances] ************************************************* 

GATHERING FACTS *************************************************************** 
ok: [127.0.0.1]

TASK: [create 2 spot instances with spot_price of $0.005] ********************* 
changed: [127.0.0.1]

TASK: [Tag instances] ********************************************************* 
changed: [127.0.0.1] => (item={u'kernel': u'aki-fc8f11cc', u'root_device_type': u'ebs', u'private_dns_name': u'ip-172-31-11-32.us-west-2.compute.internal', u'public_ip': u'54.186.184.201', u'private_ip': u'172.31.11.32', u'id': u'i-f51760fd', u'state': u'running', u'virtualization_type': u'paravirtual', u'architecture': u'x86_64', u'ramdisk': None, u'key_name': u'housepi', u'image_id': u'ami-ccf297fc', u'public_dns_name': u'ec2-54-186-184-201.us-west-2.compute.amazonaws.com', u'state_code': 16, u'placement': u'us-west-2c', u'ami_launch_index': u'0', u'dns_name': u'ec2-54-186-184-201.us-west-2.compute.amazonaws.com', u'region': u'us-west-2', u'launch_time': u'2014-03-23T18:44:12.000Z', u'instance_type': u't1.micro', u'root_device_name': u'/dev/sda1', u'hypervisor': u'xen'})
changed: [127.0.0.1] => (item={u'kernel': u'aki-fc8f11cc', u'root_device_type': u'ebs', u'private_dns_name': u'ip-172-31-14-189.us-west-2.compute.internal', u'public_ip': u'54.186.112.206', u'private_ip': u'172.31.14.189', u'id': u'i-bb1661b3', u'state': u'running', u'virtualization_type': u'paravirtual', u'architecture': u'x86_64', u'ramdisk': None, u'key_name': u'housepi', u'image_id': u'ami-ccf297fc', u'public_dns_name': u'ec2-54-186-112-206.us-west-2.compute.amazonaws.com', u'state_code': 16, u'placement': u'us-west-2c', u'ami_launch_index': u'0', u'dns_name': u'ec2-54-186-112-206.us-west-2.compute.amazonaws.com', u'region': u'us-west-2', u'launch_time': u'2014-03-23T18:44:12.000Z', u'instance_type': u't1.micro', u'root_device_name': u'/dev/sda1', u'hypervisor': u'xen'})

PLAY RECAP ******************************************************************** 
127.0.0.1                  : ok=3    changed=2    unreachable=0    failed=0 

If I look at my EC2 console afterwards, these instances are up and running, plus they have the spot price tagged as requested. From here, the instances can be provisioned further; installing databases, webservers, and so on; adding them to load balancers, updating DNS entries - pretty much anything you would do manually can be automated with Ansible in a sensible manner. With no agents or fiddly PKI management. Hurrah!

Some other great things about Ansible: firstly, they’re very welcoming towards new contributors (indeed, the play I described above uncovered a small bug in the ec2 module in regards to how it handled instance counts - I fixed the bug, made a pull request, and it was merged into master before the day was out). And, for all you hipsters out there, the Ansible company is located in downtown Durham. So it’s not just an automation system, it’s a local automation system.

Hit Him Again, Luke

I am but a few discs away from completing my once-every-couple-of-years rewatching Gilmore Girls. It’s at the point where I just want to throw rocks at Christopher and Logan whilst scratching my head at the personality transplant they gave Marty. Oh, Season 7, you were such a mistake. But at least you ended properly.

Next week, I’ll be heading back to RDU once again. But this time, heading back to LA, not for Santa Monica-related shenanigans, but just as a stopover on the way for a week in Hawaii with the family!

It's 3am, Is Your EventMachine Selecting?

A tip for those of you using EventMachine in Ruby. As you may know, by default EventMachine uses the select() system call during its run through the event loop to check for new inputs on file descriptors (which it then uses to hand off to callbacks you may have registered). This is useful, as you’ll find select() on pretty much any UNIX-based system you can care to name. However, there are a few drawbacks:

  • select() is often limited to FD_SETSIZE file handles, which is normally 1024.
  • Because of the way _select()_ runs, EventMachine needs to loop through all the file descriptors twice, once for passing into select(), and once again to see if it has marked a descriptor ready for reading or writing.

This is often fine during developing, and perhaps even testing (especially if you’re not load-testing properly), but you may be in for a surprise when you start getting serious traffic in production.

Thankfully, EventMachine comes with a few strategies to get around this issue. Sadly, it’s not quite as simple as select(), but not too taxing. Both Linux and BSD-derived systems have taken different approaches - Linux provides a system called epoll, while BSD systems have kqueue. Both implementations eliminate the idea of having to read through all file descriptors twice on every call, and are easier to scale past the 1024-descriptor limit. All you have to do is call EM.epoll or EM.kqueue before you start the Reactor.

Having said that, you’ll see a lot of code around the net that looks a bit like this:


EM.run do 
	EM.epoll
	...
	...
end

There’s a slight problem here. It should look like this:


EM.epoll
EM.run do 
	...
	...
end

There’s not much difference there, but the ordering of the lines is incredibly important - because EM.epoll in the first example is inside the Reactor, it will do nothing and will instead fall back to select(). And your code will blow up when it hits a big traffic spike. So be careful out there with rogue function snippets, and always set up with kqueue or epoll before you make the fateful call to EventMachine.run.