When your only tool is a hammer…

As a UNIX systems administrator, I’ve picked up bits and pieces of probably a dozen different programming languages. I try to avoid the programming-language-elitism that I see in other system administrators:

  • “If it can’t be done in <XYZ programming language>, it isn’t worth doing!” (Where XYZ mostly == C)
  • “<XYZ programming language> sucks!” (Where XYZ mostly == Java)

I’m most well versed (I won’t say “skilled”) in Perl and Bourne shell. But some times, another language that I’m not so used to is simply a better tool for the job at hand. So how do I decide which one to use? I have a few guidelines:

  • For quick-and-dirty one-timers, I usually use Bash + sed + awk. I have talked about awk before, but I prefer not to dig any more deeply into it that I have discussed before.
  • Solaris start-up scripts force you to use old-school Bourne shell. Bash won’t work here due to the way Solaris executes it’s startup scripts:

    for i in script1 script2 ...
    do
    /bin/sh $i start
    done
  • Anything that requires arithmetic, processing more than one input parameter, or almost any kind of string comparison, usually gets an automatic upgrade to Perl.
  • Interacting with applications in OS X requires AppleScript
  • Interacting with Solaris/UNIX system libraries obviously requires C. Even though I’m not very good at C yet, some times it is actually quicker for me to get things done with it than with Perl, due simply to the fact that I can call C libraries that I know are already on the system. Solaris has been shipping with Perl since at least version 8, but some modules that I might be tempted to use are only available from CPAN, and thus are not installed on all of my systems.
  • Any thing that needs to run fast is normally C.
  • Most any thing that needs to be written fast is normally Perl when I have a choice.
  • String processing/manipulation is abysmal in C, and I prefer using Perl.
  • Ocassionally, I have been known to resort to doing very demented things like writing Perl code that does nothing except output Bourne-Shell code.
  • Data structures in Perl are abysmal, so anything more complex than a simple array or a hash, I usually revert to C, even if it is more painful to write, it is easier for me to understand.
  • Most any thing that I’m forced to write for Windows is done in Visual Basic Scripting Edition. I prefer not having to do this, and avoid it when possible.
  • Simple web applications might get Perl. Lately, they’re Ruby-on-Rails, which I love.
  • I try to avoid building GUI programs on UNIX when possible. I’ve use Perl-Tk before. I like the look of KDE applications, but since KDE isn’t reliably available on all of my Solaris systems, this isn’t usually a good choice. Writing directly for the X Windows protocol isn’t a good idea. Ever.Generally, I try to make things into web applications to avoid writing UNIX GUIs.
  • GUI programs for OS X can be AppleScript or Objective C/Cocoa. Since I know the Cocoa framework is always there, it eliminates the problems normally associated with GUI programming under UNIX. If only Sun would adopt Apple’s GUI, running on top of a Solaris core, I’d be happy.
  • If the problem is well-suited to an object oriented solution (not all of them are, contrary to what CIS students learn at University these days), I might use Ruby for fast written programs and C++ for fast running ones. I know how to spell Java, and I’m quite fond of the coffee from there, but I don’t know much else.
  • SPARCv9 Assembler: If it can’t be done in SPARCv9 Assembler… Oh who am I kidding…
Published in: on May 19, 2006 at 2:44 pm Leave a Comment

Busy Weekend

It has been a fairly productive weekend. Amy and I did a good deal of much-needed house work, but we got that done pretty quickly. Amy had some Mary-Kay seller come out to the house to do some sort of something.

I took this as an opportunity to run off to Swan Creek Shooting Range for some trigger-time. I put 200 rounds of .45 ACP down-range, and turned my target, a cardboard box with one of those fluorescent targets taped to it, into swiss cheese at about 18-20 yards. The target told a story, and the story was this: “I may not be able to shoot very well, but a have a lot of ammo.”

