Tuesday, January 12, 2010


Command Line Applications

This article assumes some knowledge of the command line. Before we get into the specifics I should say a little about ncurses. Ncurses is a programming library enables a programmer to write a text interface for programs running under a terminal emulator, e.g. bash. An application using ncurses can resize itself within certain limits set by the programmer. Note that it is possible to ssh into devices with small displays to use a larger external display.

Text based programs come from three main development groups: GNU, Linux and BSD.

Here are some of the things I find useful to do at the command line:

Script to look up a word in the dictionary:
curl dict://dict.org/d:$1

Script to listen to CBC Radio 1:
mplayer http://icy1.abacast.com/cbc-r1toronto-96
(CBC tends to change things around a lot and this script may not work in the future)

Stream classic music from WGBH:
mplayer http://streams.wgbh.org/classical.asx

Check spelling of standard input (gives suggestions)
ispell -a

This is a script I use when I can remember what a file is called, but can't remember which directory it's in:
TEST=$(dirname `locate -n 1 $1`)
eval cd $TEST

I put this in ~/bin as locate.sh but to get the desired result one would use:
. locate.sh SAK.txt
This would put you in the directory where SAK.txt was located.

The two calendar programs cal and gcal (cal is from the Linux world, and gcal is GNU's version).

Ncurses based IRC program:

Ncurses based spreadsheet program:
sc (7.16 seems to be the newest version)

Unit conversion:
(Example: You have: 0 degC
You want: degF
* 0)

Various text based browsers like elinks, lynx and w3m.

I run bc a lot for simple math calculations:
bc -l (run bc with standard math library)

I have accumulated a rather large collection of bash shell scripts over the years but even more useful than the scripts was the text file I keep here: Accumulated Linux Notes. Text based programs are generally smaller in size and execute faster and (this might be the most important concept of all) can be easily ported to other systems.

Tuesday, December 1, 2009


Linux Laptops and Netbooks

Well, once again I headed out to the stores looking for the perfect Linux based laptop or notebook. Were there super cool ARM based netbooks running Linux? Have the stores started to stock non-Windows based computers? Could I at least find some Linux based laptops?

The current situation is bad but not hopeless. If you are willing to import you can get a Lemote manufacturered device. One can order them online from Tekmote Electronics (based in the Netherlands). Richard Stallman uses the Lemote mini-laptop because it uses 100% Free and Open Software up to and including the BIOS. Lemote's high end model is the YeeLoong 8089 which has a 64-bit Loongson-2F processor running at 900 Mhz and an 8.9" screen. This system runs Debian Linux.

Dell Canada is selling their Mini 10v netbook for $329 Canadian which comes with Ubuntu 8.04. The Mini 10v comes with an IntelĀ® AtomĀ® Processor N270 running at 1.6 Ghz, a 10.1" screen with 1024x600 resolution, 1 GB of RAM, the Intel Graphics Media Accelerator 950 and a 160 GB hard drive. This device comes with a one year warranty. Their other Linux computer is the Vostro A90 for $319 which has the same memory and graphics hardware, but a smaller 8.9" screen and a 8 GB Solid State Drive.

The third choice is to buy used on ebay. One of these days I'll get one of those Sharp SL-C3000 series PDAs. I already own a SL-5500 machine and I had a lot of fun porting GNU, Linux and BSD programs to it. You should be able to find a SL-5500 for under $100. Recently I bought a Lexar 4 GB compact flash card for the SL-5500 and it worked fine. If you are willing to go for a higher price I have seen the Netwalker go for about $520 on ebay.

Unfortunately I was not able to find any ARM based laptops or netbooks, not in the retail stores in Canada or online. What I am hearing is that next year will be a big year for ARM based netbooks. I would be happy to hear about any such devices so if anyone comes across an ARM based netbook or any other kind of Linux based netbook or laptop please comment about it.

Friday, October 9, 2009


The Importance of GNU

If you are a Linux fan, then you probably know something about the GNU utilities. In short, Linus Torvalds (and others later) used the GNU utilities to write the Linux kernel. But before that happened Richard Stallman realized back in the 80's that computer users needed a portable operating system.

What we see happening over and over again is any hardware system will eventually become obsolete. In Stallman's case it was the PDP-10 system. Over time the system became obsolete and for some reason a lot of Stallman's early programming work was lost, perhaps because it was written in assembly language. Stallman, or RMS as he is often called, realized for any operating system to survive the passage of time it needed to be a portable system.

RMS decided he would be the one to write this new portable system and not only would it be portable but it would be free as well. In this case the word free refers to freedom: the source code of the operating system would be free to modify and exchange with other programmers. RMS decided to base his new system on Unix and that at minimum the computer needed to be at least a 32-bit system. This was a task of Herculean proportions.

Unix was a good choice in that it was compartmentalized and it was relatively straightforward to replace each Unix component with it's GNU replacement. (For anyone who doesn't know: GNU is a recursive acronym that means 'GNU is Not Unix'). Bit by bit RMS worked and by the early 1990's he had almost a complete system. Only one major part was missing and that was the kernel.

