At my office there’s a setup like you’ve seen a thousand times. A conference table with a screen, desks for everyone and an old computer, in this case a Mac Book, connected to a home stereo with speakers large enough to fill the development space. I’ve been using Screen Sharing, but find it unreliable and bulky most of the time. I wanted something simple to change the volume from my desk.
You may remember my recent article about running commands across a number of hosts with SSH and BASH. Then there was my second review of Fabric, where I mention my ‘dream’ to write a similar system in BASH some day. I’m slowly getting better with BASH and recently I’ve been working on mastering redirection and sub-shells. Well I’ve got another nice parlor trick to share with you!
I’ve been using Fabric for a couple of months now. Before that I took a quick look at Capistrano. Sometimes I have a simple task I want to do on a few servers, and I don’t feel like touching either one of them. We’re talking about those times where you’d almost rather login to every box and run the commands by hand. Good news is before there was Python or Ruby, there was BASH!
Since I’ve been using Fabric for over a month now, and working with BASH a lot lately, I realized one reason why Fabric might be slower than alternatives like MCollective and pexpect. Fabric executes each run invocation through a separate ssh connection. By combining a set of run calls into a single command and one run call, the same Fabric script can run much faster.