Archive for October, 2007

Dear NETGEAR: Why is your router so flaky?

Tuesday, October 30th, 2007

Dear NETGEAR technical support department:

Several features of my (very new, purchased in the last month and a half) NETGEAR WGR614 v7 home wireless router appear to be either quite simply non-responsive to any configuration changes that I make in the web-based configuration screens or so flaky that they are all but useless. Specifically, the following list of issues are presenting themselves.

  • Ports that are configured to be forwarded via the router are not actually being forwarded, despite appearing in the WGR614v7’s list of “services” and appear in port scans as closed or filtered ports.
  • Changing the WAN-side ping response configuration option does not alter the device’s WAN-side ping behavior. That is, if it is originally set to respond to WAN-side pings and then switched so that it will not respond to the same, the router will continue to respond to WAN-side pings despite the setting’s appearance in the configuration screens.
  • Setting a default DMZ host does not actually allow that host to see all WAN-side traffic, evidenced by a simple traffic capture log.
  • I’ve only tried the above features, but the theme is consistent: making a configuration change does not change the behavior of the router. Neither power cycling the device nor any amount of hitting the “save” buttons commit changes.

    What’s most furstrating, however, is that at some seemingly arbitrary point, the configuration changes finally do stick and the router’s behavior aligns to the display of its configuration screens, at which point port forwarding, WAN-side ping, and the DMZ host all behave as expected. However, this can take anywhere from an hour to several days, and then, again at some seemingly arbitrary point, the router’s behavior reverts to whatever it was before causing port forwarded routes to time out and WAN-side ping to be re-enabled, etc.

    I’ve run through the usual troubleshooting steps that I know are common to all devices: checking for new firmware (the device claims it is up to date while using firmware version V2.020_1.0.20NA), power cycling the device, and reverting back to factory default settings. None of these actions have improved the situation any.

    Your prompt assistance increasing the reliability of my WGR614v7 NETGEAR router is much appreciated.

Sincerely,
-Meitar Moscovitz

Why isn’t skill development a primary focus for employers?

Monday, October 29th, 2007

There is always a ton of discussion about the business of programming by programmers and project managers alike. Of course, there are always (at least) two sides of this coin: the programmer and the client. For employed developers (such as myself), the client is typically also the employer, and this creates a situation that is extremely treacherous. A similar situation exists for system administrators—I know, I’ve been in that situation, too.

It’s frustrating that people’s lack of understanding about the various computer industries leads to situations that affect so many innocent bystanders. The fact that computer programmers and sysadmins (in the US) are currently considered ineligible for overtime pay because “all they do is implement someone else’s desires”, even though every computer professional knows how much independent thought and judgement is required in their everyday jobs to produce a quality result, is a classic example of this. (How sad is it that we actually have a “classic” example, by the way?)

In a recent post by Greg Jorgensen over at the Typical Programmer blog, Greg cites Joel Spolsky (programmer extraordinaire), as saying that working ’til midnight is a sure-fire way to get software projects to fail. However, while this is certainly sound reasoning as far as I can tell, what’s even more frustrating to me than being made to work long hours is having my desires for learning and skill development brushed off and made less important than the project deadlines.

Joel says that the first thing you can do to destroy the hope of a successful software project is to hire mediocre programmers, instead of the best ones. Greg makes the good point that we were all mediocre programmers once. How did we get better? Greg says,

The best way to use the people on the team and to help them gain experience is to have them work together as much as possible. Even without keyboard sharing it’s better to have programmers mentor and learn from each other than to let each carve out a domain no one else understands.

And indeed, search the job listings on any career search board and you’ll see companies trying to sell themselves to you in exactly that fashion. But once you’re hired, it’s often a very, very different tune. Suddenly your interests in skill development take a back seat to project deadlines, tight schedules, and more work. This is all, of course, understandable to some degree, but as an all-encompassing truism that provides no wiggle room, I can’t tolerate it.

What irritates me even further is that companies and recruiters only seem to seek the already-skilled. I may be fortunate to be on this list for some skills and so am thankfully not living on the street, but I know better than most that I am not a world-class programmer or an exceptional system administrator. Frankly, I think I am a mile wide and an inch deep in most of the things that I know. Thus, it is irritating that this isn’t seen as a skill when, in fact, it is the one thing that has given me the most success: my speciality is being a generalist, and my ability to learn new technologies’s baseline quickly is what’s enabled me to hold so many different kinds of tech jobs.

And why have I held so many different kinds of tech jobs? Because not a single job I’ve ever held has actually encouraged me (except on my own time, as opposed to on the company’s dime) to broaden my skill set. Frankly, broadening my skill set is why I like to work. And having employees who like to work seems like it would be good for business.