As we know Linus Torvalds wrote a kernel and then people started to use the GNU utilities to create a complete operating system. Of course there were many contributions from different places, but the two most important parts were the GNU utilities and the Linux kernel.

It is important to remember Stallman's original objectives: to write a free operating system and insure that it is portable. Basically his objectives were met and we now have several free operating systems. But it is also important to remember that Linus needed a compiler to write the Linux kernel and that compiler was the GNU C compiler gcc.

We can see the critical importance of portability: Hardware will grow old and die and manufacturers will cease to make replacement parts. They will only concentrate on new hardware. So the time will come went one will need to port a program to a new architecture. Fortunately this is made somewhat easier with the GNU utilities. Using the GNU utilities I've started to port programs which I felt were missing from the Sharp Zaurus SL-5500 PDA.

Now even though I have a lot of ideas on how the GNU utilities could be made better I can easily see how valuable a toolset it makes for any programmer. I'm sure that given enough time I could port any GNU utility or any program under the GPL (although I admit it would be a ton of work in some cases). Once I started to port programs I felt quite liberated. So what if my PDA didn't have an IRC client, it couldn't be that hard to port one, and it wasn't :)

Friday, August 28, 2009


Sharp Releases the 'Netwalker'

Sharp has released a new Linux based computer called the 'Netwalker'.

The Netwalker has a 1024x600 WSVGA display (5 inch or 127 mm) and runs a Freescale processor at 800 Mhz. For memory it has 512MB of RAM and 4GB of SSD storage which is expandable with a microSDHC card. Sharp is claiming 10 hours of battery life.

This device is a little unusual. It could be considered a big PDA or a really tiny
netbook. Sharp is saying the boot-up time for this device is under 3 seconds and
in this case the Linux distribution is Ubuntu. It's dimensions are 6.33 x 4.25 inches
or 161 x 108 mm which would require a rather big pocket.

Unfortunately the Sharp Netwalker is only available in Japan but chip makers
Freescale are looking for ways to import the device into the USA. The good news
is that Sharp is continuing to develop devices which run Linux and hopefully
the Netwalker can pick up where the Zaurus series ended (the Zaurus series
ended in February 2007).

Monday, July 13, 2009


The Importance of Freedom

One of the most important and fundamental aspects of using computers is choice. The simple ability of the customer to choose which hardware and software they want. Not too long ago you would go out and buy a 'Brand System' from a manufacturer like a Commodore Amiga or an Apple Macintosh and you would just use the operating system that came with it. Often you had to buy additional peripherals such as printers or external floppy drives from that same manufacturer. Basically your only choice was the manufacturer. There were a few third-party manufacturers who would also build devices which could work on your Amiga but there was a great deal of manufacturer lock-in.

