I created a shallow fork of the S3Sync project specifically to wrap it as a gem. My intention is most likely to hack on it but I haven't done that yet. The code is at http://github.com/mgreenly and can be installed via rubygems (gem install mgreenly-s3sync) but first you'll need to check out the instructions at http://gems.github.com/.
May 3, 2008
Apr 5, 2008
NetBeans on Ubuntu
I'm usually a hardcore Vim fan but I've started to use NetBeans for my Ruby work. It's a fairly typical install but the one quirk is that $JAVAHOME has to be defined for the installer and Ubuntu's JDK package doesn't set it.
That's easily remedied though; download NetBeans, install the JDK and pass --javahome to the installer as a command line option.
#> netbeans-6.0.1-ml-linux.sh --java-home /usr/lib/jvm/java-6-sun
Ubuntu 8.04 "Hardy Heron"
The new Ubuntu release, 8.04 "Hardy Heron", is nearly out so I thought I'd take a few minutes to do a fresh 'from scratch' install on to my laptop, a Dell Latitude D830, this weekend. I was pleasently suprised that almost everything worked exactly as expected out of the box, including; wireless networking, dual head monitor support, suspend, hibernate, compiz, etc....
There was one small but very critical change I had to make. It appears that the ACPI hard drive load/unload bug has still not been fixed. It's critically important that you apply this work around unless you want your hard drive to die prematurely.
There was one other non-critical change I made. I didn't dig into the issue to understand it but for what ever reason the default ALSA settings don't support the audio pass through in the docking station. Fortunately the fix is extremely simple. You just need to install the "Gnome Alsa Mixer" and select the IEC958 check box.
#> sudo apt-get install gnome-alsamixer

Setting CFLAGS
It turns out the gento-wiki has a great page indicating which GCC -march flag should be set for which CPUs. To determine which CPU you have, run the following at a command prompt:
#> cat /proc/cpuinfo
It will yield a page of output. The first few lines of output from my laptop are below:
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 15
model name : Intel(R) Core(TM)2 Duo CPU T7500 @ 2.20GHz
stepping : 10
The part you're interested in is the 'cpu family' and 'model'. Once you know those find the corresponding entries on http://gentoo-wiki.com/Safe_Cflags. Then create an entry in $HOME/.bashrc file that looks something like this:
CFLAGS="-march=prescott -O3"
CXXFLAGS="${CFLAGS}"
export CFLAGS CXXFLAGS
Of course substitute the -march value for the one you found on the wiki.
Mar 30, 2008
Cleaning Up Revision Histories
A post in the the bazaar email group described a better approach (than I had been using) to manage merges from personal working branches. For example; If I wanted to commit a change to the project 'Foo', according to the post, I'd do something like this...
$> bzr init-repo foo-branchesWhat I've done above is to first create a shared repository. I do this because I'm going to be working with multiple branches of the same project. Then I branch Foo's trunk into my new shared repository. Next I branch the trunk (that's in the repository) to my personal working branch, make all the changes and as many commits as I want. When I'm done I go back to the trunk. Pull it to make sure it's up to date. Then merge in my changes. Once I've done that I commit them and push them up to the server.
$> cd foo-branches
$> bzr branch http://example.com/foo-trunk trunk
$> bzr branch trunk workbranch
$> cd mybranch
$> # hack, commit, hack commit, repeat as necessary
$> cd ../trunk
$> bzr pull
$> bzr merge ../workbranch
$> bzr commit
$> bzr push
If you're worried about disk space you can remove the working trees for any branch you're not currently working in.
Labels: Bazaar, programming
Inspirational Speeches
My feeds contained a blog post from Sean Tierney in which he links to a couple of excellent speeches, both very much worth taking the time to watch. He also mentions an older post of his about publicly sharing your goals. Which I agree is an excellent idea and easily done with 43Things.com. You can find my recently started list here.
Labels: personal
Mar 25, 2008
Modeling Magic
I never dreamed I'd ever come to find business software an interesting domain to study but that's exactly what's happened.
Like it was for many people, I first got interested in programming because of games. In fact I can trace my interest to a specific event; I was about 10 and I was playing a game on an Atari 400 computer and realized I had absolutely no understanding of how it worked. Prior to that moment I thought there was nothing in the world more complex than a light switch but after that moment I wasn't so sure. I had to learn how it worked; was it magic or a light switch?
Well of course it was a light switch, a gazillion of them all packed on to a chip in fact, but while I was learning that I came to a realization, apparently one all programmers make; The only way to demonstrate your understanding of something was to model it in software.
So now I find myself trying to model business processes but I'm not 100% sure there's not a bit of magic in this light switch.
Labels: business, programming
Before Filtering HTTP Method Types
Previously I wrote the post 'Method Not Allowed' which is about how I decided to handle unsupported HTTP request method types in my actions. Today I realized I should DRY up my code and put this logic into a before filter.
Mar 23, 2008
Bzr to Git
I think it's safe to say that the Rails community has decided git is the distributed revision control tool of choice. Unfortunately for me I've been using bzr for the last year or so. Lucky for me it's easy migrate from bzr to git using svn as an intermediary.
svnadmin create --fs-type fsfs /path/to/svn/project
cd /path/to/bzr/project
bzr svn-push /path/to/svn/project/trunk
git-svn clone -T /path/to/svn/project/trunk /path/to/git/project
Feb 27, 2008
GNU Apps On Windows?
There's a story circulating that Microsoft is going to provide a GNU compatible tool chain for Windows. This would in theory allow pretty much any *nix application to run on Windows with very little or no change.
I seriously doubt there's any truth in this mostly because it would create a horrible rift with their third party developers who'd they'd be throwing to the wolfs, but you never know, anythings possible. There is no technical reason it can't be done. Hell, from Microsoft's perspective, I'd think it would actually be easy. After all both MinGW and Cygwin already provide this functionality. In fact all they'd really have to do is provide a standard re-distributable C library and compiler.
Even though I think it's a bogus rumor I really do hope Microsoft does this. I've always thought it was the one thing they could do that would guarantee them another 25 years of market dominance. In fact it's the only thing I can think of that could buy them enough time to switch away from the "Software As A Product" business model.
They just better hope other people are more forgiving than I am. While I really want this to be true, it makes it easier for software I write to run on Windows, I have no personal interest in ever doing business with them again. Any vendor who doesn't always try and do the right thing for their customers is not some one I want to give money to.
After a decade of bullying everyone in the sandbox it's a bit hard to accept they really want to share there toys now and even worse for them I've come to realize most of the alternatives are significantly better.