Posts

Human-sized software

The piece of software that I’m most proud of is a tiny real-time kernel that I wrote for the Intel 8080 back in 1979. The 8080 was a very early predecessor to the now-ubiquitous Pentium. It had specs that seem laughable now: 8-bit data, 16-bit addressing, 2 MHz clock speed. Obviously, with a chip this slow, efficiency was the name of the game in software. So I wrote the scheduler and interrupt handler in assembly language, based on the design (but obviously not the actual code) of Intel’s own RMX-80 kernel. I don’t have the source code to this kernel, but I recall that it amounted to less than 2K of assembled code.

Read more →

November 20, 2008

Convert tabs to spaces in one line of Ruby

Here’s a one-liner Ruby script that converts tabs to spaces: ruby -pe 'gsub(/([^\t]*)(\t)/) { $1 + " " * (8 - $1.length % 8) } I’m in the early stages of rewriting a tiny editor, MicroEMACS, in Ruby, and needed a tab converter. I was sure I’d seen this somewhere before, but couldn’t find it with Google, so rewrote it from scratch.

Read more →

November 19, 2008

Creating an encrypted directory on Linux

There are a number of ways to encrypt a file system on Linux, and the choices of strategies (single directory or entire partition) and tools (dm-crypt, LUKS , losetup) can be bewildering. I didn’t have a spare partition to play with, and I wanted to use what seemed to be regarded as the preferred tool (LUKS). So here’s how I created an small encrypted directory on SLED (SUSE Linux Enterprise Desktop 10 SP2). (I cobbled together this information from Encrypted Root File System with SUSE and File System Encryption .) I performed all of these steps as root in root’s home directory.

Read more →

October 25, 2008

Reviving an old ThinkPad with TinyMe 2008

I bought my first ThinkPad nine years ago, and now have five of them. Two of them (an A30p and a T40) are hopelessly broken, with system boards that either won’t power up or won’t stay powered up. The others are working pretty well, including the oldest one, a model called the 380Z, which despite the name, has no relation to Datsun sports cars. The 380Z served me well for a couple of years. It was running Mandrake Linux practically from day one, and was a reliable, non-sleek tank. Recently I thought it might be fun to update it to a more recent Linux. But its specs are quite modest by today’s standards. Its power is about 1/10th that of a modern laptop in just about every area: 96 MB of RAM, a 233 MHz Pentium II processor, and a 4 GB hard disk. Nothing could be done about the RAM, and that’s the biggest problem, because most Linux GUIs these days (KDE being my favorite) require about 256 MB at a minimum if you want some memory left over for running a browser. The hard disk problem solved itself: when I powered the machine on yesterday for the first time in a year, the disk made terrible clunking and seeking noises and the BIOS reported it as dead. So I swapped in an 80 GB disk from the dead T40.

Read more →

October 19, 2008

Using a Treo 700P as a USB modem on SLED

During my frequent trips to Vermont over the last four years, I’ve discovered that most airports do not offer free WiFi access (Burlington VT and JetBlue at JFK are notable exceptions). In preparation for an upcoming trip to Vermont and the need to do some telecommuting en route, I figured out how to use my Sprint Treo 700p as an EVDO modem on SLED (SUSE Linux Enterprise Desktop) SP2 on a ThinkPad R61. I was aided in this by a couple of blog postings: Treo 700p Tether with Linux and Dialup Networking via Treo 700p and Ubuntu . Rather than list only the things I did differently, here is a complete procedure.

Read more →

September 14, 2008

SLED SP2

Today I updated my ThinkPad R61, which came with SUSE Linux Enterprise Desktop (SLED) SP1, to SP2. I did this entirely online, using this Novell document as a guide. In particular, section 9.2.3, “Updating to a Service Pack” and “Starting with YaST Online Update” described the process I used. There were a few gotchas with the documentation. Some of the package names didn’t match what I saw on my system. But more seriously, I needed to run the Yast2 Novell Customer Center Configuration tool before anything would work. Registering one’s installation is apparently the only way to add the service pack repositories to Online Update. Otherwise, the process went smoothly, and the system appears to be running well after a reboot.

Read more →

September 11, 2008

Treo 700p field test mode

I recently moved to a rural location where cell phone signal strength is weaker. The signal strength indicator (the “bars” icon) on the Treo 700p isn’t terribly useful in finding the strongest signal in and around the house. A more accurate method of determining signal strength is to put the phone into field test mode. You do this in the main phone app by dialing ##33284, or ##DEBUG, and pressing Dial. (This is for Sprint Treos; for other carriers, see this page .) This brings up a continuously updated “Debug Parameters” display. The signal string is the “RSSI Value” on the top line.

Read more →

May 24, 2008

Installing Rails on SLED

SUSE Linux Enterprise Desktop 10 SP 1 (or SLED), as installed on the ThinkPad R61, is based on SUSE Linux 10.1. This distro includes a somewhat old version of Ruby on Rails , a popular web development framework. I wanted to use the latest version of Rails, but before I could do that, I needed to build and install the latest stable versions of Ruby and Rubygems (Ruby’s package management system). This wasn’t too difficult, but there were a few non-obvious steps along the way. (All of the steps described here were performed while logged in as the root user.)

Read more →

May 14, 2008

ThinkPad R61 and SLED

Lenovo now sells some ThinkPads that come with SUSE Linux Enterprise Desktop 10 SP 1 instead of Windows. The cheapest of these is the R61. I have owned an R61 for about a month and it’s quite nice. SLED has been performing admirably, and pretty much everything Just Works, including video, sound, suspend to disk or RAM, DVD movies, and wireless. The Network Manager is especially nice, and it reliably detects and configures wireless connections, and automatically connects to networks it’s seen before. The wireless antenna in this laptop is very sensitive and picks up networks that other laptops miss.

Read more →

April 5, 2008

Printing to PDF from Firefox

I recently needed to send my credit report to a landlord, and it seemed as if a PDF file would be the logical choice. So I needed a way to create a PDF file directly from Firefox, since the credit reporting agency didn’t provide an option for creating a PDF. Fortunately, there is a cups-pdf package that lets you do this. However, getting it to work in Firefox is not completely obvious. Here’s how to do it in PCLinuxOS 2007:

Read more →

March 4, 2008