Ever wish you could shim into and do some testing on a “live” site? Hoxy is for you! It now even supports HTTPS sites thanks to a couple awesome coders Greg Reimer (founder), Francois Ward, and yours truly. A special thanks to Seth Holladay for helping move the issue forward with his bounty!

Sure, you could use something like forever but what if you want things as self contained as possible?

It’s very ugly and breaks stdio, but it works!

var cluster = require('cluster');
var _ = require('underscore');
var spawn = require('child_process').spawn;
if(cluster.isMaster) {
  //var cluster_args = 
  var runningragnarok = false;
  var msghandler = function(msg) {
    if(msg === 'rebirth') {
      _.each(cluster.workers, function(v) {
    if(msg === 'ragnarok' && runningragnarok === false) {
      runningragnarok = true;
      var nargs = process.argv;
      nargs.splice.apply(nargs, [1, 0].concat(process.execArgv));
      if(!_.contains(process.argv, '--regnarok')) {
      _.each(cluster.workers, function(w) { w.kill(); });
      spawn(nargs[0], nargs.slice(1), {detached: true, stdio: ['ignore', 'ignore', 'ignore']});

    if(msg === 'heatdeath') {

  cluster.on('exit', function() { if(runningragnarok) return; cluster.fork().on('message', msghandler); });

  setTimeout(function() {
    _.each([1,2,3,4,5], function() {
      var f = cluster.fork()
      f.on('message', msghandler);
  }, 5000);
  //_.find(process.argv, function(v, i, a) { return i > 0 && a[i-1] === '--ragnarok'; }) || 5000

As with all things, I was in need of a solution. The problem was that multiple object prototypes were needing to be mixed together into one. No npm package I found seemed to do the trick for me in the way I wanted and needed things to work. So of course I reinvented the wheel and made multiinherits.

The main reason for this is that I wanted a way to specify what super constructor to call.

Something I’ve been toying with is a tip and trick, but mostly horrible hacking away and over-thinking things blog series highlighting the stupid things I do. These things will likely come from stuff for my work or simply curiosity.

Without further ado, here’s #1.

A couple a weeks ago, I needed to migrate a web server and test the sites before going live. Due to a variety of constraints, editing the hosts file, using something like DNShifter or editing the hostname for the vhosts was out of the question. What is a guy to do? Thinking over the problem I figured node.js would be the quickest route to write a testing routine with.

The first problem and probably the biggest was to construct the http request in such a way that I would connect to a different host than the hostname would otherwise send me to. Looking at the node.js code on github made me think it was going to be a piece of cake, just a couple additions to the /lib http files would allow me to specify the actual host to connect with.

//around /lib/http.js:1425
else if(options.connection) {

This allowed me to use a specific socket made by net.createConnection. However, this is clunky and I’d have to maintain a copy of the mainline http with this and all the other necessary code changes. Obviously this is more work in the long run and my future self is lazy.

Thankfully the folks who wrote the http module decided to check if the options object for http.request() has “createConnection” defined and then uses that to initiate the TCP stream. This makes the task so much easier and should work for the foreseeable future.

var url = require().parse("http://example.com/");
url.createConnection = require('net').createConnection.bind(null, 80, "snoj.us");
require('http').request(url, function(res) {
  res.on('data', function (chunk) {
    console.log('BODY: ' + chunk);

And of course since drafting all this drivel I find that wget (starting with 1.10), Invoke-WebRequest, and node.js allow the Host header to be specified and each works excellently. However, I still like this technique as it allows you to leave the original URL in place while forcing a connection to another server. Using custom headers means editing the URL which may or may not be doable in some situations and calls for more code changes to accomplish the same end.

Last year during a men’s retreat weekend my church put on, we men were challenged to come up with a “Family Charter”,  a document of rules and regulations concerning interpersonal interactions. You could look at it as something akin to The Constitution for Minnesota, the U.S.A or any organization. Though I’m not too keen on having a charter for several reasons that are another post, one thing did stick out to me, the family motto.

So I started digging into my family background to see if there was anything I could revive or use for inspiration. thus far, I’ve only come across one I might have claim to.

From the old maternal side I found, “Nil sine numine” or “Nothing without God”. Quite spine tingling if you ask me, invoking the idea that nothing is possible without God’s hand or blessing and reminding us of his sovereignty.

As far as I am aware, my paternal family descends from common farming folk. I’ll have to dig around more on that side.

The Bond family has a neat one as well, “The world is not enough” (“Orbis non sufficit”). Which is an actual family and crest. I had always assumed it was the realm of fiction. At any rate, I had thought it a motto with gravitas, proclaiming that there is something better, something that this world cannot satisfy. Or perhaps, the price required to “buy one off” would be more than the world.

Other ideas being toyed with:

  • To the sky/ad caelum
  • Seek the Lord/Quaerite Dominum
  • With strength, comes peace/cum virtute, fit cum pace

ref: http://en.wikipedia.org/wiki/List_of_Latin_phrases_(full)

It’s getting official, we’re moving to the country. It’s something that the mrs and I have been thinking of doing, mostly in a “sometime-in-the-future” way, several years from now and the earliest.

Then earlier this year we found ourselves a piece of land for sale about 20-30 minutes away from our current home that we could not say no to. (Intra-family deal.) Now after a month or so of unknown timelines, we have some concrete dates for moving. Which do not easily jive with other dates like when newbie is coming or snow melting. I hate moving with snow on the ground.

Why move to the country? Won’t I miss the high-speed internet offerings? Well, yes, I will. 30Mb+ internet down speed is really, really nice, but there are some other reasons I’ve had my eye on the country side.

During my childhood, we’d go visit relatives in California for a week or a month at a time. I loved the time there with my cousins and just being in California. There were several reasons we were able to do this, one of which was that my Aunt and Uncle had a large enough house that we could comfortably stay with them. To be able to do the same thing for my friends and family is something I’ve wanted to do as well.

We’ve wanted to have a garden for a couple years, but our home so far have either been rentals and the land lords prohibited it or the lot was too small. Though our last lot probably could have had a small one if we did some terracing. Our (well more my goal) is to eventually have the garden offset store bought veggies to such a degree that we’re only buying if much spoils or we’re needing extra for a feast.

There’s a chicken coup that we’re hoping to make use this summer. Our little family can go though a couple dozen eggs a week easily when only accounting for breakfast. So even just over a half dozen chickens should keep up with our weekly demand for eggs. Meat though is another matter. Thinking of all the times we have just chicken breast, wings, or legs, we’d have to have a lot of chickens to satisfy that want.

I love a good fire with friends on a brisk fall night or the warm glow of a fireplace. While we have “room” at our current digs, I’m looking forward to the additional space to have a pit instead of a portable steel bowl. We’re also looking at using wood to offset fuel oil use down the road. This will mean a lot of wood chopping.

Over the last couple months, my little flower and overflow have started waking up when I get up for work. Following me downstairs and starting to play or demanding to watch Kipper before mom comes down and turns it off.

However this week has been slightly different. The little flower has started saying “Daddy no work, stay home!” I’m almost tearing up right now thinking about it.

I love being a dad.

Building my own awesome “NAS” box for precious family photos will take a pretty penny to complete and even then I wouldn’t have backups in case of disaster (I’m a disk over tape/dvd guy). So to get me started I’m using Amazon’s EC2 service.

For the moment, I’m using one Micro instance with 3x50GB extra drives in a ZFS RAIDZ. Later on I’m hoping to either compliment it with NAS at home or perhaps another Micro instance in another datacenter…or both.

Either way, I basically only had to do the following after creating the instance.

sudo apt-get install zfs-fuse
sudo mkdir /cloudnas

sudo zpool create cloudnas -m /cloudnas raidz /dev/xvdf /dev/xvdg /dev/xvdh
sudo adduser myself
sudo mkdir /cloudnas/myself
sudo chown myself:myself /cloudnas/myself

I really wish I could have used the native ZFS modules instead of the fuse, but I couldn’t get it to work and I wasn’t in the mood to build zfs from source…yet.

It’s all official now with papers signed and everything. I’m joining the folks at Magpie Software to help make the world of planes walkers easier.

A couple weeks ago my friend (CTO of Magpie) Nick Davis contacted me about joining the team and working on the various parts that make up their flagship software. My main focus being the back-end, like making sure the card prices are “on the money”.

If you want to know more or even subscribe, check them out at their site.

A couple-few months ago I decided that I wanted to give Windows’ newish feature of booting to a VHD a real try. Actually use it for every day computing instead of just a one off test.

I won’t go into details of setting up the system, there are plenty of tutorials out there. Like the one I used.

What I will go into is a recent laptop move. You see, I was using my work laptop originally. For one thing it was way more powerful than my personal one and I really didn’t like the idea of removing my nice Logitech M570 dongle every day. (So instead I moved the whole laptop.) However now that I have a new laptop, I wanted to move my environment so I didn’t need to setup every little thing again.

So I copied my VHDx file to the new laptop, mounted it and ran bcdboot.exe, restarted and after some “getting devices ready” screens, was in a very familiar Windows 8. The only thing I needed to do was install drivers, and they were right there on the physical drive (thanks HP!). I had downloaded drivers in preparation for no reason!

All in all, besides the annoyingly long copy time –about an hour and a half– I was back to my desktop in about 15-20 minutes. I could probably have done better on the copy time by making use of gigabit Ethernet instead of external USB drives, which according to the google would be roughly 16 minutes.

With this experience being so easy, I’m thinking that this may be a feature I’m going to have to get my peers to use as well. With things being this easy to change hardware, it would be a welcome change to rebuilding a failing machine. Heck with some fancy scripting, you could probably make a backup and move it someplace on the network at night.