Portforw

One of the things I coded in Perl a while ago that I was planning to port to Ruby at some point was a little port forwarding utility called portforw (GPL license). I provided a link to download it here because perhaps you may find it useful, too, if you also need such a utility. I consider it moderately well written—I can be somewhat proud of it and somewhat embarrassed by it at the same time. I was going to clean it up when I made the Ruby port (which at one point I wrote quite a bit of code for, but now it languishes).

Portforw does what it sounds like: it forwards connections from one place to another. But simply forwarding connections is not the limit of portforw’s abilities; if connection forwarding was all I needed I would have used the port redirect feature with some host-based firewall software. Portforw also filters the data as it passes through, allowing it to pass connections through different kinds of proxies.

Read the rest of this entry »

Knowing Ruby and Perl

I came upon a startling realization today after reading some feedback from an anonymous source regarding my previous post:

Your complaint about being unable to write code the way you’re used to with Ruby when picking up Perl for a hours seemed pretty thoughtless. Of course it’s harder for you in Perl — you don’t know Perl nearly as well as you know Ruby! Claiming that this is somehow a fundamental flaw of Perl is just not right.

I meant to suggest in my previous post that the flaw was in me for no longer thinking in Perl when using Perl, though at the same time if Perl were to better support DSLs (domain specific languages) then I would have gotten a Get-Out-of-Jail-Free Card despite my mis-think. I hope that others reading this benefit from the clarification as well.

Read the rest of this entry »

Back to Perl

In my day job I spent a few hours today working in Perl. Having been using Ruby for over six years now I am quite familiar with how lacking Perl is in comparison. However, once again I was floored by how much less intuitive things are outside of Ruby. Even though Perl is a great language, having tasted from much better nectar makes it harder to appreciate those great strides Larry Wall made in the language.

What kind of things were not so intuitive? In my program today I had a situation where some questions need to be asked of the user. I wanted to use a DSL (domain specific language) to handle the querying because I need to create about a dozen similar programs that all do things just a bit differently. To facilitate this I abstracted as much common code as possible into its own class, threw it into a Perl module file, and made it available for all the programs to use.

Read the rest of this entry »

Capistrano and Administration

Know what Capistrano is? I did a presentation on it in February, so I know a little about it. At the time I was investigating it as a hopeful candidate that could assist with configuration management for general systems administration for an environment of about 150 Solaris systems. I discovered that Capistrano is a fantastic program and a great tool for application deployment. Honestly there is no reason you should ever put up with the act of moving an application to production being more than a few keystrokes, and using Capistrano makes that possible. However, Capistrano was unable to help out such a large Unix environment.

Capistrano has no facility for continuing tasks upon failure. In a large Unix environment, stuff needs to happen even if only 98% of the systems are up. What about the 2% not available? They can get the update later when they’re back. We needed a tool that can just do the work and get it done on the 98% and report on who failed. Later, when the failed systems are back online, the tool should automatically update them on the next run. Then we can go about fixing the issues causing those 2% of systems to fail and rest assured that all our changes will be pushed soon.

Read the rest of this entry »

Ruby, Rails, Applicaton Security, and more!

I’ve decided that cosine.org should be dedicated to my favorite computer topics: Ruby, Rails, application security, and OpenBSD. This is all awesome stuff. Stuff that is awesomely interesting to me. However my level of knowledge in these topics varies a bit, and it creates a perplexing situation for me.

Read the rest of this entry »