Seven Habits of Effective Text Editing

Like so many of the tips and tricks and hither-to unknown commands that I find in vim, I wish I have known about this years ago. There are a ton of little tricks in this short piece that are hugely useful.

One trick that I think is just the bee’s knees is *. If you are on a word in command mode, hit * and you will search for that word. Even better though, is the gd trick. When the cursor is on a variable name, typing gd will take you to the declaration of that variable.

The last thing that I think is awesome is "repeat the last change". If I am doing something repetitive, like creating an associative array of static values, I can type the first declaration and then start hitting . in command mode until I have enough declarations for the whole array. Very sweet.

httrack

I’ve been looking for an enhancement for wget for a while now, and I think I’ve finally found it. httrack seems to do a nice job of pulling down a site to a local repository so that it can be viewed as expected off the filesystem. Additionally, it purportedly (testing is ongoing) also does updates, which should help as well. The main problem with wget was that stylesheets called using the @import convention were not downloaded, and image references within stylesheets were also not fetched, which leads to unstyled pages in local repositories, which I didn’t like. There’s more testing to do, but so far the system looks good.

CMOS Battery for ThinkPad 600X

When the CMOS battery in my ThinkPad died, the machine became unusable. It would not boot because it could not remember the time. I think that this is a bad way to design a BIOS, but I don’t get to choose which BIOS I use (yet, keep your eyes peeled for OpenBIOS as it matures). I knew I needed to replace the CMOS battery, because the rest of the machine works very nicely.

What I discovered is that no one is willing to do this without at least a hundred bucks, which is idiotic. I learned from my research that the CMOS battery is encased in packaging, is difficult to remove on many ThinkPad models, and must be purchased as a specialty item via eBay or IBM. The technicians I spoke to where not able to order it until they had the laptop in their hands, because apparently there are different batteries for different 600X machines. I now believe that this is bullshit, and that they are simply too eager for my money to actually provide advice.

Rather than submit to the whims of the extortionists, I started removing screws and panels from my ThinkPad in search of the mythical battery. I found it in the RAM access hatch (I only needed to remove one screw) which is above (below?) the removable drive chassis (CDROM, DVDROM, etc.). It connects to the motherboard via two leads going into a specialty plug, and those leads connect to the battery via simple paddles. The battery and the paddles are held together by a short length of heat-shrink tubing. This sounds way more complicated than it is. The battery cover has the battery type printed on it, CR2025, which is a standard lithium battery I replaced at Blacks for $6. I detached the leads from the old battery, attached them to the new battery (being careful to replicate the polarity of the old one) with a length of electrical tape. I plugged it into the wee slot, replaced the panel, booted the machine and set the clock. It was essentially effortless, if you don’t count the visits to laptop repair shops and the subsequent anxiety.

Simple repairs can, in fact, be simple.