An example Position server built with Netty and Disruptor

The weekend project: Trapos

Create a real sample application using the Disruptor. Something beyond the example tests that are in the disruptor source distribution.

The goal: create an in memory position server that is fed trades and rates from the command line over a TCP/IP socket.

The first cut is ready and working, it can take in trades and rates, and update an aggregated position.

I would still like it to print Profit or Loss for the position based on the rates updates. But that will have to wait for another weekend…

The result, a poorly named

Working with Spring MVC and mustache.java

I'm starting a new project with Spring MVC and after having worked with ruby for a while I wanted to use mustache for templates.

This lead me to:

Introducing mustache.java-spring-webmvc

Unfortunately I didn't find a Spring MVC View Resolver that worked with mustache.java. However there was one for 'jmustache' mustache-spring-view

So github fork to the rescue and a few hours on Easter weekend and I have:

This is a first version and works for the cases I needed so far, basic templates, and partials.

Enjoy.

Resources

If...

Creating a Wireless Bridge on Your Laptop using Proxy ARP

Since I have had to figure this out twice from scratch, I decided to write it down for posterity.

In a previous article I explained how to bootstrap Ubuntu VMs and launch them with KVM. Part of this involved setting up a wireless bridge using parprouted. Since then I have learned of an easier method using Proxy ARP.

The details can be found here: Proxy ARP with Linux

I will summarize the relevant sections for working with KVM.

The assumptions

  1. You have a KVM host and are only concerned with setting up a wireless bridge
  2. You have...

Creating a KVM Ubuntu VM using Debootstrap

The goal is to create a small KVM guest from scratch using deboostrap and a list of additional packages. The additional packages are defined in a file, aptly named, additional.packages.

Note this is very long but pulls together a bunch of information. I also think it will only work if you are starting this from an existing Debian or Ubuntu system.

I have created scripts which execute all the steps and made the available here. Patches to the scripts are more than welcome. Just fork on github and send me a pull request.

Why? In my case I wanted...

Playing with CouchDB's REST API Using Ruby's curb and json

I found the three biggest hurdles to get over when starting to use CouchDB were:

  • That map functions are precalculated indexes.
  • 13 years of SQL implanted in my brain.
  • Interacting with a REST API for the first time.

In this article I won't go into the first one, I'm still working through that. For the second one I found this excellent article: CouchDB Joins.

The third one can be be overcome using a couple of ruby gems (json|curb) and irb. This is the focus of this article.

Perquisites

A CouchDB server up and running. This tutorial...

Remastering a Debian 5.0.3 (Lenny) CD for use in an Unattended Install

I want to create an attended Debian installation based on a standard Debian 5.0 (Lenny) CD for use with VirtualBox. This is part of an overall project to make all my servers similar and maintain them with Puppet.

At the core of an unattended debian install is a preseed.cfg file. The preseed.cfg file contains the answers to all the questions asked during the installation and is capable of performing additional package installs and running commands post installation. The whole trick is preseed.cfg must be in the root of the initrd.gz on the ISO used to run the install....

A Ruby Gem Template combined with RSpec and Flex Mock for Testing

Creating a new ruby gem from scratch

This is a bit of yak shaving I decided to take on this weekend (and last), to kickoff a larger project I wanted to get started. My goal is to create a ruby gem that will be used with Flex Mock and RSpec testing libraries. The end result of this blog entry is a very basic library bundled as gem that proves those testing components are working.

I not covering:

Note: all commands are executed in the root of project...

On the Move

I haven’t posted in a while because I have just finally completed my second international move and settled down again. This time from France to the UK (London). For anyone that has done this they understand that it is both exciting, and painful at the same time. A friend of mine once said ‘That is not fear your are feeling it is just misclassified excitement’ — that expression goes a long way during one of these types of moves.

Testing Modular JavaScript with JsUnit and Thin+Rack

I am trying to following the InfoQ article about using JSMock, Functional, and JsUnit to test JavaScript, I have encountered difficulties. Partly due to my configuration and how I want to structure my projects. It is best to read the InfoQ article as it covers the basics of using JsUnit. Then return here if you like my way of setting up a JavaScript project.

I have put everything described here into a sample project called js-test-kit on GitHub.

Modular JavaScript

I am writing tests in the following way. I put all of my application code in one or more JavaScript...

Serving Static Content With Ruby thin+rack

Why would you want to serve static content with thin and rack?

My reason is this: I am having difficulties running JsUnit using local FILE URLs (file://) for some reason it periodically fails to load the test case. This is true even when the same file URL is used in a different tab in Firefox. One solution is to serve the JsUnit test code and the JavaScript production code using thin+rack. This allows for direct access using HTTP URLs (http://), which in my case works better. And it turns out thin and rack make this is really easy!

Thin and...