What nginx + passenger means to the rails framework


Written on April 29, 2009 – 6:50 pm | by admin

I work for <insert large managed hosting provider specializing in rails deployment here> and I had the good fortune of getting to play with nginx + passenger before its recent release. This gave me some time to think about how completely it integrates into my deployment stack many weeks before it was publicly released. I've also been doing a lot of theorizing about what it means for the ruby development frameworks.

The release of Apache Passenger was met with tepid response  amongst  colleagues at my aforementioned employer. This was because of the dependence on Apache which we do not support nor care to include in our stack. What this meant is that hosting companies, many of whom are dropping the ball and being slow to respond to this technology are now able to provide easy to maintain rails/rack/merb (I know, all really the same thing now)  solutions for shared hosting platforms.  The fact that many of them are not yet using passenger is mind boggling to me but that is a rant for another post.

So for almost a year, large hosting companies with entrenched Apache solutions had the opportunity to take over a good portion of the rails hosting revenues currently being paid to managed or self managed rails friendly hosts with  solid rails stacks built on nginx. With how many calls and emails I get every week from people looking for solid Rails devs I feel that this has to be a significant figure. The good news for companies like my employer is that most hosts seemed to have missed out on this opportunity. Nginx + Passenger has arrived and I think that this is big news.

What this means for the future of rails is that as other hosts come around and start providing passenger as part of their Apache install we will see more LAMP, Java and other platform developers willing to give rails a test spin. This means that the ruby community is going to grow via the rails community, the talented codemonkeys on the other side of the fence are going to start moving over some of the ideas that have grown out of their pain and we should see a continued and steady growth and innovation in our corner of the industry.  It also means that the current rails expert companies have time to maintain their status as premium rails hosts by adapting to passenger and properly integrating it in to their stack before there is major competition from other hosts. So the companies that drive ruby development are going to continue to do so. The companies that don't have rails experience have no excuse to not get in to the game now.  Your major rails clients will eventually outgrow you and come to us but you have no reason not to give them an inexpensive platform to start on.

This future works in  favor of all involved. It allows startups to leverage ruby for their needs and find inexpensive "point and click" hosting providers for their incubation periods. It allows major Apache based hosts to get into the ruby game without much effort on their part and it allows the "expert" rails companies embracing nginx to start talking about further innovation and stop talking about the pain of managing deployments.

Tags:

My take on the Mac OS vs. Windows argument


Written on April 14, 2009 – 2:17 pm | by admin

I have worked with, networked together, programmed, repaired and played on computers for the better part of the last two decades. While this by no means makes me an old wizard, it does mean that I should have something to say about why I might prefer one platform over another. It has been part of my job since my first IT position to advise people about what technologies they should be using to get the job done and I do have a few things to say on the matter. The bottom line is that it really has nothing to do with
Apple Vs. Microsoft anymore. Mac OS is a desktop client version of Unix. Apple has succeeded in creating what is probably the first commercially successful desktop pc that runs Unix and this means a lot. It is now about Windows Vs. Unix and its cyberpunk cousin Linux.

Security: Unix was born to facilitate hundreds or thousands of users or network connections and had begun to be battle hardened long before Windows decided to release its first networking edition. If you'd like some historical perspective you should read The Cuckoos Egg, by Cliff Stoll.  The truth is that the Unix operating system model was created for the very kind of computing we do today. The protocol we use to transmit data packets back and forth (TCP/IP) was developed on Unix environments for what we now call the Internet. Almost anyone using a computer is accessing a loosely connected group of services that could be hosted anywhere in the world. Windows was created to be a standalone operating system on a single PC and the explosion of the internet has meant that it has been trying to adapt itself to a new use model for almost two decades.

Usability: Apple did not make a better operating system. They took a more functional and secure operating system that already existed and made it more usable. By starting with a solid platform Apple was able to focus on aesthetic and that is really what they are best at. It seems that they already know they have a solid platform so they spend more of their time making it usable and friendly whereas it seems that Microsoft has been concentrating on putting a new coat of paint on the same old user interface elements. I have not seen anything in the windows platform that I would consider an innovative direction in user interaction since going from windows 3.1 to  windows 95 and that was almost 15 years ago. They did have a few bug light* features in vista similar to the expose feature in mac OS X.

Resiliance: Unix is built upon a much simpler and obvious architecture than windows. Look no further than the Windows Registry and you should see my point. Its a pretty good rule of thumb that the less moving parts something has, the less likely it is to break. In this case simpler is better.

