Build a Development Infrastructure…or buy a Mac

Disclaimer: Let me start out by saying I am not anti-Mac. That being said, I am very pro-Linux. I am not a Dell lover either. I just picked them for comparison.

As a web developer, I have found it extremely beneficial to have access to my own servers for development purposes. I have my own infrastructure for version control. I maintain my own DNS servers and can quickly provide access to a temporary site for clients.  While developing TheBigFork, I developed several long-running data cleanup scripts. These would not have been possible without an always-on server to do the work.

Great. So, what does that have to do with buying a mac? Nothing, really. I recently have become aware that more and more web developers (especially Ruby developers) are developing on a Mac. Frankly, I don’t get it. I’ve tried it, and it doesn’t come close to developing on Linux. But, that’s really a discussion for another day. This article is about price.

I compared the price of a MacBook Pro 17″ 2.5 gHz notebook with a collection of Dell machines. The MacBook is listed at $2799. For that much money, you could buy:

Seven Dell Vostro 200 desktops with a 20″ widescreen display and a 250 gig hard drive. These come with Windows XP, but you can easily reformat it and install Ubuntu or Fedora. Doing so opens up a whole world of freely available open-source software. (And, don’t argue that Linux isn’t ready for the desktop. If you can switch from Windows to Mac, you can easily make the switch to Linux.)

With 7 computers, you can hire a receptionist, bookkeeper and project manager and still have a few extra machines for some junior developers. Granted, these aren’t the most powerful machines out there and they probably aren’t worthy of acting as a server–unless you’re desperate.

Here’s another scenario. Buy a Dell PowerEdge 840 server plus a Dell Precision T4300 workstation (which alone rivals the macbook’s specs). The only problem is, you’ll have almost $1400 extra. I guess you’ll have to buy a Dell Latitude D830 laptop for working on-the-go, and a second 21″ monitor for your workstation. Wait–you still have extra money. So, grab a Vostro 200 from the previous scenario. Now you have four machines: a server, a high-powered 64-bit workstation, a nice notebook and an extra desktop for your assistant.

If you really need a laptop with more horsepower than the MacBook, just get the Precision M6300 mobile workstation instead of the workstation and notebook above. You’ll still have enough for a server and the spare desktop.

Finally, if computers aren’t your thing, put a down-payment on a nice new car!

Bottom line: Macs are very nice. To me, they are simply not worth the extra cash–especially when you have work to get done.

In case you’re wondering, the best Ruby IDE that I’ve found is Aptana Radrails which runs poorly on Mac and excellent on Linux. Textmate is the Ruby IDE of choice on Mac. I found it lacking in features and difficult to use.


Converting DivX files to mpegs for an NTSC DVD


You have a bunch of DivX avi files and want to put them on a DVD for a friend. The friend wants to play the final product on a DVD player (not on a PC).


Believe it or not, my first inclination was to fire up my old Windows XP computer because it has all of the Sony programs on it–including DVD Architect. To make a long story short, Windows proved itself once again as an inferior system. The DivX files have to be converted to mpeg. I tried several converters which ran for hours at a time. I finally had 3 converted files ready to burn. I thought everything worked fine until I played the DVD on a machine. It looked horrible and skipped a lot…unacceptable.

Fortunately I have Linux which helped produce a much better final product. My originals were all 16:9 widescreen, but I wanted to make them work on a 4:3 system. After installing ffmpeg (on Fedora, do this: sudo yum install ffmpeg -y), here is the command I used to do the conversion:

ffmpeg -i originalfile.avi -target ntsc-dvd -aspect 4:3 -s 720x400 -padtop 40 -padbottom 40 outputfile.mpg

Looks hairy, but it works well. I discovered the actual size of my original files are 720×400 by looking at the output of ffmpeg. So I kept this size and padded 40 to the top and bottom to create the letterbox. For reference, here some sample output from ffmpeg:

Seems stream 0 codec frame rate differs from container frame rate: 30000.00 (30000/1) -> 23.98 (24000/1001)
Input #0, avi, from 'filename.avi':
Duration: 00:44:12.1, start: 0.000000, bitrate: 1239 kb/s
Stream #0.0: Video: mpeg4, yuv420p, 720x400, 23.98 fps(r)
Stream #0.1: Audio: mp3, 44100 Hz, stereo, 112 kb/s
Output #0, dvd, to 'filename.mpg':
Stream #0.0: Video: mpeg2video, yuv420p, 720x480, q=2-31, 6000 kb/s, 29.97 fps(c)
Stream #0.1: Audio: ac3, 48000 Hz, stereo, 448 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Press [q] to stop encoding

Then I decided to wrap it in a little perl script so I could do all 24 of the files without sitting around watching the progress:

$dir = '/home/adam/';
opendir(DIR, $dir);
@files = readdir(DIR);
closedir DIR;

foreach (@files) {
next unless $_ =~ m/^([\w\.]*)\.avi$/i;
# This should all be on one line...
print `ffmpeg -i $_ -target ntsc-dvd -aspect 4:3 -s 720x400 -padtop 40 -padbottom 40 -y $1.mpg`;

As usual, this is mostly for my reference, but maybe somebody else will also find it useful.