Nowadays we have more choice and also less choice. Long gone are the Atari and Commodore computers. Also gone are GEM, AmigaDOS and (for the most part) the BeOS operating system. Where we have greater choice is at the component level. One can go online and buy tons of different hardware on ebay or tigerdirect. One can choose which video card, hard drive, and motherboard they want from a number of different manufacturers, used or new.

With the rise of FOSS (Free Open Source Software) one now has the additional choice of an open or closed source operating system. For many computer users the importance of this choice is stifled. When one goes into a brick and mortar computer store they don't have the luxury of choosing their operating system, you get Microsoft Windows. Of course the tech-savvy user is free to erase Windows and put Linux or FreeBSD on there. The point remains that the manufacturers and retailers have gone with a 'one size fits all' solution and kowtowing to Microsoft is still the rule of the day.

Can I go into a Staples store and buy a Linux netbook? No. Can I go into Staples and get a Linux based PDA? Nope. Can I go into any store in Canada and get a Linux based computer? The answer is no, not in a traditional store (at least I haven't found one yet). Occasionally I see devices like the Sharp Zaurus SL-5500 on ebay but I don't think Sharp Canada carries them. The only real choice for the Linux enthusiast is to go online to sites like Linux Devices and do some research.

Tuesday, May 26, 2009


TV and Radio Cards

One of the great things about Linux and FOSS (Free Open Source Software) is that you can download the source code not only of programs but of modules. Modules under Linux are also known as LKMs or Loadable Kernel Modules. One very interesting example is the bttv module and you can download the source here. The bttv module is the module I used to get an old TV tuner card to work under Fedora.

The WinTV-GO-FM is a PCI card which can receive analog television and FM radio. With the pending switch-over to digital television these cards can be purchased on ebay for very little money. You might be thinking analog TV is on the way out but there are still channels like TV Ontario which are still analog only. Even with the change to digital it is still nice to have the ability to receive FM radio.

Linux applications which can be used with this card include gnomeradio for GNOME and kradio for KDE and the console radio program from the xawtv package. I prefer to use gnomeradio. The console radio program can only have 8 presets which is rather limiting.

The main thing is that you can learn a lot about your cards by looking at the source code of modules like bttv. I know my WinTV-GO-FM card is kind of limited, it can only do mono audio and can't do any mpeg2 compression in the hardware. It can act as a composite video input for a VCR which is nice to have. One could conceivably modify the bttv module to add features or even port it to another operating system. One might even learn enough from looking at the module to write their own module for hardware not yet supported!

Saturday, May 23, 2009


Thoughts on Fedora 10

Starting in the year 2009 I have been asked to replace Windows installs with Linux installs. Before this I had to coax people to try Linux. Over time this process has become easier and easier. My Linux distribution of choice nowadays is Fedora 10.

My experience with Fedora 10 has been mostly positive. I have installed it successfully on a Dell D610 laptop and also a Panasonic CF-48. I prefer using GNOME over KDE for a windows manager. I used to like KDE 3.4.2 over GNOME but Fedora 10 uses KDE 4.2.1 which to me just seems overly complex.

Some software seems to have become abandoned such as the scanner program Kooka. On one of my older systems I run Kooka 0.44 on Fedora Core 1 (using my old HP 5200C which runs like a tank) and I still prefer it to xsane. Of course both programs do mostly the same job. The thing is developers will usually stop working on older versions of software, so if you want your yum updates then you are pretty much forced to use latest and greatest.

All is not perfect with Fedora 10. One of the things it does which I don't like is auto-logout. Basically Fedora 10 is emulating what Windows XP does: after a period of time you are send back to the user login screen. There doesn't seem to be any way of disabling it which is annoying. It seems to perform software updates often which is good, but I'd rather it buffered all the updates and did it once a week. Doing updates every day seems like overkill.

Still all in all I was able to make Fedora 10 work well, which is important. Java, Flash, etc all worked correctly. One must still exercise some care in choosing your cards and peripherals but for the most part this newest Fedora was painless and even enjoyable. One may order Fedora Discs here.

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]