Wednesday, June 17, 2009

The unfurl Script

I am ashamed to say that I recently fell victim to a rickrolling prank, because the not-so-innocent URL was given to me by someone I know.

Then I came across the furl utility (easily installed on my systems using MacPorts), which gave me an idea.

From now on, when I see another such URL, I will just run a simple unfurl script to unroll it. The script simply does the following:
    furl http://tinyurl.com/n2o29e \
| grep -e "^Location"
There! Short and sweet.

Now if someone can come up with a system utility, iChat or browser plug-in that can unroll the URL for me, or perhaps if such a thing already exists, please let me know.

Friday, June 5, 2009

Freeciv Packaging Troubles

I have been having increasing issues in maintaining my Freeciv package.

Recently, when I upgraded my MacPorts installation along with all my ports (which I have neglected to do so for 12+ months), things have changed sufficiently to have broken my current process, beyond my ability to rectify.

This means until I figure out a way, there will not be any forthcoming Freeciv packages from me.

In the meantime, for those of you who have wrote me indicating interest in compiling Freeciv for yourselves, the easiest way to get going would be to install it using MacPorts .

Good luck!

Monday, December 15, 2008

Faster New Terminal Tab/Window Scripts

Reader Eric Allen commented on a shell script he's written to create new terminal tabs in Leopard faster. Very cool.

Thanks, Eric!

Friday, December 5, 2008

Passenger Rocks!

I am referring to, of course, to Phusion Passenger, a.k.a. mod_rails.

Prior to using Passenger, I had been serving up a Rails web application I've been working on using mongrel. However, I am anticipating more people hitting it (compared to just me and one other person), so I thought it's time to move up to something more robust.

The server platform I am using is the latest version of Tiger (client edition). I already have MacPorts installed in order to get Ruby and Rails. So, after installing Apache 2 using the port command, I simply followed the instructions on Passenger's web site and installed the passenger gem and the Apache module, and was serving up my application via a sub-URI in very little time. This is significant because I am not very versed in Apache configuration!

One suggestion. If you are using Tiger, don't bother following the link from the Passenger documentation to some guy's blog about setting up Passenger for Leopard. Just stick to the official docs.

As for performance relative to mongrel, it remains to be seen when the app is under some load. But when I first practiced this on an ancient 400MHz G4 running Tiger, I noticed a 2x jump in performance. That is, Apache2+Passenger with one user hitting the server is able to serve up pages twice as fast as a single instance of mongrel (using the -d -e production flags) with only one user. The same can't be said of the actual deployment machine, both serving methods yielded similar times for the one-user test.

Furthermore, after I figured out the deployment steps, I wrote a simple Python script to automate it. Yes, I know I can use capistrano. But my deployment scenario is to simple right now that I simply don't need it.

One note on deployment. After you execute sudo apachectl start (or restart), it takes a long time to load the first page. That's probably when Apache is loading stuff into memory. After, it's all good. So I added a curl command as the last step to my deployment script to kick-start things.