LJ Archive

Visit to a Strange Program

Marcel Gagné

Issue #110, June 2003

I realize it is a little bit bizarre, François, but part of what makes running Linux so attractive is it has put the fun back into computing. Sometimes fun is just plain silly. Non, mon ami, this program does nothing for your productivity. No, it does not monitor resources nor help with system administration. Yes, you are correct, it serves no obvious useful purpose.

You ask why? Why, François, do we serve fine wines and not plain water? Why do we indulge in rich foods and decadent desserts rather than consuming only what our bodies need? Because it is fun, mon ami. And why are you not paying attention to me? What are you looking at?

Ah, bonjour, mes amis! Welcome to Chez Marcel, home of fine Linux fare, great wine and the occasional excursion into strange and unusual software territory. Please sit and François will pour the wine immédiatement. François, to the wine cellar. Fetch the 1997 Eden Valley Hill of Grace Shiraz. Vite!

As you know, mes amis, the focus of this month's issue is program development. The obvious approach is to showcase some of the marvelous tools used by talented open-source programmers to improve and enrich the Linux landscape. It is on that note that I would like to point out the following: sometimes, those talented programmers are simply playing, having a bit of fun. Sometimes, the programs they turn out are silly, bizarre and, occasionally, plain weird. Those are the people I wish to honor with today's menu.

Once upon a time, ASCII art was practiced in e-mail messages sent around the world. Unfortunately, fancy fonts and HTML-ized e-mails have struck a powerful blow to this ancient and noble art form. The most missed are probably the cows, for Tony Monroe, anyhow. His cowsay program (a nice, easy-to-play-with Perl script) provides a simple way to generate an ASCII cow that speaks your message. Head on over to www.nog.net/~tony/warez/cowsay.shtml to pick up your copy and extract it into your directory. The installation consists of running an install.sh file. Running the program also is quite simple. Let's pretend that I want a cow saying “More wine, please”:

$ cowsay More wine please.
-------------------
< More wine please. >
-------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

With the -e and -T options, you can define the cow's eyes and tongue. You also can use the -f option to specify any of the other animals (or cow-like creatures) in the /usr/local/share/cows directory. You'll even find Tux there. Be warned, however, that some of the art can be a bit off-color.

Talking milk carton, anyone?

In the world of programmed silliness, a lot can be said for words. Text, that is. Take, for instance, Andy Gilligan's cack program for generating nonsensical phrases (sourceforge.net/projects/cack). “So, how would you use cack?” you may find yourself asking. Say, for instance, you are trying to answer an e-mail, and you need something totally nonsensical to make your point. It's cack to the rescue. Simply type cack followed by a number to represent how many lines of nonsense you wish to generate, then press Enter. Here is an example of what you can expect:

disintegrate the 95 marauder and the on request
medieval eel billet the unsized aged and the
biochemically amphiprostylar crotchetiness

Your friends will think you are either crazy or brilliant.

To take this up a notch, you may want to check out the aptly named nonsense. In essence, nonsense is a clever generator of, well, nonsense. For instance, with the command nonsense -f mission.data, you can generate corporate mission statements like this one:

Our mission is to achieve progress in
integrating integrated technologies to produce more
revenue for our head honchos and make our founder
enough cash to exceed the net worth of the world's
richest man.