I had quite a lot ( 8 – 10? ) fail-to-feed-last-round stoppages with both the Kimber and Wilson Combat magazines. The bullets were getting pinned nose-up to the top of the chamber. It seems like it may have stopped during the last 50 rounds or so. That makes a total of 600 rounds through the Kimber. Hopefully it is “broken-in” now, and I won’t see any more.

Grabbed some coffee at Starbucks in Athens on the way. A cup of Italian and a pound of Arabian Mocha Sanai. I really like Yemeni Mokka coffees. No “blends” for me, thank you! I made a pot of it today. The beans were quite oily, and the cup was excellent even out of my cheap auto-drip brewer.

Stopped by and visited my uncle and his family on the way home. I rarely get to see them, but as I was passing by their house on my way home, and they were outside, it would have been rude not to.

Amy and I watched two terrible films. “Jackie Chan is the Prisoner” and “Flash Gordon.” Both of them were absolute stinkers.

We also rented a 10′x10′ storage room to move some of Amy’s school stuff into. We relocated a truck load of boxes from our garage, which will help my state of mind tremendously.

Right now, I’m trying out Fedora Core 5 on a laptop. I’m just curious to see what they’ve changed with this rev. I’ll be happy when either Solaris 10 becomes really useful as a desktop OS (I doubt this will ever happen) or I can get OS X that runs on a Dell.

Today was the first day in two weeks that I’ve been out of bed after 6:00 AM. I slept-in until 8:30. Tomorrow, it is back to 5:30 AM.

Right now, I’m off to read some Heinlein.

Published in: on May 14, 2006 at 8:47 pm Leave a Comment

Thank goodness for the nanny-State of Alabama.

Amy and I went to a local German establishment for dinner on Friday night. It had been a while since we’d been there. We got in the door, and had a table within minutes. Normally, I prefer English, Irish, and Belgian beer styles, but there are some German styles that are quite good, too. Some of them are even unfiltered.

So, the waitress brought us some nice, warm, dark bread, fresh from the oven. There was a little bit of rye in it, but probably not enough to be over powering. Looking at the beer list on the back of the menu, I saw they had Tucher Dunkel. “Ah!” I thought. It would be nice to have a Tucher Dark! So I asked for one.

Turns out, they had to stop selling the Tucher beers because they are half-litres… 16.9 fluid ounces. Nine tenths of an ounce OVER the Alabama nanny-state limit of 16 ounces for bottled or canned beers… Because people might drink too much.

So, instead, I had to settle for Paulaner October Fest (or Marzen if you prefer). Since the Paulaner was on draft, I was able to order in quantities of 14 oz, 20 oz, or 1 litre. I opted for the 20 ounce, thus drinking slightly more beer than I would otherwise would have done with the 500 ml Tucher Dunkel that I wanted in the first place.

Still, the Paulaner matched well with the cucumber salad, pan fried potatoes, and Chicken Florentine I had for my meal. So all was not lost. Nevertheless, thank goodness the State of Alabama was there to keep me from drinking too much. I don’t know what I’d do without them.

Published in: on at 8:26 pm Leave a Comment

Automatic Pistol Caliber .45

In the previous post, my wife is brandishing a Kimber Pro Carry II HD. This is a picture of just the gun, from Kimber’s web site.

This weapon is a direct descendant of the M1911-A1 .45 Automatic that both of my grandfathers carried during the Korean War. This basic design was adopted by the US Army in the year 1911. That was almost a hundred years ago, for those counting along at home.

During this time, there have been some minor changes here and there, but for the most part, this gun operates exactly like the ones they used. Most people who know me, know that I am an absolute sucker for a classic-made-modern. Just look at my affection for UNIX operating systems. 1911 pistols fit that bill nicely. I’ll post more about 1911s later, when I get some time.

Published in: on May 12, 2006 at 10:28 pm Leave a Comment

So charismatic/With an automatic!


Notice that my soon-to-be-well-trained wife has her index finger off of the trigger until she is ready to fire.

And YES! She is wearing ear plugs! You can’t see them well because this picture was snapped with a camera-phone.

Published in: on May 6, 2006 at 9:37 pm Leave a Comment