Mongrel errors

July 4, 2008 – 2:13 am

While running mongrel_rails cluster::start, if you get the following error:

ERROR RUNNING ‘cluster::configure’: Plugin /cluster::configure does not exist in category /commands

then my friend, you have to do the following:

  1. verify that mongrel_rails is installed (sudo gem install mongrel_rails) You need  >= 1.0.5
  2. make sure you run sudo mongrel_rails versus mongrel_rails as a non super-user since the gem was installed for a sudo
  3. do a gem cleanup mongrel_rails (some people have said that this solved their problems)

Videocasting / recording

July 3, 2008 – 7:42 am

Michael Wilde (of splunk fame) had a cool video on tools he uses for making videos online:

  1. Keynote (of course)
  2. Backdrop
  3. Screenflow
  4. Camtwist
  5. Viddler.com
  6. seesmic.com

Postgresql 8.3 / Rails on Ubuntu 8.04

June 27, 2008 – 9:17 am

It turns out that it is important that you DO NOT select Postgresql when installing Ubuntu.
To get 8.3 working along with ruby binding, the magic strokes are:

apt-get install postgresql postgresql-client postgresql-contrib libpq-dev
gem install postgres

libpq-dev gives you pg_config along with the include directories and such. The postgres gem needs this, otherwise it complains that the paths are not set.

Making an image of an entire Ubuntu installation

June 27, 2008 – 7:43 am

I came across an awesome tool (Remastersys) for making complete backups of your Ubuntu/Debian (useful when you are deploying apps that scale-out / if you need to reinstall your perfect setup from scratch). Instructions are here.

Benchmarking in Rails

June 25, 2008 – 6:40 pm

I was looking for a tool that would help me benchmark my Ruby on Rails app. Ruby-Prof is good but it gives me too much detail, and most of it is irrelevant. I just needed a summarized method-level benchmark summary only for the methods I have written.

I came across Stephen Sykes’ post which had the right idea. With the help of Rails’ built-in Benchmark utility and some ruby fu, I was able to package it into a little module available here.

To use this, you need to install the facets gem (gem install facets) and put the above module in your lib directory (Rails auto-loads all files in this directory). You also need to set EXTRA_BENCHMARKING=1 in your environment (In bash, that would be export EXTRA_BENCHMARKING=1).

Of course, insert include Benchmarker at the very top of the class definition for the classes that you want to benchmark. All benchmarks are logged in benchmarker.log in your log directory.

Let me know if you have any questions.

On choice and VCG mechanisms

June 16, 2008 – 12:39 am

Question: You are in the job market. Which of the following two circumstances would you rather be in?

  1. Two competing offers: An offer from company A valued at $120,000 and another  from company B at $119,000 (considering all other attributes of the offer equal)
  2. An offer from company A valued at $119,000 and nothing from company B.

I have a feeling that, when presented with this situation, most people would choose option 1, although they would be happier with option 2. I think the reason lies in how happiness is defined by what we don’t have (rather than by what we do have).

(PS: Didn’t the title say …VCG Mechanisms? )

d