For nonsense, this is quite a flexible program. With command-line switches, you can make nonsense generate business plans, strange names for people, imaginary political organizations, an impressive geek resume (Figure 1), bizarre laws (“It's a Class C felony in Yellow Walnut, Michigan, to hit a poison ivy plant with a cardboard box”), newspaper headlines (“Computer Possessed By Satanic Dæmon”) and even a pretty realistic Slashdot web page. Some of the output is in HTML format and is suitable for web pages—all silly, of course. The many other options and their results may well keep you busy for hours.

Figure 1. This Nonsense resume is not guaranteed to get you

a job.

To get your own Nonsense—the program, that is—pick up the latest package at i-want-a-website.com/about-linux/downloads.shtml. Other than extracting the tarred and gzipped bundle, there isn't any compiling to do. Nonsense is a Perl script that works with a collection of templates. Once you extract the package, make sure you look through the accompanying README for the various options.

Of course, it's not all words, words, words as Monsieur Shakespeare once said. After all, the importance of music in our lives cannot be overstated, but what about completely random music? Stephan Beyer's Randomposer (<@url>freshmeat.net/redir/randomposer/8816/url_tgz/randomposer-0.2.6-2.tar.gz) may be the starting point for an answer to that question, but perhaps we need to understand the question first. Either way, if the idea of a million digital monkeys composing your next opus appeals to you, give this program a try.

Because Randomposer is a simple Perl script, no compiling needs to be done. Extract the package, and run make from the directory. To run Randomposer, type rposer and your random music will play. You can save the music, change the beats per minute and introduce other non-random elements into your creation with command-line parameters. Type rposer --help for details.

François, it appears that our guests' glasses are nearly empty. Please refill them. Could you also run to the kitchen and bring out the cheese trays? Merci.

So, mes amis, we now have words and music. With a little eye candy, we could have a complete multimedia experience, in a strange sort of way. Those of you running a KDE desktop can take advantage of a clever bit of silliness that comes as part of the kdetoys package. It's called AMOR, an acronym that appropriately stands for Amusing Misuse Of Resources.

Figure 2. Some of AMOR's tips are not only useful, but wise.

AMOR is a little animated character that sits on your open windows. By default, it comes up as a little yellow spot (or happy face) that jets around, smiles, winks at you and occasionally bursts into flame. Turn on the random tips feature, and your character occasionally throws up tips, some dealing with your system's capabilities and others dealing with more mundane topics.

Incidentally, the demand AMOR places on resources isn't particularly bad (of course, it does add to your processing demands), so you shouldn't have to worry too much about it.

When AMOR pauses in one spot, you can right-click on the character to change the options. AMOR can be transformed into a kitten, a ghost or our favorite mascot, Tux. Some characters are animated and others sit quietly doing nothing more than taking up a few pixels. One of these static characters is a visitor from another strange (but great fun) Linux program—little Bill from Brian Wellington and Matias Duarte's XBill (available at www.xbill.org).

Quoi? You do not know about XBill? Then you must download it immediately and start saving the world's computer networks from an evil hacker known only as Bill, as he tries to load a virus (cleverly disguised as an operating system) onto otherwise healthy computers.

Figure 3. Only you can stop Bill.

Well, mes amis, looking at the clock, I can see that time is unfortunately running out. Speaking of time—why, in this world of fancy graphics and eye candy, someone would want an ncurses analog clock is a question best left to the philosophers (or the programmer known only as Tommy). Should you be that someone, then maybe it is time to download and install clockywock. It features an hour, minute and sweeping second hand, all generated in a full-text terminal from nothing but ASCII characters. You can download it from www.soomka.com. Building clockywock is simply a matter of typing make; there is but one source file, and it compiles to produce the clockywock program.

Before I leave this subject of time, I would do you all a great disservice if I did not mention XDaliClock, a fascinating graphical clock where numbers don't change so much as morph from one second to the next. The Dali Clock has been around for some time, and there is a good possibility you may find it on your distribution disk and, perhaps, already installed on your system. Should you need to download a copy, head on over to www.jwz.org/xdaliclock. You even can download a version for your Palm device.

For a particularly psychedelic effect, run the program with the -cycle option and your clock not only morphs from second to second, but takes on a flowing color palette as well.

Figure 4. The Magical Morphing XDaliClock

Time is indeed passing quickly and the closing hour has arrived. But, of course, another glass of wine is certainly in order, mes amis. Nothing strange there. François, kindly pour our guests another glass. Always remember that the cost of silliness may be no more than a few laughs. Until next time, mes amis, let us all drink to one another's health. A votre santé! Bon appétit!

Marcel Gagné lives in Mississauga, Ontario. He is the author of Linux System Administration: A User's Guide (ISBN 0-201-71934-7), published by Addison-Wesley (and is currently at work on his next book). He can be reached via e-mail at mggagne@salmar.com.

LJ Archive