Git on a Shared Host, 10 Minute Install Guide

I’ve recently started using Git for local work and personal projects. So far it’s great. It’s small, fast, and extremely robust. The cheap branching and merging are certainly worth the small change in workflow you’re forced to make as a result of using a distributed scm.

One problem that I have run into is that not all hosts have Git available and you can’t go and install it in /bin on a shared host you don’t own. Luckily, this isn’t a problem. This is a quick and dirty guide to getting Git running on a shared host. Note that these instructions apply equally well for replacing the system version of Git with your own (but the version you install will be visible to you only).

Continue reading…

Zsh Snippets

I thought it might be a good idea to post my .z* files and other little tweaks that I have accumulated in my tech travels. I try to keep my shells simple so that behavior isn’t hugely different from system to system, especially since I typically work in environments where zsh may not be available and I don’t want to suffer from feature withdrawal when I’m forced to use ksh or bash instead.

Zsh in 100 Words

If you’re not familiar with zsh, you should check it out at zsh.org home page. In short, it’s a well-packaged feature-rich shell with features like

  • phenomenal tab completion that supports tab-completing cmd-line options,
  • intelligent file globbing that is suffix aware
  • intuitive command history navigation that supports find+reexecute and find+ parameterized-rexecute
  • a command history that spans multiple sessions

This is just the tip of the iceberg. I won’t bore you with a droll post about how awesome zsh is or what crazy things you can do with it. You can explore this on your own, and there are plenty of posts about this sort of thing floating around the net. This post is really for me to keep the basics of my zsh setup online and always accessible for the next time I find myself on a new host and I want to set this up.
Continue reading…

Data objects with boost::tuple

The data object. Every application’s object model has one or more of these things acting as a container for some stateful data, often in the form of record-level data sourced from outside the application. When approached top-down this usually requires gobs of boring code to implement that are redundant, a pain to maintain, and a downright chore to test.

Over time, with the addition of new data members we usually see new getter/setter pairs added, tweaks to print functions, and maybe manual edits to some critical serialization logic. Aside from being risky if there’s not adequate testing infrastructure in place, this is not the best use of your time — you could be writing far more important business and application logic. All in all, maintaining data objects is alot of work for something that should be braindead simple and done auto-magically.

Here’s an approach for providing flexible data objects built on boost::tuple that are geared toward rapid development, ease of use, and extensibility.

Continue reading…

Upgrading to Leopard, Part 1 of 2 — OS Upgrade

Unlike alot of people that ran right out and upgraded to Leopard on the first day it was available as a general release, I waited. I wanted to upgrade. And I was looking forward to it. But having experienced an upgrade that broke applications in sometimes unexpected ways before, I thought it wise to sit and wait this one out.

Why Upgrade Now
Now that the first major patch release is out (OS X 10.5.1) and after having read numerous reports about the new features, OS improvements to stability and the user experience, and the recent bug fixes, I upgraded. The upgrade went smoothly, but it wasn’t without quirks.

Continue reading…

Parted. It’s awesome.

I did something stupid last night. I tried to make a modification to the partition table of a drive while it was in use. For obvious reasons, this was not what I had intended and I corrupted the partition table and lost all my data on that drive — temporarily. Then, I fixed it with parted.

Continue reading…

Cable TV + Mac + Firewire == HD-PVR

With all the hype surrounding appleTV I’ve started to rethink the whole PVR vs. TV-media client tradeoff. I have a server at home, a bulky black box with 2×250GB hard disks that I use for storage and backups. I’ve recently considered turning it into a PVR or a TV-serving media server, but the lack of good HD options has stopped me from doing so. I have an HDTV, and I pay for HD cable. Naturally, I want an end-to-end HD solution. I could purchase and install a tuner in the server (which runs Ubuntu, by the way), such as the pcHDTV550 that’s guaranteed to run on linux — but it only takes analog inputs (coaxial and s-video) and only decodes ATSC, which is already exported via firewire by the cable tuner. When I thought about it, I noted that all I really want to do was capture the video stream.

After a little research, I found that any Firewire-equipped Mac can be made into an HD-PVR for unencrypted content at the expense of an appropriate firewire cable. Apple even provides the necessary capture software that you need, provided that you know where to look.

Continue reading…

Installing DB2 9.1 on Ubuntu Dapper (6.06)

DB2 is one of the few industrial strength, fully featured database systems that has a community edition available for free use. It supports stored-procedures, and all the standard MySQL-esque features, in addition to triggers and all sorts of data partitioning. And it even ships with a full set of administrative GUI tools. Unfortunately, nobody has taken the time to document the process of getting DB2 installed on Ubuntu Dapper (6.06 LTS). This is my attempt to do so and save others some of the confusion that I went though getting it to work.

If you’re feeling adventurous, you can read the official DB2 9.1 documentation and the many, many DB2 Manuals available on IBMs site.

Continue reading…

SVN on OS X with Fink (Part I: Installation)

Every good dev environment needs and uses source control. If you’re a programmer, and you don’t use source control of some sort, well, then you’re not really a programmer.
Continue reading…

Installing Apache2 on OS X using Fink

Installing the Apache2 HTTP web server on OS X is extremely simple when one uses Fink. The usual source based installation procedure (with docs found on the official ApacheHTP Server documentation page) requires manual download of the server and all the modules you wish to use. Fink simplifies this considerably.

Continue reading…

Installing Fink on OS X

Every flavor of *nix has some form of package management system. Gentoo has portage, Debian has the apt toolset which is also borrowed by Ubuntu, Red Hat, and now Suse, have RPM. Mac OS X, having *nix at its core, is no different.

Enter Fink. Fink is a powerful source-based package management system for OS X written in Perl and maintained by the Fink Project. While there are a number of binary packages available through the project, the available packages are primarily distributed as source and usually require the standard GNU dev toolchain to compile (gcc, make, etc). Either way, it’s easy to use, makes everything you’ll probably ever need to develop software in an OS X dev environment immediately available, and is terminal-based in the good-old unix tradition. There is a GUI that offers basic package management capabilities, but who cares– in my experience I spend so much time at a shell that switching back to the gui costs more time than it saves.

Here’s what you’ll need to install Fink:

  • Mac OS X Developer Tools (XCode 2.4 with gcc 4.0, X11)
  • The Fink installable binary

Continue reading…