All posts by sam

Searching Recent Event Logs with C#

Hi guys,

Today I was looking into event log searching. I run a script that does a chkdsk on reboot but then when the machine boots I want to see the log from that report.

To do this, I search the registry for the most recent event within a certain time period (I choose 1 day). We can use Linq to make the filtering quite easy.

Cheers to StackOverflow for the basis of this code.

RVM, Merb, Rake and RSpec

I was having terrible difficulty getting Merb to work with RSpec. Turns out that Merb now uses Bundler, and if you don’t edit your Gemfile to include rspec it bails on you.

This was solved by adding the line to the bottom of the Gemfile in the project root.

Ruby chat-server with Fibers & Eventmachine

Posting this mostly for my reference so I don’t lose it again later.

Converting from VMWare to Virtualbox

Yesterday I used Virtualbox for the first time, to create a Beowulf cluster.

Today, I am migrating my Ubuntu VM from VMWare Player to VirtualBox.

This is dead simple with a linux client:

  1. Copy your VMware image to your Virtualbox VM location
  2. Open up VirtualBox and go File->Virtual Media Manager
  3. Add the .vmdk file as a hard disk in the Virtual Media Manager
  4. Create a new VM, using the hard disk you copied as the disk.

That’s it! Could it be simplier? 🙂

For Windows, things are a bit more difficult. See this link for more details.

String matching with C++ PCRE

no such file to load — mkmf (LoadError)

Ever get this error when installing a gem?

It happens when you don’t have the development library installed. Easy enough to fix, just install ruby1.9-dev.

For ubuntu:

Ruby utility script to send email

Someone over at MUDBytes asked about sending emails from within their game. They were looking to do this from C++, which as we all know is a pain in the ass.

I wrote up this quick utility script in ruby for sending emails easily, without the risk of passing stuff to the command line.


This is an easy way of sending emails, and can be configured to authenticate with a server.