Originally Published: Monday, 24 April 2000 Author: Rob Bos
Published to: featured_articles/Featured Articles Page: 1/1 - [Std View]

Linux: Niftier Than Sliced Bread

There have been moments of triumph, of smacking my forehead when I realise that I'd been doing something fundamentally wrong. There have been moments of insight, when the structure clicks in to place, and finally, I grok.

Linux is, by all accounts, a bitch to learn. It's certainly given me hours of frustration, hours of wondering why something wouldn't work, or hours of wondering how to do something. There have been moments of triumph, of smacking my forehead when I realise that I'd been doing something fundamentally wrong. There have been moments of insight, when the structure clicks in to place, and finally, I grok. I will often while away an afternoon attempting to figure out what a program does and how it does it, and then spend hours thinking about what else I can do with it; the implications of what I learn in any given hour can keep me busy for days.

It takes long hours of work to achieve this -- long hours of staring blankly at documentation, playing around with commands, searching through configuration files. But in the end comes the reward. The moment when you completely understand how a program, a protocol, a configuration file, or what a document is saying and how to accomplish what you've been trying to do is worth every minute of the hours you spent trying to do it.

That said, here's the cool stuff I did this week, and what bearing it has on the thesis that Linux is worth the immense mental effort.

  1. Figured out how to establish a TCP/IP over PPP connection to the North Concourse computer lab at Simon Fraser University. SFU provides twenty-four carrels on campus where one can, in theory, bring in a laptop (Windows or MacOS are officially supported), hook them up via serial cable, and set up a null modem connection at low speed. One of the students here was attempting to figure out how to connect a Linux laptop about a month ago, and did not make any progress with it despite hours of trying.

    Recently, however, I got permission to set up six old desktop machines in that 24 hour lab - which gave me some amount of motivation to actually get it done. After six hours of poking through log files, going through documentation, web sites, and experimenting with pppd, I finally figured out how to do it, and do it relatively simply. What's more, the understanding I gained of networking in the process was nothing short of invaluable - I could use the same principles gained in my experimentation with connecting to the ppp annex server to set up a ppp connection between two computers over the Internet, or via a serial cable, or with two modems connected via telephone.

    Now, these are useful things to know. It could even, in theory, be possible to set up a virtual PPP connection using named pipes on the same machine -- though why someone would want to do this, I have no idea. The point is, it's possible, and it's nifty, and sometime, somewhere, I'll probably find a use for it.

  2. Wanted to put together a Debian install floppy with support for the Reiser File System, a nifty little journaling filesystem that patches right in to the 2.2.14 kernel. I was able to compile an extremely stripped down base kernel, because I know the machines that I will be installing it on, and I knew the installation method I'd be using. As such, I could remove CD support and networking support of any kind -- about all that was left in was IDE support, loopback devices, MSDOS, ext2fs and ReiserFS support, plus trivialities. I tested it, and it was good -- I had a Debian installer that would create ReiserFS partitions instead of ext2 ones. It was much more reliable, and much more convenient. It is at this point that I could have stopped; I could have simply said "Okay, it works." But no, I got to thinking - the kernel only takes up 360k or so, and I don't really need a lot of the stuff that are on the default root floppies.

    Four hours, the Boot-Disk HowTo, reams and reams of documentation, and lots of questions later, I had (and have!) a single Debian install floppy designed specifically for my hardware, that uses ReiserFS.

    In the process, however, I learned a great deal about how Linux actually boots from disk, and came up with a couple of nifty ways to do administration of computer labs on a large (50-100 machines) scale. I learned how to use ramdisks, I learned some new kernel parameters. This is nifty stuff that might be useful in the future, and no doubt will be.

  3. Figured out procmail. Yes, procmail. This has got to be one of the most useful mail-handling programs ever invented. For a half-hour investment of time, I learned how to get intensely fine-grained control over how my mail is handled. I can now redirect mail based on sender, subject, target, or by contents. If it came from my mother, it gets sent to my pager; if it came from the Red Hat PAM list, it gets shuffled in to another folder. If it contains "Make MoneY Fast" in any incarnation, it gets consigned to the bit bucket; if it is sent to "undisclosed-recipients," it gets sent to the spam folder (just in case it might be legitimate). This little program has many and varied uses, most of which I had never suspected. It's one thing to use it to forward mail, quite another to use it as quite possibly the niftiest and most advanced mail filter in existence.

This is why I use Linux; it gives me power, and tools, and never ever restricts what I can use those tools to accomplish.

Every level you penetrate, every new tool you learn, gives you a whole new way to look at the tools you have. There are some programs that give you abilities to do things you never even suspected possible before -- every tool you get puts the tools you have in a whole new light. Named pipes, pipes, redirection, standard error and standard output, shell scripts, man pages, tar, bzip2, the Reiser File System, init scripts, devices, devfs, the community -- around every corner lies small, wonderous discoveries. Each of those small discoveries gives you exponentially greater capabilities, since each of those small discoveries in some way can be used in conjunction with your existing toolset.

What's more, you're utterly assured that the skills you have picked up -- the skill of learning new small programs quickly and easily -- will be valid for a very long time in the future. The core Unix architecture has not changed in thirty years; there is a good chance that thirty years hence the skills you learn now will be useful in learning the tools that will exist then.

In thirty years, I boggle to think of the things that I will know and wonder which of my current skills will be of use then.

Rob Bos (rbos@linux.com) is installing 300 PCs this week. Six of them will be Linux. One step at a time.