So why is skills development only paid lip service by every company I’ve ever worked for?

Political crazies

Thursday, October 25th, 2007

Things that are absolutely nuts:

In completely unrelated news, maybe here’s why I’m such a pessimist.

No-Framework Ruby on the Web using eRuby on Mac OS X

Thursday, October 25th, 2007

I have a suspicion that there are a lot of web developers out there who, like me, are eager to start learning more about Ruby but who are stunted by the incredible amount of unfamiliar conventions that are used in Rails. For many of us, our first introduction to Ruby was (or is) through Rails and the challenge of learning both Ruby and Rails at once should not be underestimated; frankly it’s damn hard.

Thankfully, there’s an easier way. Especially if you’re accustomed to “old-school” development workflows that you learned through, say, PHP or perhaps Perl scripting, then ditching Rails and starting purely with Ruby might be the way to go. Doing things on your own without the “magic” of Rails will let you learn Ruby in a simple, yet fully-featured environment, much like the way you might have learned classic CGI programming.

Specifically, by using eRuby, the Embedded Ruby interpreter, you can make Ruby web development feel just like PHP development. Install it, upload an HTML file with some embedded Ruby code in it, and—voila—you have a single-page web application.

Why this tutorial?

Hivemind’s Getting Started with Ruby on the Web is an excellent resource that described this process from start-to-finish for Windows users. In fact, it was after finding that article that I realized web development with Ruby didn’t have to be governed by Rails and, being a web developer like the authors of Hiveminds, I wanted an easy way to use my Ruby knowledge on the Web.

However, I couldn’t find any similar tutorial or walkthrough for those of us who use Macs. Even the Linux walkthroughs are lacking (or at least my Googling skill for them is). After spending a little while successfully getting eRuby set up on my Mac running Mac OS X 10.4 Tiger, I thought I’d share what I learned with others, so I wrote this article. Its content mirrors the one from Hiveminds to a great degree but focuses on getting eRuby installed on Mac OS X instead of Windows (obviously). I imagine these instructions should be pretty similar if not identical for any other *nix-like platform.

The Setup

Getting eRuby installed and configured with your web server is actually pretty straightforward and won’t take an experienced web developer much time at all. All we’re going to need is the Apache web server and the Ruby programming language to start, both of which are already pre-installed on Mac OS X 10.4 Tiger. (And in Mac OS X 10.5 Leopard, Apple is even shipping new Macs with Ruby On Rails preconfigured, but that’s a subject for another time.) However, Apple typically ships an older copy of Ruby than is readily available, so you might choose to use a newer version of Ruby that you download yourself.

The easiest way to get a copy of eRuby (and an updated Ruby, if you want it) is with a package manager such as MacPorts. With MacPorts installed (which is a simple, standard package installation downloadable from the MacPorts home page), simply run

sudo port install eruby

from your terminal to download the latest stable Ruby and eRuby in one fell swoop. After this runs, you’ll have a new Ruby in /opt/local/bin/ruby and an eRuby in /opt/local/bin/eruby. Alternatively, of course, you could compile and install eRuby yourself. Instructions for that are on the eRuby homepage.

As a quick test to see if everything is installed and working correctly, create a plain text file with your favorite editor that contains the following code:

Hello world! The time is now <%= Time.now %>.

All this does is print out a “Hello world!” greeting and then announces the current time (as reported by your system clock, of course).

If you named the above file helloworld.rhtml then you can feed this file to the eruby interpreter as follows:

eruby helloworld.rhtml

Note that the file extension doesn’t actually matter. You could use .erb, if you like, or any other arbitrary file extension. The file extension is, as you’ll see later, only used for telling Apache which kind of file it is. So once you come up with file extension you like, stick with it. The standard file extensions are either .rhtml or .erb, so I’d recommend using one of those. (I prefer .erb, myself, since I don’t necessarily only want to create HTML pages. I might want to create XML documents like news feeds or even XML databases, so .erb seems a more reasonable file name extension, though most of the eRuby documentation uses .rhtml.)

If things worked properly, you should see output similar to the following:

Hello world! The time is now Wed Oct 24 21:58:54 -0400 2007.

Serve it up!

Now that eRuby is installed and working, the next step is to set it up as a CGI so that when your web server (Apache, in my case) fetches the file it will first feed it through eRuby for processing before sending it back to the browser. The simplest way to do this is to configure Apache to use a specific directory somewhere on your filesystem as a CGI directory—that is, a directory whose contents are all treated as CGI programs. You do this via Apache’s ScriptAlias directive.

