Fix for oh-my-zsh git-svn prompt slowness

I was dying a slow death from the slowness of my zsh prompt when using oh-my-zsh‘s git plugin and a repository managed by git-svn. I finally decided to do something about it today.

I tracked the slowness down to the parse_git_dirty function in oh-my-zsh/lib/git.zsh. This function calls git status which seems to be quite slow in my environment. My fix was to replace the oh-my-zsh version of the git_prompt_info function with a version that doesn’t call parse_git_dirty. This means that I can’t get the little checkmark (“✔”) or “X” (well actually “✗”) that shows whether my working copy is dirty or not, but it’s worth it to me to not have my prompt lag like crazy.

To fix this, I pasted the following into my ~/.zshrc:

Installing GNOME in FreeBSD 9

I pretty much followed these instructions, but one extra step was required.

The problem that I was having was that the system kept running out of file descriptors and becoming unusable. After a little digging around with fstat and such, it was apparent that gam_server from Gamin was the culprit, using some 3700 file descriptors. From a bit of web browsing, I saw that this is somewhat common on BSD, because BSDs don’t have inotify like Linux, so Gamin uses kqueue but this requires opening files and using file descriptors. This is described in the Gamin Wikipedia page.

My solution was to increase the number of file descriptors by adding to /boot/loader.conf:


This was enough file descriptors to placate gam_server:

[marca@freebsd9-0 ~/src]$ fstat | grep gam_server | wc -l

Why you don’t get mock objects

Why you don’t get mock objects

Fascinating talk by Gregory Moeck from RubyCon 2011

While this deals quite a bit with TDD and mock objects, it’s also largely about a particular style of OO design, one that reminds me a lot of some of Allen Holub’s writings. It’s not very specific to Ruby (it has some examples in RSpec – that’s about the extent of the Rubyness).

Fixing VMware guestOS setting after the fact

I set up an OpenIndiana vm in VMware Fusion (see earlier post) but while setting it up, I accidentally selected “Other” for the guest OS type instead of “Solaris”. As a result, later on when I wanted to install VMware Tools, it wasn’t available in the menu because the system didn’t know which CD image to mount.

The fix was to edit the guestOS setting in the .vmx file.

But first I needed to figure out what the valid settings are for guestOS.

I took a clue from this page and did this:

$ strings '/Applications/VMware' | egrep '^solaris[0-9]'

From this, I knew that I needed to put:

guestOS = "solaris11-64"

in /Users/marca/Documents/Virtual\ Machines/OpenIndiana\ Build\ 151a\ Desktop.vmwarevm/OpenIndiana\ Build\ 151a\ Desktop.vmx

Setting up OpenIndiana b151A

I’m in the process of installing OpenIndiana b151A in a VMware Fusion virtual machine.

Main reason is that I’ve become interested in DTrace and DTrace comes from the world of Solaris. OS X has DTrace too, but I’m noticing that it differs quite a bit from DTrace on Solaris, especially when it comes to developing with it — i.e.: instrumenting software with USDT probes.

OmniFocus sqlite completedDate

A while back, I posted about how OmniFocus maintains a sqlite database. This could be really interesting for writing software to do new stuff on that data.

Jared just dug into this and noticed that the completedDate field was an integer, but it did not appear to be a unix epoch time.

I just did a little experimentation and it seems that OmniFocus is setting dateCompleted to the number of seconds since Jan. 1, 2001 00:00:00 GMT.

I figured this out by setting my time zone in System Preferences to GMT and then I went into OmniFocus and created a task and set the completion date to “1/1/01 00:00:00″. Then in sqlite:

sqlite> select name, dateCompleted, datetime(dateCompleted + 978307200, 'unixepoch', 'localtime') from task where dateCompleted is not null;
Take clock out of Honda                 351241538.054  2012-02-18 07:05:38
Ate sushi                               351241498.856  2012-02-18 07:04:58
Order replacement light bulb from Amaz  351241558.269  2012-02-18 07:05:58
Test -- item completed on 2001-01-01 0  0              2001-01-01 00:00:00

and after setting my timezone back to GMT-8:

sqlite> select name, dateCompleted, datetime(dateCompleted + 978307200, 'unixepoch', 'localtime') from task where dateCompleted is not null;
Take clock out of Honda                 351241538.054  2012-02-17 23:05:38
Ate sushi                               351241498.856  2012-02-17 23:04:58
Order replacement light bulb from Amaz  351241558.269  2012-02-17 23:05:58
Test -- item completed on 2001-01-01 0  0              2000-12-31 16:00:00