Wednesday, October 22, 2008

Run legacy DOS applications in Linux

I use Linux as my personal computing OS and it does pretty much everything I need, is stable, relatively secure, and free. However there are times when I could really use a DOS box to run some ancient DOS based program that doesn't have a Linux equivalent. This isn't a problem for Windows users who can just open a command prompt window. And it's not a problem for Linux users either, with dosemu an open source DOS emulator/virtual machine. 

For Ubuntu/Debian dosemu is intalled simply with:

apt-get install dosemu

A specific directory becomes your "C:" and you can run all those old DOS programs. I have to say that seeing autoexec.bat and config.sys in my C:\ made me a little nostalgic for the old days. The feeling passed quickly though.

Friday, October 17, 2008

Global text replacement

One of the things I really like about Linux is the powerful file manipulation abilities it offers. Recently I needed to replace one phrase in a whole bunch of files with another. I copied the files from my Windows PC to a Linux machine and used the following shell commands to perform the replacement:

#!/bin/sh
for file in *; do
mv $file $file.old
sed 's/FINDSTRING/REPLACESTRING/g' $file.old > $file
rm -f $file.old
done

I didn't come up with the shell commands myself, but rather found them after a google search, so I can't claim credit for it. However, maybe you will find the script useful to replace text in your own files.

Saturday, July 26, 2008

Small. Fast. Reliable. Choose any three.

I've been really hung up on this program since I "discovered" it about a year ago. It's a honest to goodness SQL database engine implemented in less than 200 kilobytes.  I am talking about SQLite.

The software is in the public domain, which is interesting all by itself, and it's been integrated into tons of commercial programs and devices.  SQLite features include:

  • No configuration or administration needed
  • Serverless
  • Supports transactions
  • Cross platform
  • Fast!
  • Public domain

I use SQLite to track weather data that I collect at my home. I've also used the software as the heart of a simple, yet fairly smart,  amateur radio logging program built with SQLite and a  bash script.

SQLite fits nicely into the simple computing philosophy. It works well from the command line and without a lot of "moving parts" it's extremely reliable. The database files are portable across different OS's and filesystems and the entire database is in a single file which makes  copying or backing up a database as easy as copying one file. In fact I carry several databases around on a small USB stick.  For those that absolutely need a gui, there is a light weight front end available as a Firefox extension, however I prefer to use it from a command line.

Friday, July 25, 2008

# tea -earl grey -hot

This blog is about simple computing.  Simple computing is a philosophy that says computers can be our servants, save us time, and make our lives better when we use them in simple ways. Computers are a collection of tools and simple computing is about using the right tool for the job.  Here are some of the tasks where simple computing excels:

  • Data Processing
  • Data Storage
  • Communication

Do you remember when the simple tasks were all that our computers were capable of performing? Now we have so much cheap processing power that we don't know what to do with it all, so we pile on complexity to keep our CPU's busy. But has complexity made our lives better? I don't think so. There are specific ways in which the complexity of modern computing systems have opened new worlds to us and I am pleased to be able to take part in them. But on the other hand, many of our needs have not changed significantly in the last 20 years. Complex solutions to simple problems breed even more problems, yet we've been snookered into believing that complexity equals sophistication.

One of the biggest blunders of modern computing era is total domination of the graphical user interface. GUI's are so dominant that a huge percentage of computer users have never even heard of the command line interface, let alone witnessed its simple power. The desktop is a disaster in terms of accessing information, controlling hardware and software, and getting things done. I don't remember seeing officers on the U.S.S Enterprise (NCC-1701D) shuffling through windows and icons to transfer power to the forward shields, or even to make a hot beverage. And icons! What a collection of worthless little smudges!

Welcome to simple computing.