Conveniently, standard installations of Mac OS X already come with a CGI directory. It’s located at /Library/WebServer/CGI-Executables. This directory is just like any other, except that Apache treats it specially. It treats it specially because Apache’s configuration file, /etc/httpd/httpd.conf contains a line of text that reads as follows. (On a standard installation of Mac OS X client, this is line 671 of the file.)

ScriptAlias /cgi-bin/ "/Library/WebServer/CGI-Executables/"

This line basically just tells apache, “Treat every file in the /Library/WebServer/CGI-Executables directory as though it were a CGI program.” So, since that’s how we’re treating eRuby, we’re going to want to put our eruby binary in that directory. However, we don’t actually want to make copies of the binary. Having too many copies of a program on your system can easily get confusing. So instead, we’ll make a symbolic link (or an alias to use the classic Mac terminology) to the binary.

ln -s /opt/local/bin/eruby /Library/WebServer/CGI-Executables/eruby

With our eruby CGI executable in the proper place for Apache to find it, we can now tell Apache which files we want it to send to this program. We do this using the AddHandler and Action directives.

AddHandler simply tells Apache to treat files with a certain extension in a certain way. For instance, you can say something like, “Treat all files ending in .php as PHP scripts.” Similarly, you can (and will) tell Apache, “Treat all files ending in .rhtml or .erb as eRuby CGI pages.”

To do this, we add the following line to our /etc/httpd/users/username.conf file somewhere inside the <Directory> and </Directory> block. Naturally, replace username with, of course, your Mac OS X user’s short name:

AddHandler rubypage .erb .rhtml

Again, this just tells Apache that files ending in .erb and .rhtml should be treated the same way other rubypages are treated. But how are eRuby pages supposed to be treated? They’re supposed to be handed off to the eRuby program, of course, so we need an Action directive that applies to the rubypage handler we just defined.

Right below the above line, add the following line, too:

Action rubypage /cgi-bin/eruby

This line tells Apache that any file that it is treating as a “rubypage” file should be sent to the program at the URL accessible at /cgi-bin/eruby, which we’ve defined earlier to be our symbolic link to the eruby interpreter.

Your completed user-specific Apache configuration file should now look something like this:

<Directory "/Users/username/Sites/">
…
    # Let eRuby files get parsed through the proper CGI binary
    AddHandler rubypage .erb .rhtml
    Action rubypage /cgi-bin/eruby
</Directory>

Are You Being Served?

That’s it, everything should now be in place. To make sure, move your earlier helloworld.rhtml file into your user’s Sites folder, and now simply point your browser to http://localhost/~username/helloworld.rhtml (again, replacing username with your Mac OS X user short name, of course). Congratulations, you’re serving up Ruby-coded applications via eRuby.

Additional Reading

This is just the set up, of course. Now the real fun begins: learning Ruby. Here are some suggested places to start.

Naturally, feel free to leave comments if you have more resources that you found helpful.

I’m ahead of my time (again)

Wednesday, October 24th, 2007

WordPress Collapsible Archive Widget 2.1 BETA with Collapsible Month Lists

Tuesday, October 23rd, 2007

I went searching for a WordPress widget that enabled me to place a collapsible archive control much like the ones available in Blogger blogs “archives” widget a while back. With a little googling, I found a plugin that did almost exactly what I wanted in Ady Romantika’s Collapsible Archive Widget.

After a few days of playing with it, I had a working copy that reproduced the original behavior or, optionally, exposed each month’s individual posts inside each month’s own collapsible list.

The patch I submitted to Ady is still awaiting integration with the main plugin, so in the meantime you can download the plugin here.

The full description follows:

Collapsible Archive Widget 2.1 BETA is an update to the Collapsible Archive Widget for WordPress that includes a new option in the widget’s settings page that allows you to display links to the individual posts inside each month. With this setting activated, the year is expanded by default to show a list of months. Each month is another list, collapsed by default, that expands to reveal the individual post links.

Update: A new version of the plugin that incorporates the options I’ve added can now be downloaded from the WordPress plugin directory.

Everyone’s failings

Friday, October 19th, 2007

One of the patterns that has always been supremely obvious in my life (to anyone who has bothered to look) is that when I am depressed or upset I will often withdraw towards the things that give me comfort and that these things have typically fallen into one of two categories:

  • Creative but non-technical pursuits (e.g., writing, philosophy, social theory)
  • Knowledge-seeking activities, typically very techical ones (e.g., computer skills of various kinds, histories or scientific studies)