Perception: I've spent quite a few years of my life in colleges and universities and I've found that nowadays academics seem to use linux/mac to an overwhelming extent. I've also seen IT managers at some of the more progressive firms say things like  "I expect a pro to use the best tools and that means using Mac OS". I've seen plenty of flikr shots of someone from microsoft doing a presentation from a mac book pro, and while this is by no means proof of anything it does go a long way towards buidling up the perception that Apple makes better computers.

Personally I do not believe that apple makes better computers but they do make computers, microsoft does not. Apple markets its computers and its operating system as a lifestyle and a lifestyle choice. They have made themselves a symbol of an open mind and a thick pocket book and these are not misconceptions. Their computers are high end and It takes an open mind to break out from the norm. Windows was the norm and every time someone switches over they are being open to the idea that there might be something better out there.

Unfortunately this latter point is probably what drives sales and the real importance of a good computing foundation is being lost on most of the folks who buy computers. Windows came from dos and there are quite a few lines of legacy code in there from its grandfather. Mac OS came from Unix and there are quite a few lines of legacy code in there from its grandfather.  Remember that the apple doesn't fall far from the tree.

*things that make you say ooh and ahh but zap you when you get close to them

Tags: , , ,

Bash Primer for Beginners


Written on April 12, 2009 – 4:11 am | by admin

If you are working with OSX or *nix flavored systems and you are not already automating mundane tasks with bash or some other scripting language than you must enjoy repetition.  I migrated over to OS X a few years ago and although I had been integrating Linux and Apple Operating Systems into the Windows networks I was running It wasn't until I finally made the switch for personal use that I saw the light. The power of the various *nix command line interpreters and shell scripting environments makes it tough to ever look back. I'll be adding to this primer over time but I'm basically doing it to remind myself to stop wasting my own valuable time on simple repetitive tasks.

Available Libraries: Inside of your bash scripts you have access to anything you can type at the command line regardless of their underlying language. Commands like 'ls' (list all files in a directory) and 'grep' (regular expression parser) are available to you in your scripts.

Where to put your scripts If you define a set of functions in a file you can load them in to your environment at any time by calling 'source script_name' but you will most likely want to source them in your profile configuration (.profile, .bash_profile, or .bashrc) depending on how your environment is configured. You can store a bunch of scripts in one place with any extension you'd like but sh is common (script_to_run.sh) and add that location to your path variable. You can also run a script from within its directory with

 ./script_to_run.sh param1 param2

Note that you must change the permissions on your script to make it executable.

chmod +x script_name.sh

Shebang Line : Tells the operating system where to find the command interpreter, Make this the first line of your script

#!/bin/bash

Standard Output Send the text 'Hello World' to the screen

echo Hello World

File Output output to file puts the output of the function helloWorld into the file hello.txt the file will be created if it does not exist

 helloWorld > hello.txt  #overwrite file with output
helloWorld >>  hello.txt #append output to file

Variables Standard assignment syntax, prepend with $ to retrieve

#assign like this
VAR=5
#access like this
$VAR

Functions : Simple function syntax you can pass parameters in to this function and they are available as $1, $2, etc...

function helloWorld(){
  #for example 'helloWorld earth' would have the string 'earth'
  #available witihin the function as $1
}

Pipes '|' : The pipe character will take the output of one operation and pass it in to another. The following line will take the output of the ls command and 'pipe' it into the grep command returning only items in the ls output that match the string 'world'

ls -la | grep world

Tags: ,

Show hidden files in finder in OS X


Written on April 11, 2009 – 8:07 pm | by admin

Every once-in-awhile I'll want to be able to view hidden files in the finder. You can google this problem and you'll find a lot of people with the same answer pop up your terminal and enter  "defaults write com.apple.finder AppleShowAllFiles True". The issue is that every time I need this I google it again because I just don't do it often enough to remember the syntax.  So I found it useful to create a bash function called showFiles that takes either True or False.

  1. #expects $1 to be either False or True
  2. function showFiles(){
  3.  
  4. defaults write com.apple.finder AppleShowAllFiles $1 && killall Finder
  5.  
  6. }

Now you can do 'showFiles False' or 'showFiles True'. I'll admit there are very few reasons to do this if you are proficient at the command line. Sometimes I feel like being lazy and now you can be lazy too.

Tags: