LINUX GAZETTE

December 2001, Issue 73       Published by Linux Journal

Front Page  |  Back Issues  |  FAQ  |  Mirrors  |  Search

Visit Our Sponsors:

Penguin Computing

Table of Contents:

-------------------------------------------------------------

Linux Gazette Staff and The Answer Gang

Editor: Michael Orr
Technical Editor: Heather Stern
Senior Contributing Editor: Jim Dennis
Contributing Editors: Ben Okopnik, Dan Wilder, Don Marti

TWDT 1 (gzipped text file)
TWDT 2 (HTML file)
are files containing the entire issue: one in text format, one in HTML. They are provided strictly as a way to save the contents as one file for later printing in the format of your choice; there is no guarantee of working links in the HTML version.
Linux Gazette[tm], http://www.linuxgazette.net/
This page maintained by the Editor of Linux Gazette, gazette@linuxgazette.net

Copyright © 1996-2001 Specialized Systems Consultants, Inc.

The Mailbag



HELP WANTED : Article Ideas

Send tech-support questions, Tips, answers and article ideas to The Answer Gang <tag@lists.linuxgazette.net>. Other mail (including questions or comments about the Gazette itself) should go to <gazette@linuxgazette.net>. All material sent to either of these addresses will be considered for publication in the next issue. Please send answers to the original querent too, so that s/he can get the answer without waiting for the next issue.

Unanswered questions might appear here. Questions with answers--or answers only--appear in The Answer Gang, 2-Cent Tips, or here, depending on their content. There is no guarantee that questions will ever be answered, especially if not related to Linux.

Before asking a question, please check the Linux Gazette FAQ to see if it has been answered there.



radius

Wed, 7 Nov 2001 00:41:46 +0200
hakan bilginer (hakanb from vestelnet.com)

Hello,

I wonder if it's possible to make a radius server on linux to authenticate the users on a remote mssql server 7.0 database.we use ms radius server and want to try linux.and if it's possible which radius server would you recommend for this job?

Thank you

Hakan Bilginer


HTML/CSS question - useful for dicussion

27 Nov 2001 23:31:32 +0000
mike (mike from redtux.demon.co.uk)

I am currently trying to write html which will insert page breaks for printing, which is is CSS2, and just happens to be part of css2 not implemented in mozilla.

Is any anyone aware of any solutions to this using HTML/CSS1


neighbour table overflow

Tue, 13 Nov 2001 10:53:35 -0500 (EST)
Ian Berry (ian from wunh.org)

Hi all,

I just set up a nice little p120 with 2-NICs and RedHat7.0 for my mom and it is working great except for one thing which you have spoken of before, the "neighbour table overflow" message being printed out to the console.

In a response to a letter from James Zhuang, Heather spoke of how ifcfg-lo might be missing or that lo might not be up but on my system, ifcfg-lo is there and appears correct and lo is up and running. Also JimD mentioned that pump might be screwing up the loopback configuration and I am running that as my dhcp client; how might i remedy this problem? I'd be happy to provide more system information if it would help or if you have any other ideas on where i might look i would appreciate it.

Thanks,

-- Ian Berry

Old symptom, maybe a new problem. Anybody out there encountering this too? Even better if you've got a Tip sized answer. -- Heather


Ethernet: Slow download, fast upload

Mon, 12 Nov 2001 17:47:29 +0100
Matthias Posseldt (matthi from gmx.li)

Hi all there,

I recently bought a OVIS Live FSH8R 10/100 MPS autosensing switch and a Davicom 9102 network card (dmfe.c) (They deliver Linux drivers on disk!!) So I cabled all together and connected to a friends notebook. From my Apache server he can download with speeds up to 9 MB/s, that's what I expected. Now when I download files (big files to measure the throughput) from his Apache (on Windows ;-( or via smbmount/Samba, I'll just get a rate of 2,5 MB/s. With iptraf (an ip traffic analyser, it's very good, IMO) I get a lot of big packets (1400-1500 bytes), which are the data packages. But my network interface also receives/sends alot small (<100 bytes) packages. These are confirmation packages, I assume.

Both network cards run at 100 Mps, changing switch ports did not help. The switch has only two cables connected.

So, nice story ;-). The question: Why can't I get a fast downlink, but only a fast uplink.

Thanks, Matthias



GENERAL MAIL



Diablo under Wine

18 Nov 2001 13:42:13 -0600
Charles R. Tersteeg (aa0na from arrl.net)

I read your article in Published in issue 71 of Linux Gazette October 2001 where Jefferson said Diablo ran fine under Wine at LWE. Which Diablo? I or II. I have II running fine, but I can't find anyone who has Diablo I running.

thanks,
chuck

I really don't recall whether it was I or II - but it was the honest to goodness CD from the Windows software package.

It was in the TRANSGAMING.com booth; Transgaming makes ActiveX extensions for WINE, and with those extensions, many games run fine. -- Heather


Tnx Ben & Breen

Thu, 1 Nov 2001 19:47:22 -0700
William Laing (wmlaing from home.com)

Ben & Breen
Thank you people who offered me help on loading modules, into the 6.2 system I havent got it right yet, but learnt something for sure. I dumped the system and will start from scratch again with a different card.
Thanks agn bill


re Nov issue - Dennis Field article

Thu, 8 Nov 2001 10:21:37 -0500
Harold A. J. Isaacs (chorales from ioip.com)

Would you kindly pass on to Mr Field that "Lunux Canada" seems to have exactly what he is looking for. It is not free, but moderately (compared with MS) priced. Certainly it is worth checking them out.

I found them at www.linuxcanada.com

They didn't have anything that interested me but they seem to have exactly what Mr Field needs.

Thanks for your wonderful magazine.

LG has received announcements from Linux Canada before about their POS products. I sent the URL to Dennis, but I also noted that I couldn't get into the site when I retested it. However, I can get into the site now. I think Dennis is looking for more of a software solution, whereas Linux Canada is more geared toward special hardware. But maybe Dennis will find what he needs. -- Mike

Thank you for your rapid reply.

So far as I know Linux Canada only sells software. There has (in the last 2 years) never been a suggestion of hardware sales or availability - only accounting and point of sale SOFTWARE.

The only time I have had trouble getting into their website was when the backbone was clogged, you could not even get anywhere in Canada then. You may have had a similar problem.

Harold A. J. Isaacs


RE:Battle for the Desktop: Why Linux Isn't Winning

Mon, 5 Nov 2001 15:33:25 +0100
Ian Carr-de Avelon (ian from emit.pl)

There are a whole series of relatively common problems related in this article, like applications software which does not run smoothly on all distributions and hardware which is not suported by a distribution, or sometimes by any Linux driver at all.

The real point is what can be done about this, and who should do it. The author, Dennis Field, seems to put the blame with the Linux distribution he chose. He, or his employer, paid them good money and so Linux should do what he needs it to do. There is nothing wrong with the logic of this, but the prospect of all distributions, or the most comercial distributions, or even one Linux distribution running out of the box on all old and new PCs is pritty well nill. Also even if that did happen, it would not get Mr Field to his goal of using Linux for the whole bookshop in one giant leap.

The problems which would need to be fixed even in this one "case study" are spread accrose the developers of: Linux kernel, X windows, StarOffice, and the distribution's firewall. Each of these have nowhere near the resources or assistance from hardware designers which Microsoft has, and yet they produce software which (on other criteria than out of the box installation on all PCs) far outperforms Microsoft's products. They have a right to pride in their work and respect from others, and simply calling for any of these teams to work harder till the problems nolonger exist would really mean accepting that Linux has lost, because even if the developers gave up all their free time, the extra improvement could never have the kind of impact which the author desires.

I have writen elsewhere (http://www.suite101.com/article.cfm/15359/84340) how I would generally advise SMEs to move towards Linux, but given the evidence of interest in building fairly complex systems at low cost, maybe we need a business by business (Bookshops, Chemists, Garages) Linux forum to give system integration with Linux the kind of boost which Linux Documentation Project (LDP) and sourceforge have done in other ways.

Yours
Ian

[Dennis also has another article in this issue. -Iron.]


Re: Battle for the Desktop: Why Linux Isn't Winning

Fri, 9 Nov 2001 15:22:51 -0800
Robin Rowe (Robin.Rowe from MovieEditor.com)

Dennis,

It is unfortunate that you had trouble installing Linux on your ThinkPad. You don't say what distros you tried, and each distro works a bit differently. Since installation troubles are really the domain of the distro and not the operating system itself it seems unfair that you name the problem as Linux but avoided naming the distros that actually caused you the trouble.

Have you tried Debian Linux? This is a very popular distro, supported entirely by volunteers. You could download the boot/root floppy images from debian.org, copy them on to two floppies, then boot and install a minimal Debian Linux OS. This is usually quite easy. After configuring your Linux network settings and adjusting your sources.list to point to the Debian download site you could then use dselect or apt-get to install the rest of whatever you want automatically over the Internet.

That you would have the troubles you did isn't too surprising. Most Windows users would have trouble in the similar circumstances trying to install Windows on their own for the first time without ever having used it before. A more realistic approach when installing Linux for the first time is to enlist the aid of other Linux users. Most Linux users groups host monthly installfests for this reason, so that new users get the install help they need from experienced hands. Had you done that I expect you would have had an operational Linux laptop within minutes. Another approach is to join the debian mailing list where anybody usually gets answers to install problems within a few minutes.

Your analogy comparing Linux to a Ferrari with no wheels is unjust. The wheels are right there, you just had a problem with your "Some Assembly Required" situation. You were not picking up your new Ferrari at the dealer, were you? If you were buying a new Thinkpad purchased from IBM with Linux already pre-installed (look under "personal systems" at www.ibm.com/linux) you should have no installation problems whatsoever.

Please let me know if I can be of any help to you installing Debian Linux on your laptop.

Cheers,
Robin



GAZETTE MATTERS



The distinction between Tips and Articles

Mon, 5 Nov 2001 12:15:23 -0800
Mike Orr (LG editor)
Part of a discussion with Matthias Arndt about his article this month

:) Articles go to gazette@linuxgazette.net in HTML format. Tips, tech-support questions and tech-support answers go to tag@lists.linuxgazette.net in text format.

Basically, a tip covers just one simple topic in a screenful or two (or less). An article covers several subtopics under separate headings and/or is more than a couple screenfulls.

... and Tips rarely involve more than one Answer Gang member's comments. I do like to use this rule of thumb: would the answer (possibly without explanation) fit in a .sig block? If not, it's probably not small enough to make a good Tip.

When the discussions get going even a short thread might go into TAG, and some of the better long answers in TAG still aren't as long as a standard article. I'd also like to remind people that for article submissions, we prefer simple HTML to the font-laden stuff automatically generated by most web browsers when "mail as HTML" is turned on. -- Heather


Issue 13

Mon, 12 Nov 2001 11:26:28 +0100
Russell Coker (russell from coker.com.au)

The following section isn't displayed correctly because you don't use &lt; and &gt; for the <stdio> part.

      #include
      main()
      {
              printf("test\n");
              fflush(stdout);
      }
      They will not echo what I print.

Thanks Russell. We don't generally go through the back issues to correct things like this; things have gotten a lot better since then, and I'm proud to say that things have to be sneakier that that to put bugs into our HTML code these days :) -- Heather


This page edited and maintained by the Editors of Linux Gazette Copyright © 2001
Published in issue 73 of Linux Gazette December 2001
HTML script maintained by Heather Stern of Starshine Technical Services, http://www.starshine.org/

More 2¢ Tips!


Send Linux Tips and Tricks to tag@lists.linuxgazette.net


Command-line calculator

Wed, 31 Oct 2001 22:40:27 -0500
Ben Okopnik (LG Contibuting Editor)

One of the things I've always found amusing is watching people working at a PC suddenly stop and go digging through their desk for a calculator. I mean, good grief - all that processing power, and they have to go back to the Stone Age! Well, if you're one of those unfortunates, suffer no more. Just put the following lines in your "~/.bash_profile":

calc(){ perl -wlne'print eval'; }
export -f calc

The next time you log in (or if you source ".bash_profile"), the function will be available to you.

ben@Baldur:~$ calc
3.141592653*6**2   # What is the area of a circle 6 meters across?
113.097335508
( 3 - 117 ) % 7	   # If today is Tuesday, what day was it 117 days ago?
5
sqrt(115) * 1.34   # Hull speed of a ship with a load waterline of 115'
14.3698990949832
ben@Baldur:~$

Note that I actually typed those comments into "calc"; it chews and swallows them without a problem.

"calc" is actually a 'gateway' into Perl (via the "eval" mechanism); that makes it into quite a powerful gadget. It supports all the math/trig/etc. operations that are built into Perl - functions like "abs", "atan2", "cos", "exp", "hex", "int", "log", "oct", "sin", "sqrt", and even "rand" (rolling dice, anyone?)

ben@Baldur:~$ calc
print int rand(6) + 1 for 1..20		# Roll 20 6-sided dice
6
1
6
5
3
5
3
5
1
1
6
4
6
3
3
4
1
1
1
4

"calc" can be as simple as you like - or provide you with the kind of power that calculators just can't match. It's all in what you choose to do with it. By the way, be aware: there's nothing in "calc" that restricts you to "math-only" commands; if you type "unlink my_important_file", Perl will happily obey your orders (i.e., delete that file.) So, as with everything in Linux, be careful - and have fun.

[Python's interactive mode can also be used as a calculator. -Iron.]


Apache startup script improvement

Mon, 19 Nov 2001 08:54:27 -0500
Allan Peda (allan.peda from verizon.net)

Every thime I setup Apache I add two lines to the startup script to parse the config file for the variable containing the name of the file to store the PID at.

It seems logical to me to automate this, since the script has an entry for the pidfile, but really should also "knows" the location of the config file, why not parse any redundant information from it and remove the risk of conflicting parameters.

Here is what I add to the /etc/init.d/apache start|stop script:

CONFIG_FILE=/etc/apache/httpd.conf
PIDFILE=`sed -e '/^PidFile /!d; s/PidFile //' $CONFIG_FILE`

or for you bashers:

 PIDFILE=$(sed -e '/^PidFile /!d; s/PidFile //' $CONFIG_FILE)

Also, I usually pass the name of the config file to apache explicitly, so that it's obvious via "ps ef" what configuration is currently being used.

Seems to make sense to me. In fact, I'd hope this makes it into the scripts included in the distro.

[JimD] It's a good suggestion.
Personally I think the start-up (rc) scripts from most distributions are a bit lacking. For example I've always thought that it was remiss of the start up script that mounts the /proc filesystems fails to check that the mount point is a properly empty directory.
In the case of your suggestion, you are eliminating what I call a "moving part" (an opportunity for different configuration elements from different sources to get out of sync with one another).
Of course there are many other failure opportunities which could be mitigated with additional tests. For example: what if there are multiple PidFile directives? what if the case doesn't match your sed expression (doesn't Apache tread PidFile as equivalent to PIDFile, etc)?
[Ben]
The usual way that Debian does it is also fairly sensible. This is from "/etc/init.d/skeleton" (the template that you're supposed to use when writing an "init.d" script under Debian), by Miquel van Smoorenburg and Ian Murdock:

See attached apache.init-d-fragment.txt

Any daemon, when started via this mechanism, gets an individual pidfile.
[JimD]
I think you miss his point. Debian's rc scripts are no better than Red Hat's in this respect. If one changes the PidFile directive in the .conf file, then Apache's notion of its PID file location disagrees with Debian's startup/shutdown scripts.
That could be reported as a bug to the maintainer --- but it's unclear how far we should go in making the rc scripts more dynamic. It would be a bit absurd to do comprehensive failure-mode analysis and mitigation for all of the rc scripts. At some point we must just give up (maybe calling on logger -s to emit and error message).
The problem with making foolproof systems is that the universe keeps creating more ingenious fools.


Re: De-enhancing text

Fri, 9 Nov 2001 12:16:23 -0800 (PST)
Thomas Adam (The LG Weekend Mechanic)
and Peter Dzimko (dzimko from yahoo.com)

Richard Bly sent us:

Just in case you were not aware, the utility colcrt will take a man page output and format it without all the weird stuff. The underlining is put on the next line so both the text and the underline are visable.

[Thomas Adam] Why not just use the following......:
man manname | col -b > ./mymanpage.man
where "manpage" is the man page (obviously). The "col" command in this case (with the -b flag) will filter reverse line feeds.
There is also the option of using "man2html" for the adventurous......

Guys,

I think that following method is much simpler:

man thttpd | col -bx

Regards
Peter Dzimko


Fun with chroot jails

Tue, 30 Oct 2001 13:21:58 -0500
Heather Stern (The Editor Gal)

Ben asked:

There's one you could write up (assuming you ever got the time to do it, that is) - creating those "chroot" jails. That's something I'd love to have the specifics of; I understand the concept well enough, but having never implemented one, I'm short on the actual mechanics.

There's a fairly current Freshmeat entry called "cage". Initial release. Not my stuff, but it's exactly the right idea - some support for a bash-shell centered chroot jail, so you can jail more complex apps a little more safely, e.g. make chroot a one way trip, nicking off a few linux-privs along the way.

Sounds like cool fun; I'll definitely check it out.

In the "barely enough to run an app" category, there's a helpful document for BIND, and a different one for Postfix, iirc, but I don't have their URLs memorized and I'm trying to avoid getting -too- distracted. (too late!)

<grin> I'll search for those some time this coming week...

There are a few patches and at least one kernel module (capsel) around now, that offer to stop the chroot() call from happening more than once, preventing the usual script-kiddy method of getting out of one, among their other helpful efforts.

Uh... what's the usual script-kiddy method? I mean, I know I can type 'exit' if I've started a regular 'chroot' without specifying a prog... but... maybe I'm not visualizing it right. I'm seeing a chroot jail as a "system within a system" - if you exit, you end up at a login prompt. That's it. Real "root" is only available via a different IP; in effect, you're logging into a different system. Correct?

Minimum Mechanics:
  1. blank hard disk
  2. install parent level with syslog, cron, ssh, sudo.
  3. create subdirs for jail areas (e.g. /home/HTTPD-jail, /home/MAIL-jail, etc.)
  4. run installer again, using "already mounted directory". Once per jail of course.
    Mhm. I wonder how hard it would be to create a stripped-down installer just for the purpose. Might make a nice project, don't you think?
  5. tweak each jail like it was a seperate machine you could boot into normally that was dedicated to the purpose. Each jail's ssh must be on a unique IP address/port number combo.
  6. grafting - setup top level so it runs services out of their jails, already chrooted there.
  7. time to make an IPL backup
  8. stripping - take more stuff out of the jails, that they will NEVER need because they are really not the top level after all. e.g. fsck, copy of the kernel and modules. This may require some brutal adjustments to the packaging systems so they won't get put back if you choose to upgrade the jails later. Possibly make it so there should never be a need to be root inside the jail anyway. etc.
  9. time to make IPL backup #2, on a different media from #1. Allows for return to this point, or to decide you went overboard and try shaving that differently by starting again from #1.

Eh... you lost me there on #6; that's the part I'm not seeing. What's the interaction mechanism between the two levels? How does the "top" see the "bottom" without the "bottom" seeing the "top"?

I usually run a lot of things from /etc/inittab so they can be respawned if they die.

For #8 I agree, that's the way I would do it - since root can twiddle anything on the mounted filesystems, there shouldn't even be root access in there. Although I would set up some sort of an "admin" account, with carefully decided powers.

Might be helpful to have more hard disks, or seperate partitions for each jail. I gotta stop procrastinating like this ;>

I'm glad you did. :) Thanks - I'll dig into it some more!


Password list

Tue, 30 Oct 2001 08:49:40 -0500
Ben Okopnik (LG Contibuting Editor)

OK, so this is straight out of any security FAQ: whatever you do, _don't_ keep a list of your passwords on your machine. Right? Right.

Now, since you're going to do it anyway... :) Here's a somewhat safer way to do it - note that I did not say "safe", just "safeR". The way I see it, those of you who don't keep one won't be affected, and those of you that do will notch up the security just a tad.

To make this work, you'll need something to keep your secrets for you:

See attached pass.bash.txt

Here's what you do: put this script in a directory that's in your path, say "/usr/local/bin", then set the ownership and permissions as follows:

chown root:root /usr/local/bin/pass	# You must be root to do this
chmod 755 /usr/local/bin/pass		# And this, too

You now encrypt the file that contains your list of hosts, usernames, and passwords, one per line:

www.cia.gov		JohnDoe			cRYpTo
www.kgb.ru		IvanIvanov		bOLsh0isEkRET
www.mossad.il		PloniAlmoni		sHiN8eT
kempeitai.jp		NanashiNoGombe		haITTeM0ikEmAsEN
www.mybroker.com	FulanoMengano		QuIenSaBE
www.mybank.bm		MattiMeikalainen	sAipPUakAuPPIAs
www.centralbank.an	JanModaal		fInanCIeeL

...with a command like:

crypt My1SecretPasswD < mysecrets > ~/pass

Move the original ("mysecrets") to a floppy and put it somewhere safe (yes, that usually means where nobody - not even you will ever find it again. :). Remember to update it once in a while. As to the encrypted file, all anyone is going to see when they look at it (you did set its permissions to 0600, right?) is a bunch of binary-looking gobbledygook.

Now, let's say you want to see what the combo is for "mossad". Easy enough:

spy@Hideout.com:~$ pass mossad
Enter password (screen echo disabled):
www.mossad.il		PloniAlmoni		sHiN8eT
spy@Hideout.com:~$

If you want to edit the file, just type "pass -e"; this will invoke your editor ("$EDITOR" - "vi" by default) on the decrypted version of the file.

"grep"-related tip: if you want to just see the entire file, call it as

pass $


DNS

Sun, 11 Nov 2001 12:21:43 -0900
Heather Stern (The Editor Gal)
and Faber Fedor (The Answer Gang)

David Menegat asked us the following:

I am trying to set up a name server on my mandrake 8 system and I believe I installed the dns package I just don't know how to configure it do you know where there is a faq or have any advice for me. I just bought a domain name and this is the last piece in the puzzle before the final configuration and I transfer the name to my machine.

Thank you David Menegat

[Faber] Well, there's always the HOWTOs: http://www.linuxdocs.org/HOWTOs/DNS-HOWTO.html
[Heather] There's also the absolutely marvelous resaources of "Ask Mr. DNS".
Although Acme Byte and Wire was bought by Network Solutions, there still exists his marvelous archive of detailed answers to how DNS works:
http://www.acmebw.com/askmrdns
If that doesn't answer what you need, you can also ask him questions directly at his current email address... which I won't tell you, you'll have to read his archive first :) BTW as far as I can tell, he only answers questions for DNS sites which he can access, so he can see what things are resolving like.
We hope it helps! Let us know if Linux itself has any extra questions for you, or there's a spot in the DNS-HOWTO we can explain a bit better for you. We want it to make sense :D

To which David replies:

Thank you very much I'm sure I'll have no problem now
thank you
David Menegat


using m-w online dictionary.

Mon, 19 Nov 2001 21:30:59 -0500
Matt Giwer (jull43 from tampabay.rr.com)

looking up words in the m-w dictionary. I thought you carried this about a year ago.

create a file named def containing

# def <word> goes to Mirriam Webster page of it definition
lynx "http://www.m-w.com/cgi-bin/dictionary?book=Dictionary&va=$*"

used as

def word


PacHell DSL w/LINUX

Sat, 24 Nov 2001 20:47:32 -0800
(j_on_e from sbcglobal.net from sbcglobal.net)
(tag@lists.linuxgazette.net)

Johny asked us ... in quoted-printable, and in HTML:

Im a newbie to Linux but want to lear really bad. Im tired of the limitations in Windows. Anyway, I just installed OpenLinux eDesktop2.4 Caldera Systems and want to know how to configure it for use with my PacBell DSL using an Efficient Networks SPEEDSTREAM Modem.
a.. 5260 ADSL (ITU Annex A)
a.. 5260: G.DMT, G.Lite, T1.413 (ADSL)
I cannot find a driver or figure out where to configure or how to configure all of this to work so that I can get my linux online. Please help or forward this to anyone and everyone who may be able to help me out. Thank you very much for your time and I hope I can get this going very soon.

First, please send mail in text format rather than text+HTML.
External DSL modems (that connect to an ordinary Ethernet card via an Ethernet cable) work fine on Linux. Internal DSL modems are iffy, especially if they're USB. It all depends on whether the manufacturer provides Linux drivers or gives us enough of the card's specs to enable us to write a driver or expand one of our existing drivers. Unfortunately, there are so many different types of DSL modems and none of them are as widely used as the different analog modems, so drivers are less likely.
Also, there are analog modems called "Winmodems" that are marketed as real modems but they actually have part of their hardware missing. The missing portion is handled by the Windows driver. These didn't run under Linux for several years, until some Linuxers reverse-engineered them enough to make drivers for at least some of them. I don't know whether DSL modems have an equivalent to these "Winmodems", but you have to watch out for that possibility. Especially if the DSL provider "supports only Windows".
If your modem is new enough that you can return it and get an external modem instead, that's your best bet. It may cost $100-200 more, but it will be worth it because the modem will be more standards compliant, meaning fewer headaches in the future when you upgrade, move or switch systems.

I'm not sure if DSL has fallen victim to the "sahave off chips to save a few cents a motherboard" craze. On the other hand, there's PPP over Ethernet (pppoe) to run away from. Even though you in theory would get full ethernet bandwidth, in practice that protocol slows you down to PPP speeds deliberately. Some very knowledgeable sysadmins I know go directly into "rant mode" when just hearing the acronym. -- Heather


How we fixed "FW-I/LINUX kmalloc" problem

Thu, 1 Nov 2001 17:36:28 +0200
Vitaly Karasik (vkarasik from ndsisrael.com)

It may be too small for article and too big for letter, but I hope it will useful for LINUX/FW-1 administrators and provide a good example of OSS advantages.

Regards,

Vitaly Karasik Unix System Administrator Israel

But it's perfect for a 2 Cent Tip. -- Iron

---- We've tried to replace our NOKIA FW-I box with LINUX one [FW-I v4.1 SP4 + RedHat 6.2 2.2.19 kernel].

Installation was pretty strainforward, but every time when we tried to install policy from our management station we got few messages in /var/log/messages:

/var/log/messages.4:Oct  5 14:29:42 fw kernel: kmalloc: Size (786540) too
large
/var/log/messages.4:Oct  5 14:29:42 fw kernel: kmalloc: Size (786636) too
large
/var/log/messages.4:Oct  5 14:29:42 fw kernel: kmalloc: Size (789660) too
large

Our policy contains about 90 rules & 400 objects with few VPN.

Short search with Google pointed us to a few letters with the same problems, but didn't help to solve the problem. (for instance, "[FW1] Strange things in RH62 + Fw1-41-Sp2( kmalloc: Size (275548) too large )" thread on http://www.firewall-1.org/2001-01/maillist.html)

According to skl1314 from Check Point SecureKnowledge, "solution is currently not available. Issue under investigation".

But this search helped me to understand what is exactly the problem: FW-1 call "kmalloc" function in order to get block of memory. But linux's kmalloc [kernels 2.2.x & 2.4.x] knows to allocate memory in blocks 2K,4K, ... 128K only. And FW-1 in our case wants to get ~800 K memory.

The solution:

I fixed slab.c in order to increase kmalloc limit from 128K to 1280K. Diff from orig slab.c for kernel 2.2.19 is below:

298c298
< #define	SLAB_OBJ_MAX_ORDER	8	/* 32 pages */
---
> #define	SLAB_OBJ_MAX_ORDER	5	/* 32 pages */
301c301
< #define	SLAB_MAX_GFP_ORDER	8	/* 32 pages */
---
> #define	SLAB_MAX_GFP_ORDER	5	/* 32 pages */
345,347d344
< 	{262144,	NULL},
< 	{524288,	NULL},
< 	{1048576,	NULL},
370,374c367
< 	"size-131072",
< 	"size-262144",
< 	"size-524288",
< 	"size-1048576"
<
---
> 	"size-131072"

After compiling & installing new kernel we're able to install fw policy without any problem.


DSL Drivers for USB

Mon, 5 Nov 2001 13:18:19 -0500
Andy Fore (arfore from valdosta.edu)

This is in answer to the question about USB DSL drivers for Linux.

There are drivers out there for the Alcatel SpeedTouch USB. The SpeedStream 4060 is actually made by Alcatel.

I have setup the SpeedTouch in RedHat 7.1 and gotten it to successfully work on my home network.

Andy Fore
Computer Services Specialist III


gtkmm-config problem

Mon, 26 Nov 2001 07:09:04 -0500
Dann S. Washko (The Answer Gang)
When testing the gtkmm hello world code on this page I get errors:
http://gtkmm.sourceforge.net/tutorial/sec-gettingstarted.html
bash-2.05$ g++ test.cc -o test `gtkmm-config --cflags --libs`
In file included from /opt/gnome/include/gtk--/base.h:34,

from /opt/gnome/include/gtk--/object.h:30,
from /opt/gnome/include/gtk--/widget.h:32,
from /opt/gnome/include/gtk--/container.h:27,
from /opt/gnome/include/gtk--/bin.h:27,
from /opt/gnome/include/gtk--/button.h:27,
from test.cc:2:

/opt/gnome/include/gtk--/proxy.h:6: sigc++/signal_system.h: No such file
or directory
/opt/gnome/include/gtk--/proxy.h:7: sigc++/bind.h: No such file or
directory
/opt/gnome/include/gtk--/proxy.h:8: sigc++/convert.h: No such file or
directory
test.cc:4: `#include' expects "FILENAME" or <FILENAME>

For some reason (I believe) something is not getting passed to look for the sigc++ headers in /opt/gnome/include/sigc++-1.0/sigc++.

I was getting more errors about not being able to find sigc++ headers before I added -I/opt/gnome/include/sigc++-1.0/sigc++ to the gtkmm-config file. Without this line or taking off the sigc++ directory, produces more errors about not being able to find the headers in sigc++.

The sigc-config file looks just right.

Furthermore, this all started when I tried to compile quickedit. During the configure process I received and error that gtk-- was not installed correctly and/or I should edit the gtkmm-config script to correct anything off in there. Viewing the config.log shows the same error as above.

... after a bit of fighting with it ...

The problem must have been with gtkmm-config or the gtkmm packages I had originally installed. I compiled gtkmm from the sources and everything appears fine. Quickedit compiled without complaint. I noticed the one line in the new gtkmm-config that was not in the old was -I/opt/gnome/lib/sigc++-1.0/include. I had mistakenly put this in the libs area instead of the cflags. I'm not sure whether this was the whole crux of the problem though.

-- Daniel S. Washko Lehigh Valley Linux Users Group www.thelinuxlink.net/lvlinux get slack (www.slackware.com ) and get happy


Linux equivalent for Active Directory?

Tue, 30 Oct 2001 11:39:30 -0800 (PST)
Craig Baker (ctbaker78 from yahoo.com)

Ok Im just learning Linux so bare with this question...I know in Windows 2000 Server you can create a Active Directory and install a Distributed Files system...what would be the Linux counterpart to this be? I've poored over alot of FAQs but I must not be looking for the correct terminology. So far the closest Ive found is NIS/NIS+ with NFS.

Take a look at LDAP (i.e., where Microsoft got the original idea) - OpenLDAP <http://www.openldap.org> has some good info on their site; their "General LDAP FAQ" is worth a read. As well, Jeff Hodges "LDAP Roadmap" <http://www.kingsmountain.com/ldapRoadmap.shtml> is an excellent resource. Novell with their NDS (Novell Directory Services) had an early jump at the idea of abstracting the directory structure from the FS; chances are pretty high (I'm making a guess here - I don't know Caldera that well) that Caldera, being a Novell "sister" company, supports it. To confuse the tangled skein a bit more, Novell has released the JLDAP (the LDAP class libraries for Java) to the world - I haven't done Novell stuff in years, but I would guess that LDAPv3 is what they're using these days. There might be other implementations of the idea, but the key words, rather than "Active Directory", would be "LDAP" (Lightweight Directory Access Protocol) and "X.500" (the protocol that defines LDAP.)


Re: [LG 72] 2c Tips #4 translated oddly

Mon, 19 Nov 2001 11:31:10 -0800
Marcelo E. Magallon (marcelo.magallon from bigfoot.com)

Hi,

I think the translation of the original message is wrong. The original poster is asking about a content manager, not an editor. Here:

información acerca de algun manejador de PHP con el cual pueda modificar los archivos de páginas de internet bajo Linux Red Hat 7.1

Even if the Spanish translation of several computer terms varies wildly across countries, I can't imagine a place where an 'editor' would be called 'manejador'. This word means 'manager'. Even if it's not clear what the original author actually wants or needs, I think he's thinking of something along the lines of Midgard, available at http://www.midgard-project.org.

If the original author does mean an editor, Heather is right on the spot: vim, in particular vim 6, has some nice features, like improved syntax definitions and folding, that make editing of HTML and PHP files much easier.

HTH,
-- Marcelo

Thanks Marcelo. The original querent never wrote back to tell us what he was looking for, even after we asked him. So I'm inclined to think he's either already found what he needs, or it's his fault if we misunderstood it. But we've published your tip for other readers. -- Iron


This page edited and maintained by the Editors of Linux Gazette Copyright © 2001
Published in issue 73 of Linux Gazette December 2001
HTML script maintained by Heather Stern of Starshine Technical Services, http://www.starshine.org/


(?) The Answer Gang (!)


By Jim Dennis, Ben Okopnik, Dan Wilder, Breen, Chris, and the Gang, the Editors of Linux Gazette... and You!
Send questions (or interesting answers) to tag@lists.linuxgazette.net

There is no guarantee that your questions here will ever be answered. Readers at confidential sites must provide permission to publish. However, you can be published anonymously - just let us know!

TAG Member bios | FAQ | Knowledge base


Contents:

¶: Greetings From Heather Stern
(?)clock setting
(?)device drivers
(?)fine-grained delay in shell scripts
(?)Serial Programming on an i486 in Linux
(?)Shut down when turn computer off
(?)slib installation
(?)SuSE 7.1 installation CD not recognized
(?)Installing tulip.o in 6.2
(?)Just wondering

(¶) Greetings from Heather Stern

Hi everyone and welcome! This month I hope you like the threads I've selected for you, nice, juicy, full of meat...

Hmm, I wasn't expecting to make that sound like the turkey dinner I had last week. Oh well! I hope you had a good Thanksgiving, and of course we all wish you the best for the winter season too.

Now on to the nitpicking ;) By a HUGE margin the Peeve of the Month is poor use of the subject line. It so happens that we had really high traffic on our administrative list -- something to do with the new FAQ and knowledge base getting posted, everybody give a big hand to Ben and Chris! -- but, we actually got more slices of mail with useless subjects, totalling about a fifth of the overall mail for the month.

What do I mean? Well, I'll put it the same way Ben does. You have only 40 characters (in most mailers). Don't waste them on things like "Help me" (why else would you be mailing us? Hoping to frame our most creative flames?) and "Linux problem" (good, you have the OS we know best) or even, cheerful though it makes us, "Hi Gazette" (yep, that's us, you reached the right place).

Even worse is people who have no subject at all. Now it's true that with so many helpful souls in the Gang a lot more of the questions get answered nowadays. But, my statistics show that about two-thirds of the messages with no subject were utterly ignored. Not even a worn out match starting a flame. Nada, zip, zilch. So you really hurt your chances of getting anything more than a lump of coal in your stocking by not having a real subject on your questions for The Answer Gang.

So, the trick is, make sure your subject contains at least one noun or verb that relates directly to the question. "SuSE install" or "wheelmouse woes" or something, so we can guess if that message is something we know about, so we can leap into the fray.

Okay, now what can I say about Linux? Well, let's see. It'd be a great x-mas present to see that 2.4 kernel stabilize now that 2.5 is properly set up. (I'd go for "peace on earth" but it seems to be making a nasty hole in the stocking, darn it.) I already lost my bet that it'd be 2.4.14 that would win. What I really want is one of those 21" studio LCDs but, I'm broke this season, so I'll probably have to make "21 inch diagonal" my New Year's Resolution. <brickbats appear from offstage> hey! watch it! You trying to break my old monitor? That's it for now. Whatever you do this season don't forget to Make Linux A Little More Fun.

Jim and I will be at the annual Large Installation System Administrators conference in San Diego, the first week of December. USENIX always has a great seminar track, plus a lot of the developers we've gotten to know personally are regulars. If you can afford it, I highly recommend going. If you are going, perhaps we'll see you there.

Failing that, see you next year...


(?) clock setting

From Bryan Henderson

Answered By Bryan Henderson

By this odd chance, the Gang get to be the querents, and we have a real guru to answer our clock questions at hand. Thanks Bryan! -- Heather
(!) As the maintainer of the main Linux hardware clock managing program, Hwclock, I found the Answer Gang discussion and survey of daylight savings time switches and other hardware clock issues enlightening. I'd like to add some important information.

(?) [John Karns] Thanx for your contribution! I for one really appreciate it.

(?) [Ben] First thing, Bryan - thank you for the info, as well as for the very useful job that you're doing!

(?) [Mike] Yes, Bryan, thanks for taking the time to write that explanation, and for offering to debug distribution-caused problems.

(!) First, let me state that the _only_ sane reason to keep your hardware clock in local time is if you sometimes run Windows on the machine. Windows isn't capable of using a hardware clock in any other format. Unfortunately, local time is Hwclock's default and the default that Red Hat and I believe other major distritbutions ship.

(?) [John K] How about time zones where daylight savings doesn't apply?

(!) Then it's less insane to keep your hardware clock in local time, but still not sane.

(?) [Ben] I certainly appreciate it; I'm sure that a number of our readers do as well. One of your tips in here - the persistence of "UTC" - has already let me figure out why my localtime was "backwards" (i.e., 5 hours earlier instead of later) if I set the hardware clock to UTC. I don't use Windows, but I do travel quite a lot, which means I have to keep changing time zones; do you have any advice or pertinent info for doing this

(!) First of all, of course, keep your hardware clock in UTC format. Whenever you enter a new timezone, do a quick 'ln' command to link /etc/localtime to the descriptor for your new timezone.

(?) [Ben] Ah, so. Actually, I've often thought of writing up a "Mobile Linux" article - a sort of a HOWTO for traveling with Linux - and you've just cleared up one of the last pieces of the puzzle. Tres cool. For those folks who need to bounce around as I do, here's something that'll be useful:

See attached chzone1.bash.txt

This script will present you with a menu of choices for the Eastern, Central, Mountain, and Pacific timezones. Pick one, and you're set.

(!) The /usr/share/zoneinfo/US directory may be more appropriate here.

(?) [Ben] Odd. The entire "tz*" suite (tzselect, tzconfig, etc.) uses the "America" version. <looking at the contents of 'US'> Ah. OK, that seems to make sense - at least you'd be setting the timezone by name ( <grin> I'd spent a few minutes hopscotching through "tzselect", back and forth, back and forth, to figure out which cities it used for which zones.) So, here's an updated version of "chzone" - this one actually covers a wider range but keeps the choice list down to the actual zones rather than the (possibly confusing) list of cities:

See attached chzone2.bash.txt

(!) The C library (GNU libc 2) looks at /etc/localtime for the description of the local timezone. That can be a symlink to the relevant timezone descriptor in /usr/share/zoneinfo. (I use US Pacific Standard/Daylight time, so I link to /usr/share/zoneinfo/US/Pacific). If you don't have descriptors for every timezone known to man in /usr/share/zoneinfo (5 MB of them come with glibc -- having them all installed appears to be "normal"), you'll have to install them per your distribution. Sometimes they are in /usr/lib/zoneinfo.
Note that changing timezones doesn't cause any time discontinuity. You aren't changing the clock, only the language your system uses to communicate to humans about what time it is.

(?) [Ben] ... (hopefully, without screwing up "/etc/timeadj") other than setting the TZ to the appropriate value? Are there any non-obvious issues with the clock that I should be aware of when I do this?

(!) You change your hardware clock to UTC by adding the --utc option to any clock-setting 'hwclock' command. You only have to do it once, because your choice gets saved in /etc/adjtime and becomes your default in the future.
The major practical drawback to keeping your hardware clock in local time is that in most locales, local time jumps an hour twice a year. The hardware clock is incapable of implementing that. So you have to explicitly reset the hardware clock twice a year. Windows does that automatically. In Linux, you can do it with a startup script and/or cron job, but I'm not aware of any Linux distribution that does it out of the box. If you're running both Linux and Windows, though, I think both would make the adjustment!

(?) [John K] In my case, the time doesn't change, as I'm near to the equator.

(!) Actually, the time doesn't change for anybody; only the local time representation does. :-)

(?) [John K] OK, but I think you understand what I'm saying - daylight savings time doesn't exist here.

(?) [Mike] Where do you live? Indiana?

Why are there not timezone configurations for those locations, and if they're not, how hard is it to copy one and modify it to disable the DST?

(!) He said it's near the equator, and he didn't say he can't do timezones the normal way (in fact, he probably does). He just pointed out that it isn't as advantageous to him as it is to most the world to keep his hardware clock in UTC format, because one of the advantages of UTC format is that you don't have to reset your hardware clock for DST changes.

(?) [John K] Also, the Linux based distributed network I'm setting up, at this time is all contained within one time zone. Thus, I haven't felt compelled to leave my hw clock set for utc. I did try it once on my personal laptop, (sans the --utc option though - I probably used hwclock to set the time, but can't remember all the details) but didn't like the fact the timestamps on my files (ls) were not in agreement with the time as displayed by the 'date' command

(!) The hardware clock format doesn't affect ls and date displays -- unless there's a bug in the system, of course. I do often see people configure their machines for the wrong time zone and then keep the hardware clock set to the wrong time to compensate. This causes some displays to be correct, but always causes something else to be broken.

(?) [John K] I've never done that or even considered doing it, as I can see where it could really distort parts of the system and create havoc. What I'm trying to say here is that, well let me give an example:

  • Local time is 1pm
  • I create a file
  • I do an ls, which shows the file with a date-stamp that's skewed e.g., 6 hrs from local time.

Thus I constantly have to do mental arithmetic to figure relate these times to my frame of reference, which is local time. It's particularly undesirable when those 6 hrs spans midnight, so the date-stamp shows a different day.

(!) And every once in a while you see a program that chooses to display times in UTC (because it's easy). If you lie to your system about what time it is, you can trick that program into displaying local time! But that breaks other programs. If you then lie about what time zone you're in, those other programs start appearing to work, but still other things break. It usually falls apart as soon as you try to communicate to the rest of the world, for example email timestamps.

(?) [John K] - it tends to make things a little bit confusing. So I changed things back to local time.

I do also run Windows but mostly via VMWare on a Linux host. Do you have any info or input in regards to that scenario?

My main concerns are these:

The distributed net that I'm setting up could eventually span outside of the local time zone. When and if that happens, it might make sense to use utc.

(!) If we're still talking about the hardware clock internal format (UTC vs local time), I don't think the issues change when you expand into multiple time zones. Using local time shouldn't be any worse than with one time zone, since Hwclock does all the work of converting between Unix standard format and hardware clock format.

(?) [John K] I have read about the Unix standard format and more or less know what it is, but don't really understand the big picture here - how all the parts fit together.

(!) But if you mean set the timezone on all the machines to UTC so that displayed times are the same on all systems, that's a separate question.

(?) [John K] But the LANs are a heterogeneous mixture of W9x and Linux clients with a Linux server providing application sharing and Internet gateway services. I wish to use samba for W9x file sharing and login / user profile control, as well as run a batch file to sync the clocks on the w9x clients to the server clock. In short, I want to have all clocks more or less synchronized.

I don't quite follow you here - "displayed times"? .. what about syslogd? My concern is mostly with file date-stamps, and system logs. Lets say I'm examining a system log of a remote system located in a different time zone. I would like to avoid confusion about when specific events may have happened in relation to my local time - and this would be my principal motivation for using UTC. For example, I will have a "master server" which will be doing telephone dialup to remote hosts to exchange mail, collect system logs, etc. I would like to have the master server log timestamps of the dialup session agree with those of the remote system logs, rather than all be skewed one or two hours. Same with file creation & modification timestamps. I will likely have a Perl or bash script run via cron on remote systems to collect all files of interest having a date-stamp falling within a certain time period.

My understanding prior to the test I did at least a year ago when I set my hw clock to UTC, was that such date-stamps would be shown (e.g., via ls) as local time, but UTC would allow for a standard that would put all systems using it on an equal level, and would help to eliminate confusion regarding date-stamps on files between different systems. But that didn't seem to be the case - it simply added more confusion.

(!) The usual way to do that is with an ntp network (run ntpd on all the systems. Have a master ntp time server that gets time from some higher authority and distributes it down to everyone else). Don't use Hwclock at all (I mean it -- if you set the hardware clock manually even once, the system won't maintain it automatically after that).

(?) [John K] That's what I have been thinking - sync the "master server" clock via NTP (ADSL has just recently been introduced here, so now a full time Internet connection is possible); then use a system util such as ntpdate or rdate (samba logon batch files for the other OS) to sync all other clocks to the master. Since my "WAN" will be mostly dialup, using the NTP daemon an all servers is not possible or practical.

I still have questions about UTC re: W9x and other flavors under VMWare. I guess a little experimentation is in order.

I hope that I haven't rambled too much, and thanx for your input.

Any thoughts you might care to express about this would be greatly appreciated.

(!) Regardless of in what format you keep your hardware clock, the display of the time by 'date', 'ls', etc. is controlled by the time zone settings as defined by the C library (e.g. the "localtime" function). Remember, the time does not change each Spring and Fall -- only what we call the time changes. Properly configured, the C library routines generate daylight savings time in Summer and standard time in Winter. The underlying clock is oblivious.

(?) [Ben] Is the above configuration anything that needs to be done by the local admin/user, or does the above mean "properly configured by the author/maintainer/etc of the C library"?

(!) It's C library installation options, like the /etc/localtime setup mentioned above.

(?) [Ben] Hm. All I can do is hope - now that my hardware clock presumably resembles something normal - that the Debian installation options are right. Heck, I'll even go so far as to disable my "spring forward, fall back" cron jobs. :) I'm a brave soul, I am.

(!) The original querent was having trouble with Ls displaying times in UTC instead of local time in Red Hat 6.1. I've dealt with those messy time zone problems (There was a totally different way of doing time zones before Red Hat 6.0, by the way, and the conversion wasn't perfect) many times, and I'd be happy to debug this problem for anyone who is having it.

(?) [John K] I'm a bit fuzzy on this issue too. What is the expected / intended system behavior in this regard? If I set my clock to UTC, and specify hwclock's --utc parm as you have suggested, then the system should compensate in such a way that the ls command would show timestamps reflected as *local time* - or UTC?

I suppose that the system always stamps the files in accordance with the Unix standard format, and it is up to the various parts of the system (ls, tar, and the like) to do conversions in relation to either UTC or local time. What I interpret you as saying is that there have been instances where these various progs are not in agreement concerning the method with which these conversions are done. Am I Correct? I guess it's time for another try at setting one of my boxes to UTC to find out what.

I think this was what I was experiencing as well (SuSE 6.4).

(?) [Ben] A very cool offer indeed - you can't get much better than that if you're having problems with the above. I'm not, but - Bryan, my job takes me to the Bay area on a fairly regular basis; I'd be more than happy to stand you a beer if you're interested, on behalf of all the folks that need and appreciate your help.

(!) I'd love to.

(?) [Ben] Excellent - I'll be up there, let's see <rummaging> the first week of next month <waving at Jim and Heather>. See you then!

(Hmm, perhaps the "beerware" concept is outdated. If all of us bought beers for all the authors and maintainers, there wouldn't be any more authors or maintainers - not sober ones, anyway. And where would we be then? :)

Down at the pub, nursing a few sharp ginger beers, or root beers if you like them better, until the Guiness wears off and we're safe to drive home. 8) -- Heather

(?) device drivers

From ranjeet k s

Answered By Dan Wilder, Udo Puetz, Mike Orr

to sir,

thanks for reply i wanted to know information regrading linux device drivers books or manuals pages from net and tcp/ip for professional people.

thanks ranjeet

(!) [Dan] You've reached a mailing list administrative address. I'm forwarding your query to the <tag@lists.linuxgazette.net> mailing list.
You might try a search for
linux device drivers
on http://www.google.com
I just tried it and got 304,000 matches, of which most of the matches in the first two pages (as far as I got) looked worthwhile to visit.
(!) [Udo] Hi!
You could download "writing linux device drivers" on the oreilly web-page (www.oreilly.com) some time ago (I think 2-3 months ago). This was not the last release, but hey, it's for free and online :-)
(!) [Mike] There was an article about writing device drivers recently in LG:
http://linuxgazette.net/issue69/mathew.html
This article is about a PC speaker driver, but it serves as a general example. Republished from Linux.com with theirs and the author's kind permission. I requested this article for LG because we had a need for articles on device-driver programming.

(?) fine-grained delay in shell scripts

From Ben Okopnik

Answered By Thomas Adam, Mike Orr, John Karns

So, you're writing a shell script, and you want to add a little pizzazz: you know, a little blinking indicator, or a slow display that prints out "Please wait" one letter at a time or something. You look around, and the only choices you've got are a) "sleep" (a minimum 1-second delay), or various strange things involving loops and "cat"ting large files (which makes you CPU usage shoot up into the 90% range.) Blechhh. What's a poor but honest scripter to do?

Farm the job out, of course.

See attached nap.pl.txt

It doesn't get much simpler. "nap" will give you a delay in milliseconds, plus a tiny machine-dependent fudge factor for starting Perl. Here, as an example, is that famous "rotating dash" indicator, using "nap":

while :; do for x in - \\ \| /; do printf "%c\b" $x; nap 100; done; done
(!) [Thomas Adam] Tut tut Ben. For this kind of use, I always tweak the millisecond usage of the command:
"usleep"
Then I can use a for i in....loop and a usual "echo" in Bash.
Works everytime.
But, I prefer your script!! :-)

(?) OK, I'll admit my ignorance - what's a "usleep"? There's nothing like that on my system, or indeed in the Debian "Contents-i386.gz" file list. Please enlighten me. (I do seem to _vaguely_ remember something like that in C, but that's less than helpful.)

(!) [Thomas] But, I prefer your script!! :-)

(?) <grin> Well, you got _something_ useful out of it. That's a plus.

(!) [Mike] ..From "man 3 usleep": "The usleep() function suspends execution of the calling process for usec microseconds."
It looks like it's available only as a C function. Somebody should wrap it up in a command.

(?) <smirk> I did.

(!) [Thomas] ....and they did just that :-). I believe that on RedHat systems, it was supplied as part of the "initscripts" rpm, thus:
http://www.rpmfind.net//linux/RPM/redhat/7.2/i386/initscripts-6.40-1.i386.html
/sbin/usleep
is where my copy resides (despite the fact im running SuSE 7.1 professional).
Hope that helps
(!) [John K] No such animal on my SuSE 7.2 install ...
jkarns@jkInsp8000:~ > locate usleep /home/jkarns/Dwnlds/Linux/XScreenSavers/xscreensaver-3.32/utils/usleep.c /home/jkarns/Dwnlds/Linux/XScreenSavers/xscreensaver-3.32/utils/usleep.h /home/jkarns/Dwnlds/Linux/XScreenSavers/xscreensaver-3.32/utils/usleep.o /usr/share/doc/packages/mod_php/doc/function.usleep.html /usr/share/doc/packages/phpdoc/manual/function.usleep.html /usr/share/man/allman/man3/usleep.3.gz /usr/share/man/man3/usleep.3.gz

(?) As I'd mentioned, it's not part of Debian - whereas Perl is in every distro. I'm sticking with portability. :) Besides, when would you ever need microsecond precision in a shell script? Even milliseconds is splitting it frog-hair fine.

(!) [Mike] You don't, but sometimes you want to delay for a quarter second or half a second.

(?) BTW, "usleep" isn't described in "libc.info.gz", either - although there's an interesting-looking "nanosleep".


(?) Serial Programming on an i486 in Linux

From V Sreejith

Answered By Chris Gianakopoulos, Ben Okopnik, Heather Stern

hi all,

This is my first posting. Here I have a problem related with linux serial programming in C.Hope u can help me in this.

I have a C program that communicates with a remote terminal unit via serial port.The program uses termios structure to initialise the port. The program works as expected in kernel version 2.4.2-2 on an i686 macine.

This same program when tested on a 586 (Kernel 2.2.14-12 on an i586) machine fails to read the port properly. Writing to the port was working properly. The setserial and stty commands produced the same result on both machines.

(!) [Chris G.] What does "failing to read the port properly" mean? Do the data look rather odd? Does it look garbled?

(?) Later i found that minicom(communicating with hyperterminal in windows) also showed the same problem while reading the port on the 486 macine. Writing to the port was working properly. Communication was proper when hyperterminal was used on both sides.

Here is the o/p of the setserial command.

/dev/ttyS0, Line 0, UART: 16550A, Port: 0x03f8, IRQ: 4

Baud_base: 115200, close_delay: 50, divisor: 0
closing_wait: 3000
Flags: spd_normal skip_test

and here is the settings on the port using stty command while my program is running.

(!) [Chris G.] I am guessing that your baud rate is 115200 baud.

(?)

speed 9600 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D;
eol = <undef>;
eol2 = <undef>; start = ^Q; stop = ^S; susp = ^Z;
rprnt = ^R; werase = ^W;
lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 hupcl -cstopb cread clocal
-crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr
-igncr icrnl ixon -ixoff
-iuclc -ixany -imaxbel
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel
nl0 cr0 tab0 bs0 vt0
ff0
isig icanon iexten echo echoe echok -echonl -noflsh
-xcase -tostop -echoprt
echoctl echoke
(!) [Chris G.] I am guessing that your baud rate is 9600 baud.

(?) If anybody knows what is creating the problem... please do help..

regards, sree

(!) [Chris G.] Hey Sree, Are you running both sides of the link at the same data rate? The parameters that you displayed give me the indication that the data rates are not the same.
When you type on one terminal, do you see anything displayed on the other terminal? If they are different, one cause could be mismatched baud rate. Your stty parameters seem okay -- if they are not, someone else will probably jump in and correct me.
Get back to me (at you convience of course), and let me know what you see on the displays.
I hope that this helps, Chris Gianakopoulos

(?) hi chris,

I think this isn't the problem of the code as this same code is working as expected in an i686 machine.

(!) [Ben] I agree with you here, Sree; if "minicom", etc. are having problems, then your programming isn't what's at fault - it's "lower down". That could still mean that there are problems with the baud rate, however - the "lower down" part means anything from the serial port settings, through hardware initialization, to actual hardware problems (the last of which you've eliminated by trying it in Wind*ws.)

(?) So it couldn't be the problem of baudrate,parity etc. Ofcourse my baudrate is 9600 and the stty command showed that i have initialised the port as expected.stty command showed the same o/p for i686 and i586(not i486 ..sorry for the mistake).

(!) [Chris G.] That's ok. If you are at the same baud rate, you might expect things to work.
(!) [Ben] Why the "of course"? I almost always set my port speed to 115200. One of the few exceptions is when I'm reading from my Minolta Dimage V camera: it will not work with anything past 38400.
Have you tried your program on another 586, preferably a different make and model? It could be that the serial hardware on that specific machine is wonky, or that it's sufficiently strange that the serial driver is having problems. I would also urge you to study the "setserial" man page; if indeed the driver is having problems, "setserial" gives you _tons_ of configuration options, and you might be able to "configure the problem away."

(?) My problem(in an i586) is that i can't read from the port properly.I could get the no of bytes available on the port with an ioctl call.The program fails to read that bytes..

Sometimes it reads correctly a few bytes.. But most of the time the read function returns with Zero bytes read even if bytes are available on the port. Writing was working properly(verifying..by the return value of write function)

Earlier i thought it could be some problem with my code.Later minicom also showed the same problems.That is, whatever was typed on my keyboard was displayed on hyperteminal on the windows machine on the other side correctly.But when i typed something on the other side(in hyperterminal) it was not reaching here properly.That is, once it displayed some ..2 or 3 characters correctly and failed to show the rest.

(!) [Ben] Hmmm... that _does_ sound like a speed problem. If the port on the other machine was set to, say, 57600, and this machine was set to 9600, it would "miss" most of the characters sent to it (although the classic speed problem shows up as random garbage mixed with a few of the characters being sent.)

(?) When hyperteminal was used on these side also ..everything was ok. So i guess..there is no problem with the serial port.

Could this be some problem with the serial driver in linux.

i think the problem is more clear now...

sree

(!) [Ben] Wind*ws, depending on the version, sets the serial port speed to 57600 or 115200, if I remember correctly.
(!) [Chris G.] Hi sree,
You have got an interesting problem here. First, let me mention that I read Ben Okopnik's response, therefore, I will attempt to provide information that does not overlap his response. Take his response into consideration.
Let's pretend that your baud rates are the same on both sides. When you type on your Linux machine, the characters appear on the Hyperterminal display. So, you Linux machine can send, and your Hyperterminal machine can receive.
Now, when you type on your Hyperterminal machine, I get the impression, that the first few characters that you type appear on the Linux machine (my assumption may be wrong -- correct me if I am wrong). After that, when you type any more characters on your Hyperterminal machine, the Linux machine displays nothing. My first guess would be that flow is enabled on your Hyperterminal machine, and you are using a 3-wire connection.
Flow control being enabled would seem like a logical cause for your problem except for one thing. I get the impression that if you type ten characters on your Hyperterminal machine (excluding the enter key), that your ioctl() returns a value of ten. The results seem contradictory. I believe that you are telling me the truth -- therefore I am now confused.
One trick that I use to test a serial port on a computer is to test each serial port one at a time. Go ahead and remove the cable that connects your two computers. On your Hyperterminal computer, connect a serial cable to it, but, do not connect the other end of the cable to your Linux machine. On the cable, connect pins 2 and 3 together. This will connect your transmit data line to your receive data line. Bring up Hyperterminal and start to type characters. If things are working, you should see whatever you type appear on the display.
Do the same thing on your Linux machine. That is, connect a serial cable to the serial port of your Linux machine, and connect pins 2 and 3, of the connector, together. Bring up minicom, and go ahead and type characters on your Linux machine. If things are working, you should see whatever you type appear on the display of your Linux machine.
In both cases, we are performing a loopback test. If you do not see a proper display, you have isolated the machine for which a problem exists on a serial port.
If you do see proper display, I would expect the following causes: 1. Mismatched baud rates between the two computers (maybe not) 2. Problems with your RS-232 drivers (voltage level problems).
If you don't see proper display on each machine, I would expect the following causes: 1. Problems with your RS-232 drivers. 2. Flow control enabled (you could disable flow control)
Try Ben's suggestions too. My analysis may be incomplete.
Let me know what happens, and good luck, Chris Gianakopoulos

(?) Hi chris amd ben,

Sorry for the delay in replying as there was some problem with our mailserver.

(!) [Chris G.] No problem.

(?) Now, when you type on your Hyperterminal machine, I get the impression, that the first few characters that you type appear on the Linux machine

Not always...it appeared rarely...

(!) [Chris G.] Hmmmmmm.....

(?) (my assumption may be wrong -- correct me if I am wrong). After that, when you type any more characters on your Hyperterminal machine, the Linux machine displays nothing. My first guess would be that flow is enabled on your Hyperterminal machine, and you are using a 3-wire connection.

Hardware Flow Control is enabled in hyperterminal(That's the default..) That is set in minicom also.I changed only the baudrate. (I am in doubt about this cable whether it is using 3 pins only or more)

But the cable I use in my program uses the rts,cts pins and uses them in data transmission since the rtu expects that.Everything is working fine in 686 machine.

Flow control being enabled would seem like a logical cause for your problem except for one thing. I get the impression that if you type ten characters on your Hyperterminal machine (excluding the enter key), that your ioctl() returns a value of ten. The results seem contradictory. I believe that you are telling me the truth -- therefore I am now confused.

I haven't checked the ioctl call with hyperterminal.I am using minicom with hyperterminal.

(!) [Chris G.] Understood.

(?) The ioctl call is used in my program that communicates with an rtu through serial port. I am sending some data to the port and expecting some data in return. The ioctl call returns the no of bytes available on the port. But the read function fails to read them and returns zero bytes.

By using hyperterminal on both computers communication is perfect. So that proves there is no problem with port or cable.

(!) [Chris G.] I agree.

(?) If there is some problem with the settings mismatch in hyperterminal and minicom ...how is the communication working correctly in one direction?

(!) [Chris G.] The direction that is not working would be the one that is not getting the proper handshake -- if my flow control idea is valid.

(?) I will check with flow disabled in hyperterminal.

I want to know whether this is a problem of linux? I am asking this because ..when hyperterminal was used on both sides communication was working. Have anybody encountered this type of problem in 586.

(!) [Chris G.] That is what is odd. A serial port is not really associated with a processor -- Ok, ok, some embedded microprocessors do have lots of serial devices incorporated into their package. I would think that you are using something like a 16450, 16550, 8251, or someother UART or USART. It is just a device that is addressed by the Intel processor in I/O space. I understand what you mean, though. When you say 586, you are referring to your particular 586 motherboard with its oddly behaving serial interface (as far as its behavior with Linux is concerned).

(?) I am waiting to check this problem with another 486 machine.

I wan't to know more about the flow control aspect. What is its significance?

(!) [Heather] That's "ready to send" and "clear to send". One system says it wants to .. has data ready to go... and the other system has to give it the thumbs up... clear, you can send now.
(!) [Chris G.] When you want to send, you assert rts. Your system will monitor cts, and it will not send the data unless cts is asserted (when I say asserted, I mean set to an active state). If the computer, at the other end of the link, does not activate the cts line, your system will never send the data byte. It will be flow controlled. As a quick test, you could make a cable that jumpers rts to cts. That would be pins 7 and 8 on your db9 connector.

(?) I am using the rts/cts pins in my program. I do it like this.. I will make the rts pin high before writing and wait for cts to become low. Only when cts becomes low will i write to the port. However i am not using any setting/resetting while reading the port. Everything is working fine in 686.

bye sree

(!) [Chris G.] Okay. You seem to be troubleshooting things in a good manner. Don't forget to look at Ben O's suggestions, too.

(?) Shut down when turn computer off

From pclouds

Answered By Richard Adams, Frank Rodolf, Mike Orr

What I think he is talking about is that with some computers (dell is the only one I know) that are running windowsNT if you hit the power button on the front of the pc they begin to do a software shutdown.

Thats what he is asking how can he set it up so when he hits the power button that the machine notices this and goes into a software shutdown..

(!) [Richard] Well look at it this way, by depressing the power button on the computer you start a shutdown, ok yes i now know what wa meant, what Linux has that no windows software has is "ctrl-alt-del" invokes the defined call in /etc/inittab by default its in short, "shutdown -r now" that one can change to use 'poweroff' 'shutdown' or 'reboot'.
So instead of pressing the power button on the machine itself, hit ctrl-alt-delete, advantage of that is no need to streach to reach the machine as the keyboard is right in front of you.
(!) [Mike] There is also a POWERFAIL signal Linux uses to signal the detection of an imminent power failure. It's meant for emergencies, but maybe you can somehow latch onto that infrastructure. But an option like 'ctrlaltdel' in '/etc/inittab' would be more ideal.
ATX-style computers have a momentary on/off switch that can (somehow) be made to trigger the "shutdown" command -- maybe. I'm not sure how it's done. Look through "man inittab", "man init" and the kernel documentation, and maybe you'll get an idea.
This won't work with older AT-stype cases and motherboards because they have a true 2-position switch. When you turn the switch off, it cuts the power mechanically, and Linux doesn't know about it. Even if Linux did know about it, there's not enough processor cycles left for Linux to do a clean shutdown before it dies.
(!) [Frank] I did some quick lookup... It seems acpid can do this - should be available with your distribution, or otherwise you can easily find it online.
If not, there is also something called "Linux PowerSwitch Driver", which is meant exactly for what you want... You can find it at:
http://deadlock.et.tudelft.nl/~joris/powerswitch
Hope this helps you!

(?) Thanks for all advices. I have got powerswitch. It work very well!


(?) slib installation

From Dann S. Washko

Answered By Ben Okopnik

While compiling gnucash I needed to install the slib libraries. I grabbed the latest files from SLIB site and looked over the install information. I initially put the slib files in /usr/lib/slib, but this was not working, g-wraper kept puking saying it could not find require.scm. Looking at the path's listed, I moved slib to /usr/share/guile/1.4. I reconfigured g-wraper and ran make with no errors.

Is this where slib belongs?

(!) [Ben] Just a datapoint: on my (Debian) laptop, "slib.scm" is in /usr/share/guile/1.3.4/ice-9/. It sounds like the right neighborhood.

(?) Yeah, that is where it is on my slack system. The g-wrapper program was looking for it in /usr/share/guile, so that is where I put it. I managed to compile gnucash successfully. It puked on the first run saying I should run it as root. Again, this was an issue with the slib libraries.

strace gnucash showed some issues with opening slib.cat, but after running it as root once, I was able to run it as a user.

(!) [Ben] Hm. That makes me wonder if it creates some sort of a config file that it relies on in a place wher you normally don't have write permissions. <Shrug> Just a wild guess.

(?) This makes me wonder if my placement of slib is not 100% correct.

(!) [Ben] I would think that if it wasn't, it would continue to fail. Either way, it's working now, right? :)

(?) Thanks for your reply, Ben.

(!) [Ben] You're welcome, Daniel; little enough that it was, I'm glad that it was of use to you.

(?) SuSE 7.1 installation CD not recognized

From Tom Zabosky

Answered By Dan Wilder, Karl-Heinz Herrmann, Jim Dennis

Good day

I came across the undermentioned question to yourselves and it is the identical problem I have been having. Could you please send me the answer given to this question. Thanking you in advance for your kind consideration in this matter.

yours

Tom Zabosky

...............

SuSE 7.1 installation CD not recognized

ram son - Tue, 3 Apr 2001 09:52:50 -0700 (PDT)

My knowledge of Linux systems isn't very extensive but I have been checking out different systems by downloading ISO's from ftp sites.Because SuSE 7.1 live-evaluation is only an image and uninstallable, I downloaded from a mirror the folders and files I thought might be needed by duplicating the layout from version 7.0 --which seems to be the same as the ftp layout. Unfortunately I ended up with an unbootable CD...So I made a boot floppy and get started only to get a message saying " unable to find SuSE 7.1 Installation CD 1..." It then switches to manual installation and I am able to install using yast1...But I actually wanted to check all the new stuff included in Yast2 and the partitioning improvements -- aside from the curiosity factor to find out what actaually went wrong. If I use the cd from 7.0 the boot floppy works fine and I get yast2. I also compared the layout and files in the two versions and was not able to solve the problem. I searched many sites and all I get are bits and pieces that did not help me much.

The questions are: What is missing from my cd that it is not recognized as the installation cd? What is it that linuxrc looks for to get Yast2 started? and more importantly where in the tree is it supposed to be? I would greatly appreciate any help you can offer me ..preferably with a direct answer or at least point me to where the answer could "actually" be found and save me the link-chasing.

...............

(!) [Dan] I'd suggest you ask SuSE this question.
(!) [K.-H.] I agree with Dan on this -- SuSE would be the place to ask.
If you didn't fetch a boot disk as well and burned the CD explicitly as bootable CD with that disk-image of course it can't be bootable. See cdrecord man pages and README's for details or move to a search engine of your choice and type "burn bootable CDR" or something similar.
The partitioning improvements of yast2/7.1 are that you still cant choose any more complicated layout than a continous part of a HD. (seems to have improved with 7.3).
SuSE/yast requires a list of packages and lots of information for administration of the system. probably you forgot that.
You've no problem with filesystem type/extensions on the CD? like all caps filenames instead of lower case ones?
I guess SuSE put something there so it's not that easy to just bake your Installation CD yourself where lots of needed stuff might be needed. Aren't there CD images which would even be bootable?
(!) [JimD] Actually it's probably a replay of the old question:
I downloaded a .ISO image and it doesn't work after I burn it to a CD
(i.e. the user/querent is using CD burning software that is not recognizing the target file as a pre-mastered ISO image).
The best answer to this question seems to at the LinuxISO web page:
http://www.linuxiso.org/cdburninginfo.html
... where one can also find ISO images of over twenty Linux distributions, as well as FreeBSD, NetBSD, and OpenBSD (which I usually call *BSD or {Free,Net,Open}BSD for brevity's sake).
What I particularly like about this page is that they used to have a Javascript animation that showed a sequence of dialogs and options in "Easy CD Creator" that selected the appopriate "Options, Track Type" settings for burning pre-mastered ISO images. (Even though that seems to have disappeared, the information is still there; MS Windows users just have to READ it and find the

(?) Installing tulip.o in 6.2

From William Laing

Answered By Ben Okopnik, Breen Mullins

hello

Can someone instruct me how to install the module/ driver in Linux 6.2 .for the Linksys networking card.

The following module came with the card on a floppy and I was able to load it in as follows as per the instructions. I have tulip.o loaded in at this location.

# locate tulip.o
   /lib/modules/2.2.17-14/net/old_tulip.o
   /lib/modules/2.2.17-14/net/tulip.o

Does the old file require to be deleted or may it stay ? I am be having some fun, but not making any headway on insmod.At this point I cant go ant further.

Thanking you. Bill

(!) [Ben] Did you try loading the module that was already on your system? I would do that before using the new one, by preference - consider that to be your fallback position if the new one fails, or gives you any problems. Presumably, you're using the 2.2.17 kernel; all you have to do is type
insmod tulip
If the module loads without errors, check to see if the system actually "sees" the card as it should:
ben@Baldur:~$ ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:4C:69:6E:75:79
          inet addr:192.168.0.3  Bcast:192.168.0.255  Mask:255.255.255.0
          BROADCAST PROMISC MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
          Interrupt:11 Base address:0x200
Note that your numbers may not be the same as mine; in fact, the line starting with "inet addr" will most likely be absent. This is normal.
Truth to tell, I'm a little surprised at the fact that the manufacter included a module: they're normally compiled for a given kernel, and will error out (although they can be force-loaded) when pushed onto a different one.
The old module (I assume, from the above, that you renamed the original to "old_tulip.o") does not need to be deleted. If you want to test the system with it instead of the new one, you should just be able to type
insmod old_tulip
Don't try to load more than one of them at a time; unload the one that you don't want with
rmmod <module_name>
You can always see what's loaded by typing
lsmod

(?) Ben

Thank you for Clear instructions, much apprecated. The following happens while using the commands you suggested.

Presumably, you're using the 2.2.17 kernel; all you have to do is type...

Yes a 2.2.17-14 kernal

insmod tulip

Yeilds as follows:

Using /lib/modules/2.2.17-14/net/tulip.o: init_module:
Device or resource busy Hint: insmod errors can be caused by incorrect
module parameters including invalid I0 or IRQ parameters.
(!) [Ben] That sounds like it's looking for parameters. This can also be caused by I/O or IRQ conflicts, but ...
(!) [Breen] The tulip cards are all PCI and you shouldn't attempt to specify either IRQs or IO addresses for them. The system assigns these for a PCI device, not the driver.
(!) [Ben] Right. Check "/proc/pci".

(?) insmod old_tulip

Yields the same as the new one. I believe I am guilty of copying both modules myself to the linux box.

(!) [Ben] It sounds like either one will work, once you have the correct parameters.

(?) lsmod

Yeilds:

# lsmod
Module                        Size             Used by
#

With nothing listed.

(!) [Ben] This is fine.

(?) Both machines can ping each other while Window applications are installed suggesting the network path is funtional.

(!) [Ben] Good - knowing that will narrow down any troubleshooting that you may do.

(?) Ben, Breen

Agn thank you people for you kind assistance. The results of your suggestions follow. (It is a bare bones machine text only.)


The kernel is a 2.2.17-14
The card is a Linksys LNE Ver.4.1 TAIMAG HE-012D

I do have other D-Link Cards I have tried, using RTL8139, but the results were the same.

# /var/log/dmesg
    Permission denied
#
(!) [Ben] Erm, you're supposed to read it - not execute it. "/bin/dmesg" will print out the contents; for a bit more scrolling control, try
more /var/log/dmesg
Reading "daemon.log" and "messages" in "/var/log" would be of even more use - they would tell you what happened when you tried to load the module. A quick look at the available parameters for "tulip.o" tells me that there's a "debug" option, enabled by
insmod tulip debug=value
Where "value" is 1-6 (I just took a quick look through the code, and the tests for "tulip_debug" max out at 'if (tulip_debug > 5)...') This should print much more info to the logs.
(!) [Breen] As Ben said, you're supposed to read the file. But you won't find the detection message we're looking for in dmesg; I realize that you need to look in /var/log/messages.
Try this:
# grep tulip /var/log/messages*
You'll be looking for a line similar to this:
messages.3:Oct  8 13:17:41 archy kernel: tulip.c:v0.91g-ppc 7/16/99
becker@cesdis.gsfc.nasa.gov
That tells us the version of the tulip driver you're using. Mine is old but so is the card I'm using.
Instead of Ben's suggestion of
# insmod tulip
you may want to try
# modprobe tulip
(Some versions of the tulip driver need a shim driver to load first. modprobe will pick that up.)
If that doesn't work, try getting the latest drivers from Donald Becker's site:
ftp://ftp.scyld.com/pub/network/netdrivers-3.0-1.src.rpm
Become root and install the rpm:
# rpm -i netdrivers-3.0-1.src.rpm

# cd /usr/src/redhat/SPECS
# rpm -bb netdrivers.spec
That will build the latest set of drivers.
# cd ../RPMS/i386
# rpm -Uvh netdrivers-3.0-1.i386.rpm
  (you MAY have to use a --force flag with that -- you'll know if you do.)

# depmod -a
# modprobe tulip
Which should get you up and running.

(?) Just wondering

From andrew

Answered By Jim Dennis, Faber Fedor

This is a multi-part message in MIME format.

(!) [Faber] First off, this is a major no-no around these here parts. Please send your emails as text only, NOT as HTML. Most of us will refuse to read HTML (because we don't use Outlook, Netscape, etc.). We even have one guy here who carries around a riffle for people who send MIME formatted emails! ;-)
I'll answer your Q this time, but any more that come in as anything other than text only will be ignored (at least by me).
(!) [JimD]
Note that his message was in text and HTML. This is more of a venial sin; though MIME handling of some text mode MUAs isn't all that good and both sections seemed to be in MIME parts (one text/plain and one text/html).

(?) Hello,

(!) [Faber] Hi.

(?) I am wondering if you could help.

(!) [Faber] We try our best.

(?) My question is if i was to buy a Redhat 7.2 CD & choose the Upgrade will i expect my major services to break or will this upgrade be able to make it as painless as possible.

(!) [Faber] Yes, it will be as painless as possible and yes it will break things. It all depends on what you are running. If you save your configuration files (the Upgrade promises to do that, and I beleive it but I don't trust it), you should have minimal problems. Red Hat will save your config files as config_file.rpmsave, so you'll still have to go in and "fix" stuff.
Outside of that, the only problem I've had upgrading a system is when the 2.4 kernel didn't have a driver/module for the RIAD controller and we had to drop back to the 2.2 kernel and it broke DNS because the BIND on the CDs is looking for a specific 2.4 kernel feature. Outside of that, they've all gone well.
(!) [JimD]
Personally I prefer the "scorched disk" upgrade method. That's where we do a fresh installation to a new disk and copy our data and configuration over.
Obviously this works best if you have (at least temporary use of) a whole system on which to perform your staging.
Debian is the only system that I regularly upgrade from one major release to the next without "scorching the earth" beneath it. In other cases I've just seen too many artifacts and quirks in other operating systems when upgrading core libraries and system components.
An advantage to the "scorched disk" approach is that you have an obvious back of the entire system throughout the process. You can easily switch back to the old system. So it represents a lower risk than the typical "boot from the new distribution CD, cross you fingers and pray" process (herein-after referred to as the "boot and pray" technique).
If you don't have a whole system to spare then get a spare hard disk. Most systems have a spare interface/channel to which a third or fourth IDE device can be attached (and PCs with SCSI subsystems almost always have spare IDs and spare IDE interfaces). Care should be taken when connecting a new IDE hard drive to an IDE chain with any other IDE device already on it. (I once wiped out a system by accidentally configuring two drives as masters --- the pinouts on those used to be harder to figure out; bad documentation. Luckily the customer's backups were good and recent).
After you get the new drive in place and make it bootable, be sure to mount the old filesystems in read-only mode during the transition.
When your done with all of the data and configuration transfer you can put the drive on a shelf for a few weeks, months, or whatever. When the filesystems on the old drive are so far out of date that you wouldn't use them in the worst case --- then the drive is ripe for putting into a new system.
Of course its possible to do this using tapes, CDR, DVD-RAM or whatever removable media you normally use for your regular backups. However, the mismatch between the sizes of most production filesystem and removable filesystem media make this convenient. Tapes are big enough but they must be accessed using archiving utilities which is also inconvenient.
So it is best to use an extra drive where you can.
The hardest thing about any upgrade is knowing when you're done. How confident can we be that everything is working? This is one of the challenges to professional systems administration that remains largely unsolved.
Ideally we should be able to run an automated test suite which would test each service and application on our system(s) (locally and from remote systems, including some from "out on the Internet" for public servers). Recently I've been reading about "Extreme Programming" which advocates the continuous creation and maintenance of automated test suites which are integrated into the sources and makefiles of a software system. I've come to the conclusion that sysadmins need to adopt similar practices. We need something like an /etc/systest/Makefile what launches these checks for a given host.
However, that's work for another time -- an article of its own. For now you'll just have to muddle through and test your newly (upgraded) system using whatever procedures you normally use to


This page edited and maintained by the Editors of Linux Gazette Copyright © 2001
Published in issue 73 of Linux Gazette December 2001
HTML script maintained by Heather Stern of Starshine Technical Services, http://www.starshine.org/

"Linux Gazette...making Linux just a little more fun!"


News Bytes

Contents:

Selected and formatted by Michael Conry and Mike ("Iron") Orr

Submitters, send your News Bytes items in PLAIN TEXT format. Other formats may be rejected without reading. You have been warned! A one- or two-paragraph summary plus URL gets you a better announcement than an entire press release.


 Linux Journal's new web site

[screenshot of site]

Linux Journal has redesigned their web site. The new site is based on PHP-Nuke, and allows users to have login accounts and to comment on every article in the site (both magazine articles and web articles), reply to each other's comments, and participate in discussion forums. Best of all, the frames are gone! (Good riddance.)


 December 2001 Linux Journal

[issue 92 cover image] The December issue of Linux Journal is on newsstands now. This issue focuses on System Administration. Click here to view the table of contents, or here to subscribe.

All articles through December 1999 are available for public reading at http://www.linuxjournal.com/magazine.php. Recent articles are available on-line for subscribers only at http://interactive.linuxjournal.com/.


Legislation and More Legislation


 European Legislation

Bad news from the European Patent office. It appears that they are just itching to get a piece of the software-patents action their American colleagues have been hogging. Eurolinux have reported that the president of the European Patent Office has, "in preemption of political decisions to be taken by European governments, decreed a regulation that authorises patent claims to computer programs". The updated rules are available online along with a related memo.

The outrage at this stems both from strong feeling against software patents per se, and from the undemocratic nature of their introduction. As reported by the French daily, Le Monde, European governments had already made a decision to postpone changes to the articles in question until further study had been done into the potential ramifications.

A study commissioned by the German Federal Ministery of Economy and Technology (BMWi) found that introduction of software patents would be likely to put many currently successful software companies out of business and slow down innovation in the software field (perversely, that report then went on to recommend the introduction of these patents). A European Commission consultative report [pdf] found that 91% of respondants where opposed to software patents. However, it appears that the "economic majority" was in favour of patents. So much for democracy.

There are several fine online resources available if you want to familiarise yourself about the issues regarding software patents.


Slashdot reported on the signing of the new European Cybercrime Treaty. The final version is available here. It is effectively a template to be used by signatory countries when framing laws concerning crime committed using computers. As reported by The Guardian, the treaty: "...outlines common definitions of computer-related crimes, defines the methods for criminal investigations and prosecution and establishes methods of international communication between law enforcement officials."

Though some comment has been favourable, many civil rights groups have condemned the treaty on the grounds that it grants excessive powers to police forces while eroding privacy. One consolation (as noted last month) that Bruce Schneier has highlighted is the explicit statement in the treaty of the legitimacy of using "hacking/cracking" tools in security work (as opposed to using them to rob banks!). Nevertheless, there is still strong cause for concern as the provisions for extradition and cross border action could be subject to tragic abuse.


In a final titbit of European news, The Register recently reported that the EU Microsoft probe hearings should take place December, with a verdict early 2002. It appears Competition Commissioner Mario Monti is not giving much away about how this will pan out or what the ultimate aim is.


 UK Developments

The European Cybercrime treaty will not be of much interest to the United Kingdom Government, as they seem to have implemented many of the most draconian measures already. In the current climate of terrorist fear, things are being locked down even more tightly. New measures being introduced by David Blunket (UK Home Secretary) will give law enforcement bodies access to records of all UK telephone and internet users. This was reported in The Guardian. This access will not only be available for terrorism investigations, but also for investigations regarding minor crimes and tax issues. This is basically an extension/clarification of the much criticised Regulation of Investigatory Powers Act 2000 which gave the government unprecedented powers to monitor communications with very little outside scrutiny or even the need for a court order. Apparently, it is "inappropriate" to involve judges in the process where issues of national security or economic well-being are involved. An article in Criminal Law Review described this assertion as "wholly spurious".

The Foundation for Information Policy Research (FIPR) and Magna Carta Plus have a lot of information regarding this and related issues.


 Judge Refuses Adobe Injunction Against Reseller of OEM Software

In a case that impacts the questions of (1) whether software is "licensed" or "sold" and (2) the validity of End User License Agreements (EULAs), a US district judge has denied [pdf] Adobe a preliminary injunction against SoftMan Products Company for reselling Adobe software that was originally bundled with computers in OEM fashion but that the computers' owners did not want.

The judge rejected Adobe's claim that the bundled copy was a "license" rather than a "sale". Thus, the First Sale doctrine applies, meaning Adobe cannot control the subsequent transfer of the the software after the initial sale. The court also found that SoftMan was not bound by the EULA because it had never assented to it. The validity of EULAs was also questioned as the terms were not fully disclosed prior to the sale. Linux Journal has more details.

Linux Weekly News also has an informative editorial that examines how this ruling might affect other cases. One implication is that it should be possible (if the principle of first sale now applies) to resell e-books or unwanted OS installations. The ruling may also be important to the two DeCSS cases (the famous one and another one). These cases "depend, partly, on the claim that a commercial DVD package was 'improperly' reverse engineered. It is the software's EULA that prohibits that reverse engineering. If the code is reverse engineered without installing it and agreeing to the EULA (by, say, disassembling it on a Linux system), the EULA may not apply".


 Lawrence Lessig

There is an article by Lawrence Lessig at Foreign Policy on the evolution of the Internet, transforming communication relations from controlled to free, and the very real threat that much of it may become controlled again.

He makes some interesting comments about who invented various important Internet protocols and services and on the vested interests vying for control. "Policymakers around the world must recognize that the interests most strongly protected by the Internet counterrevolution are not their own. They should be skeptical of legal mechanisms that enable those most threatened by the innovation commons to resist it."


 Judge Rejects French Jurisdiction Over Yahoo's Auction of Nazi Artefacts

US District Court Judge Jeremy Fogel has refused [cnet.com] to enforce a French court's order barring Yahoo from auctioning Nazi memorabilia on a US site that was accessible to French citizens.

LG wonders what the judge would think if the situation were reversed, given the current attempts by US companies to get their US patents and DMCA copyright rights recognized overseas.


 Good and Bad DeCSS News

Slashdot reported that in the California DeCSS case, a court of appeal overturned the injunction imposed by a lower court. Quoting: 'In the case of a prior restraint on pure speech, the hurdle is substantially higher [than for an ordinary preliminary injunction]: publication must threaten an interest more fundamental than the First Amendment itself. Indeed, the Supreme Court has never upheld a prior restraint, even faced with the competing interest of national security or the Sixth Amendment right to a fair trial.' This is obviously a very positive development, though there is a long road still to be travelled.


Less positively, in the New York MPAA v. 2600 case, the court of appeals decision has gone in the favour of the MPAA. There are reports on the judgement available here [TheRegister.co.uk] and here [EFF.org]. Cryptome.org has a very through collection of documents relating to both cases, including the text of the ruling. The judge accepted that computer code can be protected as a form of speech under the first ammendment. He then decided that the target of the injunction was not the speech, but the functional component (i.e. the use the code can be put to: decrypting DVD's). In these circumstances, the injunction can be granted as long as it is "content neutral", and the impact on the speech component is incidental. The judge writes:

This type of regulation is therefore content-neutral, just as would be a restriction on trafficking in skeleton keys identified because of their capacity to unlock jail cells, even though some of the keys happened to bear a slogan or other legend that qualified as a speech component.
The other part of the rationale is that the Government's interest in the prevention of unauthorised access to copyrighted material "is unquestionably substantial". Thus, the injunction is upheld. A similar argument is used relating to the injunction against linking to web pages containing DeCSS.

Claims against the injunction based on the principle of fair use were dismissed on the grounds that although the user is allowed to make fair use (say, by quoting from a copyright work) she is not automatically entitled to make that use with a preferred technology. CSS may prevent you taking a still image from a movie, but it does not stop you from photographing your monitor/television screen. Thus, your fair use rights are not affected.

The issue as to whether or not DeCSS is really a piracy tool was relegated to footnote 5. The footnote correctly states that piracy is entirely possible without DeCSS, but contends that DeCSS is a substantial aid to the process. Many would contend that the piracy issue is actually a canard (=bogus), but it is the most respectable argument the MPAA can come up with.

Note: I am not a lawyer (as they always say on Slashdot), and this interpretation is based on a quick reading of the ruling just before this month's deadline. However, I believe that the summary above is a fair representation of the major points. As to the correctness of the ruling/opinions, you must make up your own mind. Personally, some of the distinctions seem a touch specious. The separation of speech and function with regard to computer code is not as clear as in the case of the logo on a key, or a poem written on a gun. Also, the issue of fair use regarding the playing of legally purchased DVD's on Linux was summarily dismissed, apparently on the basis that you have the right to watch, not decrypt, DVD's you purchase, thus subsection 1201(a)(3)(A) of the DMCA still applies. -- MC


Slashdot has an eyewitness account of the Felten vs RIAA hearing. As you remember, Professor Felton write a paper describing weaknesses in the CSS encryption used on commercial DVDs. RIAA threatened to sue him if he presented the paper at a scientific conference. But they didn't sue him, and after a public outcry they withdrew their objection to him presenting the paper. Meanwhile, Felten filed a lawsuit of his own, claiming that RIAA's action encourages researchers to censor themselves to avoid legal liability that may or may not be legitimate. The judge dismissed the suit, saying that he cannot rule on a potential issue (RIAA threatening to sue Felten), but only on an actual issue (if RIAA sued him, which they didn't). He said he is not allowed to rule on Constitutional issues (whether Felton's free-speech rights were violated) in a non-criminal case without a compelling reason, and there is no compelling reason in this case. He also said this case is like "night and day" compared to Dmitry Sklyarov's case, since Dmitry was charged with a criminal violation of infringing for commercial gain. -- Iron]


Dmitry's trial date is now expected to be April 15, 2002, assuming the case isn't dismissed in the meantime.

More information about most of these issues is on the Electronic Frontier Foundation home page.


 Bad News for Napster

In less positive news, The Electronic Frontier Foundation published a white paper on the US appeals court decision confirming that Napster was liable for its users sharing copyrighted files. The court agreed that the file-sharing technology in itself is not illegal, but the minute its developers and users receive reasonable knowledge that specific infringing files are servable on the system (e.g., if they receive a "cease and desist" letter), they must immediately delete these files or they, and possibly their ISP and so on upline, will be liable. Knowledge of infringing uses overshadows whatever non-infringing uses the server may also be performing. In practice, this will have the effect of deletion through intimidation, or deleting files that are alleged to infringe but may not. It also forces sysadmins to become their own police for the benefit of the content companies, or face liability. Technologies such as Freenet that are unable to police user access may have an advantage under this ruling.


Linux Links

LWN have the following links which you might enjoy:

The Register have reported

CNet wonders whether the Open Source model be killed by hard times? Annalee Newitz at AlterNet doesn't think so.

Alternet look at Network Admin Blues

ZDNet ran a story on the Virtual Memory issue. eWeek.com covered it too.

LinuxWorld have an article on installing Debian over a network.

LinuxSecurity.com have a report Hal Burgiss' new Linux security quick-start guides: the Security Quick-Start HOWTO for Linux and the Security Quick-Start HOWTO for Red Hat.

At OReillynet.com Jerry Peek explains why Unix and Macintosh users should learn to use the command line.

BSD bug report in comic strip form. From the Aspiring to Crudeness e-newsletter .

There is an informative Article at linux.oreillynet.com about what a kernel Oops is and how to troubleshoot its cause.

Here is a large list of links to Python sites and resources. Lots and lots of information, including a selection of links to French language Python sites.

Deepak, from Bangalore, India, submitted a link to his webpage where he has a PowerPoint presentation available for download. The title of the presentation is "The (R)Evolution of an OS", and it provides a very thorough broad-based introduction to Linux for people who may be familiar only with Windows. The slideshow is "95% StarOffice compatible", but even if you don't have Powerpoint or StarOffice, you can also see thumbnails and full-size jpegs of the individual slides.

Ernesto Hernandez-Novich suggested that we plug the Venezuelan Linux User's Group and their mailing list archive. Linux Gazette is always pleased to be able to alert readers to public linux resources. A great way to promote a new or existing Linux Users' Group (LUG) is to register the LUG at GLUE (Groups of Linux Users Everywhere).

LinuxDevices.com have a Review of Sharp PDA running Linux. This was also highlighted on Slashdot, which linked to an infoSync story.

Not Linux, but www.gatt.org is a satire of the WTO web site from the viewpoint of anti-globalization activists. The real WTO web site, www.wto.org, allegedly had a statement deploring this pseudo-site. In a comical turnaround, the satire site now has an article (at the bottom of the home page) titled "Fake WTO site misleading public", with a link to the "fake" site that is actually the real WTO site!

There's neither pine nor apples in pineapples, no ham in hamburgers, Look here for further extracts from the book Crazy English.


Upcoming conferences and events

Listings courtesy Linux Journal. See LJ's Events page for the latest goings-on.

15th Systems Administration Conference/LISA 2001
December 2-7, 2001
San Diego, CA
http://www.usenix.org/events/lisa2001

Consumer Electronics Show (CEA)
January 1-11, 2002
Las Vegas, NV
http://www.cesweb.org/

Bioinformatics Technology Conference (O'Reilly)
January 28-31, 2002
Tucson, AZ
http://conferences.oreilly.com/biocon/

COMNET Conference & Expo (IDG)
January 28-31, 2002
Washington, DC
http://www.comnetexpo.com/

LinuxWorld Conference & Expo (IDG)
January 30 - February 1, 2002
New York, NY
http://www.linuxworldexpo.com/

The Tenth Annual Python Conference ("Python10")
February 4-7, 2002
Alexandria, Virginia
http://www.python10.com/

Australian Linux Conference
February 6-9, 2002
Brisbane, Australia
http://www.linux.org.au/conf/

Internet Appliance Workshop
February 19-21, 2002
San Jose, CA
http://www.netapplianceconf.com/

Internet World Wireless East (Penton)
February 20-22, 2002
New York, NY
http://www.internetworld.com/events/weast2002/

Intel Developer Forum (Key3Media)
February 25-28, 2002
San Francisco, CA
http://www.intel94.com/idf/index2.asp

COMDEX (Key3Media)
March 5-7, 2002
Chicago, IL
http://www.key3media.com/comdex/chicago2002/

BioIT World Conference & Expo (IDG)
March 12-14, 2002
Boston, MA
http://www.bioitworld.com/

Embedded Systems Conference (CMP)
March 12-16, 2002
San Francisco, CA
http://www.esconline.com/sf/

CeBIT (Hannover Fairs)
March 14-22, 2002
Hannover, Germany
http://www.cebit.de/

COMDEX (Key3Media)
March 19-21, 2002
Vancouver, BC
http://www.key3media.com/comdex/vancouver2002/

FOSE
March 19-21, 2002
Washington, DC
http://www.fose.com/

Game Developers Conference (CMP)
March 19-23, 2002
San Jose, CA
http://www.gdconf.com/

LinuxWorld Conference & Expo Singapore(IDG)
March 20-22, 2002
Singapore
http://www.idgexpoasia.com/

Software Solutions / eBusiness World
March 26-27, 2002
Toronto, Canada
http://www.softmatch.com/soln20.htm#ssebw

SANS 2002 (SANS Institute)
April 7-9, 2002
Orlando, FL
http://www.sans.org/newlook/home.htm

LinuxWorld Conference & Expo Malaysia (IDG)
April 9-11, 2002
Malaysia
http://www.idgexpoasia.com/

LinuxWorld Conference & Expo Dublin (IDG)
April 9-11, 2002
Dublin, Ireland


Internet World Spring (Penton)
April 22-24, 2002
Los Angeles, CA
http://www.internetworld.com/events/spring2002/

O'Reilly Emerging Technology Conference (O'Reilly)
April 22-25, 2002
Santa Clara, CA
http://conferences.oreillynet.com/etcon2002/

Software Development Conference & Expo (CMP)
April 22-26, 2002
San Jose, CA
http://www.sdexpo.com/

Federal Open Source Conference & Expo (IDG)
April 24-26, 2002
Washington, DC
http://www.idgworldexpo.com/

Networld + Interop (Key3Media)
May 7-9, 2002
Las Vegas, NV
http://www.key3media.com/

Strictly e-Business Solutions Expo (Cygnus Expositions)
May 8-9, 2002
Minneapolis, MN
http://www.strictlyebusiness.net/strictlyebusiness/index.po?

Embedded Systems Conference (CMP)
June 3-6, 2002
Chicago, IL
http://www.esconline.com/chicago/

USENIX Annual (USENIX)
June 9-14, 2002
Monterey, CA
http://www.usenix.org/events/usenix02/

PC Expo (CMP)
June 25-27, 2002
New York, NY
http://www.techxny.com/

USENIX Securty Symposium (USENIX)
August 5-9, 2002
San Francisco, CA
http://www.usenix.org/events/sec02/

LinuxWorld Conference & Expo (IDG)
August 12-15, 2002
San Francisco, CA
http://www.linuxworldexpo.com

LinuxWorld Conference & Expo Australia (IDG)
August 14 - 16, 2002
Australia
http://www.idgexpoasia.com/

Communications Design Conference (CMP)
September 23-26, 2002
San Jose, California
http://www.commdesignconference.com/


News in General


 Kernel News

Kernel 2.4.16 has been released, fixing an unmounting bug in 2.4.15 (released just recently) that causes fs corruption. The changelog for the first pre-version of 2.4.17 is available here 2.4.x maintenance has been passed to Marcelo Tosatti. But the horrible bug was Linus' fault, not his. ("I inherited this mess from the previous administration," is what a US president would say.)

A new development series has been started, 2.5.x. However, 2.5.0 is the same as 2.4.15, so it has the same horrible bug. In other words, don't use it. LWN have reported the availability of a 2.5.1-pre3 prepatch that fixes this bug. No major changes (cleanups and fixes mostly). This ends the over-a-year hiatus in which there was no development kernel.


 Amazon Saves $$ With Linux and MS vs Linux

CNet recently reported that "Amazon.com was able to cut $17 million in technology expenses in the last quarter largely because of a switch to Linux." This was also reported at The Register who have links to Amazon's SEC filing.

Before everyone starts predicting the demise of Windows, its worth pointing out that this gain was at the expense of UNIX servers (WinInfo). Still it is certainly encouraging. Especially so in light of The Register's report of a Microsoft memo describing Linux as "the long-term threat against our core business. Never forget that!". You should really take a look at The Reg's report: the original memo is included at the end of the page, complete with references to butt-tattoos (don't ask!). The contents indicate that MS sees Linux as being an obstacle to their plan of replacing UNIX servers with MS powered (there's an oxymoron) servers. Sales folk are urged to identify UNIX systems in their customer's organisations, and then focus on getting MS into those functions (presumeably before some geek slips Linux in). (Story also featured on Slashdot.)

This brings to mind the Halloween memo of 1998. To refresh your memory of the documents, and also on the intervening history, take a look at LWN's editorial revisiting the memos. They ask--and answer--the question "How many of the predictions came true?"


 Microsoft PR Spin Continues While Browser Lockout Still in Effect

Last month we briefly reported on the issue of MSN not working with non-Internet Explorer browsers, and Opera Software's comments on the situation. Since then, Opera have issued a press release detailing apparent inaccuracies/spin being fed into the media by Microsoft spokespeople. Also, not all site features are made available to non "MSIE 5" browsers. Seems the only way to get proper service is to set the browser identity to "MSIE 5". These kinds of behaviour (taking the Opera statement at face value) bode ill for the future of the open internet.


 Fermi National Accelerator Laboratory Powers New Particle Discovery With 96-Processor Linux NetworX Cluster Supercomputer

Linux NetworX have announced that scientists at Fermi National Accelerator Laboratory (Fermilab) are using a Linux NetworX cluster to help identify new particles as part of a worldwide scientific collaboration to find subatomic clues to reveal the building blocks of the universe. Fermilab scientists are studying the collisions of protons and antiprotons in an effort to identify new particles that are produced as a result of the collisions.

Located in Batavia, Ill., Fermilab's 48-node cluster from Linux NetworX includes 96 Pentium III 1.0 GHz processors, 48 GB of memory (RAM) and a Fast Ethernet interconnect.


 Linux Clusters

The Register brought the story that Compaq has followed through on its promise to GPL its NSC, or Non Stop Clusters code (the code that SCO licensed and co-developed as UnixWare Non Stop Clusters). Compaq announced two projects - The CI Project (for the infrastructure) and SSI. "...and here with one blow is a pretty comprehensive applications platform: Oracle can failover from node to node", Peter Braam.

On the commercial front, IBM have introduced the world's first pre-packaged Linux cluster, a powerful and scalable system that has been optimized for e-business. The IBM eServer Cluster meets the demand of corporate customers who have neither the time nor inclination to "roll their own" Linux clusters from a collection of mismatched piece parts. They want an easy-to-order system delivered and supported by a single vendor. IBM gave no link to the press release.


 Linux is Number 1 at Lyris

Lyris Technologies, Inc., developer of email messaging and filtering software, have revealed that downloads of its applications for Linux have surpassed all other Unix-based versions combined. Lyris' core products include ListManager for opt-in email newsletters, and MailShield for server-based protection against unsolicited email. Linux versions of Lyris software have grown from 40% to more than 60% of the company's Unix downloads since January 2001.


Distro News


 Debian

The lates revision of the Debian 2.2 series of releases, Debian 2.2r4, has been unleashed. This release "mostly includes security updates, along with a few corrections of serious bugs in the stable distribution."
A vulnerability in the packages ssh-nonfree and ssh-socks has been reported. Migration to OpenSSH is recommended, but updated non-free packages have been released.
Debian Weekly News reported that Javier Fernández-Sanguino Peña has contributed a Debian Euro HOWTO to the Debian Documentation Project. This will be important reading for anyone living in or doing business with the European Union after January 1st.


 LynuxWorks / BlueCat

LynuxWorks Inc., a provider of open source and real-time embedded solutions, have unveiled the latest version of its popular BlueCat Linux distribution.


 Mandrake

Mandrake Linux have announced Mandrake Linux Gaming Edition. This new edition comes on 4 CD's, and is powered by TransGaming Technologies' portability layer. The distro comes complete with Electronic Arts' The Sims. Reports on the release are available here [Slashdot] and here [BluesNews].


 SuSE

SuSE Linux have announced SuSE Linux Connectivity Server. The company's latest business product is a pre-configured Linux network solution, especially adapted to the requirements of SME and suitable for file and print services in company networks as well as secure connections to the Internet.


SuSE Linux, have made an agreement with IBM to distribute IBM's entire line of software for Linux in Europe, Middle East and Africa as a Value Added Linux Distributor.
FirstLinux.com have reviewed SuSE 7.3, which has also recently been released in its PowerPC Edition.


Software and Product News


 OpenSSH

OpenSSH 3.0 has been released (as reported by Linux Today). Go to their homepage for details and downloads (3.0.1 was later released on Nov. 15th).


 XNotesPlus V3.4.0 Debuts

Michael J. Hammel, the Graphics Muse, is pleased to announce the release of version 3.4.0 of XNotesPlus, a Personal Information Manager for the Linux and Unix desktop. XNotesPlus includes support for all major features on the Palm Pilot, including Memos, Todo Lists, the Address Book and Calendaring. All data from each feature can be downloaded from the Pilot, edited within XNotesPlus and uploaded back to the Pilot. Additionally, backups and restores of a Pilot PDA can be managed from within XNotesPlus.

The release of XNotesPlus includes numerous bug fixes, many of which were serious problems in earlier releases. Users of older versions are highly encouraged to upgrade.

XNotesPlus is available in both source and Red Hat Linux 7.0 dynamically built binary distributions.


 Creatures on Linux

Creature Labs Ltd and Linux Game Publishing Ltd have announced that Creatures Internet Edition, the latest in the breakthrough Creatures series, is to be released for Linux. Creatures Internet Edition is a bundle of Creatures 3 and Creatures Docking Station and it also includes 4 different Norn breeds (the creatures within the game). The game allows interaction with other players over the internet. For more information about Creatures Internet Edition, please visit http://ds.creatures.net/expansion/cie.pl.


 Rackspace Partners with Red Hat on E-commerce

Rackspace Managed Hosting a provider of managed hosting services, and Red Hat Linux have launched E-Commerce Complete, a comprehensive, hosted e-commerce solution. The offering features the Red Hat E-Commerce Suite installed and pre-configured on a Rackspace hosting platform, and it includes support and services from both companies to ensure complete integration and smooth management of the application.


 Sharp Goes for Opera in Embedded Software Solution

Opera Software today announced that Sharp Opera Software have announced that Sharp will use its Opera 5 for Linux Web browser in the Zaurus SL-5000D developer unit. The Zaurus SL-5000D is a robust Linux/Java-based handheld. The Opera Web browser will be used as part of Lineo, Inc's powerful software solution Embedix Plus PDA, launched at JavaOne in June this year. Apart from Opera 5 for Linux, the Embedix Plus PDA solution contains Lineo's Embedix Linux, Trolltech's Qt/Embedded and QT Palmtop graphical user interfaces, and Insignia Solution's Jeode PDA Edition.


 Linux Application Appliance and Application Partner Program from Tricord

Tricord Systems, developer of the IlluminaTM clustering software and Lunar FlareTM NAS appliance-- have announced a new application appliance series for independent software developers and systems integrators. The Lunar Flare AA 1100 and AA 1200 support Linux-based applications, consolidating them on an easy-to-manage, fault tolerant, scalable platform with unique clustering and storage capabilities. Tricord's application appliance series combines a high-performance Linux server with built-in clustered storage, making it an optimal appliance solution for content-hungry applications.

Additionally Tricord Systems, and Tarantella, have announced that Tarantella Enterprise 3 software has been certified on Tricord's Lunar Flare Application Appliance (AA) platform.


 GUI Programming with Python

The Python/QT book; GUI Programming with Python: QT Edition is in final edit and will be shipping by the end of the month. For those who are unaware QT is the toolkit behind many powerful applications, including the KDE Desktop for Linux/UNIX.

The new book covers the use of Python and QT extensively, including the Blackadder RAD environment for Windows and Linux. For those interested please visit: http://stage.linuxports.com/projects/pyqt


 Grey Zone Announces the 3 Minute Extranet with SecureZone 5

Grey Zone, a developer of out-of-the-box Linux-based Web content management software, announces the release of SecureZone 5. SecureZone 5 enables business users to create a completely functioning extranet, including users and content, in as little as 3 minutes. SecureZone empowers non-technical professionals to rapidly spawn an unlimited number of distinct Web sites from a single platform. The product combines security, content management, and audience-based publishing capabilities that simplify the Web publishing process, helping companies rapidly and cost-effectively conduct business over the Web. Although ease of use is a major priority, SecureZone is also very feature rich. For more information consult Grey Zone's web page. SecureZone pricing begins at $50,000.


 XML/PosgreSQL Application Server LXP 0.8

Command Prompt, Inc. announced the release of LXP version 0.8.0, Command Prompt's PostgreSQL application server. The LXP application server provides easy access to the advanced features of PostgreSQL. LXP offers a suite of services to assist the Linux web developer produce easily managed, dynamic websites, data driven websites. Beyond the LXP markup language you can also utilize the following languages through our direct URI support: Java, PHP, C, C++, Python, and Perl. LXP also offers a fast valid XML parsing engine, useful to support industry standard DTDs such as RDF/RSS. An example of LXP application can be found at LinuxPorts.Com.


 Teamware Office 5.3 for Linux Edition 4

Teamware Group, a Fujitsu subsidiary, have released edition 4 of Teamware Office 5.3 for Linux, a complete set of ready-to-run groupware applications for today's business professionals. In the new edition the main emphasis is on web service enhancements. Edition 4 is the first Teamware Office for Linux version with the main focus on the browser side. The new look & feel for the web service client templates has been developed according to extensive usability research and customer requests. Via the renewed web service Teamware Office modulescan be easily accessed with standard web browsers. The service enables fixed www addressing for any Teamware Office object over standard HTML templates making integration with other web based systems as well as search engines easy.

Teamware Office can be purchased online through the Teamware web site at www.teamware.com/linux. Also a free 90-day evaluation version can be downloaded at the site.


Copyright © 2001, Michael Conry and the Editors of Linux Gazette.
Copying license http://www.linuxgazette.net/copying.html
Published in Issue 73 of Linux Gazette, October 2001

"Linux Gazette...making Linux just a little more fun!"


Linux User Caricatures

By Franck Alcidi


tux_monitors.jpg

kfc_kernel.jpg

Hint: "kernel" is pronounced "Colonel" in English. Colonel Sanders is the mascot of the Kentucky Fried Chicken (KFC) restaurant chain.

spikey_bsd.jpg

Previous cartoons published in Linux Gazette:

You can view my other artwork and sketches on my projects page.

Franck Alcidi

Franck is an artist in Australia. His home page ("Ausmosis") is http://www.ozemail.com.au/~geisha/projects.html.


Copyright © 2001, Franck Alcidi.
Copying license http://www.linuxgazette.net/copying.html
Published in Issue 72 of Linux Gazette, November 2001

"Linux Gazette...making Linux just a little more fun!"


The Art of Atari ST Emulation

By Matthias Arndt


Contents

1 Introduction

I'm quite an Atari ST fan. It was the computer that introduced me to computing in the first place. It was a thrill that changed my life forever.

All those of you who prefer the Amiga, write your own article instead of claiming the ST was or is crap.

What? You don't know what the ST is? It's a late-80s, early-90s 16/32-bit home and semi-professional computer system manufactured by Atari. The ST still has many friends all over the world, the Atari ST community is very active on the web due to the fact of emulation. Just visit the Little Green Desktop (www.atari.st) or www.atari.org to see what I mean.

This article concentrates on Atari ST emulation on Linux, describing the available emulators and some useful information about ST emulation in general.

2 What is emulation?

Emulation tries to rebuild the behavior and performance of hardware components with software. Practically this means to make your PC think it is another computer with a different hardware architecture and in most cases another OS, enabling you to run a great amount of software written for the emulated system on your real box.

In our case, this means running software for the Atari ST on your Linux box.

3 Machine Facts

Anyone who is interested in emulation should at least know the hardware facts of the emulated system. Here we go:

(all data refers to the standard ST, not the TT, Falcon or clones)

  1. 320x200 pixels, 16 colours out of 512 (50 or 60Hz)
  2. 640x200 pixels, 4 colours out of 512 (50 or 60Hz)
  3. 640x400 monochrome running at 72Hz
The STE models had advanced sound and graphic capabilities.

Always keep in mind that this machine was introduced in the spring of 1985 and the masses were stunned. More capable than a Macintosh of that period and much cheaper at that time.

Just as a little overview of what an emulator has to emulate.

4 ST Emulation

The first attempt at emulating the ST was the Gemulator in 1994 or 1995. It was an emulator for DOS that needed a special hardware plug-in card. Nowadays, all ST emulators are software-only solutions.

The ST Emulation boom started in 1997 with the DOS based emulator PacifiST written by Frederic Gidouin.

Since then several other ST emulators have reached a very high niveau such as WinSTon or STEEM. This applies partly to ST Emulation on Linux as well. STEEM is now officially available for Linux, and STonX is getting better and better at each release.

5 ST Emulators for Linux

5.1 Things common to all emulators

All ST emulators have the following things in common:

5.2 STonX

The famed STonX was the first and for a long time the only ST emulator available for Unices. It now reached a really usable state, although still not wonderful to play games and run demos on it.

A few quick facts:

STonX may not be the emulator of choice for games or demos but it is definitely the emulator of choice for developing system-conformant (meaning GEM) applications. It runs pretty fast and smooth. And I couldn't make it crash in 6 months of operation (The emulated ST may still crash but not the emulator program itself).

Really annoying at the moment are:

But no program is perfect - STonX is definitely worth a try. It is better than one might expect.

STonX can be found at: http://stonx.sourceforge.net/.

5.3 STEEM on Linux

This is a port of the STEEM emulator to Linux. It is not GPLed but freeware.

STEEM is much better suited for games, since it features even STE graphics and sound, overscan and raster effects included. It runs many demos and most games.

STEEM facts are:

STEEM is close to be perfect. Some features of the Windows version are still missing but it runs pretty good. And its main advantage over STonX: it runs games and demos!

STEEM can be found at: http://steem.atari.org/.

5.4 Hatari

Hatari is a port of the WinSTon source code to Linux. It is still in early alpha phase and unusable at the moment.

Check http://hatari.sourceforge.net/ for details.

6 TOS

As stated above the TOS is the Atari ST's default operating system. (You can run Minix, Mint and several other systems as well.)

Obviously, all ST emulators need a TOS ROM in order to work. It is not included with the emulators and always keep the copyright in mind. There are several places on the net to get TOS images, and there are programs available that allow you to extract the TOS ROM of your ST to a file.

7 Software for the ST

There is still a large amount of ST software around on the net. FTP sites carry public domain and freeware, and some sites have pirated ST games online. Finally, the ST community on the net is very supportive when looking for ST software.

8 Community

There is a large Atari community on the net, several IRC channels, bulletin boards and a hierarchy of Usenet news is available.

A few useful tips:

At the time of this writing, November 2001, the Little Green Desktop is still in a redesign phase but that may change by the time this article is online.

9 Conclusion

The Atari ST is still alive - and you can support this development on Linux. Join us by running an Atari ST emulator. Even if you never had an ST, it is worth a try.

Take me for example, I never had a C64, VCS2600 or ZX Spectrum, but I run emulators for all of them.

Always remember: Atari will never die!

Matthias Arndt

I'm a Linux enthusiast from northern Germany. I like plain old fifties rock'n'roll music, writing stories and publishing in the Linux Gazette, of course. Currently I'm studying computer science in conjunction with economics.


Copyright © 2001, Matthias Arndt.
Copying license http://www.linuxgazette.net/copying.html
Published in Issue 73 of Linux Gazette, December 2001

"Linux Gazette...making Linux just a little more fun!"


Audio Processing Pipelines

By Adrian J. Chung


For decades experienced Unix users have employed many text processing tools to make document editing tasks much easier. Console utilities such as sed, awk, cut, paste, and join, though useful in isolation, only realise their full potential when combined together through the use of pipes.

Recently Linux has been used for more than just processing of ASCII text. The growing popularity of various multimedia formats, in the form of images and audio data, has spurred on the development of tools to deal with such files. Many of these tools have graphical user interfaces and cannot operate in absence of user interaction. There are, however, a growing number of tools which can be operated in batch mode with their interfaces disabled. Some tools are even designed to be used from the command prompt or within shell scripts.

It is this class of tools that this article will explore. Complex media manipulation functions can often be effected by combining simple tools together using techniques normally applied to text processing filters. The focus will be on audio stream processing as these formats work particularly well with the Unix filter pipeline paradigm.

Sound Sample Translator

There are a multitude of sound file formats and converting between them is a frequent operation. The sound exchange utility sox fulfills this role and is invoked at the command prompt:

sox sample.wav sample.aiff

The above command will convert a WAV file to AIFF format. One can also change the sample rate, bits per sample (8 or 16), and number of channels:

sox sample.aiff -r 8000 -b -c 1 low.aiff

low.aiff will be at 8000 single byte samples per second in a single channel.

sox sample.aiff -r 44100 -w -c 2 high.aiff

high.aiff will be at 44100 16-bit samples per second in stereo.

When sox cannot guess the destination format from the file extension it is necessary to specify this explicitly:

sox sample.wav -t aiff sample.000 

The "-t raw" option indicates a special headerless format that contains only raw sample data:

sox sample.wav -t raw -r 11025 -sw -c 2 sample.000 

As the file has no header specifying the sample rate, bits per sample, channels etc, it is a good idea to set these explicitly at the command line. This is necessary when converting from the raw format:

sox -t raw -r 11025 -sw -c 2 sample.000 sample.aiff 

One need not use the "-t raw" option if the file extension is .raw, however this option is essential when the raw samples are coming from standard input or being sent to standard output. To do this, use the "-" in place of the file name:

sox -t raw -r 11025 -sw -c 2 - sample.aiff < sample.raw
sox sample.aiff -t raw -r 11025 -sw -c 2 - > sample.raw

Why would we want to do this? This usage style allows sox to be used as a filter in a command pipeline.

Play It Faster/Slower

Normally sox adjusts the sample frequency without altering the pitch or tempo of any sounds through the use of interpolation. By piping the output of one sox to the input of another and using unequal sample rates, we can bypass the interpolation and effectively slow down a sound sample:

sox sample.aiff -t raw -r 44100 -sw -c 2 - |
sox -t raw -r 32000 -sw -c 2 - slow.aiff

or speed it up:

sox sample.aiff -t raw -r 32000 -sw -c 2 - |
sox -t raw -r 44100 -sw -c 2 - fast.aiff

Simple Editing

Suppose one wants a sample consisting of the first two seconds of some other sound file. We can do this using sox in a command pipeline as shown here:

sox sample.aiff -t raw -r 44100 -sw -c 2 - | head -c 352800 |
sox -t raw -r 44100 -sw -c 2 - twosecs.aiff

The input file sample.aiff is converted to 44.1kHz samples, each two bytes in two channels. Thus two seconds of sound is represented in 44100x2x2x2 = 352800 bytes of data which are stripped off using "head -c 352800". This is then converted back to AIFF format and stored in twosecs.aiff

Likewise to extract the last second of a sample:

sox sample.aiff -t raw -r 44100 -sw -c 2 - | tail -c 176400 |
sox -t raw -r 44100 -sw -c 2 - lastsec.aiff

and the third second:

sox sample.aiff -t raw -r 44100 -sw -c 2 - | tail -c +352801 |
head -c 176400 | sox -t raw -r 44100 -sw -c 2 - lastsec.aiff

Note that with 16-bit samples the argument to "tail -c +N" must be odd, otherwise the raw samples become misaligned.

One can extract parts of different samples and join them together into one file via nested sub-shell commands:

(sox sample-1.aiff -t raw -r 44100 -sw -c 2 - | head -c 176400 
sox sample-2.aiff -t raw -r 44100 -sw -c 2 - | head -c 176400 ) | 
sox -t raw -r 44100 -sw -c 2 - newsample.aiff

Here we invoke a child shell that outputs raw samples to standard output from two different files. This is piped to a sox process executing in the parent shell which creates the resulting file.

Desktop Sound Output

Sounds can be sent to the OSS (open sound system) device /dev/dsp with the "-t ossdsp" option:

sox sample.aiff -t ossdsp /dev/dsp

The sox package usually includes a platform-independent script play that invokes sox with the appropriate options. The previous command could be invoked simply by

play sample.aiff

Audio samples played this way monopolise the output hardware. Another sound capable application must wait until the audio device is freed before attempting to play more samples. Desktop environments such as GNOME and KDE provide facilities to play more than one audio sample simultaneously. Samples may be issued by different applications at any time without having to wait, although not every audio application knows how to do this for each of the various desktops. sox is one such program that lacks this capability. However, with a little investigation of the audio media services provided by GNOME and KDE, one can devise ways to overcome this shortcoming.

There are quite a few packages that allow audio device sharing. One common strategy is to run a background server to which client applications must send their samples to be played. The server then grabs control of the sound device and forwards the audio data to it. Should more than one client send samples at the same time the server mixes them together and sends a single combined stream to the output device.

The Enlightened Sound Daemon (ESD) uses this method. The server, esd, can often be found running in the background of GNOME desktops. The ESD package goes by the name, esound, on most distributions and includes a few simple client applications such as:

This command will play the first second of a sample via ESD:

sox sample.aiff -t raw -r 44100 -sw -c 2 - | head -c 176400 | esdcat

One can also arrange to play samples stored in formats that ESD does not understand but can be read by sox:

sox sample.cdr -t raw -r 44100 -sw -c 2 - | esdcat

In some cases samples can sound better when played this way. Some versions of ESD introduce significant distortion and noise when given sounds recorded at a low sample rate.

The Analog RealTime Synthesizer (ARtS) is similar to ESD but is often used with KDE. The background server is artsd with the corresponding client programs, artsplay and artscat. To play a sample:

sox sample.cdr -t raw -r 44100 -sw -c 2 - | tail -c 352800 |artscat

Both ESD and ARtS are not dependent on any one particular desktop environment. With some work, one could in theory use ESD with KDE and ARtS with GNOME. Each can even be used within a console login session. Thus one can mix samples, encoded in a plethora of formats, with or without the graphical desktop interface.

Music as a Sample Source

Having covered what goes on the end of an audio pipeline, we should consider what can be placed at the start. Sometimes one would like to manipulate samples extracted from music files in MP3, MIDI, or module (MOD, XM, S3M, etc) format. Command line tools exist for each of these formats that will output raw samples to standard output.

For MP3 music one can use "maplay -s"

maplay -s music.mp3 | artscat

The music.mp3 must be encoded at 44.1kHz stereo to play properly otherwise artscat or esdcat will have to be told otherwise:

maplay -s mono22khz.mp3 | esdcat -r 22050 -m
maplay -s mono22khz.mp3 | artscat -r 22050 -c 1

Alternatively one can use "mpg123 -s". Additional arguments ensure that the output is at the required rate and number of channels:

mpg123 -s -r 44100 --stereo lowfi.mp3 | artscat

Users of Ogg Vorbis may use the following:

ogg123 -d raw -f - music.ogg | artscat

Piping is not really necessary here since ogg123 has built-in ESD and ARtS output drivers. Nevertheless, it is still useful to have access to a raw stream of sample data which one can feed through a pipeline.

Music files also can be obtained in MIDI format. If (like me) you have an old sound card with poor sequencer hardware, you may find that timidity can work wonders. Normally this package converts MIDI files into sound samples for direct output to the sound device. Carefully chosen command line options can redirect this output:

timidity -Or1sl -o - -s 44100 music.mid | artscat

The "-o -" sends sample data to standard output, "-Or1sl" ensures that the samples are 16-bit signed format, and "-s 44100" sets the sample rate appropriately.

If you're a fan of the demo scene you might want to play a few music modules on your desktop. Fortunately mikmod can play most of the common module formats. The application can also output directly to the sound device or via ESD. The current stable version of libmikmod, 3.1.9, does not seem to be ARtS aware yet. One can remedy this using a command pipeline:

mikmod -d stdout -q -f 44100 music.mod | artscat

The -q is needed to turn off the curses interface which also uses standard output. If you still want access to this interface you should try the following:

mikmod -d pipe,pipe=artscat -f 44100 music.mod

Only the later versions of mikmod know how to create their own output pipelines.

Effects Filters

Let us return to the pipeline friendly sox. In addition to its format conversion capabilities, there is small library of effects filters. Here are some examples:

Putting It All Together

The major components of an audio command pipeline have now been covered. Let us see how they can be combined together to perform a few non-trivial functions:

Hopefully these examples hint at what can be accomplished with the pipeline technique. One cannot argue against using interactive applications with elaborate graphical user interfaces. They often can perform much more complicated tasks while saving the user from having to memorise pages of argument flags. There will always be instances where command pipelines are more suitable however. Converting a large number of sound samples will require some form of scripting. Interactive programs cannot be invoked as part of an at or cron job.

Audio pipelines can also be used to save disk space. One need not store a dozen copies of what is essentially the same sample with different modifications applied. Instead, create a dozen scripts each with a different pipeline of filters. These can be invoked when the modified version of the sound sample is called for. The altered sound is generated on demand.

I encourage you to experiment with the tools described in this article. Try combining them together in increasingly elaborate sequences. Most importantly, remember to have fun while doing so.

Adrian J Chung

When not teaching undergraduate computing at the University of the West Indies, Trinidad, Adrian is writing system level scripts to manage a network of Linux boxes, and conducts experiments with interfacing various scripting environments with home-brew computer graphics renderers and data visualization libraries.


Copyright © 2001, Adrian J. Chung.
Copying license http://www.linuxgazette.net/copying.html
Published in Issue 73 of Linux Gazette, December 2001

"Linux Gazette...making Linux just a little more fun!"


Microsoft's New Briar Patch

By Jim Dennis


By now most of use with an interest in the software industry and/or in the free software movement have probably heard of Microsoft's latest legal maneuvers, an offer to settle the remaining local antitrust cases (brought by many state's attorneys general) by providing computers and software to U.S. public schools.

"Please don't put me in de bre'r patch! Anything but that!"-- Uncle Remus

I can't believe that I'm alone in seeing this as playing into Microsoft's hands. If practically all of our children are raised running nothing but Microsoft software, then that's what they'll expect in college and throughout their careers.

Microsoft should be paying dearly to gain such a lucrative franchise. This is a far cry from punishment or remediation. Indeed, it is antithetical to restoring competition to the software industry.

As a Linux user and enthusiast, I don't care about Microsoft. I never believed that the Federal antitrust case would be effective; and I see the various state and private suits as being mere echos to that. The Europeans might see more effective measures taken by their EC, but that is unlikely. However, as an observer of the software industry, and a veteran in various segments of that market I have to re-iterate my views on the matter.

The only effective and fair remedies in this case must relate to the software. Specifically Microsoft must be required to publish source code to complete and working reference implementations of each protocol, API, and file format that they use in any of their applications and operating systems. They must be forbidden from distributing new software until the reference implementations are published. The reference implementations must be in the public domain (freely usable by all for free and commercial works).

In other words, given that Microsoft has become the standard in the industry (at least in part through illegal and anti-competitive means) then they bear the burden of providing enough information to everyone else to ensure interoperability.

We could argue endlessly about the adequacy of documentation, and the need to publish "internal" programming interfaces or "administrative" protocols. This would be a miscarriage of justice. Requiring a reference implementation for a set of command line primitive utilities, in ANSI standard C and/or C++ (no MSC or MFC entanglements) provides an unambiguous standard for their compliance. Either the requisite reference tools can perform the designated (minimal) functions over their protocols, on their target files, or calling their OS/library components, or MS is fined and enjoined from further distribution.

Note that this approach does not force MS to publish the sources to their OS or their applications. They are free to create an independent reference implementation. Of course that would be a expense to them; the cheapest path to compliance would be for them to engineer their software with a core (that would separately constitute the reference suite) and then add their UI elements on top of that.

However, it is vital that they be prohibited from releases new software until the reference suite is shown to provide the requisite interoperability. It's also critical that the remedy encompass protocols, APIs, and file formats.

Any less is just another example of government and big business posturing to the public while cutting their own backroom deals to line the pockets of the politicians and lockout the "little guy" businesses.

Jim Dennis

Jim Dennis is the proprietor of Starshine Technical Services. His professional experience includes work in the technical support, quality assurance, and information services (MIS) departments of software companies like Quarterdeck, Symantec/ Peter Norton Group, and McAfee Associates -- as well as positions (field service rep) with smaller VAR's. He's been using Linux since version 0.99p10 and is an active participant on an ever-changing list of mailing lists and newsgroups. He's just started collaborating on the 2nd Edition for a book on Unix systems administration. Jim is an avid science fiction fan -- and recently got married at the World Science Fiction Convention in Anaheim.


Copyright © 2001, Jim Dennis.
Copying license http://www.linuxgazette.net/copying.html
Published in Issue 73 of Linux Gazette, December 2001

"Linux Gazette...making Linux just a little more fun!"


Winning the Battle for the Desktop

By Dennis Field


Last month (Battle for the Desktop: Why Linux Isn't Winning, issue 72), I recounted my misadventures in trying to install Linux onto an IBM ThinkPad, and called several unnamed venders to task for failing to provide adequate documentation and/or customer support. Or testing their software before releasing it, but that's a different story . . .

Well, I actually sold that laptop to a fellow writer (who is perfectly happy with it running WordPerfect under W*ndows 98 Second Edition). I am currently looking for a slightly newer ThinkPad that will support booting directly from a CD. I haven't found one yet, because I'm on a tight budget and, given my previous experience, I want to get something that is at least marginally capable of running Windows XP. Yes, I know I just used the "W" word again (for those wishing to stone me, there's a pile of rocks to your left. Anyone wishing to lynch me, however, must supply their own rope).

As far as distributions go, I'm waiting for the latest version of Libranet Linux (due at the end of the month, although they've already delayed the release once - apparently wishing to make sure it works before they ship it. What a novel idea!). They are the one vender from last month's article that actually bothered to answer my email, or to publish their hardware requirements. Meanwhile, I downloaded their old version so I can try it out on my desktop before purchasing the new release. Libranet is based on Debian, and I have heard that Debian actually provides some of the documentation I keep ranking about. If any other venders are already providing the documentation and support I'm referring to, then please understand that this article is directed at those venders who aren't - which is the majority of them, in my experience.

Windows XP is now out, and I continue to be amazed at the opportunity that Linux venders have squandered. After I couldn't find a functional version of Linux (remember, that pile of rocks is to your left), I was forced to upgrade my home PC to XP. XP doesn't really do anything 98 wasn't supposed to be able to do, although I've been running it for almost three weeks now and only had it crash twice (a record for a Microsoft product!). Both times it even rebooted itself without locking up. But Microsoft's infamous Product Activation and obnoxious attempts to hijack everything in the world even vaguely related to computers have continued to sour people on the idea of even trying XP. If any Linux vender had a functional OS, packaged with a good suite of business applications, they could be eating Microsoft's lunch right now.

The first and foremost step in winning the battle against Microsoft will be to introduce a concept which is apparently entirely unknown in the Linux community. This revolutionary new strategy is called Customer Service. No, by this I do not mean the customer is always right (I work in a retail store, remember?). Nor do I mean that Linux should be made into an idiot-proof, one-size-fits-all Windows clone that does all your thinking for you - whether you want it to or not. What I mean is that the objective, goal and overall attitude of those wishing to advance Linux should be to meet their customer's needs. Listen closely here, because there's something that a lot of Linux people are currently not understanding: The objective is not to get the software on the CD. The objective is for the customer, i.e.; the end user, to be able to successfully use that software in his business, life, Conquest of the Galaxy. Whatever.

In the late Douglas Adam's science-fiction satire Life, the Universe and Everything, he introduces a whimsical invention called the "SEP Field" (chapter 3). He begins by explaining that to make something (say, a mountain) truly invisible is both infinitely complex and requires fantastic amounts of energy. But if you erect a cheap and simple SEP Field around the mountain, "then people will walk past the mountain, around it, even over it and simply never notice the thing is there. An SEP is something that we can't see, or don't see, or our brain won't let us see, because we think that it's somebody else's problem. That's what SEP means. Somebody Else's Problem. The brain just edits it out; it's like a blind spot. If you look at it directly you won't see it unless you know precisely what it is."

Well, apparently there are a lot of Douglas Adams fans in the world of Linux. Because the single most common response I got from those who objected to last month's article was that I was blaming vender's for things beyond their control. This is a view that is certainly shared by the venders themselves: Your software doesn't install? That's not our problem! There are no instructions telling you how to configure our firewall? Too bad! The software works, but you can't get it to do what you want? Well, figure it out yourself! What? You want us to tell you if Linux will work with your hardware before you buy it? Well, that's certainly not very reasonable of you to expect that level of service!

Now, for the record, I will concede that if it's an obscure printer that only 3 people in the world are using, then it's probably never going to get supported. In which case, you should at least be able to tell your customers that it's not supported, so they won't waste their time trying to get it to work. But the real bottom line is that this doesn't solve the user's problem. And if you're honest you will have to admit that the attitude of dismissing users valid problems as being Somebody Else's Problem covers a whole lot more than just print drivers in the world of Linux.

Am I being unreasonable in expecting venders to actually solve their customers problems? Many of you have said that the Linux venders are not responsible for third-party problems. Well, let me tell you a little story: Last year, everyone in our office chipped in and got our boss a Handspring Visor for Christmas. The first week he had it, he installed some third party software that wiped out the USB connection in his Windows box. We called the third party vender and they denied all knowledge of the problem and had no idea how to fix it. We then called Handspring and explained that the Visor connected just fine until we installed Somebody Else's software, and now it wouldn't connect at all. We'd already tried uninstalling the third party software, we'd tried reinstalling the Windows USB drivers, we even deleted all references to the bad software from the Windows registry. Still no USB connection. Did Handspring have any ideas? Their response was: "No problem, we've done this before". Their phone tech then preceded to lead my boss, step by step, thru opening the Windows registry, finding an obscure entry and editing it. The tech then cheerfully waited while the computer was rebooted to make sure that the problem was fixed. Now, Handspring is not responsible for Windows, and they are certainly not responsible for the third party software that caused the problem. But Handspring knows that the value of their product depends upon being able to connect it to a PC. So they make it a point to know how to fix connection problems instead of just blaming them on someone else. The last that I heard, Handspring was selling Visors as fast as they could build them, largely to business people. These same business people won't take a copy of Linux for free. So which approach do you think is more effective? Let me give you a hint: We now have a total of six Visors in our office, and zero Linux boxes.

Wait! Stop. I can already hear your screams of protest. Every Linux vender on the planet is now getting ready to email me to explain that they don't have the resources to do that! Maybe IBM can afford to have world-class Customer Service, but the poor little Linux venders and software companies can't even afford to have anyone answer the phone now. How are they supposed to provide support for their customers? Well, I have a solution for them. You see, there's this newfangled invention called the "Internet". People can build something called a "website" and post information on it. What? You've already got a website? Well, let's give it a little test: Go to ibm.com, look up a model of computer and see how much information IBM provides to help their customers use it. Now go to a couple of Linux sites and see how much information they provide. Oops. I hear more screams of protest. You are now yelling "Do I have any idea what it costs to build and maintain a professional quality website like IBM's?" Well, perhaps not (although if IBM has more money to spend on website development than you make, then they must be doing something right <g>). But I do know a way the smallest Linux vender can compete with IBM in terms of information available, if not polish and web graphics.

Again, the key to IBM's website is not that they manufacture their own servers. The key is that IBM is concerned with making sure that their customers have whatever it takes to use the products. IBM doesn't just say "Well, we built a perfectly good laptop, it's not our problem if you can't get it to work". IBM makes sure that you can get it to work. In like manner, I propose that Linux venders build support websites with two key features:

1) The vender should post current information on their distribution's file structure, boot options, port assignments, common command line switches, etc. This should also include professional HOWTO's on installing a new X server, recompiling the kernel, trouble shooting network problems and any other common difficulties. Isn't this all available on the net? Yes, and every HOWTO on the net includes the disclaimer "This works with SUSE, but I don't know about Red Hat" or "I tried this with version 5.1, but 5.2 does it differently". The vender is the one who knows both the file structure and correct procedures for that specific version. And that is the information people need to have. One of the great strengths of Linux is that you can work on it yourself. But if you were trying to fix the engine in a '96 model Mercedes, how would you feel if the Mercedes factory sent you a repair manual for an '84 model Ford along with a note that said "Well, this is pretty close, maybe you can just figure out the differences"?

2) But the venders can't possibly test every piece of hardware, or know every different network configuration! So they shouldn't even try to offer user support, right? WRONG! The second feature that needs to be on the vender's website is an area where users can post HOWTO's of their own. Again, this information needs to be version specific. Not just how to install some printer under some version of Linux, but detailed, step by step instructions for how to install a Canon BJC250 with distribution 6.5. That way the first person with a BJC250 can pass the correct settings on to everyone else (otherwise everybody is forced to reinvent the wheel). But the Internet is already loaded with Linux HOWTOs. Why add more? Several reasons. Aside from version specific information, having the HOWTO's submitted to the vender for posting means the vender can, if not test each one, at least visually inspect all HOWTO's for apparent errors before posting them. Which at least prevents some joker from telling newbies that the first step in installing a printer is to reformat the hard drive <g>. This would also represent a tremendous research tool for the venders. By adding a couple of radio buttons for user feedback, each HOWTO could be rated (on a scale of 1 to 5) on both whether the HOWTO addressed the user's problem and also how well it solved the problem. That way if a vender gets only 5 hits a month on how to handle MP3 files, but 200 hits on how to burn CD's, then the vender can tell what to improve or add in the next version. And if only half of the people trying to burn CD's actually succeeded, then maybe that problem needs to be fixed. This feedback would also make the HOWTO's self-correcting. HOWTO's that consistently solve people's problems could be made a permanent part of the vender's documentation, possibly even be put into the man pages. Any HOWTO reported as unhelpful or counter productive could be dropped.

If I were a vender, I would carry this idea one step further. Whenever anyone submitted a HOWTO that got positive user feedback, I would send the person who submitted it token of appreciation (a toy penguin, or a pen with the company logo, or a baseball cap with "Linux Software Team" embroidered on it). Does anyone doubt that in less than a month there would contests among your more technically inclined customers (notice I didn't say Computer Geeks ) to see who could collect the most pens, caps, whatever. As a vender, I would encourage this by giving a special prize (T-shirt, jacket, Handspring Visor) to whoever submitted the best written and/or useful HOWTO each month. Wouldn't that cost a lot of money? Well, let's see. If someone spends 10 hours researching and solving a problem for your customers, and you give them a $5 baseball cap, then you've gotten expert technical support for 50 cents an hour.

Many of you are now saying that I'm just being silly. After all, there are all kinds of Linux users groups, mailing lists and clubs already out there. Why should a vender waste his precious time hosting one more? The answer is: Because of your customer, that's why. Imagine for a moment that you are the CEO of amazon.com and you've just learned that your server has crashed. You call the head of your IT Dept. and ask "What happened? How soon can we be back up?" The head of your IT Dept. tells you "Beats me. I have no idea what happened. But I'll start asking around with some friends of mine, and maybe one of them can think of something in a few days?" How long do you think the head of that IT Dept would have a job? Allow me to let you in on a secret: If some little one man operation with a single printer is using your software to make a living, then keeping that lone printer running is just as important to him as amazon.com's web server is to them. Users groups are wonderful resources for learning, sharing solutions to problems, etc. But the bottom line is that it's the venders who are responsible for keeping their product working. And if the customers can't trust the venders to take that responsibility seriously, then they're not going to buy the software.

And unless I'm mistaken, the people who are now yelling that they don't have time to build a useful website were the same ones who were yelling a few minutes ago that they can't keep up with the Customer Service demands they've already got. Well, everybody that can find the information they need on your website is one less person phoning your understaffed Customer Service Dept.. And if the customer does phone anyway, then which takes less time: Explaining something to him on the phone (and hoping he takes good enough notes to actually do it), or looking it up on your own site and emailing him printed directions to solve his problem? And as for not being able to afford to provide Customer Service? Well, several of the larger commercial venders are now charging for Customer Support. Unfortunately, what none of them have figured out yet, is that you have to actually provide the support in order for customers to be willing to pay for it!

In closing I would like to say, for the record, that I am NOT attacking Linux. I like Linux (and will probably enjoy it even more once I find a distribution that actually works <g>). And I think everyone would be better off if Microsoft had some serious competition. But so far, the best explanation that I can come up with for the behavior of most Linux venders is that they are secretly owned by Bill Gates. Because Microsoft couldn't come up with a better strategy to protect it's market share than what many Linux venders are already doing!

Dennis Field

My first encounter with a computer was when my high school got an old IBM 1130 (which had a whopping 8k of main memory!), and I've been playing with computers off and on since then. My first home computer was as Amstrad, which ran C/PM and came complete with a revolutionary 3" floppy disk drive (yes, you read that right). Although I've had one college course each in both C and Linux, I still consider myself a Linux newbie.

The author is currently in hiding at a secret location, after having narrowly escaped an angry mob of torch-waving penguins.


Copyright © 2001, Dennis Field.
Copying license http://www.linuxgazette.net/copying.html
Published in Issue 73 of Linux Gazette, December 2001

"Linux Gazette...making Linux just a little more fun!"


Visual Debugging with ddd

By Wolfgang Mauerer


Overview

To err is human. Programmers are humans. Therefore programmers err. The overwhelming complexity and unsurpassable logic inherent in those little words may well be the cause for several years of discussion in the philosophers' department, but holds without further doubt one timeless truth, when it's brought down to earth again: All programs written by human programmers are full of errors. Although the belief is still alive in some places that programming is just a more or less mechanical and stupid exercise that can be fulfilled without making any mistakes if only enough care is taken and planning is applied, a more sensible way of thinking seems to be devastating for programmers at first: Nothing works, all programs are full or error, the specs are wrong, and the implementation does the opposite as expected. But this is noting against programmers, in fact the fully opposite is the case: Programming is a very complicated and challenging task, and errors are therefore unavoidable, even for the best programmers - only easy things can be done without fault. The importance of errors or better: the way how to find and fix those errors in the lifecycle of a software product is a task whose importance cannot be stressed enough over and over. Finding errors is not just an unavoidable part in the development cycle, but a vital part of every software system's lifespan.

It seems clear that bugs in software systems must be found, and that good tools are needed to assist the programmer in this complicated task. As most of you might know, there is a very capable debugger available as free software from (who else?) the GNU project. Since the GNU people are responsible for the most important compiler under linux, the gnu c compiler, both programs form a bodacious and capital team when it comes to kill nasty bugs in your programs. Those of you who have already used the debugger know its spartan interface: It's not bad, but not too good either. Even if one is a friend of the command line and text-based utilities (as the author certainly is), using this form of debugger interaction is not always hilarious and can be a quite poignant exercise, especially when larger systems with complex data structures are debugged. The text interface may be well suited for single-stepping through programs, checking simple values or testing certain conditions, but it is certainly not the optimal choice for modern, effective and easy-to-do debugging of structures deeply connected with each other. Other interfaces (like the emacs gud-mode or the new tui interface for gdb) offer slightly more comfort, but are not ideal as well.

We need a graphical interface therefore, and again the GNU project offers a very good possibility: DDD, the data display debugger. DDD is a graphical interface written by Andreas Zeller and Dorothea Luetkenhaus (and the help of many other programmers from the free software community) and made into a GNU program some time ago (although it was GPLed already before that). If debugging weren't such a sometimes very hard job, we would nearly be tempted to say that debugging with ddd is mere fun.

What does ddd offer compared to the pure gdb interface or to other debugger front ends like the emacs gud-mode? The main point is not just DDD's normal debugging functions (e.g., stepping through your source file line by line, setting breakpoints and watchpoints, changing the values of program variables), which are supported by ddd (in a very convenient and much simpler way compared to the traditional gdb interface), but that DDD can also display data structures graphically. What does this mean? Consider a linked list in C, as we will use it in one of our later examples. The data structure basically consists of several data fields together with one or more pointer fields to other structures of the same type, that together form an interconnected network. The network is made up of the values of the pointer variables. It could in principal by reconstructed by their hexadecimal contents, giving the memory location of the previous or following elements, but this is neither a very convenient nor comfortable task. It is very difficult to produce a concise overview about the situation this way, and even if the programmer succeeds in that laborious task, there is a major drawback: Since memory locations change in the next program run (or when a different input dataset etc. is used), the work is quickly rendered useless. DDD overcomes this limitation by automatically creating diagrams from the memory contents, allowing a simple and appealing visual view to complex structures.

But the ability to draw program structures graphically is not the only enhancement offered by ddd compared to classical dialog-based debugging methods:

Let's see how all these things look in practice by debugging a simple example program.

Generating debugging information

Binary programs normally don't contain any information about the source file; they solely perform the codes intended task in terms of machine instructions. It is therefore necessary to include so-called debugging symbols in the object code before advanced features of a debugger can be used (without this, it would be possible to step through the program in single machine instruction steps, but since there is no direct connection with the source code any more, this is not very helpful). There are several different debugging formats floating around in the Unix world, but we do not want to dive deeper into this subject, since it is mostly important for compiler programmers. Instead, we will concentrate on the GNU/Linux platform using the GNU C compiler using standard settings.

The standard option to include debugging information in a program is to use the switch -g when calling gcc:

[wolfgang@jupiter wolfgang]$ gcc -g fac.c -o fac

This will create a binary file fac which is bigger in size than the normal executable. Obviously, this is not a big surprise: Since additional data (like assignments between blocks of machine instructions and line numbers in the source code etc.) are stored in the code now, the size must increase.

It is important to note that gcc offers a feature quite rare among competing compilers: Debugging information can be generated even if optimizations are turned on, e.g. gcc -g -O2 fac.c fac will work, producing a binary file that is optimized and contains debugging information. Although this can be quite handy in some cases, there are some well hidden trap doors behind this approach (like optimizing away several lines of code), so we won't cover these combinations here.

The source file for fac.c has the following contents:

#include<stdio.h>

int main() {
  int count;
  int fac;

  for (count = 1; count < 10; count++) {
    fac = faculty(count);
    printf("count: %u, fac: %u\n", count, fac);
  }

  return 0;
}

int faculty(int num) {
  if (num = 0) {
    return 1;
  }
  else {
    return num * faculty(num - 1);
  }
}

As you can see, the program just performs some really simple calculations: We loop over a range of integer values from 1 to 9 and call a function to calculate the number's faculty in every loop step. It's perfectly clear that this could be done in a much more efficient way, but it serves as a good example for general debugging techniques. By the way: It will not run correctly, since it contains an error. You can check this by executing it in a normal shell, without an attached debugger (binaries with included debugging symbols run like normal programs, they are just a little bit slower): The only thing you get is a core dump that happens due to a segmentation fault. So let's put the program into the debugger and find out what's wrong!

Stepping through programs

Opening a program to debug

ddd is started by typing

[wolfgang@jupiter wolfgang]$ ddd&

at your prompt; the file name of the program that shall be debugged can be supplied as an optional argument. If ddd is not installed on your system, this can almost certainly be done using your favorite package management system (like apt-get, rpm etc.), since ddd binaries are supplied with all major distributions. In case there is no binary package for your system (or if you want to compile ddd from scratch for some reasons), get the source distribution from ftp.gnu.org (or preferably one of it's mirrors) and follow the instructions in the INSTALL file accompanying it.

If you did not supply the file name on the command line, you can select it via the File->Open Program menu entry via a dialog box. ddd then loads this program, parses the debugging symbols (or, to be precise: lets the back-end debugger parse the symbols) and loads the main source file afterwards. Your display should show a window similar to figure 1.

Figure 1: The ddd main window
\begin{figure}\begin{center}
\epsfig{file=sshot1.eps, scale=0.3} \end{center}\end{figure}

The ``Command Tool''-Subwindow is very important for our later work. By default, it is shown in the main window's right area, offering several buttons to perform diverse actions with our code (in case you should close the window incidentally, you can reopen it either via F8 or the View->Command Window menu item).

Step and Next

Let's step through the program line by line, watching precisely what happens during its execution. To do this, we need to start the program, but we also need to set a so-called breakpoint in order to prevent the whole program from finishing before we have a chance to interrupt it. A breakpoint suspends the program execution on a certain source line, giving the opportunity to interact with the debugger and perform debugging actions. Point your mouse on the left side of the source window on the line int count;, press the right mouse button and select ``Set Breakpoint'' from the popup menu. This creates a red stop sign on the corresponding line, meaning that the program execution will stop once it reaches this point.

Now we can get the ball rolling: Select ``run'' from the command tool, which will instruct the debugger to start the code. The program doesn't run very long, since our breakpoint is located at the very beginning of the file; we are now in a debugger interaction mode. The green arrow to the left of the source lines shows us the line that will be executed next in the source file.

There a two possibilities to step through a source code: While ``next'' takes you line by line, but omits procedure calls (and just presents you the result of the call), ``step'' will dig through the subroutine's code when it is called. As we want to see what's wrong in our program (since the error is a very common one, experienced programmers will have seen it already certainly), we decide to ``step'' through the program. Press the button, and you will find the green source line pointer right in the beginning of the faculty subroutine. This is what we intended, so you can press ``step'' another time, leading the green arrow directly into the else-branch of our conditional decision. This is all right again. What would we expect now? Since num had the value 1 when we entered the subroutine, it should be 0 when we enter the subroutine again recursively, resulting in an immediate return of the value 1, which should again result in returning 1*1=1 from our first call of faculty, leading us back to the main program. Let's check whether this is what actually happens by pressing ``step'' for another time: The green pointer moves again to the beginning of the function, but enters the else-branch again in the next step! Obviously, something went wrong: We need to check num's value.

There are several possibilities to show the value of simple variables (e.g. variables of simple types like int, long, float etc.). The most common one is to keep the mouse pointer over the variable in the source window, waiting until a tooltip with its contents appears on the screen. Alternative ways are to press the right mouse button right over the identifier and select Print num from the popup menu or to mark the identifier and select the Data->Print() menu entry. With the last two methods, the value is displayed in the gdb output window in the lower region of the main window.

Regardless of the method used, we receive 0 as num's value. Why has the second branch been taken, although num is 0? Using step for another time confirms your possible assumption about the error case: If we look at the value of num right at the beginning of the function, we see that it is -1, but in the next step (again the second branch of the if-conditional), it is 0 again: The error is a forgotten = in the if-clause, resulting in an assignment rather than a comparison! Although this is a very common error in C programs, it can cause considerable delay to the program's development if it is only well enough hidden. Since we won't receive any meaningful result from this incorrect program, we can kill it with the ``kill''-Button in the execution window.

Correct the error by exchanging the "=" with a "==", recompile the program (don't forget to include debugging symbols again!) and reload it into ddd via the "File"-menu. As you can see, out breakpoint is conserved, so we can start the program again from the very beginning. If we step through the faculty call now, everything works alright. The faculty function is completed, and the green source line pointer is now in the printf(...)-line. We need to be careful: If we select ``step'' for another time, ddd will try to step through the print call, which is not possible, since the function is taken from the standard C library which is normally not compiled with debugging symbols (although it's possible to). We therefore prefer ``next'' in this case. ``Step'' would give us an error message about several missing source files; it would take a bunch of ``next''-clicks to get the green pointer back to our source code again.

Visualizing data structures

Simple structures

In our first, simple example, ddd is similar to other interfaces like the emacs gud-mode (except for the increased comfort). But here's a unique and marvellous feature of ddd: The ability so display nested structures graphically. In order to demonstrate the corresponding features, we need a new example program, list.c:

#include<stdio.h>

int main() {
  typedef struct person_struct {
    /* Data elements */
    char* name;
    int age;
    
    /* Link elements */
    struct person_struct *next;
    struct person_struct *prev;
  } person_t;

  person_t *start;
  person_t *pers;
  person_t *temp;

  char *names[] = {"Linus Torvalds", "Alan Cox", "Rik van Riel"};
  int ages[] = {30, 31, 32};
  int count;  /* Temporary counter */

  start = (person_t*)malloc(sizeof(person_t));
  start->name = names[0];
  start->age = ages[0];
  start->prev = NULL;
  start->next = NULL;
  pers = start;
        
  for (count=1; count < 3; count++) {
    temp = (person_t*)malloc(sizeof(person_t));
    temp->name = names[count];
    temp->age = ages[count];
    pers->next = temp;
    temp->prev = pers;
    pers = temp;
  }
  temp->next = NULL;

  printf("Data structure created\n");
  return 0;
}

Although you might know the names used in the example, they are not important. The ages are chosen at random!

The code defines a double linked list of person-elements that stores two personal properties (name and age) together with two pointers (to the next and previous person in the list). Since this is one of the most important structures in C, every programmer should have seen something like this already several times before, normally in a more complete fashion. As before, our program does not perform a too important job: It just builds a data structure in memory and then exits, but this is sufficient for our purposes. As usual, the program must be compiled with debugging symbols included and then loaded into ddd.

For this time, we set our first breakpoint in line 28 (the beginning of the for-loop) and start our program afterwards. Place the mouse pointer over the start-identifier: ddd will show you in the value tooltip appearing after a small amount of time that it is a pointer to an instance of struct person_t at a certain memory location given in hexadecimal notation. A perfect candidate for graphical visualisation!

Pop up the context menu by pressing the right mouse button over the start identifier and select "Display *start" - the star is needed so that ddd automatically dereferences the pointer and shows the structure's contents. A new section in the upper part of the ddd window will show up, containing a figure visualising start's contents: name and age are set to the values assigned a few lines before, and next, prev contain NULL pointers as expected. Figure 2 shows the box that you should see on your display (the char pointer's hexadecimal value may vary on your system, though).

Figure 2: Visualisation of a data structure
\begin{figure}\begin{center}
\epsfig{file=sshot2.eps, scale=0.3} \end{center}\end{figure}

This is already a pretty amazing feature, isn't it? But let's execute our program a little further, seeing how our data structure is built up in memory. Use the ``next''-button to step through the for loop's body until line 34 (pers->next = temp) is reached: The second person's data structure is built and connected with the first person by then. When you watch the graph display afterwards, you can see that the next-field of our first person has a value different than 0 now, meaning that it points to another structure: The clou: If you double-click on this value, a new box with the second person's structure opens, and the pointer from person 1 to person 2 is automatically displayed as an arrow between the boxes.

We take a different way to create the third person's data structure, because it is inconvenient to step through all single lines of a code just to see the result. Let's apply another breakpoint in line 39 which contains the printf(...)-statement. Pressing ``cont'' continues the program flow until another breakpoint (our fresh set one) is reached.

We can display the third person's data structure in the usual way. But now, we do not just want to see the pointers from person n person n+1, but also the backward pointers! Double click, for example, on the prev-field in the second graph: Another box pops up, duplicating the first person's box in the display! The same thing happens for the prev-pointer of the third person. This is obviously not what we want, because the same structure should not be displayed twice. We have to tell ddd to take care about this.

Ddd uses a feature called alias detection in order to achieve this, which can be activated by activating the Data->Detect Aliases menu entry. The display should look like figure 3 now.

Figure 3: A linked list of persons
\begin{figure}\begin{center}
\epsfig{file=list.ps, scale=0.7} \end{center} \end{figure}

All pointers are shown in the correct manner, giving us a quite good impression of the data structure in memory. Sadly, alias detection especially with tight connected structures has the drawback of slowing down ddd, since several memory locations must be compared after every program step in order to see which structures in the display represent the same memory location, compacting the graph respectively. Additionally, alias detection is only available with source languages that allow the back-end debugger to provide addresses of arbitrary objects, limiting the possible choices to C, C++ and Java at the moment.

A more complicated example

Let us take a look at a slightly more complicated example (at least in relation to the created data structure) in order to demonstrate ddd's graph layout capabilities. The source code used from now on is the following (arith.c):

#include<stdio.h>
/* Create a binary tree structure representing an arithmetic expression */

enum operator { plus, minus, times, div };

typedef struct tree_struct {
  struct tree_struct *left;
  struct tree_struct *right;
  union {
    int op:2;
    int val;
  } opval;
} tree_t;

int main() {
  tree_t *node;
  tree_t *root = (tree_t*)malloc(sizeof(tree_t));
  root->opval.op = times;

  node = (tree_t*)malloc(sizeof(tree_t));
  node->right = NULL;
  node->left = NULL;
  node->opval.val = 7;
  root->right = node;
  
  node = (tree_t*)malloc(sizeof(tree_t));
  node->opval.op = plus;
  root->left = node;

  node = (tree_t*)malloc(sizeof(tree_t));
  node->left = NULL;
  node->right = NULL;
  node->opval.val = 5;
  root->left->left = node;

  node = (tree_t*)malloc(sizeof(tree_t));
  node->left = NULL;
  node->right = NULL;
  node->opval.val = 3;
  root->left->right = node;

  printf("Tree created\n");
  return 0;
}

The program creates a tree representing a arithmetic expression in the way compilers see them after the completion of the parsing process: Parentheses are superfluous in this form, since the graph structure contains this information intrinsically. Each node contains either an arithmetic operator (plus, minus, times or div, as defined by the enumeration operators) or a certain (integer) value. In explicit notation, the expression represented by the data structure is (5+3)*7

Run the program (after setting a breakpoint before the end, but after building the data structure), display the root element and open all subsequent members via double-clicking on the left/right-members of the structure. You can get all information about the memory structure, but it does not look very nice. We want to achieve a look like in figure 4:

Figure 4: Simple arithmetic expression represented by a tree
\begin{figure}\begin{center}
\epsfig{file=tree.ps, scale=0.7} \end{center} \end{figure}

One change compared to the picture produced by simply unfolding the tree is obvious: All elements are layed out in a ordered manner. This can certainly be achieved by using the mouse to drag the elements to their respective locations, but is not very convenient: A much simpler method (at least for the user) is the automatic layout capability provided by ddd. To use it, we simply need to select the menu entry Data->Layout Graph (or use the shortcut ALT+Y). ddd layouts the graph in the manner shown afterwards.

Note that another manual change was applied to the graph. Since we use a union structure to represent either a value or an operator in every node, ddd displays both possibilities at a time. This may be somewhat confusing and should be avoided. The rules are clear: If both left and right pointer are set to NULL, the node represents a number, otherwise an operator. Select ``Undisplay'' from the context menu accessible with the right mouse button to delete the unwanted entry. Ddd will ask if the action should be applied to all fitting structures or just the present one; since we want to delete different values from different boxes, the second alternative must be selected.

Ddd offers some additional features dealing with graph layout in the data menu. The reader will surely figure out how to use them very quickly since they are quite intuitive and self-explaining.

Multi-linked structures

As a last example (and to demonstrate the great possibilities ddd offers once again), take a look at figure 5: It shows a graph produced by the program poly.c which implements a representation for a certain polynomial (3*x^2+zy-3xz^3) using a data structure presented in the all-time classic work on computer science, Fundamental Algorithms (from the Series The Art of Computer Programming) by Donald Knuth. You are not assumed to understand the graph's meaning instantaneously...Just let you impress by the possibility to visualise quite complicated structures that would merely be un-understandable from the program source alone. Note that automatic layout wasn't used for this graph, since it produces a correct, but not very informative visualisation: Too much information about the idea behind the structure has to go into the layout.

Figure 5: A polynomial expression represented in memory
\begin{figure}\begin{center}
\epsfig{file=poly.ps, scale=0.7} \end{center} \end{figure}

Plotting datasets

Data structures are not the only things ddd is capable of drawing: Additional, datasets stored in arrays can be visualised using the well known Gnuplot program as helper. Since the generation of such datasets occurs quite frequently in scientific programs, we will take a look at this convenient feature.

Program valtab.c shows a program that creates a value table for a certain function (in this case, a two dimensional sine function). Note that you must compile this program using the -lm switch in gcc in order to include the mathematical library!

#include<stdio.h>
#include<math.h>

int main() {
  float *val;
  float sval[100];
  float **threed;
  int points = 100;
  float period = 2*M_PI;
  int count, count2;

  val = (float*) malloc(points*sizeof(float));
  for (count = 0; count < points; count++) {
    val[count] = sin(count * period/(float)points);
    sval[count] = val[count];
  }
  
  threed = (float**)malloc(points*sizeof(float));
  float x,y;
  for (count = 0; count < points; count++) {
    threed[count] = (float*)malloc(points*sizeof(float));
    for (count2 = 0; count2 < points; count2++) {
      x = count*period/(float)points;
      y = count2*period/(float)points;
      threed[count][count2] = 1.0f/(x+y)*sin(x+y);
    }
  }

  /* Normally, we would write the generated data into a file or so. */
  printf("Value tables created\n");
  return 0;
}

Normally, most programs will deal with more complicated functions (or acquire their data sets in a different way), but the basic principle (filling some values into an array) remains unchanged in all cases.

We use three kinds of arrays in our sample program to demonstrate the different methods for plotting data. The simplest possibility is a static, one-dimensional array, as is sval. In this case, we only need to highlight the identifier by clicking on it with the right mouse button and pressing on the ``plot'' icon found in the upper zone of the window - voila, a new gnuplot-window with the desired graph opens. The graph's appearance can be customised with several menu entries; figure 6 shows the output with the plot style changed to ``lines'' from the default value ``points'' by selecting Plot->Lines in the menu.

Figure 6: The plot window
\begin{figure}\begin{center}
\epsfig{file=plot.eps, scale=0.3} \end{center} \end{figure}

The situation is somewhat more complicated with dynamical created arrays, since ddd cannot determine their lengths automatically. A workaround for this is the use of so-called array slices that must be defined manually in the debugger interaction part in the lower part of the ddd window.

The expression graph display val[0]@points creates such an array slice, where the index-expression [0] denotes the lower and @points denotes the upper bound for the used values (instead of the memory value points, a simple integer number can be used likewise). Plotting this graph is achieved in the same way as before (by pressing the ``plot''-button) and gives (surprise, surprise) the same result, since identical datasets are used.

Plotting three-dimensional graphs works pretty much the same way: The identifier of static array needs just to be highlighted with the mouse in order to apply the ``plot''-button afterwards, while an array slice has to be created when dynamic allocated structures are used. The syntax for this is graph display threed[0][0]@points@points, as the reader will have expected.

Since the customisation features available with gnuplot for three-dimensional graphs are not very well supported in the ddd-interface, such plotting attempts will normally tend to give not very good and meaningful results as with two-dimensional plots.

Printing graphs and plots

In order to document programs, it can sometimes be convenient to have graphical representations for their data structures handy, like the ones produces by ddd. Ddd's printer interface offers the possibility to create a Postscript version of graphs and plots therefor. To print a graph, just select File->Print Graph. A menu pops up offering some choices, and hitting the print button produces either a file or sends the output directly to the printer.

The same approach may be applied for plots; the only difference is that fewer options are available in the print dialog. While graphs can be exported to Postscript as like as well as to the fig-format format (as used by the classical Unix drawing tool xfig), plot printing can be exported only to Postscript.

Ddd offers many more features such as watchpoints, multiple language support etc. These are beyond the topic of this article, since we do not intend to repeat the excellent documentation coming with ddd. (The documentation is available from http://www.gnu.org/software/ddd.) Instead, we encourage readers to explore ddd's rich set of features themselves, debugging their own programs.

As a last remark, let's consider a quotation that ddd uses as one of its "tips of the day", because it expresses the importance (and limits) of debugging very well:

The debugger isn't a substitute for good thinking. But, in some cases, thinking isn't a substitute for a good debugger either. The most effective combination is good thinking and good debugger. --Steve McConnell, Code Complete

Wolfgang Mauerer

Wolfgang has written several articles for both German and international publications, is the author of a German book about text processing and works as system administrator and programmer. His main interests include programming language theory, operating system kernels (explicitly not limited to Linux..), and (sometimes) physics. Besides, he is on a holy war against monopolistic, proprietary software. He lives in London at the moment.


Copyright © 2001, Wolfgang Mauerer.
Copying license http://www.linuxgazette.net/copying.html
Published in Issue 73 of Linux Gazette, December 2001

"Linux Gazette...making Linux just a little more fun!"


Installing Linux on Root Devices Unsupported by Your Distribution

By Zwane Mwaikambo


I'm sure the vast majority of sysadmins out there have occasionally acquired new server hardware that their latest Linux distribution does not support. This is usually not a problem because as long as you can install the base system you can then graft the other bits in once it's running. The only exception is when your root device isn't supported; that's when the excitement begins.

The key here is that the hardware is not distro supported. Most of the time you'll may find that the most recent kernels do support your hardware and hence, upgrading to the newer kernel would solve your problem. But it's a chicken-and-egg situation since you don't have a running system yet. With this article I hope to alleviate some of the headaches of these problematic installations so that you can get on with your usual duties sooner. The distribution i shall use as an example is Red Hat 7.1 (hereupon referred to as RH7.1), and the server root device is a RAID device on an Adaptec 2100 host adapter, but of course I will try to generalise so that you will be able to adapt this advice for just about any unsupported device (e.g. IDE RAID controllers or other SCSI HBAs).

The kernel shipped with RH7.1 is 2.4.2-2, a 2.4.2-ac based kernel with extra patches by Red Hat. My target kernel will be 2.4.10-ac1. I recommend "-ac" since Alan Cox incorporates lots of experimental drivers in his kernels for testing and hence usually has support for various devices first before the mainstream Linus kernel , which he merges to later. In order to build the kernels you will require an additional Linux box to do the compilations on (you might want to read the kernel-HOWTO if you're a bit rusty) and to prepare the bootdisks. When creating the bootdisk kernel image you can make good guesses based on the kernel ring buffer output from dmesg). Size is the objective here since we have to be able to fit the new kernel into the same space the original took, there really isn't much leeway so we have to pick carefully. Here is a rough outline of our new configuration with explanations. (Parts removed.)

CONFIG_X86=y
CONFIG_ISA=y
CONFIG_UID16=y

# Needed for newer drivers
CONFIG_EXPERIMENTAL=y
CONFIG_MODULES=y
CONFIG_MODVERSIONS=y
CONFIG_KMOD=y

# Select your target CPU but skip SMP due to the size
# hit when enabled
CONFIG_MPENTIUMIII=y

# Even if you have over 1G of RAM, stick with no
# highmem for the installation
CONFIG_NOHIGHMEM=y

CONFIG_NET=y
CONFIG_PCI=y
CONFIG_PCI_GOANY=y
CONFIG_PCI_BIOS=y
CONFIG_PCI_DIRECT=y

# This particular option just bloats the kernel
# no need for this during install
# CONFIG_PCI_NAMES is not set
CONFIG_SYSVIPC=y
CONFIG_SYSCTL=y
CONFIG_KCORE_ELF=y
CONFIG_BINFMT_ELF=y
CONFIG_BINFMT_MISC=y

# ACPI and APM are not required even for normal
# operation on desktop systems so skip it.
# CONFIG_PM is not set
# CONFIG_ACPI is not set
# CONFIG_APM is not set

# No need for parallel ports right now either
# CONFIG_PARPORT is not set

CONFIG_BLK_DEV_FD=y
# Some distributions use loop devices during
# installation
CONFIG_BLK_DEV_LOOP=y

# Initrds are almost always used during installation
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_SIZE=4096
CONFIG_BLK_DEV_INITRD=y

CONFIG_PACKET=y
# CONFIG_PACKET_MMAP is not set
# CONFIG_NETLINK is not set
# CONFIG_NETFILTER is not set
# CONFIG_FILTER is not set
CONFIG_UNIX=y
CONFIG_INET=y

# Any IDE devices? I usually have
# IDE cdroms
CONFIG_IDE=y
CONFIG_BLK_DEV_IDE=y
CONFIG_BLK_DEV_IDEDISK=y

# Speeds things up by reading multiple sectors at
# a time
CONFIG_IDEDISK_MULTI_MODE=y
CONFIG_BLK_DEV_IDECD=y
CONFIG_BLK_DEV_IDEPCI=y
CONFIG_IDEPCI_SHARE_IRQ=y
CONFIG_BLK_DEV_IDEDMA_PCI=y
CONFIG_BLK_DEV_ADMA=y

# You may require this if you're installing to
# a disk on an addon card
# CONFIG_BLK_DEV_OFFBOARD is not set

# DMA is good to cut down that install time
# and general error checking
CONFIG_IDEDMA_PCI_AUTO=y
CONFIG_BLK_DEV_IDEDMA=y
CONFIG_IDEDMA_AUTO=y

# If you've got one of those IDE-RAID cards
# you'll want to check this out.
# CONFIG_BLK_DEV_ATARAID is not set
# CONFIG_BLK_DEV_ATARAID_PDC is not set
# CONFIG_BLK_DEV_ATARAID_HPT is not set

CONFIG_SCSI=y
CONFIG_BLK_DEV_SD=y
CONFIG_SD_EXTRA_DEVS=40
CONFIG_SCSI_MULTI_LUN=y

# Of the low-level drivers, only pick the ones
# which you require doing installation
# I didn't select my aic7xxx based card
# since it only has a tape drive on it.
CONFIG_SCSI_DPT_I2O=y

# Increases kernel size, skip.
# CONFIG_SCSI_DEBUG is not set

# required for this specifc i2o based RAID
# card
CONFIG_I2O=y
CONFIG_I2O_PCI=y
CONFIG_I2O_BLOCK=y
CONFIG_I2O_SCSI=y

# We don't really need network card drivers
CONFIG_NETDEVICES=y

# You have to type somewhere ;)
CONFIG_VT=y
CONFIG_VT_CONSOLE=y
CONFIG_UNIX98_PTYS=y
CONFIG_UNIX98_PTY_COUNT=256

# We can use the "text" based installation
# CONFIG_MOUSE is not set
# CONFIG_PSMOUSE is not set
# CONFIG_82C710_MOUSE is not set
# CONFIG_PC110_PAD is not set

# You can be a BOFH later ;)
# CONFIG_QUOTA is not set

# If you're on a distribution with ext3 installation
# support you might want to enable this (ditto for Reiser).
# But try keep the number of filesystems supported low
# CONFIG_EXT3_FS is not set

# Some distributions require msdos fs
CONFIG_FAT_FS=y
CONFIG_MSDOS_FS=y

# For the installation media
CONFIG_ISO9660_FS=y
# CONFIG_JOLIET is not set

CONFIG_PROC_FS=y
CONFIG_DEVPTS_FS=y
CONFIG_EXT2_FS=y

# Your regular PC partitions
CONFIG_MSDOS_PARTITION=y

# This might not be necessary but may break things
CONFIG_NLS_DEFAULT="iso8859-1"

# Console drivers
#
CONFIG_VGA_CONSOLE=y

# No pretty penguins right now :)
# CONFIG_FB is not set

# Unless you have USB keyboards/mice skip this section
# CONFIG_USB is not set
After the kernel compilation is done, it's time to move the new kernel to the previous installation kernel's location, we do this by mounting the bootdisk used by the installation. You will require loopback block device support to do this.
# cd /tmp
# cp /cdrom/boot/boot.img .
# mkdir bootdisk
# mount -t msdos boot.img bootdisk -o loop
# cp /usr/src/linux-2.4.10-ac11/arch/i386/boot/bzImage bootdisk/vmlinuz
An rdev isn't required because syslinux passes the appropriate root device (ie initrd)
# umount bootdisk
# dd if=boot.img of=/dev/fd0
Lets compare sizes for this particular kernel build.
Original installation kernel : 652k
Custom installation kernel : 632k
Custom "normal" kernel : 951k
We obviously wouldn't be able to fit in a full-featured kernel onto our bootdisk.

Once that's done, we have a "new" installation disk with support for our root device. We now use the bootdisk to start the installation. I recommend using text-based installs since we removed framebuffer and mouse support to minimise the kernel size. Upon completion of the installation you will have an installed system but still won't be able to boot from the device. The reason is that your distribution will install the kernel packages from its installation medium, and not the one used during installation. We have to now go back to the compile box and do the following to create a bootdisk.

# rdev bzImage /dev/sda1
# dd if=bzImage of=/dev/fd0
(Use your actual root device instead of /dev/sda1.)

When that's done and you've booted to a shell, you can then unpack a new tarball on your target computer/server and configure as required. You may want to take the distribution config file and build on that by doing.

# cd /usr/src/linux-2.4.10-ac11
# cp /home/zwane/config-2.4.2-2 .config
# make oldconfig
Answer the prompted questions, then go through menuconfig to check the final configuration before compilation:
# make menuconfig
# make dep bzImage modules modules_install
Copy the resulting image to your kernel location (e.g /boot/vmlinuz) and edit your lilo configuration (or skip lilo if you're using grub ;) You will have to do a final rdev to your new kernel, since the kernel build process "detects" your current root device when compiling and sets it in kernels you build in that session. Or you can edit the toplevel Makefile (e.g. /usr/src/linux-2.4.10-ac11/Makefile) and change ROOT_DEVICE to your device.
# rdev /boot/vmlinuz /dev/sda1
You should be able to reboot now and enjoy the fruits of your labour!

Zwane Mwaikambo

Zwane is a net/sysadmin in Swaziland for one of the ISPs there (Realnet) until he starts University sometime in 2002. He's router-hopping during the day and hacking on Open Source Software at night (oh and anyone for an LUG in Swaziland?).


Copyright © 2001, Zwane Mwaikambo.
Copying license http://www.linuxgazette.net/copying.html
Published in Issue 73 of Linux Gazette, December 2001

"Linux Gazette...making Linux just a little more fun!"


The Answer Gang's Posting Guidelines

By Ben Okopnik


This article describes the things that you need to do when posting to TAG in order to maximize the chances of getting meaningful replies to your inquiry. This should also prevent you from getting laughed at for being lazy and trying to have others do work that you yourself should be doing. It draws heavily on Tad McClellan's Posting Guidelines for comp.lang.perl.misc and the Netiquette Guidelines RFC.

Before Posting

You Must

  • Check the LG and TAG FAQs
  • Check the list of HOWTOs for anything relevant

You Really, Really Should

  • Search previous issue of LG for relevant answers

If You Like

  • Check Other Resources (books, STFW, etc.)

Posting to TAG

  • Question should be about Linux, or of interest to Linux community
  • Carefully choose the contents of your Subject header
  • Beware of saying "doesn't work"
  • Use an effective followup style
  • Provide enough, but not too much information
  • Do not post binaries, HTML, or MIME
  • If your message contains any "confidential" or "for recipient only" conditions (these are sometimes added automatically on a site-wide basis), you must give us explicit permission to publish in your e-mail. Otherwise we cannot answer you. (But asking for your name not to be published is OK.)

As you would expect, The Answer Gang's discussions are usually technical in nature; hence, there is a strong need to observe conventions for conduct in these discussions.

Checking the FAQs before posting is required in Net forums in general; there is nothing TAG-specific about this requirement.

There can be hundreds of messages in TAG in any given month. We all must decide somehow which ones we are going to answer. Your post is in competition with all the other posts. You need to "win" before a person who can help you will even try.

You have 40 precious characters of Subject in which to make your first impression. Spend them indicating what problem we can expect to find in your query. Don't waste them indicating "experience level" (guru, newbie...) Don't waste them pleading (please read, urgent, help!...) Don't waste them on non-subjects (Linux question, Could I ask a question?...)

Part of the beauty of Net forum dynamics is that you can contribute to the community with your very first post! If your choice of subject leads a fellow searcher to find the thread you are starting, then even asking a question helps us all.

When composing a followup, quote only enough text to establish the context for the comments that you will add. Always indicate who wrote the quoted material. Don't quote the entire article.

Intersperse your comments *following* the sections of quoted text that your comments apply to. Failure to do this is called "Jeopardy" posting because the answer comes before the question. Reversing the chronology of the dialog (putting your response before the quoted text) makes it much harder to understand; some folks won't even read it if written that way. For more information on quoting style, see: http://www.geocities.com/nnqweb/nquote.html

Email is a text only medium. Don't post Word documents, vcards, HTML, or MIME (unless MIME is necessary to preserve your language's specific characters.) Many people will not be able to easily read your post, and thus will not bother. Plain text is something everyone can read.

Published answers benefit the entire community; this is what we do here in TAG. If you have a "This is to be kept confidential" blurb in your post, forget about having it answered: it just isn't going to happen. Don't expect people to do one-on-one problem resolution unless you're willing to pay for it.

Beware of saying "doesn't work". This is a "red flag" phrase. If you find yourself writing that, pause and see if you can't describe what is not working without saying "doesn't work". That is, describe how it is not what you want.

Ben Okopnik

A cyberjack-of-all-trades, Ben wanders the world in his 38' sailboat, building networks and hacking on hardware and software whenever he runs out of cruising money. He's been playing and working with computers since the Elder Days (anybody remember the Elf II?), and isn't about to stop any time soon.


Copyright © 2001, Ben Okopnik.
Copying license http://www.linuxgazette.net/copying.html
Published in Issue 73 of Linux Gazette, December 2001

"Linux Gazette...making Linux just a little more fun!"


The Foolish Things We Do With Our Computers

By Mike "Iron" Orr


"Foolish" is becoming an inappropriate title, since more and more of the submissions are "interesting" rather than "foolish". But we'll stick with the title. The submissions continue to pour in.

A baffling screen

By Courtney Grimland

I remember the very first time I installed Linux on a PC (or any computer, for that matter). It was a Red Hat installation (6.2 I believe), and everything went smoothly. Keep in mind this was my very first exposure to anything ![DOS|Win9x].

When time came to boot it up, I anxiously typed in my root password. Next thing I know, I'm frantically digging through all of the documentation and paperwork that came in the box, looking for my bash number. Sure am glad I didn't call up Red Hat and ask for help with the registration process (which is what I thought this was).

You see, after I logged in with root password, all I see is:

bash#
It kind of threw me. I didn't recognize it at the time to be a friendly command prompt waiting for input (like c:\) that I was used to seeing all of my life).

I guess it wasn't really a foolish thing, but it shows how far I've come in the last year and a half. I'm currently working on a device driver and file-management software for my nifty little miniature MP3 player my girlfriend bought in Hong Kong.

A story from Russia

By BaRoN!

Hello gazette,
I read a Russian translation of your funny stories, and here is a story about a friend of mine.
It was about 5 or 6 years ago... He had a 100Mb hard disk. And after a half-year of working fine, it stopped being detected by BIOS. In the mid-1990s, tech support was VERY BAD in Russia, and it was EVEN WORSE in the country. We live in a small town (about 300.000 people) and in the mid-1990s, just about 100 of families had got PC's. So, the seller said that the HDD was damaged my friend and will not be replaced.

A new 100Mb HDD was unaffordable to my friend, so we started to do different things with it.

Alex, my friend, took his HDD to show to one guy, and after he brought it back to home, IT WAS DETECTED BY THE BIOS!

We tried to partition it and then to format it, and IT PASSED OK! But this paradise lasted for only one day.

When it didn't work again, Alex tried a different strategy. He walked for 20 minutes with his HDD -- and was detected again! (It was winter, about -25 degrees (Celsius)).

I suggested he put his HDD into polyethalyne packet and put it in the freezer portion of his refrigerator for fifteen minutes. That too :).

So every morning before my friend went to school, he grabbed his hard drive and put it in the freezer. :). It lasted for about 5 months, until he could afford to buy new HDD.

Conclusion

Another interesting point is how many of the stories we've received can be summarized as, "If anything goes wrong, try freezing, refrigeration or ice cubes."

Mike Orr

Mike ("Iron") is the Editor of Linux Gazette. You can read what he has to say in the Back Page column in this issue. He has been a Linux enthusiast since 1991 and a Debian user since 1995. He is SSC's web technical coordinator, which means he gets to write a lot of Python scripts. Non-computer interests include Ska/Oi! music and the international language Esperanto. The nickname Iron was given to him in college--short for Iron Orr, hahaha.


Copyright © 2001, Mike "Iron" Orr.
Copying license http://www.linuxgazette.net/copying.html
Published in Issue 73 of Linux Gazette, December 2001

"Linux Gazette...making Linux just a little more fun!"


Free-Software Appreciation

By Mike ("Iron") Orr


A letter linked on Slashdot got me thinking. It was written by Christoph Pfisterer when he resigned from the Fink project. (Fink is an attempt to "bring the full world of Unix Open Source software to Darwin and Mac OS X.") But it's not Fink itself I want to focus on, but the fact that it's free software. A developer is resigning from a free-software project because of the unappreciative demands of its users. He writes, "I'm tired of dealing with people who don't appreciate what they get for free. I'm tired of dealing with people who think they have a commercial-grade, 24/7, one hour turn-around time support contract with Fink.... I'm tired of people who complain loudly when something doesn't work, but fall silent when asked to help in fixing it.... I'm tired of putting my professional future at risk by neglecting my studies."

Here's the original letter: http://www.geocrawler.com/lists/3/SourceForge/11114/125/7038861/

This is one of the dangers every free-software developer faces. Have you hugged your favorite free-software developer today? OK, I'm joking. But if there's a free program you use a lot and really depend on, especially one that doesn't get a lot of recognition or is maintained by one volunteer, tell them how much you appreciate it. Consider giving a financial or in-kind donation to them or to their favorite free-software organization or charity. Or send a donation to the Electronic Frontier Foundation in their name. Love makes the world go round, and recognition (and taking care of the developers' material needs) helps the free-software world go round.

Another way to show your appreciation is to become a contributing user. You can code, write documentation, submit bug reports, or answer newbie questions. Many projects have a TODO list showing work they'd like to do when they have time. Are any of those goals things you can do? You may find that one of those TODO items would actually benefit you too.

As the adage goes, "If you can't code, write documentation." Are there parts of the documentation you feel are lacking? Is there any documentation at all? What advice did you wish you had when you first installed the program? Put it in a HOWTO. LG has been running several articles about documentation in the past couple issues, and January and February will bring even more.

Some projects have a closed development team, meaning they don't accept code from outside the core team. But even these sites are happy to receive bug reports from users, especially if the reports include a proposed fix or at least some research into what might be causing the problem and how to solve it. OK, maybe "happy" isn't the right word, because it means more work for them. But this additional work leads to a more bulletproof product.

The more users actively contribute on a project's bugtracker and mailing lists, the more the core developers will feel that their effort is worthwhile, and that translates into better software.

Also, participating in the development of your favorite software helps give you a sense of ownership in it. Which gives you something to brag about to your friends.

Mike Orr

Mike ("Iron") is the Editor of Linux Gazette. You can read what he has to say in the Back Page column in this issue. He has been a Linux enthusiast since 1991 and a Debian user since 1995. He is SSC's web technical coordinator, which means he gets to write a lot of Python scripts. Non-computer interests include Ska/Oi! music and the international language Esperanto. The nickname Iron was given to him in college--short for Iron Orr, hahaha.


Copyright © 2001, Mike ("Iron") Orr.
Copying license http://www.linuxgazette.net/copying.html
Published in Issue 73 of Linux Gazette, December 2001

"Linux Gazette...making Linux just a little more fun!"


Content Management with Procmail

By Pradeep Padala and Prakash Bulusu


"Small is beautiful" -- Unix Philosophy

Introduction

Ever wondered what it takes to create a web site that can be completely managed by e-mail? Are you one of those e-mail buffs who wants to manage everything with mail? Are you the guy who wants something different? If your answer is yes to any of these questions, read on....

Have you ever thought how a special correspondent for CNN reporting from the remotest place on earth can cause a web page to change its content based on the latest he is reporting ? Or how the Newspaper dot coms manage hundreds of HTML pages every day ? The achieve this through a concept called a Content Management System.  

Content Management is one of the prominent issues every website has to deal with, from lightly-loaded sites to very content-intensive sites). A very basic Content Management System (CMS) at the very least should provide a user friendly interface to modify the Web Content. A sophisticated CMS does much more than that, not only providing management of creation, modification and deletion of content but also services like revision control, roles hierarchy, multichannel content management and delivery etc. In this article we talk about a relatively new channel for Content Management very well known to readers: e-mail! Though this particular channel has already been put to use by commercial CMS's like Vignette, they are rather very expensive and sold on a per-feature basis. 

If the above paragraph looked like Greek to you then you are an Eligible Candidate to read this article. Carry on and you will learn the simplest ever implementation of e-mail based Content Management System with Procmail.

Here we will show how a web page can be updated just by sending an e-mail. We will use this test page (Javascript should be enabled to properly view this page). All it contains is a streamer. We update the text of the streamer when we receive mail with proper subject!!!

procmail

Now what's the connection to Procmail? Procmail follows the UNIX philosophy that a program accomplishes one task, efficiently . Procmail is an extremely powerful mail filtering utility. All one has to do is write recipes which get executed when certain type of mail arrives. It is generally used to filter incoming mail into seperate directories. In the Procmail developers' words,
Procmail can be used to create mail-servers, mailing lists, sort your incoming mail into separate folders/files (real convenient when subscribing to one or more mailing lists or for prioritising your mail), preprocess your mail, start any programs upon mail arrival (e.g. to generate different chimes on your workstation for different types of mail) or selectively forward certain incoming mail automatically to someone.

If you don't understand any of those terms above, dont panic. Just sit back and relax. We will show some basic examples on how it works and explain a cute method to update the streamer on your web page.

The intial blues

Procmail is a mail filtering utility. It can be run on each mail sent to you and process it accordingly. Say, you wanted to save all the mail with subject discuss to a folder named discuss. Then you have to write the following lines in the files specified.

In your home directory create a file named .forward and put the following lines
	"|IFS=' ';exec /usr/local/bin/procmail USER=<username>"
Replace the username with your username and make sure that the path to the Procmail binary is set correctly. Don't worry about the details. We will dig deeper into them in the next section.

Create a file named .procmailrc in your home directory and add the following lines

	:0
	* ^Subject:.*discuss
	discuss

Create a directory named discuss in your home directory for putting the mails with subject discuss.

Now try sending a mail to yourself which contains at least the word "discuss" in the subject. This mail will automatically be moved into a directory discuss.

Let's try to understand what's happening here. When a mail is sent to an smtp server, it will be delivered to the corresponding user by a MDA(Mail Delivery Agent) like sendmail. This program looks for a file named .forward; if it exists it tries to execute the rules specified in the .forward file. Usually the .forward contains a mail address to which one wishes to forward all mail. We may also write commands within this file to execute a program like Procmail. This is exactly what the lines above in the .forward do. For a detailed explanation of things to be put in .forward see here Once Procmail is executed, it looks for the file .procmailrc which contains mail processing directives - what actions have to be taken for different kinds of mail.

.procmailrc file

The file .procmailrc contains rules for how to filter the mail. In above example, the rule says that for all the mails with subject discuss, forward them to a directory named discuss. General syntax for writing rules (called recipes in Procmail jargon) is

	:0 [flags] [ : [locallockfile] ]
	<zero or more conditions (one per line)>
	<exactly one action line>

You can ignore the first line for now. From the second line, you can start writing conditions. A condition starting with '*' specifies an extended regular expression to be matched. If it matches then the action line is executed. If the action line starts with a '|' then it executes the program whose name follows the '|'. You can use the '!' character to forward to mail to another address. If the action line doesn't start with either of these two characters or a '{', then it is assumed to be a directory or file to which mail has to be delivered, as in the above example.

Another example will clear the mist.

	
	:0 c
	* ^Subject:.*discuss
	discuss

	:0
	* ^Subject:.*discuss
	! yourname@somewhere.com
This recipe forwards the mail to the address yourname@somewhere.com and keeps a copy in the directory discuss. The flag 'c' in the first stanza tells Procmail to continue reading recipes even if this recipe matches. Normally Procmail stops after the first match. The procmailrc manpage says 'c' generates a carbon copy of the message, but it's easier to think of 'c' as meaning "continue". Either way amounts to the same thing. Another useful but ill-named flag is 'D', which makes the match expressions case sensitive.

The following example shows the usage of '|'

	:0
	* ^Subject:.*discuss
	| formail -I "" >> index.html
If a mail with subject discuss comes, formail is executed. formail is a small utility which can be used to format mail. The above action line extracts the body from the mail and appends it to the file index.html.

Ready for action?

You have seen some basic examples. There is a lot of information on Procmail recipes on web. Refer to the section on resources for links. In the next few sections, we will show how Procmail can be used to update a streamer on a web page.

We put the following lines in .procmailrc. My procmailc at it stands now is here
	
	SHELL=/bin/sh
	PATH=/bin:/usr/bin:/usr/local/bin
	
	:0
	* ^Subject:.*announce
	| formail -s parse.pl announce;

	:0
	* ^Subject:.*notice
	| formail -s parse.pl notice;

The first lines set some variables so that Procmail works properly. See procmailrc man page for details.

Here, mail containing the subject "announce" or "notice" is forwarded to formail. formail parses the mail and each individual mail is given to a perl script named parse.pl. The perl script updates the streamer with the string in the body of message. The text version of the script is here

#!/bin/perl

$option = $ARGV[0];                                 # Get the option
$my_html_dir = "/cise/homes/ppadala/public_html";   # My web directory
$tmp_file = "/tmp/tmp.out";
$start = 0;     #start would be false(0) until we get to a message beginning 
$line = "";     #The streamer line

if($option eq "announce") {
    $line = "ANNOUNCEMENTS:";
}
elsif($option eq "notice") {
    $line = "NOTICE:";
}
else {
    exit(1);
}

#Read the input. In this case the mails
#Parse the body and attach it to line

while()
{	chomp;

	if(/From.*/) {
		$start = 0;
	}	
	if($start == 1) {
		chomp;
		$line = $line . $_;
	}
	if($_ eq "") {
		$start = 1;
	}
}

#Open the web page containing streamer 
#and update it

$my_homepage_file = $my_html_dir . "/procmail.html";
open(MY_FILE, "<$my_homepage_file") || die("Cannot open input file");
open(TMP, ">$tmp_file");

$replace = 0;

#Replacement is done just after the line
# //Replace strStreamer .....

while()
{	if($replace == 1) {
		print TMP "var strStreamer = '${line}';\n";
		$replace = 0;
		next;
	}
		
	if(/\/\/Replace str.*/) {
		$replace = 1;
		print TMP $_;
	}
	else  {
		print TMP $_;
	}
}
	
close(TMP);
close(MY_FILE);
system("mv $tmp_file $my_homepage_file");
system("chmod go+r $my_homepage_file");

All the perl script does is update the variable strStreamer in the web page. The web page contains a streamer written in javascript. You can test it by sending mail You can see the streamer at http://www.cise.ufl.edu/~ppadala/procmail.html. It is magically updated when you send mail to my address with a subject "announce" or "notice". The text in the body goes to streamer.

Conclusion

This is a small example of Content Management. Content Mangement is a huge topic with a lot of ramifications. It requires well planned procedures for updating web pages, keeping their style sheets intact etc.. We have shown a small example of how easy it is to create a basic content management system with Procmail. The permuatations are endless. As Descartes had said "It is not enough to have a good mind. The main thing is to use it well".

Resources

Pradeep Padala

I am a master's student at University of Florida. I love hacking and adore Linux. My interests include solving puzzles and playing board games. I can be reached through p_padala@yahoo.com or my web site.

Prakash Bulusu

I am a master's student at the University of Florida.


Copyright © 2001, Pradeep Padala and Prakash Bulusu.
Copying license http://www.linuxgazette.net/copying.html
Published in Issue 73 of Linux Gazette, December 2001

"Linux Gazette...making Linux just a little more fun!"


Writing Documentation - Part 1: POD

By Christoph Spiel


The title, Writing Documentation, sounds somewhat formal. However, in this article I refer to documentation a broad sense, not only to documentation accompanying a particular piece of software, but to any related textual pieces of information. This textual information could be as short as a few lines and, for example, describe how to to start a program with all of its command line options and environment variables set correctly. On the other hand, the text could be several tens of thousands lines long, elaborating all the tricks a group of users has learned over the years while using a large software system.

Introduction

With today's GNU/Linux distributions, the aspiring documentation writer immediately finds herself in fat city: there are several systems to chose from! Three documentation systems will be introduced in this article series. Here, I start with POD. Next month I'll address LaTeX in conjunction with latex2html, and in part 3 DocBook.

The systems cater different documentation needs and all have their highs and lows. But before assessing the pros and cons of the different systems, let me put up some requirements, which I want to impose on the documentation systems.

The sources of the documentation should be:

Portable
As of December 2001, writing a "portable" file almost implies using 7-bit ASCII to encode characters. Today, 7-bit ASCII is the only encoding that works on a huge number of computers. In the future, hopefully, it will mean Unicode. Unicode can represent many more characters than ASCII does and will be as portable.

Requiring portability ensures that the texts' sources can be read and modified on a wide variety of computer systems, thereby making the documentation accessible to other programmers, which is what Open Source Software is all about.

Searchable
Data on a computer is only as good as the access to it. -- Sounds like a commonplace, but we easily forget that documentation ought to be maintained just like source code is. We want to be able to search existing documentation for, say, a particular term or identifier. Therefore, the source of the documentation should at least be amenable to standard searching tools like, for example, the grep family (grep, agrep, rgrep, sgrep) of tools.
Modular
Unless we write a short note, it is desirable that the document sources can be split into logical parts, for example sections, and the collection of all the source files is still processed as a whole by the documentation system.
Easy to Read
For documentation to be ``open'' (as in ``Open Source''), the source should be easy to read, and the system to generate the final output should be simple to learn. A documentation system will be better accepted if the writer -- and later possibly the maintainer -- can concentrate on contents rather than syntactic quirks or obscure tool chains.

Just as I require certain features in the documentation's source format, so I do with the output.

Multiple Output Formats
The documentation system must be capable of producing different output formats -- the more formats the better. At least HTML and PostScript (some users prefer PDF) must be supported, one for on-screen reading, the other for print outs.

HTML support in turn requires ``hyperlinks'', this is, references between documents or parts thereof that can be followed in a convenient way. References also help to implement the Modular Requirement in my list of source format features.

Automatic Reference Generation
All references should be resolved automatically as far as this is possible. For example, the system should resolve cross references within in the document and should allow for footnotes or sidenotes to be placed and numbered without the help of the writer. The index and bibliography also should be generated automatically.

Let us now look at a particularly easy to use format: Perl's Plain Old Documentation.

Perl's Plain Old Documentation (POD)

The ``Plain Old Documentation'' system that ships with every Perl distribution is simplest documentation system in my selection. It is simple to learn, simple to use, but -- and I hesitate to write therefore -- also the most limited of the three. Anyhow, the article you are currently reading (yes this one!) has been prepared with POD. If it is good for the goose, it can't be bad for the gander...

The big advantages of POD are

  • It comes with Perl. So you probably already have it on your Linux box. Try
        pod2man --help
    

    to see if it is installed.

  • It offers a small and well-though-out set of document structuring and markup instructions.
  • The POD translation tools render at least four different output formats: HTML, UN*X manual pages, LaTeX (which serves as base for a further translation into PostScript), and plain ASCII text.

Syntax

The POD format defines three different kinds of paragraphs. Paragraphs are separated from each other by one or more completely (!) empty lines.

Ordinary Paragraph.
Any line that does not start with at least four spaces or an equal sign is considered ordinary text. Paragraphs are separated by one or more empty lines. This means, the documenter simply writes one paragraph after the other with at least one blank line between each pair.

Ordinary paragraphs will be filled and justified (if the output format allows for justification) when output.

Verbatim Paragraph.
Lines indented by four or more spaces are considered verbatim text. They are output exactly as typed. All formatting instructions that we will see later, are disabled in verbatim paragraphs.
Command Paragraph.
Command paragraphs start with an equal sign ``='' in column zero, immediately followed by an identifier. Usually, command paragraphs consist of single lines. Yet they are syntactically paragraphs, because they are separated by blank lines before and after them.

Sectioning

Text is sectioned by =headN commands, like

=head1 primary_heading

=head2 secondary_heading

=head3 tertiary_heading

which also define the section headings primary_heading, etc.. How many heading levels (this is largest N permitted) actually are accepted, depends on the POD-to-something converter. For example, pod2man allows only two levels, pod2html allows up to six levels.

I have added line and column numbers to the source of the examples. The line numbers do not appear in the real source. They are included here to point out the empty lines that must separate the command paragraphs, this is, those starting with an equal sign in column 0. Additionally, I have added a column-number ruler at the beginning of the next example to clarify where column 0 starts.

Example:

                    1         2         3         4          5
          0123456789012345678901234567890123456789001234567890
     1    =head1 Hardware
     2
     3    The physical parts of your computer are called "hardware".
     4
     5    =head1 CPU
     6
     7    The CPU is the most important part of your computer.
     8
     9    =head1 Mass Storage
    10
    11    Mass storage devices store data permanently.
    12
    13    =head2 Hard Disk Drives
    14
    15    Hard disk drives provide fast random access to data.
    16
    17    =head2 Magnetic Tapes
    18
    19    Magnetic tapes provide slow sequential access to data.
    20
    21    =head1 Software
    22
    23    This is where the trouble starts ...

Lists

Itemized, enumerated or description lists are produced with

=over N

=item label

=item label

...

=back

where =over N starts a list that is indented at least N spaces, and extends until =back. Depending on the first label the POD-to-something translators generate an itemized list (label = *), a numbered list (label = 1) or a description list (label starts with a letter).

Example: itemized list

Again, I have added line numbers to alert the reader of the (many) empty lines used for separating the command paragraphs.

Source

     1    =over 4
     2
     3    =item *
     4
     5    Fruit, particularly non-imported fruit like ...
     6
     7    =item *
     8
     9    Though not tasty, vegetables should make up a large part of your
    10    daily diet.
    11
    12    =item *
    13
    14    Fish is much easier digestible than meat.  Therefore, ...
    15
    16    =back

Result

  • Fruit, particularly non-imported fruit like ...
  • Though not tasty, vegetables should make up a large part of your daily diet.
  • Fish is much easier digestible than meat. Therefore, ...

Example: enumerated list

Source

     1    =over 4
     2
     3    =item 1.
     4
     5    Ensure that the power switch is in position "OFF".
     6
     7    =item 2.
     8
     9    Plug in the power cord.
    10
    11    =item 3.
    12
    13    Switch the power switch in position "ON".
    14
    15    =back

Result

  1. Ensure that the power switch is in position ``OFF''.
  2. Plug in the power cord.
  3. Switch the power switch in position ``ON''.

Example: description list

Source

     1    =over 8
     2
     3    =item Robert
     4
     5    Lead singer
     6
     7    =item Jimmy
     8
     9    Lead guitar
    10
    11    =item John-Paul
    12
    13    Bass guitar
    14
    15    =item John
    16
    17    Drums and percussion
    18
    19    =back

Result

Robert
Lead singer
Jimmy
Lead guitar
John-Paul
Base guitar
John
Drums and percussion

Inline Markup Commands

Within Ordinary Text, several markup commands are recognized. All markup commands start with a single capital letter and enclose their argument within angle brackets: LETTER<argument>. The argument can consist of multiple words, which can span more than one line.

I<argument>
Render argument in italics. I corresponds to the HTML tags em and var, thus it is primarily used for emphasizing words or marking up variables.

Examples:

  • Do not remove your Linux kernel!

    is produced by

        Do I<not> remove your Linux kernel!
    
  • Use cd directory to change your working directory to directory.

    is generated with

        Use B<cd> I<directory> to change your
        working directory to I<directory>.
    
B<argument>
Render argument bold. B corresponds to the HTML tag b. It is used to emphasize in text and to mark up program names or switches.

Examples:

  • Always shut down your machine before switching it off.

    comes from

        B<Always> shut down your machine before switching it off.
    
  • podchecker accepts the options -warnings and -nowarnings.

    is the result of

        B<podchecker> accepts the options B<-warnings>
        and B<-nowarnings>.
    
C<argument>
C marks up code or anything else which is to be taken literally. The corresponding HTML tags is are code, samp, and tt.

Examples:

  • Every C-program must have a function called main.

    is generated by

        Every C-program must have a function
        called C<main>.
    
  • Boolean false is represented by [1 1 0], and boolean true by [1 1 1].

    is produced by

        Boolean false is represented by C<[1 1 0]>,
        and boolean true by C<[1 1 1]>.
    
L<reference> or L<description|reference>
Link to an existing reference. If description is omitted, the link's text is reference, otherwise it is description. Using L is a bit tricky. Therefore, I have devoted the next section to it.

Cross References

The L-command is distantly related to HTML's <a href = "reference">description</a>, however, in POD, reference is not a general unified resource locator (URL).

reference can only refer to (automatically by the POD-to-something translator) generated labels. These labels are inserted for every =head and =item. The label associated with =head heading is heading downcased, but otherwise unchanged, e.g.

    =head1 A Multi-Word Heading (MWH)

automatically gets assigned the label

    a multi-word heading (mwh)

The labels of =items are prefixed by item_, spaces are replaced by underscores, and non-alphanumeric characters are replaced by their hexadecimal ASCII code prefixed by a percent sign. Anybody expected an easy rule? So, one of the items in this article,

    =item Automatic Reference Generation.

has the label

    item_Automatic_Reference_Generation%2E

because the ASCII number of the period is 46 in decimal or 2e in hexadecimal.

Example:

Source

    =head1 Introduction
    Section L<"concepts"> introduces the basics of the field.
    =head1 Concepts
    ...
    =head1 Synchronization
    =over 4
    =item Deadlocks
    =item Race Conditions
    =item Recovering from Deadlocks
    =back
    How to cope with deadlocks was already discussed in
    L<Deadlocks|"item_Deadlocks">, and L<Recovering from
    Deadlocks|"item_Recovering_from_Deadlocks">.

Result

Introduction

Section concepts introduces the basics of the field.


Concepts

...


Synchronization

Deadlocks
Race Conditions
Recovering from Deadlocks

How to cope with deadlocks was discussed in Deadlocks, and Recovering from Deadlocks.

The L-command is very limited in its use, for the writer cannot insert places to refer to with an L-command; HTML-like ``anchors'' are missing.

A second limiting factor are some POD translators trying to be smart and decorate link with additional text. For example, pod2latex mangles both references to items in the above example:

How to cope with deadlocks was discussed in the \textsf{Deadlocks$|$"item\_Deadlocks"} entry elsewhere in this document, and the \textsf{Recovering from Deadlocks$|$"item\_Recovering\_from\_Deadlocks"} entry elsewhere in this document.

where I have underlined the words added by pod2latex. Clearly, we want a better mechanism. The mechanism exists in format-specific paragraphs.

Format-Specific Paragraphs

We have just seen that the L-command is somewhat difficult to control. Why can't we simply use a HTML-reference? The terse answer, ``because POD is not HTML'', leads to the solution. If we had a way to say ``this text is for HTML, this line is for LaTeX, and this paragraph is for ''SnaFoo``, we could use the specific markup provided by these formats.

The special command

=for format paragraph_of_text

tells a translator to look at format before processing paragraph_of_text. If the translator feels responsible for handling format, it transforms paragraph_of_text according to its own rules, otherwise it completely ignores the paragraph. The second part of the translator's name usually specifies which format it takes care of. For example, pod2man transforms =for man paragraphs, pod2html processes =for html paragraphs, and so on.

As all command paragraphs, a =for format paragraph ends at the first completly empty line that follows the introducing =for.

A consistent document structure will show ``forks'' whenever specific formats are used, because a =for format clause ought to appear for each desired output format, otherwise we punch a logical holes into the document.

    This is an ordinary paragraph, which is processed by all
    translators.
    =for html <p>This paragraph only appears if the file is processed
    with <b>pod2html</b>.</p>
    =for latex This very paragraph is only treated by {\bf pod2latex}.
    =for text I am a paragraph for the *pod2text* formatter.
    We now continue with the ordinary text for all formatters.

The translators ignore unknown formats, which means we can invent special paragraphs for our own purposes! For example, to ``comment out'' a paragraph, write

    =for comment Can someone clarify the next section?

Another popular use is the emacs format :-) To switch emacs into text-mode when preparing a POD-file, start the file with

    =for emacs -*- text -*-

or end it with

    =for emacs
    Local Variables:
    mode: text
    End:

The emacs-users who are using the hyperbole add-on can convert their "dumb" POD-files into hyper-linked collections (well -- hyperbole can do a lot more than that, but hyperlinks are a beginning) of files with

    =for hyperbole <(std-reference)>

where <(std-reference)> is a hyperbole button taking you to another file which holds the reference documentation of std when you click the button in emacs.

Programs That Work With POD

  • pod2html, pod2man, pod2latex, pod2text

    Translators from POD to HTML, UN*X manual pages, LaTeX and plain text respectively.

  • podchecker

    Simple syntax checker for POD files.

Pros And Cons of POD

Pro
  • Simplicity
  • Conversion speed
Cons
  • Lack of tables
  • No program to generate an index supplied by default

Further Reading

Manual pages of perlpod(1), pod2man(1), pod2html(1), pod2latex(1), pod2text(1), and podchecker(1).

Next month: LaTeX in conjuction with latex2html.

Christoph Spiel

Chris runs an Open Source Software consulting company in Upper Bavaria/Germany. Despite being trained as a physicist -- he holds a PhD in physics from Munich University of Technology -- his main interests revolve around numerics, heterogenous programming environments, and software engineering. He can be reached at cspiel@hammersmith-consulting.com.


Copyright © 2001, Christoph Spiel.
Copying license http://www.linuxgazette.net/copying.html
Published in Issue 73 of Linux Gazette, December 2001

"Linux Gazette...making Linux just a little more fun!"


Managing MP3 Playlists, The One UNIX Way

By zhaoway


Prelude

Many cool, flashy MP3 players for Linux have been around for quite some time, but none of them resemble the One True UNIX Touch-n-Feel. They are all submissive to the shabby concept of the so-called Gooey User Interface, and I refuse to mention their names in this article that is dedicated to the One True UNIX Way of doing things. After all, the listening experience usually does NOT involve the eyes, so why not purge those graphical players to give them a rest while we concentrate on our beautiful music?

But of course, we are dedicated Linux users. (Oh, I heard you ask why I say Linux instead of UNIX? Hmm, I appreciate careful readers--hehe). This doesn't mean that we are not as newbie-friendly as most of the other computer user groups. Absolutely not. So I will first tell the uninitiated among you what that One True UNIX Way is. Oh, wait! I heard some of you moaning about some other crappy, loony, self-assured philosophical nonsense now. Okay, let's kick those newbies, and I will show you the bread and butter of my article. Advice for newbies: just pretend you aren't one.

Sweet Instruments

First, we will look at a command-line MP3 player. Then I will introduce you to some flexible ways of managing MP3 playlists along with some very short shell script snippets and a small C program to aid in the task. A very useful rename utility that comes along with the standard Perl distribution is briefed also.

Command-Line MP3 Players

There are many command-line MP3 players on the market. Oops, I mean on the Internet. But I only will introduce my favorite one: alsaplayer-text, which is packaged for Debian GNU/Linux already. (The Debian package name for it is just alsaplayer-text.) The usage most interesting to us is, for example,

% alsaplayer-text -l 85 -n some.mp3 >/dev/null 2>&1;

The -l switch controls the volume, with possible values ranging from 0-100. The -n switch tells it to start in command-line mode. The ponytail >/dev/null 2>&1 is a common trick to suppress the rubbish output. And remember, man is your friend. The above is enough for us to play with it using shell scripts. And through shell scripts, we will gain maximum flexibility in the One True UNIX Way.

Next, we will look at a command-line ID3 tag editor. An ID3 tag is a bit of information tucked within an MP3 music file that says something about the MP3 song itself: its title, the artist who performed it, etc. The ID3 tag editor we will look at is named mp3info, which was packaged for Debian too. The Debian package name is just mp3info, which means you can apt-get install mp3info very easily. (That is, if you are fortunate enough to be on a Debian GNU/Linux system.) Now let's see a usage scenario to end our briefing on the command-line MP3 commanders:

zw@q ~/mp3/chopin % mp3info chopin:revolutionary_etude:robin_alciatore.mp3 
File: chopin:revolutionary_etude:robin_alciatore.mp3
Title:   CHOPIN: "REVOLUTIONARY" ETUDE  Track: 
Artist:  CHOPIN PIANO FAVORITES
Album:                                  Year:  
Comment: http://www.mp3.com/chopinpiano Genre: Blues [0]

zw@q ~/mp3/chopin % 

Admittedly, the display isn't very flashy, and the information presented isn't satisfying. (For example, for a classical piano work, we want to know more than can be presented in a poor ID3 tag.) Readers are invited to make their own improvements.

Prepare for Shell Scripts: Line Randomizer

One often wants to play songs in a random order. For this purpose, we need a line randomizer, presened here as rand.c, which can read some lines (filenames) from stdin and randomize the order of the lines, and then print them line by line on stdout like this:

zw@q ~/mp3/chopin % ls           
chopin:nocturne_in_c_minor:robin_alciatore.mp3
chopin:nocturne_in_db_major:elena_kuschnerova.mp3
chopin:nocturne_in_e_major:joerg_demus.mp3
chopin:nocturne_in_f#_major:john_bell_young.mp3
chopin:nocturne_in_g_minor:robin_alciatore.mp3
zw@q ~/mp3/chopin % ls|rand
chopin:nocturne_in_g_minor:robin_alciatore.mp3
chopin:nocturne_in_e_major:joerg_demus.mp3
chopin:nocturne_in_db_major:elena_kuschnerova.mp3
chopin:nocturne_in_f#_major:john_bell_young.mp3
chopin:nocturne_in_c_minor:robin_alciatore.mp3
zw@q ~/mp3/chopin % 

Prepare for Shell Scripts: Rename the MP3 File

When downloading MP3 files from the Internet, you get a lot of files with spaces in between the filenames, which is a disaster in shell scripts. Of course, we could fiddle with the magic shell variable $IFS but I will introduce a handy utility that comes with the standard Perl distribution to rename a bunch of files according to some Perl Regex (regular expressions). Ladies and gentlemen, let's welcome the charming /usr/bin/rename.

zw@q ~/mp3/u2 % ls
u2 all that you can't leave behind new york.mp3
u2 all that you can't leave behind peace on earth.mp3
u2 all that you can't leave behind stuck in a moment you can't get over.mp3
zw@q ~/mp3/u2 % rename 's/^(u2) /$1:/; s/(behind) /$1:/; s/ /_/g' *.mp3
zw@q ~/mp3/u2 % ls
u2:all_that_you_can't_leave_behind:new_york.mp3
u2:all_that_you_can't_leave_behind:peace_on_earth.mp3
u2:all_that_you_can't_leave_behind:stuck_in_a_moment_you_can't_get_over.mp3
zw@q ~/mp3/u2 % 

So you want to learn Perl now?

Use Hard/Symbolic Links to Simulate Playlists

If you happen to open an MP3 playlist file (filename postfix *.m3u) with a text editor, you will see that the contents of the file are no more than some lines of full pathnames to your MP3 music file. So, why don't we get over it and use directories and hard links or symbolic links to achieve the same effect as a playlist and to let shell scripts process it more easily (for example, by just using ls) than to parse a text playlist file?

In our arrangement, you just make a new directory as a playlist using mkdir, then link the MP3 files that you want to place in that playlist into that directory by using ln. If your MP3 file is not on the same filesystem as your playlist directory, then you have to use symbolic links (ln -s), but hard links have the advantage that when you move around your original MP3 file, symbolic links (and traditional playlists, i.e., those *.m3u files) go dead but hard links still would work like a charm. Believe me, this feature is very important. You just don't know how many times you'll want to move around you MP3 files after they are downloaded from the Internet or are ripped off a music CD!

zw@q ~/mp3 % ls
chopin  classical-all  debussy  fav  nightly  u2
zw@q ~/mp3 % find chopin                
chopin
chopin/chopin:nocturne_in_db_major:robin_alciatore.mp3
chopin/chopin:berceuse:robin_alciatore.mp3
chopin/chopin:nocturne_in_db_major:elena_kuschnerova.mp3
chopin/chopin:nocturne_in_c_minor:robin_alciatore.mp3
zw@q ~/mp3 % find nightly 
nightly
nightly/chopin:nocturne_in_db_major:robin_alciatore.mp3
nightly/chopin:berceuse:robin_alciatore.mp3
nightly/ravel:gaspard_de_la_nuit:elena_kuschnerova.mp3
nightly/chopin:nocturne_in_db_major:elena_kuschnerova.mp3
nightly/chopin:nocturne_in_c_minor:robin_alciatore.mp3

In Concert

With all of the preparations above, the following is a snippet from my ~/.zshrc. It should be very easy to adjust it to your own favorite shell. There is plenty of room for enhancements. One obvious thing to do is to use mp3info, as mentioned above, to get the information about an MP3 song instead of relying on a filename.

PLAYLISTS=$HOME/mp3

# 1st arg is the playlist to be played
# 2nd arg is the volume to play with

play() {
    # Install the ALSA song card driver.
    if [[ -z ` lsmod | grep snd-card-cmipci ` ]]; then
	sudo modprobe snd-card-cmipci;
    fi
    # Play our MP3 playlist.
    while true; do
	for i in ` find $PLAYLISTS/$1 -name '*.mp3' | rand `; do
	    j=` basename $i | sed -e 's/:/: /g; s/_/ /g; s/,/, /g; s/.mp3$//;' `;
	    echo -n "Playing $j ";
	    alsaplayer-text -l $2 -q -n "$i" >/dev/null 2>&1;
	    echo "DONE.";
	done
    done
}

In the above snippet, we first check if the ALSA sound card driver for Linux is already loaded. If not, we load it by calling modprobe. My sound card is a C-Media 8738, the ALSA driver name for it is snd-card-cmipci. This is probably different on your system. You may not even be using the ALSA (Advanced Linux Sound Architecture) at all. In this article, I cannot go much deeper on how to set up your sound system on Linux. If you have difficulty setting up your sound system, or if you are interested in ALSA, check the Linux Documentation Project and the ALSA Project web pages for help. (Or turn to your local guru.)

The snippet above keeps playing a playlist and plays all songs on it in a random order, like the following screenshot shows. While a song is playing, you even can skip to the end of the song if you don't like it and jump to the next song by pressing Ctrl-C. By pressing Ctrl-Z to kill the process, you can stop it (of course this is not a very elegant stop).

zw@q ~ % play chopin 75
Playing chopin: nocturne in e major: joerg demus DONE.
Playing chopin: nocturne in db major: robin alciatore DONE.
Playing chopin: nocturne for violin and piano: alexander skwortsow, violin DONE.

You easily can write your own scripts to achieve your own satisfaction, providing you use your imagination. Open sesame! Now it's your turn, dear reader; thanks for coming with me along the One UNIX Way! So long!

Have fun and good luck!

Zhaoway

Zhaoway lives in Nanjing, China. He divides his time among his beautiful girlfriend, his old Pentium computer, and pure mathematics. (He's teaching himself grad level math. If you have a few precious stamps to spare and some used grad level math books sleeping around, then feel free to send him a copy.) He is also a volunteer member of the Debian GNU/Linux project.


Copyright © 2001, zhaoway.
Copying license http://www.linuxgazette.net/copying.html
Published in Issue 73 of Linux Gazette, December 2001

"Linux Gazette...making Linux just a little more fun!"


The Back Page


Wacko Topic of the Month


How to be a hacker

Answered By Iron, Dan Wilder, Frank Rodolph, Heather Stern,
Ben Okopnik, Huibert Alblas, Thomas Adam

(?) hi sir i want to lern hacking how i can do this please mail me and eplain in simple words

(!) [Iron]

Buy a weedwhacker. Become a prep cook. Take up golf.

(!) [Dan]

http://jc316.stormpages.com/diablo/ocnewbiehack.html
http://www.collegemarketplace.com/INsider/golf.html
http://www.ai.mit.edu/lab/olympics/2000/events/mini-golf/
http://www.golf-haha.com/index.html
http://www.pgaprofessional.com/glossary/h.html

(!) [Frank]

This site might be helpful... One might have to learn Japanese first though... http://www.pfu.fujitsu.com/hhkeyboard/ (The Happy Hacking Keyboard)

(!) [Iron]

Here's an English version of the Happy Hacking site. And an LG review of the original Happy Hacking keyboard. And an LJ review by The Answer Gang's own Don Marti on using vim with the Happy Hacking Keyboard Lite 2

(!) [Heather]

1. refer to a dictionary so you are sure which definition of "hack" you want to use. There is a nice 2c Tip this month about visiting Mirrian Webster's dictionary website, or you might find the Jargon File (aka. The New Hacker's Dictionary) useful.

2. follow directions for the right definition.

a. I recommend starting with a light axe and smaller pieces of firewood. As you work on bigger pieces you may want to use a hammer and wedge. The best thing is that poor practice results with the smaller wood leads to kindling size pieces, which are also needed for a good fireplace setup.

By all means, don't forget to seriously clean the flue before using your fireplace the first time in a season. You can seriously smoke yourself out if you forget that, and carbon monoxide, being invisible, is especially dangerous.

b. Most Linux distributions make it easy to find source code for its tools. Start with things which are shell scripts. Then learn perl, and study things which are perl scripts. Learning a minimal amount of C will allow you to look at the source code of "small" programs like ls or cat. As your talents grow you might feel inclined to look at the kernel, or other large programs that everyone uses. All the while make your own practice programs and try to do things which are useful for your own purposes. When these things are useful patches or programs to others, post them to project maintainers or start up your own thing (maybe at Sourceforge).

If the terms in this description are not "plain english" to you, you are not yet ready to be a code hacker.

c. th11s 11z != a cr@ckERz d-N d00d! Find an IRC channel somewhere. Try not to get caught doing anything the al-Qaeda would do. Expect a lump of coal in your stocking if you manage to hurt anybody with your internet joyride.

/me cackles wickedly while splitting the next email thread with a medium size wedge and light axe.

(!) [Thomas]

well u hammer get and move then strike computer as needed then you get your hacked piece.

simple is this enough good for u??

ok doodz, u understand now m8??

luvely....

I remember when Jim Dennis (the God Father) :-) answered a question similar to this way back in LG issue 21??? --- he has a knack for this sort of thing :-)

(!) [Iron]

I assume Thomas is talking about this answer: phreaking.


Not The Answer Gang


More about Ben's reputation

Answered By Ben Okopnik, Iron

(!) [Ben]

I used to teach PC troubleshooting classes way back when. On the second day, when everyone was at lunch, I'd hose their machines in different ways (*OOOH* I was evil back then... <waiting for a comment from Mike> )

(!) [Iron]

**Was** evil back then? What about now?

(!) [Ben]

Ah. I'm basking in the glow of satisfaction; the world is complete, once again. :)

As to your question, I shall ignore it with all the dignity I can muster. Humph.


A windoze weenie gets it

Answered By Thomas Adam, Iron, Ben Okopnik

I recently formated my machine and installed win 98 on it but now i got a problem

(!) [Thomas]

Awww...I can *really* understand why.....I am so sorry you had to put Win98 onto your machine and not Linux :-((

1)i am getting no sound.

(!) [Thomas]

It has been known that in the dead of night, computers such as those running Windows98 do groan and moan about why they have such an awlful operating system on them. Maybe you need to turn the speakers on (or connect your internal speakers) to hear it :)

2)i cannot change from 16 to 256 colors or higher

(!) [Thomas]

Ha ha.....

(!) [Thomas]

what shud i do or what driver shud i load i have intel celeron and vintron motherboard 58 mb ram.

(!) [Thomas]

Driver??? Driver?? You must mean using the following command:

insmod /lib/modules/kernel-version/some_file

(!) [Iron]

Using modprobe instead of insmod will automatically load any driver this driver depends on. i tried intel 810-815... chipset vga driver fow win98 but it did not work

(!) [Thomas]

Tell me Mr. [the querent], if you send an e-mail to an address such as the following: Linux-questions-only at ssc.com. Would that suggest to you "oh, maybe they know something about Windows???" -- I should hope not. It would be a great help if you actually READ the e-mail address that you are sending it to.

And now, I shall do Heather Stern's piece:

* * * * * * * THESE ARE NOT THE DROIDS YOU'RE LOOKING FOR * * * * * * *

Hi, you've reached the Linux Gazette Answer Gang....
   Linux ::::::::: a modern operating system not much like any of:
               --- DOS -- Windows -- Solaris -- MacOS -- alien starships ---
               ... except occasionally, an ability to run on the same hardware.
   Gazette ::::::: published more regularly than "almanac."  In our case:
               --- a monthly web-based magazine, home: www.linuxgazette.com
   Answer Gang ::: Not the "lazy college student's UNstudy group"
               --- nor the "hey d00dz help me cRaK my neighBoorZ klub"

Have a nice day :-)


The great riffle caper

Answered By Thomas Adam, Ben Okopnik, Iron, Dan Wilder, Don Marti, Frank Rodolf

(!) [Thomas]

Tut tut, this question is in HTML format.

Hey Heather....lets nab him!!

<In the distance a figure looking like Ben (with those dark sun glasses), is pointing a riffle at the accused Win98 user>

(!) [Ben]

I'm so sorry, Thomas; all my riffles are currently in use. Those darn California gold-miners always have them out on rental... Besides, it's fairly hard to point one: it kinda stays pointing the way you build it.

Seriously, though - I'm not very much of a Linux zealot; other people are welcome to run whatever they want. I know what works well for me, and I do indeed attempt to proselytize those who are stuck with OSs that they hate - but it's a big wide world out there, and YKIOKIJNMK is one of my mantras.

send me free linux cd then

(!) [Thomas]

--Hum, Do you know what the "Open Source Movement" is?? I suggest you read the book "rebel code"....

(!) [Iron]

And then after we decline to help him, he demands a free Linux CD? No wonder his e-mail service is ToughGuy.net (run by PunkAss Enterprises of Boston, MA, USA, an organization with no web site). I wonder if he's a scr!pT K]dDiE too....

(!) [Dan]

Riffle? That's the fast water between pools in a stream.

I'd be pretty scared if somebody was pointing a riffle at me; Lessee, small stream, maybe 5m across, .25m average depth, that's 1.25 m**2 cross section, if the riffle is 15m long that's 18.75 m**3 of water, plus surrounding streambed. I wanna be pretty well clear of anybody strong enough to lift that, let alone point it!!!

(!) [Ben]

It's also what you call a gold-separating trough, as well as the stuff at the bottom of it (these days, a lot of folks use Astro-Turf. Go figure.)

That was what I was riffing on... :)

(!) [Dan]

Yeah, I don't know anything about gold-separating troughs. Tho I can see how it'd be called a "riffle" ... region of faster-moving water, with maybe some bumps to it. Calling its bed a "riffle" seems like taking some liberty with the term, but I guess you need to call it something, and maybe "bed" doesn't sound obscure enough.

Then in another thread...

(!) [Frank]

Lowering the case (S20hwclock -> s20hwclock) is used - as Mike pointed out - to disable the execution of the script totally, without losing the info about where it normally is...

(!) [Iron]

As Ben pointed out.

(!) [Frank]

Oops... Sorry guys... You just look so much alike... :)

(!) [Iron]

Do you want a riffle sniper on your doorstep? :)

(!) [Ben]

ITYM "riffle snipper". Beware of the Snip of Doom.

(!) [Thomas]

<whines>....

My spelling is terrible, lol.....

Thanks for picking that one out Dan. I'd be scared if someone was pointing a river at me!!

Also, I would just like to point out that you are wrong about what a "riffle" is.

Ehem.....having done A-Level Geography, a "riffle" is created from turbulent flow, which only occurs within meanders.....

so that means that you'll be pointing a bendy river :) :)

(!) [Dan]

Try walking some trout streams. Mostly they don't meander, at least in this mountainous part of the country, but you'll find pools and riffles alternating nonetheless. Smooth and turbulent flow.

(!) [Ben]

If I recall correctly from my trout-fishing days, "head-pool-run-riffle" is the repeated structure that makes up a mature stream. The length of the sequence is mainly dependent on the stream width and rate of flow. As Dan says, most of them don't meander; this structure is a result of the water carrying silt, building up a restriction where it settles, speeding up through the restriction, and slowing down as it exits.

(!) [Heather]

Oh, so that's where you get the trout cluebats to flog people with.

(!) [Dan]

Real streams are contingent things, at least at the scale of human beings, full of rock outcrops, changes in the lie of the land, slide debris, logs and other noise. And silt, carried predictibly by faster water to deposit in slower water. Also gravel, cobbles, and bolders, carried during the spate when the babbling brook becomes the raging torrent, its flow influenced by factors ordinarily far above its waterline. As it erodes slowly headward, carrying all to lower ground, the things it can reach, first, the rest, later.

Surprising how hard it is to get a model stream running on a uniform substrate to behave according to the model. I've tried. Enough to wonder to what extent the patterns we see in streams are just our poor minds seeking to impose order where there lies only chaos.

Though I must vouch for the repetition of the pool-and-riffle pattern. With, as Ben says, each pool having head and tail, each with their own implications for the behavior of the elusive trout.

(!) [Ben]

Oh, definitely. Dan... you've got me thinking about four-pound test, and turning over rocks for bait, and rationalizing that maybe the water isn't all that cold yet. It just ain't fair, I tell ya... I've done close to zero freshwater fishing in the past ten years; it's all been big-game saltwater stuff - 1/4" nylon line, 6 feet of solid stainless steel wire for leader, 7/0 forged SS hooks baited with a foot-long ballyhoo, and /sauve qui peut/ once you hook into the big bastard. As much fun as that can be, I've just realized how much I've missed the fine, subtle game that trout fishing can be. Well... they _did_ just open a new Outdoor World near here... I think I've got a field trip coming up tomorrow, with a bit of local stream research thrown in.

Oh, the weird and wonderful ways that discussions of Linux can go...

(!) [Thomas]

All this talk about pools and riffles (and trouts) makes me think of the following song:

Schubert, Trout quintet in A major (I played the piano part in the Leder....lots of semi-quavers, quite difficult).

Of course he is singing about catching this fish....which he does eventually. I wonder if he saw these pools and riffles????

What?????

<Here come the men in white coats....>

(!) [Dan]

Yes, we've gotten pretty far afield, so to speak.

(!) [Iron]

This riffle discussion is perfect for The Back Page. Heather, we'll need to split the thread cleanly somewhere.

(!) [Ben]

Just where the pool meets that enticing little backwater, slightly to the left of that branch would be a good place.

<The line makes a 'shhhhhusshhh' sound as the tiny Panther Martin spinner traces an arc through the still air above Loch Raven...>


Paul Revere

Answered By Thomas Adam, Ben Okopnik, Huibert Alblas, Iron, Don Marti

--- Walter asks:

Why hasn't the Linux world come to the idea that WINDOWS is a good idea and start making linux work just like MS windows without all the MicroDumb BooBoo's. Do like Paul Revere did, he did not make the cooking pots different he just made them better.

(!) [Thomas]

Now, now where is that axe??? Damn, don't tell me Ben has borrowed it again to go on one of those "trips"..... oh well.....

Walter, Walter dear boy what's going on?? Are you mad? I think you are. Linux is NOTHING like Windows and it will remain that way. If you are after a Linux based MS-Windows OS, then Microsoft released their own version of Unix with MS apps embedded in it.....try that.

BUT, don't leave the land of Linux *just* yet......KDE offers a "Windows" feel to it. Also, FVWM95 has a near complete look and feel of Windows. The "IceWM" also provides a similar style to Windows...

(!) [Ben]

[A pregnant pause. Birds twitter in the trees; the sun shines; all seems eerily normal, a calm that bears no hint of the edge-of-the-seat suspense.]

...

AHEM!

No comment.

(!) [Halb]

Who is this Paul Revere guy? The only time I heard the name Paul Revere was on the License To Ill Album from the Beasty Boys. The track is called Paul Revere, but in the song text, its the name of a horse.

(!) [Iron]

http://www.encyclopedia.com/articles/10919.html

"Revere became a figure of popular history and legend, however, because of his ride on the night of Apr. 18, 1775, to warn the people of the Massachusetts countryside that British soldiers were being sent out in the expedition that, as it turned out, started the American Revolution.... it is Revere who is remembered as the midnight rider, chiefly because of the poem by Henry Wadsworth Longfellow."

Paul Revere's Ride by Henry Wadsworth Longfellow:

Listen my children and you shall hear
Of the midnight ride of Paul Revere,
On the eighteenth of April, in Seventy-five;
Hardly a man is now alive
Who remembers that famous day and year.

He said to his friend, "If the British march
By land or sea from the town to-night,
Hang a lantern aloft in the belfry arch
Of the North Church tower as a signal light,--
One if by land, and two if by sea;
And I on the opposite shore will be,
Ready to ride and spread the alarm
Through every Middlesex village and farm,
For the country folk to be up and to arm." ...

The most famous quote here is, "One if by land, two if by sea."

We learned the poem in elementary school. Although looking back, there's no way we could have understood since I had no concept of what Middlesex or a farm or a belfry was.

(!) [Ben]

I believe that the correct term nowadays is "bisexual", and any term that connotes "fence-sitter" is frowned upon.

(!) [Iron]

Of course, Middlesex is an area of Massechussetts, which was named after a region in England. Although, us Yanks never could understand how Brits can use terms like Middlesex and Sussex while keeping a straight face.

(!) [Ben]

Oh, the people who named the towns in the US were no less obsessed. :)

ben@Baldur:~/devel/geo$ grep -ci sex US_Concise.txt
326
Not to mention Intercourse, Pennsylvania and such...

Paul Revere was also a silversmith, and there's still a line of high-quality pots and pans ("Revere ware") named after him. He also forged pewter utinsels, I think.

(!) [Ben]

Why, he never! Paul Rever, a forger? I won't believe it! I'm sure that his pewter utensils were perfectly original. <sniff>

(Note: Pewter is cast, not forged.)

<Smile> I remember the '1 if by LAN, 2 if by C' (erm... it _sounds_ right...) <shrug> I thought he rode horses and yelled at people for a living, or something.


1001 uses for a dead hard drive

Answered By Iron, Dan Wilder, Don Marti

(!) [Iron]

Our sysadmin Dan Wilder suggests that a dead drive makes a good weight for a fishing line....

(!) [Dan]

Can be used for taking depth soundings also.

Another use for a dead drive: it contains a couple of magnets that are GREAT for picking up small ferromagnetic items, such as spilled machine screws or carpet tacks. Also useful for confining map pins and paper clips to one corner of the desk drawer. I wouldn't be without one! In fact I have a couple in my desk drawer, some in each toolbox, and the kids each have a couple to play with.

Just don't stick it on the fridge. Might be useful for holding small piles of recipes, but don't stick it to the fridge without a generous cushion or it may chip the paint.

Many drives are assembled with odd drivers for the screwheads. To disassemble, use a small drill to remove the screwheads, when you find you don't have a suitable driver.

(!) [Iron]

This is also good info for the person who wanted advice on starting a cybercafe. The chipped paint may make the health department inspectors nervous.

(!) [Ben]

<shrug> Then you'd just use the magnet to stick them to the fridge, until they realize that chipped paint is wonderful, no, they have no problems with it whatsoever, it was all a mistake...

(!) [Don]

Action Surplus in Sunnyvale, California has all the bastard spawn "security through strange screwhead" drivers.

Save the cheap Allen wrenches you get with stuff to assemble it -- you can hammer an Allen wrench into some of those strange screws, then turn it (if you don't want the screw afterward)

(!) [Ben]

<Evil Genius laugh> A Dremel tool with a steel-cutting disk makes a "flat" screw out of any of those strange ones in about three seconds. I have reason to know...

(!) [Don]

I've done this too but the ones on hard drives are countersunk below the level of the drive frame. You could cut a slot if you were willing to cut the drive frame too.


Compare and contrast

Answered By Iron

Compare and contrast the computer sytem to the manual system. Please heip me out.

(!) [Iron]

The phrase "compare and contrast" raises warning bells because it sounds like a homework question, so my instinctive answer is, "Figure it out for yourself. That's why your teacher/professor gave you the question."

However, we may feel inclined to give some amusing answers if you give us more precise information. "The manual system" of what? Playing chess on a computer vs a chessboard has a different impact than word processing on a computer vs a typewriter, and both are different from engineering with a computer vs engineering without, or building animation movies on a computer vs in Walt Disney's day.


World of Spam


ATTENTION!!!THIS PROGRAM HAS BEEN PRESENTED AND PROVED EFFICIENT ON NATIONAL TV. IT REALLY WORKS!!!!!!


I'm having a tax problem and I want you to be the beneficiary instead of the IRS... My business has had a phenomenal year so far in 2001. In fact, we've done so well I'm probably going to pay 2½ times more corporate taxes than I did last year. And if we make any more money this year, the tax problem will only get worse... I'll have to pay even more money to the IRS.
our company is located in Dubai , just we would like to know if you sell this scratch machine , what I mean its a machine then you can pass the cards through this machine then it will be scratched .
No HYPE!!! No BULL!!! Reading this E-Mail Could Change Your Life!
The latest domain name extension is here .SEX!!! It's the fresh ,new, exciting web address that is taking the world by storm. Who wants to be .com when you can now be .SEX
ATTENZIONE nel messagio di posta elettronica a voi indirizzato, è stato riscontrato il seguente VIRUS: (TROJ_SIRCAM.A), data: 08/21/2001 19:08:34, nel file (PROPELLER, 9 MAGGIO.doc.com). Al fine di tutelare la vostra sicurezza e quella di tutti gli utenti della rete il messaggio è stato disinfettato.
Now, if you order by November 16, you can save over $2,000.00. For our $1,495.00 special price, you receive not only [the product] at a thousand dollar discount, network ready, but two user licenses and a link to either Peach Tree, QuickBooks or Excel, which normally would be an additional charge of over a thousand dollars.
Introducing THE EVIDENCE ELIMINATOR - the **only** safe way to surf the net. Make it safer to use the Internet - All in one click of your mouse!

Did you know... that your computer is spying on you? Did you know for example that every click you make on Windows Start Menu is logged and stored permanently on a hidden encrypted database within your own computer? Your PC is keeping frightening records of both your online and off-line activity.

Any of the Web Pages, Pictures, Movies, Videos, Sounds, E-mail and Everything Else you or anyone else have ever viewed could easily be recovered - even many years later! How would you feel if somebody snooped this information out of your computer and made it public? Do your children or their friends use your computers? What have they downloaded and tried to delete?

You deserve a far more rewarding and safer Internet experience!


Are you ready to upgrade your web site for e-commerce or drastically improve your current shopping cart system? Most on-line retailer's success or failure is largely determined by the quality and flexibility of their e-commerce solution.
Subject: Confidence is now for sale

Protect yourself against CRIME and TERRORISM! Experience the difference of knowing you can protect yourself. Even if you never have to use that pe pper spray or stun gun you are carrying, you will feel more secure and confident knowing that it's there.

  • Animal Repellers
  • Diversion Safes
  • Hidden Cameras
    • Wired
    • Wireless
  • Home Protection
  • Knives
    • Butterfly Knives
    • Folding Knives
  • Mace Spray
    • Mace Pepper Foam
    • Mace Pepper Spray
    • Mace Triple-Action Sprays
    • Michigan-Approved Sprays
  • Miscellaneous
    • Blowguns
    • Crossbows
    • Garrett Super Scanner
    • Handcuffs
    • Kubotans
    • Safety Lights
    • Throwing Stars
    • Voice Changer
  • Gas Masks
  • Pepper Spray
    • Pepper Shot Pepper Spray
    • Wildfire 15%_Pepper_Spray
  • Personal Alarms
  • Stun Guns
    • Accessories
    • Stun/Alarm Flashlights
    • Stun Batons 300k-500kv
    • Stun Master 100k-300kv
    • Stun Master 625kv
    • Talon 80k-250kv
  • Tasers
    • Air Taser
    • M-18 Advanced Taser

Subject: Cofres funebres Colombianos - Funeral coffins
Ever wanted to gamble on-line? This is your chance to avoid shady casinos and their practices. We have scrutinized 100's of on-line casinos so you won't have to! All of these choice casinos offer promotions and bonus dollars to get you started. Get up to $100 FREE.
[And they are not shady? -Iron.]

Subject: RE: My Password

THIS SITE IS THE NASTIEST F*%$#ING SITE YOU WILL EVER SEE
Our @#$%s will blow your mind and your co^%!


I believe we both have Internet businesses! Perhaps you'd be interested in these freebies.

All are free to join, no strings By joining the first you'll receive a lot of free software for your business including an email address extractor.


Stock Alert Newsletter
[Company name]
Symbol: ^%$#
Exchange: OTCBB
Recent Price: $2.50
52 Week Range: $1.00 - 6.25
Shares Outstanding: 11.9 million
Estimated Float: 1.5 Million
On October 8, ^%$# announced that they were acquiring a California brokerage called &*( Securities. They expect to use &*(& as a vehicle to buyout other stockbrokers while prices are currently depressed. Due to this aggressive strategy, we believe that the company is about to make the turnaround into a well-known, profitable firm.

Since [company name] only went public in June, this is the first time they have been featured in a stock market write up. This gives Stock Alert readers a GROUND FLOOR opportunity.

Disclaimer: The publisher of Stock Alert Newsletter has received a fee of 5000 shares of ^%$# from a shareholder, and may buy or sell shares at any time. &^* %^*^& Services provides an e-mail delivery service on behalf of securities issuers and publishers that circulate information about a company or the company's securities. The publisher of this newsletter has agreed to pay &^* %^*^& Services ten thousand dollars as payment to circulate this newsletter via electronic mail to e-mail addresses contained in &^* %^*^& Services database. To read entire disclaimer, please click here.

[If you don't see the scam, read the first sentance of the disclaimer again. -Iron.]

The GOVERNMENT thinks it OWNS you! It thinks YOU are its PROPERTY!

You can BREAK their grip on you, and TAKE CONTROL of yourself and your property (including earnings) -- so they can NEVER confiscate ANY of it, ever again! You can learn how to:

  • FORCE the IRS to pay any tax liabilities FOR you!
  • HALT Mortgage Foreclosures!
  • STOP Credit Card liens!
  • KILL Lawsuits!
  • TAKE CONTROL of any trial and force the Judge to give YOU the Order of the Court.
  • and, much, much more!

We are sending you this email because A) We are both members of the same Opt in list, B) You submitted a classified link to one of our pages, C) You sent an email to one of our addresses in the past. If you were not the intended recipient of this message, please accept our apologies and delete.
This message uses a character set that is not supported by the Internet Service. To view the original message content, open the attached message. If the text doesn't display correctly, save the attachment to disk, and then open it using a viewer that can display the original character set.
Content-Type: text/plain; charset=3D"DEFAULT_CHARSET"
Content-Transfer-Encoding: quoted-printable
STOP!
URGENT MESSAGE!
PLEASE READ COMPLETELY!
It is important that you read this message as soon as possible. Again I urge you to read this message to its fullest! Last year 72% of bankruptcies could have been saved by an extra $200 a month.
Save up to 80% on Dental Services! Plan Includes Free Prescription, Vision and Chiropractic Plan For only $11.95 Per Month for an individual membership $19.95 a Month for the entire Household.
[Considering that a normal inadequate dental plan in the US costs at least $25/month for just one person, I don't think so. A normal cheapo plan will cover $1000 worth of treatment a year. That rate was set thirty years ago when $1000 could pay for a couple surgeries as well as regular checkups. Try having two dental surgeries this year and see how far $1000 goes. (Hint: you'll have to pay around $800 additional out of your own pocket.) -Iron.]

We produce/export bamboo mats, bamboo flooring, wood flooring and multifarious wooden massage implements, etc. Please contact us if you are interested in any of our items.
Whether it is bad checks, or unpaid invoices, why not let a trustworthy collection professional help you with your past due customers?

What makes our company unique is that we will custom design a collection program to suit your business needs. Here are just a few things we can do:

  • 15-day Free Demand Letter- We will custom design a collection letter, send it in your name, handle the call, and collect the debt. If the account pays within 15 days of the letter sent date, we will not charge you a fee. After 15 days, the account is subject to a low 33%.
  • Send a series of a collection letters at no additional charge. When you refer accounts to %^&*(* Protection Services, we will send a series of collection letters to your customers as well as contact them by phone. RPS does not charge its clients for letter series.


Russian Joke of the Month


Quick translation of a Russian joke -

The UN poses the following question to the assembled representatives of different countries: "Please state your opinion about the lack of sufficient food in other countries."

Many of the representatives ran into insurmountable problems:

  • No one in Africa knew the meaning of "sufficient food".
  • No one in Western Europe knew the meaning of "lack".
  • No one in Eastern Europe knew the meaning of "opinion".
  • No one in the US knew the meaning of "other countries".

Ben Okopnik
-=-=-=-=-=-


Happy Linuxing!

Mike ("Iron") Orr
Editor, Linux Gazette, gazette@linuxgazette.net


Copyright © 2001, the Editors of Linux Gazette.
Copying license http://www.linuxgazette.net/copying.html
Published in Issue 73 of Linux Gazette, December 2001