What is amazing to me is the sheer enormity of the number of people who have (or have had) authoritarian figures in my life in some capacity or another (e.g., parents, school teachers, employers, administrative personnel) who have completely missed this whole point and, associatively, everything it explicitly means and implies.

This makes those observant enough to notice it that much more valuable, and, sadly, makes me that much more upset when I fail to take advantage of such valuable resources in my life.

The 10 Geekiest Leopard Features I Will Probably Love

Thursday, October 18th, 2007

This is already horribly old news, and by old I mean several days ago since that’s about as fast as it takes technology news to grow old, but Apple is releasing Mac OS X 10.5 “Leopard” at the end of this month. Apple is calling this release a “major upgrade,” and indeed Apple has rarely made its users wait so long between operating system releases as they have done between Tiger (Mac OS X 10.4) and Leopard. So, I’m already excited.

But then today I was glossing over Apple’s featured features list and I got even more excited. There are the usual, largely meaningless, fluff updates that are nice for Joe Schmo or his mother, but that power users simply don’t care about, like the new iChat support for animated buddy icons, but the list is also chock-full of really cool, really useful features.

What’s interesting is that a good deal of these features aren’t really new features at all. For instance, if you knew how to manipulate the NetInfo database on your Mac, you could already share any folder via Apple’s “Personal File Sharing” feature. (Here’s a Mac OS X Hints hint explaining how to do it.) In Leopard, however, Apple claims that this functionality is now integrated straight into a folder’s Get Info… window. If it works as smoothly as Apple claims, this is finally going to bring Mac OS X (client) into decent competition with Windows XP Professional in terms of GUI-level power-user features.

However, while all of these features are really cool, here’s a list of the ten geekiest features I will probably absolutely love, for one reason or another.

  • Ruby on Rails, out of the boxThe hot thing in web development right now is Ruby on Rails. Macs have already been the best personal desktop and web development platform because they have built-in support for the Apache web server and a host of other features, but now they will come with a ready-to-roll installation of Ruby on Rails, sporting Mongrel and (better yet) Capistrano! Specifically with the addition of Capistrano, which is terribly undersold as simply a Ruby on Rails deployment platform, these UNIX-y “toolbox” items are bound to make Macs that much more useful right out of the box.
  • Safari’s full history search — As their recent public partnerships with Google have shown, Apple is very clearly invested in search technologies. Spotlight gets a huge number of improvements in Leopard, but none which I think are going to be more useful to more people than this one: spotlight searches on the full text of each web page in your visited history list. That’s just awesome. Also awesome: using spotlight as a calculator and as a dictionary, which also shows just how Google-like Apple is trying to be. (Google also lets you ask it arithmetic questions and a dictionary.)
  • Wikipedia articles in Dictionary.app — I love Wikipedia because it’s one of the fastest ways to get (relatively) reliable information quickly. Now that Dictionary.app has built-in integration with Wikipedia, imagine the possibilities for getting that knowledge instant-gratification craving fixed. Apple has not yet announced this capability, but I can easily envision a scenario where all Cocoa text fields are instantly “wikified” (with text that matches Wikipedia articles highlighted) much in the same way that current Cocoa text fields allow you to right-click on a misspelled word and have it corrected by Dictionary.app.
  • Application-based firewall — In classic Apple fashion, functionality that was previously available via third-party additions is now available from Apple itself. In this case, I have to wonder how well Apple’s updates to its firewall will obviate the need for Little Snitch, which is basically an application-based firewall, too, and a good one at that.
  • Built-in guest log-in account — If you’re as paranoid about security as I am, you’ve already created a special, limited-access user on your system (called Guest or Visitor or whatever) and whenever friends are over, you tell them to use that account instead of your own. Now in Leopard, Apple has gone through the trouble of setting this up for us already. A small change that is going to have a big impact.
  • Scriptable System Preferences & applications — With AppleScript, you can automate the things your computer does with scripts, as long as those things are “scriptable.” In previous versions of Mac OS X, huge gaping holes of what things shipped by Apple were scriptable existed, causing me (personally) some really annoying headaches. AppleScript GUI scripting helped me get around many of those roadblocks, but now it seems Apple is finally filling in some of the most notorious gaps in this functionality with scriptable System Preferences. Yay!
  • Automator workflow variables — Automator brings the power of AppleScript I just mentioned to more people with a completely graphic programming environment. There is no need to open up a text document and write AppleScript code because Automator lets you create a script (called a Workflow in Automator jargon) using your mouse by dragging and dropping actions into the order you want them to be performed. It’s very slick, but until now it’s been very limited. With Leopard, Apple is beefing up Automator so that it includes things like variables, basic programmatic capability that was sorely lacking before. (Also majorly cool: a command-line utility to access Automator!)
  • Finder.app’s path bar — Every serious Mac user knows that the Finder needs a lot of help. Now, it’s getting some. Something the Windows Explorer has had forever (as had every desktop environment for Linux, of course) is a visual cue to show you where in your filesystem tree a given folder is located when you are viewing said folder. Now the Finder gains this capability (though Apple’s description implies that it’s going to be off by default) with what Apple is calling a “Path Bar”. Finally!
  • Cocoa and scripting bridges — Even though no one really seems to know about it, it has long been possible for languages other than AppleScript to do things like send Apple Events to Mac OS X applications. Specifically, Ruby and JavaScript, two of the most well-known web development languages in existence, can already do this with a single ScriptingAddition (OSAX). But now Apple is making this functionality a central feature and fully extending it to their Objective-C (and Cocoa) language and applications such as Xcode and Interface Builder. This means people like me will have a shallower learning curve before we’re able to create full-fledged, native Mac OS X applications. Now that’s exciting!
  • Xcode 3 refactoring — This is something you kind of have to see to believe. I got the opportunity to see it demoed at Apple’s Leopard Tech Talks last year and I was really excited by it. With the new Xcode, Apple’s development IDE, you can do away with find-and-replace searches for things like renaming functions because Xcode understands what parts of your code are what structures and, when you tell it to “change the function named myFunction to myNewFunction,” it’ll only find-and-replace function names instead of every instance of the string “myFunction.” That’s pretty big, and if it were available for more languages, it’s almost enough to make me ditch vim.

