Xen Workflow – Copy VMs

Creating VMs from scratch in XenServer is a bit of a hassle, but that’s OK because it’s not a frequent task. Typically you’d create one (or a few) base templates, and then make copies whenever you want to spin up a new disk. This process is very simple and straightforward in XenServer, and easily automated. Continue reading Xen Workflow – Copy VMs

Xencap – Xen Management Library for Capistrano

I’m starting to dive into choosing from a variety of server virtualization options for work in order to determine which solution to roll into our environments. First up is XenServer, with which I’ll stand up a pool of a couple machines and test out provisioning new servers, live migration, network isolation, and other cool features. While these tasks are more straightforward using the GUI (official GUI is Windows-only, but there are alternatives), I’m spiking out tooling that does as much as possible via the API (since we’ll want to automate it). Continue reading Xencap – Xen Management Library for Capistrano

Testing Singletons in Ruby

Ruby’s standard library includes the Singleton module, which lets you easily implement the singleton pattern. It can make unit testing a little difficult, though, because you cannot easily instantiate different versions of the class. This post will look at three solutions, two of which are hackish/wrong, and one of which is basic and clean (imho). Continue reading Testing Singletons in Ruby

Drop-Dead Simple Authentication for Microapps

For Inspectinator (a sinatra microapp), I needed a database-less authentication solution that was as lightweight as possible, but with a reasonable amount of security and maintainability. I came up with something that suits this purpose well, and I’m sharing it in case anyone is looking for something similar. I call it EasyAuth. Continue reading Drop-Dead Simple Authentication for Microapps

Announcing Inspectinator

I’ve been wanting to experiment with sinatra for a while, so I popped something off my things-to-do-someday list and put together Inspectinator.  It’s aim is pretty straight-forward: parse standard ruby #inspect strings into a more palatable form.  It parses a string into a system of nested objects, and displays it as a tree.  Some simple jQuery let’s you drill down to the level of detail you want. Continue reading Announcing Inspectinator

Erlang & Ruby

I’ve been playing around with Erlang lately, and it’s been quite a departure from the language I’m most comfortable with (and use everyday): Ruby. As part of my exploration, I’m doing a variety of sample problems (from the “Programming Erlang” book, among other places) in both Ruby and Erlang, and comparing the different implementations I come up with. Continue reading Erlang & Ruby