Saturday, September 17, 2011

VMWare: how to lose a customer in one easy lesson

A while ago, when I was developing a lot of courseware, I got hooked on virtualisation. Virtual Machines are a great way to create a repeatable course environment, and if your course is Linux-based you can distribute the course images freely. I started off using VMWare; their Windows workstation was inexpensive, and their player was free.

I stuck with VMWare for years, and used it for more and more applications. In the good old days, when Dell were after market share rather than margin, I picked up a couple of servers for about £250 each - dual-core machines with 4Gb of ram and decent hard drives. I ran Ubuntu on them, and used VMWare Server to host several virtual machines.

All worked fine until VMWare announced that  Server had reached end-of-life, and their remote desktop stopped working with current browsers. I found myself with a set of unusable VMs which represented many weeks of development and configuration.

At the time I was working on a contract a few desks away from Stuart Ervine, and he suggested I try VirtualBox. It's proved to be a more-than-adequate replacement for VMWare, who won't be getting business from me or the clients I advise in future. Of course VMWare were within their rights to end-of-life a free product, but they caused me enough grief to destroy six years of brand loyalty at a stroke.

Leiningen and Eclipse

I'm now fairly comfortable with leiningen, though I still feel a frisson of anxiety whenever I run it. I know that Maven is lurking there somewhere, and my experiences with Maven have not been happy.

I'm also a bit leery of letting lein download and install arbitrary software from external sources. I'll need to set up a local repository, which will mean a closer brush with Maven that I've had before.

It's annoying, but seems unavoidable. Clojure libraries and tutorials generally assume that you're using leiningen.

At least the lein/Eclipse combo makes it simple to create and populate an Eclipse Clojure project.

Here's what you do:

  1. In the directory in which  you want to create your project, run lein new
  2. cd to the newly-created directory
  3. open project.clj in your text editor of choice
  4. add :dev-dependencies [[lein-eclipse "1.0.0"]]
  5. save the file
  6. run lein deps
  7. run lein eclipse
  8. import your newly-created project into eclipse
At the end of stage 4, your project.clj file should look like this
(defproject hadoop-spike "1.0.0-SNAPSHOT"
  :description "FIXME: write description"
  :dependencies [[org.clojure/clojure "1.2.1"]]
  :dev-dependencies [[lein-eclipse "1.0.0"]])

WabbitMQ runs too

Off to a good start this morning;I set up a Clojure spike using WabbitMQ and got a simple test running in a few minutes. Now I can link up my Python and Clojure components. Eeeeeeeexcelent.

Thursday, September 15, 2011

Run, RabbitMQ, run Rabbit, run, run, run

I'm about to do some more work on Sknoman (a personal knowledge management application) and need to link together several disparate subsystems. Some are written in Python, but I'm developing one in clojure.

Nat Pryce speaks highly of RabbitMQ, so I decided to give it a try.

For reasons too boring to explain, I'm developing on a Ubuntu Lucid virtual machine. Lucid is almost as old as I am, so the packaged version of RabbitMQ is seriously out-of-date.

Once I'd installed an up-to-date version from the RabbitMQ Debian repo, I had the RabbitMQ Python send/receive example running in about five minutes. While that's hardly an exhaustive test, it's very reassuring.

I'll be trying a Clojure client next, but I'm hoping this is going to be painless.