So there you have it. Ten features you might not have already known about that are some of the most promising features I can see in Leopard. And I didn’t even get into Wide-Area Bonjour, which could make services like DynDNS or No-IP a thing of the past (and which I still want to learn more about), or the new Terminal application (finally with tabs!), or even the multiple user certificates for S/MIME encrypted email.

Note: One of the least known security features available on Mac OS X is also possibly one of the best, and the simplest. Evidently, all Intel-based Macs are shipped with the XD (aka. NX, aka. DEP) bit turned on—and thankfully there doesn’t seem to be any way for users to turn it off. However, this isn’t a silver bullet and if you want to learn why you should check out this excellent Anandtech article: A Bit About the NX Bit.

A small gesture

Sunday, October 14th, 2007

It’s hard to talk when I’m sad. I want to, but I just can’t make my mouth make any sounds that form words. My father realized this when I was younger. One time, and only one time, when I was upset and feeling like I couldn’t talk, he set me up in front of a computer with a text editing window and asked me to type my responses to his questions. He was clever; his questions were simple yes-or-no questions at first. I think he realized that it was even difficult for me to type anything more than that at first. Slowly, as he sensed my body language change, he would start asking more complex questions that required more complex answers. Yes or no responses soon turned into short sentences and soon after that I was pouring my heart out onto a digital notepad.

That is how well my father understood how to communicate with me, for I am all but incapable of communicating actively when I am in such a state as that.

Interestingly, it is only around another person that that state causes such a complete shutdown of my communicative faculties. Alone, I am still quite expressive, as this short piece illustrates, for it was written shortly after I was left alone in just such a state. Furthermore, an internal dialogue is constantly running through my head in these states. Indeed, I am very expressive in every meaning of the word, except in outward appearance. Small gestures such as the slight twitch of a finger are in fact huge, sweeping, screaming motions, so loud as to silence my own thoughts for a few moments and yet so invisible to an outside observer that I somehow feel that much more unheard when someone—through little fault of their own—fails to recognize it.

This is unendingly frustrating. I am at once both completely irrational and unreasonable, unforgiving of people’s blindness towards me and at the same time intolerably chastising myself for being so incommunicative. The internal war feels as though it is enough to tear me limb from limb, which in addition to making it hard to speak makes it hard to move. Muscles become at once weakened and strengthened, incapable of lifting the weight of my own extremities and yet ready to unfurl in so spectacular a display of speed and strength at a moment’s notice that one might believe them to be constructed as though they were made of some giant wound metal spring.

I do not understand why it is so insanely impossible for me to break from these states. Of course, in moments of obvious sanity I tell myself that it is precisely insanity that makes me so distraught. However, this very thought also makes me wonder how I can be so sanely aware of my insanity and yet be so unable to do anything about it.

The Map Of The Internet, Circa 2007

Tuesday, October 9th, 2007

This map of the Internet is pretty neat. It even gives you a “you are here” signpost when you first arrive.

More information on the map is available from the ISI ANT Census home page.