LINUX GAZETTE

March 2001, Issue 64       Published by Linux Journal

Front Page  |  Back Issues  |  FAQ  |  Mirrors  |  Search

Visit Our Sponsors:

REDSonic, Inc., total real-time Linux solutions
Linux NetworX
Tuxtops
eLinux.com

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.com/
This page maintained by the Editor of Linux Gazette, gazette@ssc.com

Copyright © 1996-2001 Specialized Systems Consultants, Inc.

 The Mailbag!

Write the Gazette at gazette@ssc.com

Contents:


HELP WANTED -- Article Ideas

Send tech-support questions, answers and article ideas to The Answer Gang <tag@ssc.com>. Other mail (including questions or comments about the Gazette itself) should go to <gazette@ssc.com>. 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.



Email and News Access for Linux from a Server requireing NTCR authorization?

Tue, 13 Feb 2001 10:00:12 -0500
K.Woodward (kwoodwar from mindspring.com)

Hi,

I have a problem trying to setup Linux to access the servers at the University of Phoenix. The servers (Microsoft IIS) require a "log on using Secure Password Authentication" under Microsoft Outlook Express. I understand that this requires a email and news reader to authenticate using the WindowsNT Challenge/Response (NTCR) protocol [a really bad use of the http protocol]. The school does have a website to get to the email and news groups but it is timed and is very particular and seems to like rejecting Netscape Navigator access. The UOP Tech group's pat answer is that they only support Outlook Express under Windows, I want a Linux answer.

Is there any program or daemon that I could run to allow me to authenticate using this protocol so I could use Linux based email and news readers? I have tried using pine, staroffice, and leafnode and several others which are common under KDE/RedHat 6.2.

Thanks,
K. Woodward


telecommunication in a hospital

Sat, 27 Jan 2001 22:11:51 +0600
Nandalal Gunaratne (nandalal from itmin.com)

Dear LG readers

I am a doctor working in a hospital in Sri Lanka. I am thinking of connecting several computers in the hospital eg: one in the ward with the operating theatre, the pathology laboratory etc. The cheapest wasy would be via an internal modem and the use of the intercom telephones which work via the telephone exchange in the hospital. Is there a way of email/ file transfer which would allow say the doctor in the ward to download the results from the biochemistry department? I have read about C-kermit and UUCP but they are too confucing for us mere doctors. I have used RedHat Linux, but am hoping to use Corel Linux and Star Office in the hospital as they are more user friendly. Is there a simple, preferably GUI based communication tool which can do the above? Can StarOffice do it? If one can see the other desktop and click and download the file or email say with "ward 29 results on 26 January 2001" after connecting up - that is a dream come true!

Dr Nandalal Gunaratne


Q: Initialising secondary video card under XFree86 4.0

Wed, 7 Feb 2001 01:23:55 +1100
Mark Tigwell (tigs from zip.com.au)

Hi there

I have two graphics cards in my machine:

1:0:0 AGP 3DFX Voodoo3 2000 16Mb 2:0:0 PCI 3DFX Voodoo3 2000 16Mb

I am running XFree 4.0 under kernel 2.2.17 with SuSE 7.0

The problem is that I cannot get X to run on the second graphics card, either in multihead or regular mode. My BIOS allows me to specify which card is initialised as primary (the PCI or AGP card) and, depending on which one I select, X will only run on that card. It runs perfectly on each respective card when it is primary. I am trying to do multihead, but I can't get the secondary card to work either way. It does initialise (ie the monitor receives a signal) when I try to start X on the secondary card, but the screen remains blank. I am forced to do a cold reboot and watch fsck go through its motions every time.

Any thoughts?

Thanks
Mark Tigwell


Linux PPP route question

Wed, 21 Feb 2001 07:59:47 -0600
Brian Smith (bsmith3 from charter.net)

The following is a message I posted last night on redhat.networking.general, I thought I'd send it to you guys as well since you always seem to be able to provide good answers...


I'm trying to set up a demand-dialed PPP link to my employer's LAN. I've got it mostly working, except for one thing. I'd like to be able to just do 'ifup ppp0' (or have it done at boot) and then be able to bring up the link on demand. The problem is, I need to 'route add -net 172.18.0.0/16 ppp0' so that traffic from my machine to and address on the work LAN brings up the link (DNS is not an issue, I'll be accessing the machines by numeric IP address). The route command has to be done after pppd has started and the ppp0 interface exists, but before the link is actually dialed. None of the 'ipup-post' processing helps me, because it doesn't get executed until after the link is dialed. It's sort of a chicken-and-egg problem, eh? If I do the ifup and then the route commands manually, everything works beautifully. I just need a way to automate it better.

Also, it would be nice to be able to make a few mods to my ipchains ruleset when the ppp0 interface comes up, but that's easier to work around because I can set an ipchains rule for an interface which isn't up yet.

If anyone has a nice elegant solution to this, please let me know. By elegant I mean better than throwing the route command in rc.local - that's going to cause problems if I ifdown and later ifup the interface, because it won't get executed again.

Incidentally, this is on RedHat 7.0 with all the latest updates (except kernel 2.2.17 - haven't gotten around to that yet). In addition to the ppp0 I have eth0 (home LAN) and eth1 (cablemodem internet, and the reason that pppd's 'defaultroute' option doesn't help me either).

Thanks,
Brian Smith


Linux-based companies

Thu, 15 Feb 2001 17:01:10 -0800
Trent Carlyle (trent from codehost.com)

Hi.

I have been paying attention to your magazine and web site quite a bit in the past couple of months and have learned from and enjoyed the information. If you ever want to publish an article on companies that are running successfully on open-source and/or Linux we would embrace the opporuntity to be featured. We are a custom software development company who run all Linux work stations (including Marketing/Sales, Operations, Programmers, Art, Human Resources, etc). We are also dependent on Linux for our servers, network, etc. We have even gone as far as developing apps internally that have proven to be very useful.

Have you thought of doing a monthly profile (like a quarter page column) on companies that run mostly or all Linux products? You could just build a Q&A and companies could fill in the blanks. i.e. "What desktop programs do you use?" (or) "What are the biggest benefits/problems you've encountered?" -- Just an idea.

I look forward to hearing from you. Keep up the great work.

Regards,
Trent M. Carlyle


GENERAL MAIL



cocky arent we?

Sat, 24 Feb 2001 20:07:54 -0000
Lee Berube (lberube from twcny.rr.com)

i just came across your website and was looking up bad clusters also.i've seen some of your replies to theses people and you seem pretty cocky. you sound like a total dick, like you dont have the time to just be nice and say geesh im sorry but you have to look elsewhere.

You've reached an entire group of people. It used to be one, renowned as an expert in Linux, and I know it will sound weird, but the "chip on the shoulder" you're complaining about is how he gained the renown.

It's our practice to be cocky and to give people useful answers, if they ask questions which aren't too vague. Often they need to know WHERE elsewhere, just "go away" would in fact, be rude.

The "Answer Gang" column has become a tradition in our magazine and we have written many times in the past about why we maintain the style. If you want either politically correct "cleaned up" speeches or formal listings of questions and answers, go to formal and commercial entities, or go look in the Linux Documentation Project HOWTOs (http://www.linuxdoc.org). But if you want to stomp into the nearest Techy Bar and see if the alpha geek has a real answer for your question, you've come to the right Answer Gang.

is it their fault that they use a search engine that brings up your webpage and hoping for help ---they get you (unfortunatly).

This project is part of the Linux Documentation Project as well, and translated into many languages. Therefore yes, it will be found in a lot of search engines. This isn't a bug -- it's a feature!

Maybe these people you are talking who are "hoping for help" will either

  1. use the Linux Gazette specific search engine at
    http://www.linuxgazette.com//wgindex.html
     
    (pretty easy to get to really, just hit "search" off our home page) ...and look at all the other past articles in there (not all by the same fellow, either).
     
    or
     
  2. Actually ask us a Linux question we can answer! You didn't!

LG is all volunteer work, though. If you think that's unfortunate that we hand out freebie answers with a little roughhousing in them -- your loss, dude, get a new 'tude...

dude...lighten up a bit will ya? it happens....
Lee

Let us know when you have a Linux question, Lee, maybe we'll be able to help. Meanwhile, have a nice day :)

-- Heather Stern


Reference to Progeny

Mon, 19 Feb 2001 12:27:43 -0800
Bruce Byfield (bbyfield from progeny.com)

In the latest issue of The Linux Gazette, the following appeared:

[Heather] Well, then, keep an eye on the Progeny project - Ian Murdoch himself and a handful of trusted friends, are working on putting together a new debian based distro which is really aimed at desktop users >more than the server and hardcore-linuxer crowd, yet is aware of the "standard" debian project enough to >allow a smooth transition.

[Bruce Byfield, Director of Marketing and Communications, Progeny Linux Systems]
I wanted to mention that appearances are deceiving. In many ways, Progeny Debian has taken on an unexpected life of its own, with many features for the desktop market. However, that's only what everyone is seeing right now.

In the long term, Progeny Debian is the foundation for Progeny's Linux NOW (Network of Workstations) project, and therefore aimed squarely at the server market.

Not that I'm complaining, you understand. Any coverage is good coverage, and all that. However, because Progeny Debian is the first Progeny project that will released, people are getting a distorted view of what the company is about, and we don't want anyone to feel that Progeny is misrepresenting itself.


So the "Linux NOW" will be a clustering project, while the present "Progeny Debian" is the side effect of work on a good installer system for the project overall? (just want to make sure that when I'm updating my view of it, I'm getting it right this time.)

Yes, you're basically right. That's not to say that desktop refinements won't be added, but Progeny plans to be more of a provider of services than a seller of software.

However, maybe I should add that, in the strictest sense, Linux NOW isn't a clustering project. Although it could loosely be called that, Progeny is avoiding the term to prevent misunderstandings (to say nothing of criticisms). Instead, it's being called a network of workstations or a networking computer solution. I suspect, though, that it would be a welcome edition to a clustering solution.

Thank you very much for correcting us in this regard. I do like what I am seeing and I suspect that when you roll out the big guns on the server issues that a lot of netadmins will also be very happy with it. -- Heather

Thank you!

[Mike] Bruce, our last announcement about Progeny was http://www.linuxgazette.com/issue57/lg_bytes57.html (search for "Progeny"). If you have any more material to add, send it to LG.


Classified Disk - Low-level Format

Thu, 15 Feb 2001 21:46:05 -0500
Mark Nielsen(nielsen from wwc.com)

Classified Disk - Low-level Format

Add my comment,

I was so impressed with that one line command at writing 7 times to the hard drive, I included it in my article (though I only discovered it after it got submitted to LG). I left it as an option for someone to uncomment the command.

http://www.gnujobs.com/Articles/14/Wipe_It.html

Mark


Alternative to "software released on the basis..."

Thu, 15 Feb 2001 14:40:04 -0600
Dave(df from cameron.k12.wi.us)

Heather,

In your answer in the latest Linux Gazette to the question concerning the HSP (et al) modems, you requested a new word/name: (Can someome out there please spin up a new buzzword for "software released on the basis that you get no tech support" so we can go back to using "unsupported" for meaning "doesn't work" ?)

I have two suggestions: On-your-own-ware or noware

Dave Forcey


Good Atomic Clock Source (Cheap Hardware)

Wed, 14 Feb 2001 20:46:28 -0600
Ross Jacobs(rosskj from rossandkelly.com)

Check out http://www.parallaxinc.com, they make microcontrollers and hobby kits for electronics. They offer a radio to serial device that receives atomic clock broadcasted updates via radio waves, and outputs data to the a serial port. It can also be polled.

Ross K. Jacobs


geforce card

Mon, 29 Jan 2001 22:28:10 +0100
Jorge Gimenez(jorge.gimenez from wanadoo.es)

Hi.
Nvidia has released drivers for geforce 2 cards with opengl support. Visit his web. http://www.nvidia.com . I read on the documentation of that drivers that Xfree 4.0.2 has support for this card. I have a tnt2,the same drivers for geforce cards, working perfectly with nvidia drivers on a redhat 6.1 with Xfree 4.0.1. There is a mini howto called Nvidia-OpenGL howto that covers this stuff very well , I would recommend you to download it

Later,
Jorge


Fw: Booting Problem after compiling kernel 2.4.0

Thu, 1 Feb 2001 14:14:22 +0530
santanu_jal2000 (santanu_jal2000 from yahoo.com)

Hello,

What do I do ??

[Heather] Well, the startx text results from booting it under the other kernel, may give you an idea of some features to actually declare in your XF86Config file.

Look especially at the things that start with two dashes since those are things it decides on its own. If you succeed at declaring these in your config, the server should boot up the same way on 2.2.16 but the same features will change to being marked with two stars. Then you can try it under the new kernel and see if it straightens up and flies right.

I note that you may have a particularly old i810 server anyway, since XFCOM are the Xfree Compatible series, and according to http://www.xfree86.org the i810 is among their source tree. Defaulting to not building it, but it's in there :) So a smarter i810 server for 3.3.6 might be available from your distro vendor's updates area.

Xfree86 4 is reported to work with the i810's as well. The readme for its 810 support mentions that the Tyan Tomcat and some settop box (HappyPC) also work. That server includes the ability to declare a few features (such as the DAC) if they get misdetected or just missed. Switching from X 3.3.x to X 4 has been very happy for some, tweaky for others, so I have to leave that possibility up to you.

I figured out that I have to do some serious reading ( the kernel docs and the XFree86 docs , etc.) and then I will be more prepared to try out the tweakings you mentioned above ( specially the first suggestion ). Good thing I will learn a lot that way.

Last but not the least , I must say a big Thanks to You for carrying on the 'conversation' . I learnt a lot from you, specially how to go to the heart of the problem. Thanks again.

Here I dive into the Docs . . . .

Bye!

Regards,
Santanu Chatterjee


Re Spf for Linux

Sat, 17 Feb 2001 10:34:24 -0800
Mike Chard (mchard from uneclipse.com)

Hi Heather,

Just to let you know that Uneclipse Software Systems has released an SPF Editor for just $69.95 - http://www.uneclipse.com

Mike


Thank you

Tue, 30 Jan 2001 19:27:16 -0800
Gerard Berthet (gberthet from xmlnetworks.com)

Thank you for your site. I found what I needed, very easily, and quickly about my Linksys Ether16 LAN Card. The Linksys web site was useless in comparison.

Regards,
Gerard Berthet


Comment

Wed, 7 Feb 2001 20:50:11 -0600
skimbrel(skimbrel from home.com)

More AOL Instant Messenger Spying

From Jon Sandler on Mon, 11 Oct 1999

it is very important to me as well that i spy on other people's instant messages - seeing messages from both the sender and the reciever. your help would be greatly appreciated. and im not too in tune with the technical stuff, so a simple way would be good. thank you very much.

You are also "not too in tune" with ethics. You're also not too bright, and you're lazy (since I'm sure you know something about the basics of capitalization, et al).

U R my hero!!! THIS GUY NEEDS A LIFE. Good work. Sam


RH 7.0 update problems

Sun, 4 Feb 2001 21:55:02 -0500
Bob Lee (general from gis.net)

Thank you for your quick response to my upgrade problems. After my two experiences with upgrades, your suggestion fills the bill on that situation. Don't upgrade, do a new installation. Especially with the hard drive resources and partitioning program available to work with.

Using Partition Magic for Linux, I created a fresh 10GB hard drive with anly unallocated space on it and used PM to copy the 6.1 installation to it and now have a 7.0 updrade on my other disk. Just as soon as I am happy with RH 7.0. I will run a complete new install on the 10gig disk.

The reason for the big disk was to allow me to experiment with different distributions and new kernels.

Your opinion is well valued and my experience bears out what you suggested.

Many thanks to you and the Answer Gang and the many hours of enjoyable reading and learning gained from the Linux Gazzette each month. It's nice to have people like you willing to share your knowledge and experience with us.

<Smile> Glad I could help, Bob. As far as I'm concerned, a well-documented story of things going wrong can be quite valuable; it may save someone else the trouble of trying the same route. Thanks for writing.

-- Ben Okopnik


symlink

Sun, 04 Feb 2001 01:30:53 +1000
Les Barron (les from spiderweb.com.au)

Why the big fuss ?? I downloaded the 2.4 kernel untarred it in /usr/src symlinked it to linux configured and compiled it & have been using it for some time with no apparent problems. I use SuSE 7.0 pro on a 433celeron. Must admit I have not tried it on my other machine (a 233 cyrix)with redhat caldera,windows & turbolinux installed.(My apologies I did upgrade modutils and several other utilities first) Cheers

les

I finally came up with a much clearer way of expressing it, as a thread on a similar vein came through the debian-laptops mailing list:

According to the fellow who berated The Answer Gang about this (suggesting NOT moving around the include link -- Thanks Michal!) ... as passed through my tiny little "not a kernel hacker" brain ... the idea is that glibc has a certain set of the headers which it sort of generically expects to use when compiling userland apps.

Whereas the one inside the real linux sources is desperately needed to be from the kernel sources, when compiling the kernel itself. (Duh :) )

The problem we keep running into is with apps that "cross the blood/brain barrier" ... pcmcia as a prime example ... it probably would greatly prefer the "real" includes. But, you can't just move them -- most userland apps prefer the fakes! Er... older versions. The versions that were there when glibc was itself built. They're not at all fake. :)

Worse, when we start hopping entire kernel versions, or if you are someone who is developing kernel modules yourself. Newer versions have a link in /lib/modules called 'build' that says where it got its sources from, so that something smart can be done, however, I have no idea if gcc does The Right Thing with that yet.

Until then, in the debian distribution at least, /usr/include/linux contains its own copy of headers for userland compiles. Their docs for the libc6 package explain clearly to use:

gcc -I/usr/src/linux-X.Y.Z/include ...

...if you really need the headers from a specific kernel.

All this doesn't really help a poor user decide, but I hope it makes a lot more sense to you folks now.

Anyone who works in this magic at a deeper level is certainly welcome to chime in and improve our view of Linux physics. Send that techy stuff to tag@ssc.com so the whole Gang can see it.

-- Heather


GAZETTE MATTERS



Re: Earthquake - SSC is fine.

Wed, 28 Feb 2001 16:03:54 -0800
Don Marti (LJ Technical Editor)

The SSC people in Seattle survive, just a few broken windows.


This page edited and maintained by the Editors of Linux Gazette Copyright © 2001
Published in issue 64 of Linux Gazette March 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

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.


 March/April 2001 Embedded Linux Journal

[cover image]

The March/April issue of SSC's newest publication, Embedded Linux Journal, will hit the streets March 2nd. ELJ focuses on the use of Linux and other open-source software to increase efficiency, economy and stability in embedded design and development.

Free subscriptions are available to qualified individuals in the USA, Canada and Mexico. Paid subscriptions to other countries are also available. Visit the ELJ web site at http://embedded.linuxjournal.com to subscribe, read articles on-line and post your comments.


 March 2001 Linux Journal

[cover image]

The March issue of Linux Journal is on newsstands now. This issue focuses on Consulting. 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/lj-issues/mags.html. Recent articles are available on-line for subscribers only at http://interactive.linuxjournal.com/.


Distro News


 SuSE

SuSE Linux has announced the availability of SuSE Linux 7.1, with the newly released Kernel 2.4, in both Personal and Professional editions. SuSE will continue shipping the reliable 2.2 series kernels parallel to Kernel 2.4. For more information, please visit SuSE's product web page.

The Duke of URL has recently posted a review of the very recently superceded SuSE Linux Professional 7.0. It will certainly give you a feel for the spirit of SuSE's distribution, although of course there will be some extra features/updates in 7.1.


SuSE Linux and IBM Global Services have signed a worldwide technical support agreement, covering various platforms, including IBM eServers. IBM Global Services will use SuSE's expertise to help address customers' technical Linux concerns. Since the announcement of SuSE Linux Enterprise Server for zSeries (formerly S/390) in October, SuSE is the only company delivering a worldwide Linux distribution for IBM xSeries, pSeries and zSeries eServers. At this time, SuSE supports more IBM server platforms than any other commercially available Linux distribution.


SuSE Linux has also announced the new SuSE Linux Knowledge Portal. The service can be accessed and searched on the Web at SuSE's German, UK and US web-sites. Topics covered are wide-ranging, and the site is aimed at both Linux desktop newcomers and experienced system administrators. Much of the information is not distro-specific.


News in General


 Upcoming conferences and events


Bang!inux
March 5-7, 2001
Bangalor, India
http://www.Banglinux.com/

LINUX Business Expo
March 7-9, 2001
Sydney, Australia
http://www.linuxexpo.com.au

Computerfest
March 10-11, 2001
Dayton, OH
http://www.computerfest.com

Internet World Spring
March 12-16, 2001
Los Angeles, CA
http://www.internetworld.com

COMDEX Canada West
March 13-15, 2001
Vancouver, B.C.
http://www.key3media.com/comdex/canadawest2001

Game Developers Conference
March 20-24, 2001
San Jose, CA
http://www.gdconf.com

CeBit
March 22-28, 2001
Hannover, Germany
http://www.cebit.de

3rd USENIX Symposium on Internet Technologies and Systems
March 26-28, 2001
San Francisco, CA
http://www.usenix.org/events/usits01

LinuxBazaar
March 28-29, 2001
Prague, Czech Republic
http://www.linuxbazaar.cz

Colorado Linux Info Quest Conference & Expo/CLIQ 2001

March 29-30, 2001
Denver, CO
http://thecliq.org

Association of C/C++ Users (ACCU)
March 29-31, 2001
Oxford, England
http://www.accuconf.com/

LINUX Business Expo
April 2-5, 2001
Chicago, IL
http://www.linuxbusinessexpo.com

Linux Expo, Madrid
April 4-5, 2001
Madrid, Spain
http://www.linuxexpomadrid.com/EN/home

Linux Expo Road Show
April 23-27, 2001
Various Locations
http://www.linux-expo.com

Open Source Development Network Summit
April 30 - May 1, 2001
Austin, TX
http://osdn.com/conferences/handhelds/

Linux for Industrial Applications
3rd Braunschweiger Linux-Tage
May 4-6, 2001
Braunschweig, Germany
http://braunschweiger.linuxtage.de/industrie/

Linux@Work Europe 2001
May 8 - June 15, 2001
Various Locations
http://www.ltt.de/linux_at_work.2001

Linux Expo, São Paulo
May 9-10, 2001
São Paulo, Brazil
http://www.linux-expo.com

SANS 2001
May 13-20, 2001
Baltimore, MD
http://www.sans.org/SANS2001.htm

7th Annual Applied Computing Conference
May 14-17, 2001
Santa Clara, CA
http://www.annatechnology.com/annatech/HomeConf2.asp

Linux Expo, China
May 15-18, 2001
Shanghai, China
http://www.linux-expo.com

SITI International Information Technologies Week
OpenWorld Expo 2001
May 22-25, 2001
Montréal, Canada
http://www.mediapublik.com/en/

Strictly e-Business Solutions Expo
May 23-24, 2001
Minneapolis, MN
http://www.strictlyebusinessexpo.com

Linux Expo, Milan
June 6-7, 2001
Milan, Italy
http://www.linux-expo.com

USENIX Annual Technical Conference
June 25-30, 2001
Boston, MA
http://www.usenix.org/events/usenix01

PC Expo
June 26-29, 2001
New York, NY
www.pcexpo.com

Internet World Summer
July 10-12, 2001
Chicago, IL
http://www.internetworld.com

O'Reilly Open Source Convention
July 23-26, 2001
San Diego, CA
http://conferences.oreilly.com

10th USENIX Security Symposium
August 13-17, 2001
Washington, D.C.
http://www.usenix.org/events/sec01/

HunTEC Technology Expo & Conference
Hosted by Hunstville IEEE
August 17-18, 2001
Huntsville, AL
URL unkown at present

Computerfest
August 25-26, 2001
Dayton, OH
http://www.computerfest.com

LinuxWorld Conference & Expo
August 27-30, 2001
San Francisco, CA
http://www.linuxworldexpo.com

Linux Lunacy
Co-Produced by Linux Journal and Geek Cruises

Send a Friend LJ and Enter to Win a Cruise!
October 21-28, 2001
Eastern Caribbean
http://www.geekcruises.com

LinuxWorld Conference & Expo
October 30 - November 1, 2001
Frankfurt, Germany
http://www.linuxworldexpo.de/linuxworldexpo/index.html

5th Annual Linux Showcase & Conference
November 6-10, 2001
Oakland, CA
http://www.linuxshowcase.org/

Strictly e-Business Solutions Expo
November 7-8, 2001
Houston, TX
http://www.strictlyebusinessexpo.com

LINUX Business Expo
Co-located with COMDEX
November 12-16, 2001
Las Vegas, NV
http://www.linuxbusinessexpo.com

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


 Steeleye and Linux Networx Partnership

SteelEye Technology, Inc. have announced an OEM agreement with Linux NetworX, Inc.. Linux NetworX will offer SteelEye's LifeKeeper for Linux platform in the solutions it provides to eBusiness customers. The agreement also includes co-marketing and joint technical support activities. SteelEye's LifeKeeper monitors system and application health to maintain client accessibility and provide uninterrupted data access. LifeKeeper automatically restores application services by either restarting them locally or relocating them to another server in the cluster.


 AMD Showcases First VirtuHammer Simulator

AMD announced at LinuxWorld events in New York and Paris the first public demonstration of "VirtuHammer," the tool developed by AMD and Virtutech to allow software developers to write and test 64-bit programs for AMD's next-generation "Hammer" family of processors. AMD, along with SuSE have reported significant progress in the Open Source community's efforts to port Linux to AMD's x86-64 technology. The x86-64 technology extends the x86 instruction set to enable 64-bit computing and is the backbone behind AMD's planned 64-bit processor family, code-named "Hammer." AMD's "Hammer" family is planned for commercial introduction in the first half of 2002. For additional information on the x86-64 instruction set, visit http://www.x86-64.org


 LUGFEST IV

The Simi-Conejo Linux Users Group will be holding LUGFest IV on April 21st and 22nd, 2001, in Simi Valley, California. The LUGFest is intended to be an opportunity for Linux users to demo Linux (or other Open Source operating systems), Linux applications, attend seminars, and BOF (Birds Of a Feather) sessions. Additionally, Linux vendors may participate and show off their wares. For more info, to register for LFIV, or to volunteer to do a demo, contact gareth@wiked.org, or visit the LUGFest web-site.


 CLIQ 2001 Conference and Exhibit

Colorado Linux Info Quest - CLIQ have announced sponsorship from Hewlett Packard, XFree86 and GNOME (among others) for CLIQ2001 (March 30th). Daryll Strauss (VA Linux, XFree86) and Havoc Pennington (Red Hat, GTK+ and GNOME) have agreed to speak at the event which will take place March 29th-30th at the Denver Marriott Tech Center. All scheduled talks and the exhibit floor are scheduled for the 30th, with early registration and a few smaller informal events expected on the 29th.


 Linux Links

The Duke of URL has some links which may appeal to you:

The folks on Slashdot have featured the following stories during the past month:

Three articles on The Register which may be of interest:

Userlocal.com offer a site focusing mostly on Slackware Linux, though much of the information is useful for all Linux users.

OSOpinion take a look at MS .net and Linux: whether Microsoft will have Corel port .NET to Linux, and how the possible antitrust split of MS may affect this. The hurried sale of the shares reported by Linux Today and discussed on Slashdot, just makes the story more fascinating. One to watch.

Rainer Gerhards has written an article on integrating Windows NT into a Unix syslog based management system (having Windows reporting to Unix via Syslog).

Linux Today have an overview of Berlin (a possible future alternative to X). You can get a bit more info from TAG in our very own LG issue 61 here.


Software Announcements


 IBM Personalization Software for Linux Announced

IBM have announced that the latest version of its WebSphere Personalization software now supports Linux. This software enables businesses to focus their websites more precisely at their individual users through "personalization", and then to optimise this process through analysis of activity. For more information on Websphere and Personalization and IBM/Linux follow the links.


 Partnership to create Comprehensive Motif GUI Solution on Linux for Enterprises

Integrated Computer Solutions, Inc. and Sitraka Software are entering into a partnership focusing on their BX PRO and XRT PDS Motif development products. ICS has developed a kit that allows integration of Sitraka's XRT PDS with their own BX PRO product, and have now arranged a Reseller agreement with Sitraka for XRT PDS. With this agreement, ICS can now claim to offer the largest selection of Motif development tools on UNIX and Linux systems. This solution is shipping on various platforms, including Linux (Intel).


 2netFX and Linux NetworX to Offer Streaming Server Solution

The solution integrates the 2netFX ThunderCast Server and StreamRider Client Player software with Linux NetworX Evolicity clusters. The StreamRider client will be offered on the Linux NetworX Evolocity 1240s. Four independent CPUs will share the Web serving workload through a software-level load balancer. If one compute module should fail, the others continue providing services, providing maximum system uptime. Clustering technology offers advantages in redundancy and scalability.


 Dell Linux Initiatives

Dell has announced its intention to offer Borland Kylix, to U.S. customers of its Dell Precision Workstations beginning in February. Borland Kylix is a development environment enabling Linux developers to build and deliver powerful desktop, client-server, database and Apache Web-based applications.
Dell has also announced that select components of its OpenManage server management suite of tools are available for use with Red Hat based servers. Dell OpenManage Server Assistant for Linux supports the installation of Red Hat Linux 6.2 and 7 and all of the latest drivers, making it easier to install the Linux operating system as well as reducing server setup time.


 VMware and the NSA Team to Build Advanced Secure Computer Systems

VMware, Inc. have announced a cooperative research and development agreement for a joint initiative with the U.S. National Security Agency (NSA) to enhance and certify the security of VMware's virtual machine technology. The project will enable government users to safely use commercial off-the-shelf software for certain sensitive or classified applications and environments. NSA's project NetTop plans to use security enhanced virtual machines as building blocks for applications requiring separation of information domains, such as providing secure remote access to classified computer networks over the Internet. VMware plans to incorporate the security enhancements resulting from the agreement in its future product releases. Details of the NetTop project are available online in PDF format.


 Arkeia Enterprise Backup Software Included in SuSE eMail Server II

Knox Software have informed us that the Free Version of their flagship product, Arkeia, is included into SuSE's 2nd Generation eMail Server II. The SuSE eMail Server II is an Open Source solution which administrates mail on a central server, and is in accordance with the IMAP standard. Arkeia 4.2 provides incremental and full backups, scheduled or on demand, and preserves directory structure, registry, symbolic links and special attributes.


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


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

(?) The Answer Gang (!)


By Jim Dennis, Ben Okopnik, Dan Wilder, the Editors of Linux Gazette... and You!
Send questions (or interesting answers) to tag@ssc.com


Contents:

¶: Greetings From Heather Stern
(?)A Question About Answering Questions
(?)Interrupt for Linux
(?)Please help I am at wits end
(?)Training?
(?)Finding a tutor --or--
Looking for a Tutor
(!)netscape bash function
(?)More help with Linux Multimedia
(?)Hope you can help! --or--
Readline Features in the Bash 'read' built-in
(?)Moving System to another device --or--
Duping a Drive Under Linux
(?)Fortran Compiler
(?)Modules cannot load with kernel recompile
(?)Installing Apps --or--
The "Now what" Experience: Using Apps After They're Installed
(?)ISP and Internet.
(?)virtual e-mail domain --or--
Virtual E-mail and POP Services with a Webmail Chaser
(?)Question --or--
LILO: Password Protected Entries
(?)Question in shell programming
(?)qmail pain
(!)Regarding backups
(?)uninstall linux

(¶) Greetings from Heather Stern

There are folks out there who wonder about us open sorcerors :) Sometimes, they are ecstatic, and amazed: "How can you do all this for no pay?"

Others are not so nice: "well what do you expect for free. Humph."

The fact is that the programmers and documenters and we here of The Answer Gang who serve as some tech support for free software *do* get paid, and we tend to give a bit of effort in relation to our pay. What our detractors don't understand is that their gripes and grumps sure don't pay us, so why should we help *them*? They need to learn about...

The Coin of The Realm

[the weekend mechanic]

The realm itself is the first thing that is confusing. This is the weekend neighborhood. The crunching of unbzipped tarballs hitting the disk and the tippity tap of new code being typed in and committed to builds is our buzzing of power saws in the garage workshop. The chore of making the documentation begin to describe the program it came with is handled with the same care as mowing the lawn on Sunday - some households are dutiful, sometimes a neighbor's kid will be helpful but only do a half job, some homes obviously hire someone to deal with it regularly, some tea gardens are clearly a well loved art... err, some just give up on having a lawn. It all got turned into workshop space. Sigh.


[the weekend attendant]

If it took extra help from the neighbors, we do things for each other. There's give and take, arguments here and there, and often an occasional lost hedge clipper. Sometimes a kindred spirit strolls through, helps a bit (or hinders?) and moves on. The debts that build up here from these little bits of lost balance aren't about money. "Pay back the net" is what I've seen said - once upon a time on BBS' and later on newsgroups and mailing lists and IRC channels. (Check out www.openprojects.net if you don't believe me. IRC doesn't have to be just for idle chatter. And tell lilo that the Editor Gal says Hi.) The loose change of knowledge gathered in your pockets - including the knowledge gained by mistakes - isn't considered worth much if you don't spill it back into circulation.


Like those weekend projects, our projects also vary in their degrees of completeness... and in their likelihood of ever being "done" in their author's eye. "Scratch your own itch" is a phrase I've heard a few times lately. If the neighborhood handyman has a problem to solve and the tools in his workshop, he'll likely solve it right there and never know a better answer was available at the corner store. (Or do it because the corner store wants an arm and a leg for what he could do himself.) For many it's done enough when it works for them, but they post it to public forums anyway.

Why? For many, what fun's a job well done if you can't show it off? Call it "bragging rights" or "a chip on his shoulder" or respect. We like to know whether the trophy we've posted could stand a better polishing or stood just fine on its own. Telling us it just rots isn't cool. Telling us what you tried to do (that didn't work) and what convinced you our stuff was going to work for you, that's what we want to know. And yes, an occasional housewife really might be good enough to go into the jam and spreads business, but it'll take a few neighbors saying so to convince her of it.

Okay, sometimes you find someone whose days in the garage are through. Rare is the time that he or she won't at least lend a hand briefly to someone who's willing to haul that old rattletrap to their own garage and keep plugging away at it. If you have in mind to take up the ropes to a dust covered project, give a shot at letting the old hands know you're interested. You'll never know what extra parts they might bring forward for you if you don't ask.

My editing peeve of the month is "confidential" signature blocks. If you don't want to discuss your problems publicly we understand, but, you're not paying in the coin of our realm if we can't share the results, so don't expect an answer here (unless by chance someone else asks the same question). Check the Consultants-HOWTO instead and find someone who will take your money and sell you their services in a timely fashion, too:

Money isn't bad - but it is the coin of another realm, that strange one called Real Life that keeps roofs over our heads and the bandwidth bills paid up. I'm glad to say that I see a lot of *our* sort of coin change hands here in the *Gazette* regularly. Thanks to everyone who sends thank you notes and especially those Two Cent Tips!

Enjoy your stroll past our garage sales and half tended lawns :)

[The automobile images are from John Fisk's Weekend Mechanic column which appeared in 1997 and 1998 in LG. -Mike.]


(?) A Question About Answering Questions

From Chris Gianakopoulos

Answered By Mike Orr, Heather Stern, Dan Wilder

Where do these questions come from. Is there a central location from which all of you retrieve these questions (a repository of some sort),

(!) [Heather] I have to warn you that the volume is pretty high, but if you'd like to take a look at some of the stuff that came in the past month or two and are not yet answered let me know, and I can forward you a reduced mbox. Same offer is open to my fellow AnswerGuys.

(?) or when questions are sent to tag@ssc.com, does the message automatically get forwarded to the members of the Answer Gang?

(!) [Mike] tag@ssc.com is a mailing list. The subscribers are people who want to answer questions. The public sends in a question...
(!) [Dan] Anybody in the world can post (which causes a certain amount of spam to clear the spam-filter), and postings are forwarded to all subscribers.
(!) [Mike] ... all the TAG members see it. Anybody who feels herself/himself qualified will send an answer, both to TAG and to the querent. We try to include TAG and the querent on any follow-ups to the answer; e.g., if another TAG member wants to contradict it or add additional information.
At the end of the month, Heather sorts the questions and answers, selects threads to publish, and distributes them to the Mailbag, 2-Cent Tips and The Answer Gang columns.
Anybody is welcome to subscribe to TAG and offer answers. Send mail to tag-request@ssc.com with "subscribe" in the message body.
(!) [Dan] the list admin may have to approve your subscription, and in any case the list server will send you a cookie in the mail with instructions for its return.
When the listserver gets your return mail (and maybe after the list admin approves your request), you're on.
List members are asked to copy list responses to the original poster.
(!) [Heather] Which, thanks to the reply-to being forced to tag@ssc.com so the querent won't accidentally take the whole thread private, is something you do have to pay attention to.
(!) [Mike] There is also an "inner circle" of TAG volunteers who have a greater commitment to keeping TAG functioning and also offer other technical advice to the Gazette. These people are listed on the LG home page.

(?) When I once asked a friend how I could ever pay him back for some side jobs that he gave (software stuff), he told me "Don't pay back -- pay ahead". So I am just attempting to pay ahead the gift of knowledge that all of those fine authors of textbooks, Linux Gazettes, and other stuff have given me.

(!) [Mike] "Pay ahead" is exactly right, and I've never heard it expressed that way before--thank you. We all volunteer what we know so that somebody will help us when we need it.

(?) P.S. Keep up the good work! Also, let me know if this email has been sent as clear text -- I have set up my Microsoft mailer to do that.

(!) [Dan] It arrived as clear text.
(!) [Heather] Yeah, now if you could give us the steps you did for that so we can put it into the FAQ.... hey Chris, welcome to the Gang!


(?) Interrupt for Linux

From auejei

Answered By Mike Orr

I would lik to know about interrupt handle for Linux .

How dose it diffrence from another OS ?. And I would like to know interrupt vector for Linux .

Thank you S. Auejai(Thailand)

(!) [Mike] This question is very general and so difficult to answer. What specifically do you want to know about the interrupt handlers and interrupt vectors?
Have you looked at the kernel source? Then you can see exactly what it's doing, and there may be some documentation in the Documentation/ directory as well. Find a kernel mirror close to you at www.kernel.org.
There are also two kernel guides at http://www.linuxdoc.org/guides.html that may answer your question.


(?) Please help I am at wits end

From Spicer

Answered By Dan Wilder, Ben Okopnik, Heather Stern

I have Redhat 7 on my computer.

(!) [Dan] First mistake. Try Red Hat 6.2. If you must use Red Hat.
Though by all accounts 7 usually installs OK. Your real troubles begin after that.
(!) [Ben] I'm not as strongly spring-loaded as Dan against RH7, but if I was having problems with installing it and could borrow 6.2 anywhere, I'd probably try that, just to see if there's any difference. Getting the same error with a different distro would cause me to strongly suspect hardware.

(?) I am relatively new to this so please bare with me. I first tried to insert disk and install, that didn't work I got the error below. So by suggestions of friends I first made a boot disk and fdisked the machine. Now that was ok I got into Bios and made it run from CD-Rom and it booted up the disk like it should but as soon as the machine tried to start formatting Swap Partition the error below once again popped up. So thinking this an error on my part I tried to fdisk it again.

(!) [Ben] Well... I don't know exactly what you're using, but 'fdisk' can be relatively confusing, and (in my opinion) is more of an expert tool. For someone new to Linux, I'd recommend sticking with DiskDruid, 'cfdisk', or even - heaven forfend! :) - DOS's 'fdisk' (the failure mode there is not to do anything, and this is a Good Thing when you're not sure of what you're doing.) The nice thing with that last is that you can boot DOS in seconds, run 'fdisk', and be done quickly. I never could find a use for either the security features or the multitasking capabilities of Linux while fdisking a machine... :)

(?) Since I have no OS at the moment I

(!) [Dan] You don't have any idea why it is trying to make swap on /dev/hda12, do you? That'll be the eleventh (or something like that) usable partition on the disk. Unless you've got a huge hard drive and you're booting a half-dozen different OSs, that's probably not where you want to be.
(!) [Heather] She may not have a choice (RH 6.2's anaconda likes swap to go last) but I agree, it sounds like too many partitions. I had a system with 14 but it was a triple boot with a strange partition layout.

(?) decided to use fdisk Linux style. But when I do fdisk from CD rom and type in 'linux rescue' all seems well until I get:

/usr/bin/anaconda-runrescue: line 10: 37 Bus Error ln -s /mnt/runtime/etc/$i

Well, it does give me a prompt so I go ahead and type fdisk /dev/hda and get Unable to open /dev/hda and I get that with any variable of fdisk I try.

(!) [Dan] That doesn't sound good. When I see something like that I begin to suspect hardware.
(!) [Ben] Ooops. I'm in agreement with Dan, here: bus errors generally indicate hardware problems, or at the very least improperly configured BIOS settings. Not a good sign.
What that "unable to open /dev/hda" says is that Linux can't even see the 'hda' device - this is about as low in the chain as you can go. Sounds more and more like hardware, to me.
Try this: since, by your description, you're starting with a "bare" machine (no partitions, no info stored anywhere), go into the BIOS settings and restore them to the default ones - most BIOSes these days have such an option. If yours doesn't, you might have to call Dell and have their tech support people give you a couple of hints - I've found them to be helpful and knowledgeable in the past, unlike a number of other tech support departments.
What we're trying for here is elimination of any ugly possibilities; starting from scratch, so to speak. Write down the HD specifics - heads, cylinders, sectors - then, delete the info and have the BIOS redetect the drive. Now, try installing again. If you get the same error... it might be time to talk to Dell about replacing some hardware.

(?) So when I try to boot it with disk I get Fdisk error( machine needs to be fdisked I assume) and I can't fdisk it.

(!) [Ben] Actually, it's probably saying "I can't find anything to run 'fdisk' on!"

(?) So I made a boot disk of Windows 98 and tried to fdisk it that way by booting up that boot disk and all was going well until I was told I couldn't fdisk primary logical drive with an ext dos, so obviously I went to try and fdisk ext dos but then it told me it couldn't fdisk with a primary logical drive. Which by the way there is no logical drives found when I look. I have discovered through the web looking for info my problem was that someone told me to when making the partitions to put everything left in / which I know now is not a good idea. 1024 I believe is the maximum. I have also tried EXDrive and various other efforts in my attempt to fix this.

(!) [Dan] With current LILO, there's no longer a maximum number of cylinders for the boot drive, and the maximum for the root drive is 'way bigger than that.
I'm conservative and still arrange drives with three partitions: boot (usually 16M), swap (generally 64M), and root (all the rest).
You may run afoul of some limit I'm unaware of with an 80G drive. The biggest I've done that way is 20G.
(!) [Ben] Hmm. Given some of the error messages below (like the fact that 'anaconda' is trying to make swap on hda12 (???)), I would be inclined to try 'flushing' the MBR (master boot record) on the drive, just in case something ugly - a virus, maybe? - has placed some weird partition info in there. Mind you, the above errors all point to hardware, but it would be interesting to find out - I've seen, in the past, virus-created stuff in the MBR that made it look as though the drive had failed (a combo of the oddities of the Compaq BIOS and a modified 'Stoned' virus gave a "Track 0" error. <shudder> ;). Boot DOS, type
lock c:
agree to the the horrific "You might destroy the world!!!" message, type
fdisk /mbr
That should clear the MBR; I actually prefer to go in there with Norton's Disk Editor and overwrite everything with zeroes (at least the partition table), but that requires a bit of special tooling. :)

(?) So I can't by my knowledge fdisk it that way. I have run out of options as I sit here looking at a bright blue screen that keeps telling me "you may safely reboot your system". I would like any advise or directions to web sites on how I can get my computer running again and why that dang error is happening. I have included below my system stats and the error report.

Thank you, Stephanie

System stats:

DELL  Dimension 4100.
256MB SDRAM at 133MHz.
80GB  ultra ATA hard drive ( 5400 RPM )
Pentium III processor at 800 MHz.

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

Exception Occured

Traceback (innermost last):
 File "/usr/bin/anaconda.real",
line 225, in ?
intf.run(todo, test == =
test)
File
"/tmp/lib/python1.5/site-packages/text.py",
line 1000, in run
rc == apply (step[1](), =
step[2])
File
"/tmp/lib/python1.5/site-packages/text.py",
line 572, in __call__
 if todo.doInstall ():
File
"/tmp/lib/python1.5/site-packages/todo.py",
line 688, in makeFilesystems
 raise RuntimeError, "error making =
swap on "=

+ device
RuntimeError: error making swap on hda12

Thank you so much, Stephanie

(!) [Ben] That one really makes me wonder. On the one hand, it says that it can't see "/dev/hda", on the other, it says that there are 12 partitions on it... it's time for those low-level tools that I've described above; all the graphical stuff and specialized routines ('anaconda', etc.) are just getting in the way of seeing what's really going on.
A guy I used to work for, Mark Minasi, came up with an excellent way to gurantee that you blast out your MBR; I just did a web search, and - lo and behold! - Mark had messed around with a multi-OS install (including Linux) and got his MBR terminally confused. So, he went ahead and documented the method - thanks, Mark! - which only used to be available as a part of the course that we taught, a rather expensive affair. Here is the link:
http://www.winntmag.com/Articles/Index.cfm?ArticleID=5327
Seems a bit strange, linking to "winntmag.com" from an LG article - but good info is good info, regardless of source...
Note that you'll probably still want to use 'lock', as above; Windows has nasty habits in regard to letting things write directly to cylinder 0.

(?) I thank you so much for your help! It was excellent. I was able to fix the Linux and it is working now better than before because now I know more because of looking up this error in the first place. I really just wanted to say thanks.

(!) [Ben] Hi, Stephanie -
I'm very glad to have been able to help... but can you give us some feedback on what actually worked for you? I believe that this information could be very useful to anyone struggling with an identical problem.


(?) Training?

From Travis Gerspacher

Answered By Mike Orr, Heather Stern

I have been looking around for training programs and I have come across the LPI and the RHCE. How recognized are these certifications by employers. Being a RHCE just won't mean as much if a potential employer has no idea what the heck it is. I welcome any comments or guidance from anyone!!!

(!) [Mike] I can't answer this directly, but have you seen the LG articles on LPI? Dan York and Ray Ferrari trace the creation and achievements of the Linux Professional Institute over two years, how they sought to gain recognition for it, and how they succeeded.
(!) [Heather] If it helps any, when listing them on your resume' you could give their full names, followed by the short form in parentheses. RHCE is the Red Hat Certified Engineer program, so it expresses that Red Hat thinks that you are sufficiently versed as a Linux technician, because you have the skills (as expressed by the testing series you went through, real life may give you different mileage).
Doing a Google! search on the single keyword "RHCE" finds 42000 hits, one of the top of which is a review on Amazon for a book to help study for it. The reviewer states that "my boss wants me to take the RHCE exam!" and that by starting to delve into the book, he realized that he really wasn't ready yet.
In either the RHCE or LPI series, it's not a single test, and it's not a "rubber stamp". The RHCE tests include a hands-on exam (so it's not just "multiple guess" bubbled tests).
Any given employer may have heard of them; if they have, their interest may be in your actual skills, or in the ability to pit RHCE or LPI against college degrees and other buzzwords. The LPI has tried to be very scientific. The RHCE focuses on practical experience (with their distribution). This may help you pick which, if you're only planning to go for one and feel you will be competing with degrees and so on.
If they haven't, you still have the skills they tested for, and should be able to show that in your interview or regular review.
It may be worthwhile to you to see if you can tell what kind of things your hoped-for employers already say they are looking for in their other hiring. That may give you a basis to guess if they care about such things. It's up to you to decide if you think they should care that you have these. If you think many people are competing for the job, you with an apparently valid certification may get past non-technical screeners more easily.
I don't have any good statistics(*) to determine how many employers have heard of these but think certifications are a waste of time, or that these certifications in particular aren't useful.
I have the feeling that statistics about certification will be about how many people are taking the tests, not how many people are ignoring the results. You certainly shouldn't take my word as a very useful statistic! I encourage you to investigate for yourself.

See also the Two Cent Tips item this issue about books for your own crash course. -- Heather


(?) Looking for a Tutor

From Rosebud

Answered By Jim Dennis

I am looking for someone to help me lean more about Linux so I can pass my cerification test for Linux Admin. I would like to hire a tutor to help me. Can you tell me where I could possible search for one on the web?

(!) [JimD] Oddly enough, Starshine Technical Services, (my wife's consulting sole-proprietorship; sometimes run by yours truly) started out as "Starshine Tutoring Services" in Los Angeles over a dozen years ago.
Heather did some tutoring through the LAVCC (http://www.lavc.cc.ca.us) and some of her clients suggested that they'd be happy to pay her directly (the tutoring was sponsored by the college from what I gather). So she hung out her shingle; focusing primarily on computer related topics.
Over the years she and I have taken over the business whenever we weren't working a traditional position. I used it as a research vehicle while I was writing my book (specializing in sysadmin support and training).
Anyway, onto your question.
The obvious first step would be to search for "tutoring services" on the Google! Linux (http://www.google.com/linux) engine. I get 62 hits. Searching on just "training" gives us about 40,000 hits one of the first of which points at the Linsight/LinTraining (http://www.lintraining.com) portal. One of the first links therefrom gets us to Henry White's "Basic Linux Training" web-based courseware (http://www.basiclinux.hypermart.net).
I've referred people to the LinTraining and to Henry White's online courses before. These are the best online resources for free Linux training that I know of. Note that the Basic Linux Training course lasts for several weeks and courses start every other month. The LPI web site also refers interested parties to the LinTraining web site for information about training centers.
Of course there are always your local users groups and community colleges. I've also seen video tutorials in the local Fry's (computer stores in California, Arizona, and possibly some other western U.S. states.


(!) netscape bash function

Answer From Allan Peda

Comments By Ben Okopnik, Heather Stern

I wrote a quick wrapper function to pass html directly to netscape if it is running, else to launch netscape with the local file. I find it quicker than clicking the file -> open .. menus since I have an xtern open all the time.

I simply type:

mybox]$ ns README.html

or

mybox]$ ns /tmp/README.html

It takes care of the rest.

Here (from .bash_profile):

See attached misc/tag/ns.bash.txt

(!) [Ben] One thing to be careful of, Allan: there is already a program called "ns" (/usr/bin/ns) that is part of the "dnsutils" package. It's a good idea to check for that kind of conflicts.

(!) [Allan Peda] Thanks:

This is where the various packages / Unices get confusing, since I don't have this on my desktop PC RH7 system.

Thanks for the tip.

apeda]$ unset ns
apeda]$ ns
bash: ns: command not found
apeda]$ ll /usr/bin/ns
ls: /usr/bin/ns: No such file or directory
apeda]$
(!) [Heather] If you do find a conflict, it's very easy to use capitals instead. For example, I gave my dad-in-law a bash alias named Elm which does some mail prep for him and then launches elm. So you could name your alias Ns and it is unlikely to bump heads... or even N, unless you like to use one character variables in your scripts a lot.
But definitely, thanks for the script!


(?) More help with Linux Multimedia

From James Coleman

Answered By Ben Okopnik

I enjoyed the Linux Multimedia article in the February 1/2 2001 LinuxGazette. Though I was hip to most of what the author covered, I could use some help with another aspect of Linux multimedia.

I'm in the process of building a web site for a local non-profit organization I work with. Among other things, the web site will feature mp3s from several of the bands we've worked with over the years. Problem is, not every band can afford to have CDs of its music so I've got a fair number of cassette tapes to deal with. I hate the idea of leaving this music out by default but the fact is, I have zero experience transfering cassette tunes to a PC. I've found Linux tools to handle problems like sound level control but I've been unable to find software designed to assist in creating wav files from the tapes in the first place. Anyone familiar with such an animal? Any tips at all would be appreciated. Thanks!

(!) [Ben] I did that a year or so ago. I used 'brec' (part of the 'bplay' package) to do the recording; I simply patched the output of my tape player to the input of my audio card and ran 'brec' with the appropriate options. I then split the huge resulting .WAV file into individual songs with 'mixviews' - that is one terrific, well-written program - and wrote them out to a CD. Pretty much a problem-free process.

(?) Thank you, Ben! I'll be sure to give brec a spin. I've found lots of (Freshmeat) leads on software to convert the wavs to mp3 once I've got 'em on the system so I think I'll be all right in that department. I've got a 6GB drive installed just for this purpose... Can I presume that's going to be enough for serious work or should I pop in a 30GB? In other words, how large is a 9 or 10 minute wav gonna be? Thanks!

(!) [Ben] If I remember correctly, the songs came out at ~ 20-40MB each, just like making WAV/RAW files from audio CDs; that would have meant ~ 200-250MB per tape side. 6GB should be plenty.
I did remember one quirk; in order to get good recording quality, I had to set the input level at 80% or so - any more than that, and I got horrendous distortion, whereas anything below 50% was silent - and do the fine adjustment with the tape player volume knob. Your Mileage May Vary, of course - it was probably related to the quality of my sound card - but if you get no output, check the input level.
Good luck with your project!


(?) Readline Features in the Bash 'read' built-in

From Harv Frost

Answered By Jim Dennis

Dear Mr. Dennis,

I've got a problem with cursor keys in a bash shell script and I sure hope you can help me. In it's simplest form the script goes like this:

#!/bin/bash
tput cup 4 47	# position the cursor in a field for input
read afield

If the user makes a mistake typing in this field and tries to backup using the left arrow key, a "^[[D" is displayed instead of the cursor moving backward a character. I've tried working with the inputrc file but no joy.

(!) [JimD] Try read -e to enable the read command to use the readline "editing" features. That might help. However, they'd have to use the [Backspace] or [Ctrl]-[H] key to erase characters (according to your stty settings)

(?) Why is it that the left and right arrow keys work fine on the command line but not from a shell script that reads input? Boy if you can be of help, I'd be forever in your debt. Thanks a million. I've enjoyed reading some of your articles and appreciate your help on so many things.

(!) [JimD] It's documented in the info pages under the section on the read command in the "built-ins" references.
If you don't use read -e then none of the "readline" library routines are active; thus arrow keys won't work.
BTW: I don't recommand that you serious try to build forms applications under bash. You could use the Linux "dialog" utility or Python or Perl curses modules to get much better control over the keyboard and screen then will ever be possible with tput and read commands. I doubt that it is feasible to create a robust full screen interface using sh and commonly available command line utilities like tput, stty, and echo.


(?) Duping a Drive Under Linux

From Leon

Answered By The Linux Gazette Answer Gang

I need to move my entire redhat 6.2 installation to another hard drive. It currently resides on a portion of DRIVE-2. I want to move it to DRIVE-3 and use the whole drive for the system. After I move the files I intend to remove the partition from drive 2. DRIVE-3 has no files and has not been formatted.

I have files installed in the system that I need and it would take days to re-install and reconfigure them.

In windows, Laplink enables you to transfer or move files and their subdirectories across drives or computers.

Do you know of a utility that can do this?

Leon

(!) [JimD] Linux comes with several utilities for archiving your files.
In the simplest case you can simply use the GNU cp command with the -a (--archive) and possibly the -x (--one-file-system) options.
Here's an example. Assume that you are using /dev/hda now and that you've adding a new /dev/hdc to your system. (I'll assume that /dev/hdb is your CD-ROM, not that it matters). Let's say that your Linux system is on /dev/hda5, /dev/hda6 and /dev/hda7 (and that OS/2, Windows or whatever is on /dev/hda{1,2,3}). Let's assume that you have /dev/hda5 mounted on /, /dev/hda6 mounted on /usr, and /dev/hda7 on /home (a minimal but reasonable fs arrangement).
First I'd suggest partitioning /dev/hdc (using fdisk or cfdisk) making your new filesystems (using mke2fs -c --- check for bad blocks just in case; I know they're quite rare on modern hard drives: but if the drive remaps out enough to spares it will have to show some of them). You can make the new filesystems any size you like; though you should probably make them at least as large as your existing filesystems. Perhaps you'd like to also move /var off of / and onto it's own filesystem (often a good idea). So you might make a one or two hundred Mb / on /dev/hdc1, a 127 Mb swap on hdc2, an "extended" container for hdc3, and three filesystems (5, 6, and 7) for /usr, /var, and /home restectively. So you create all of those. (/dev/hdc4 is unused in this example, since it is a "primary" partition and we didn't need three primaries; in fact we could have just created one primary for the / or /boot filesystem and put all of the rest, including our swap partition into the extended container as "logical" partitions from 5 through whatever).
Because I'm so studly at the command prompt I could (after writing my new partition table) make all of these filesystems with a short and a long command like:
mkswap /dev/hdc2
for i in 1 5 6 7; do mke2fs -c /dev/hdc$i; done
... and I can then mount them like so:
mount /dev/hdc1 /mnt && cd /mnt && mkdir proc usr var home && mount /dev/hdc5 usr && mount /dev/hdc6 var && mount /dev/hdc7 home
(all those && thingies ensure that each previous step was completed without an error before going to the next step. The backslash just marks a line continuation. Of course we can enter each command one at a time and just manually make sure that it went O.K for ourselves. Sometimes I'm just too studly for my own good).
Now, I'd have all of my new filesystems mounted under /mnt in a way that corresponds to their intended arrangement on / (the root directory). In other words, if /mnt were my root directory then *it's* /usr, /var, and /home would be properly mounted.
Thus my target disk space is prepared and arranged for a full copying. Here's how:
cp -ax / /usr /home /mnt
That's all! We're directing the GNU cp command to "archivally" copy (-a) everything below /, /usr, and /home (including all of their subdirectories; which is one of the implications of the -a option) but excluding any external filesystems. That's why we have to list / and /usr and /home (our three mounted local filesystems).
This command will not copy /proc (which is a special, virtual filesystem that represents the kernel's PROCess state as if they were files and directories). It will also skip any devfs, /dev/pts, and other virtual filesystems as well as any NFS or other filesystems that we didn't explicitly list on our command line.
Now you might understand why I spent so many paragraphs "setting up" this example. If you had 11 filesystems (/, /usr, /var, /home, /opt, /var/spool, /var/cache, /var/spool/news, /var/spool/mail and /tmp, and /usr/local) then you'd probably want to list all of them on your cp command.
If you left off the -x and just did a cp -a / /mnt then you'd have two problems. You'd be making a copy of /proc to /mnt/proc (which would waste lost of disk space and be hard to track down after you rebooted and mount the virtual /proc over the /proc containing "regular" files). Of course you could simply follow your cp command with an 'rm -fr /mnt/proc' --- but that's a waste of time and CPU cycles; and an extra opportunity of mess things up (particularly since you're doing all of this as 'root' where any mistake can destroy the whole system). Worse, you'd copy some things from twice (once into /mnt and again into /mnt/mnt). That's a classic recursion problem. Again, you could follow up such a mistake with an rm -fr command --- but you still might cause problems (you might fill up your /mnt filesystem with duplicate /mnt/mnt and /proc junk).
So, it's wise to use -x (limit the cp command's recursion or "descent through subdirectories" to those filesystems that the cp command "started on").
There are similar ways to accomplish this task using any of tar, cpio, rsync or the dump/restore pair of utilities. In fact it's even possible using these with ssh to security duplicate your system or any of its directory trees across a network to another system. However, I'll defer discussion of that for a more comprehensive "Recovery and Backup HOWTO."


(?) Fortran Compiler

From Yvonne Swagg

Answered By Dan Wilder, Jim Dennis

Hi there,
I have read that Linux has a compiler for fortran but cannot find it in the OS. Is it the GNU software that does it and could you please tell me what extension I would save my file as? You help would be greatly appreciated.

Yvonne

(!) [Dan] Part of what is now called the Gnu Compiler Collection, gcc. Which includes C, C++, Objective C, Fortran, and others I no doubt fail at the moment to recall.
Fortran may be invoked as
g77
on source files with suffix ".f", ".for", or ".FOR".
If g77 is not installed on your machine, check your distribution; it is quite likely present in the distribution.
(!) [JimD] A couple of years ago I had a group of rocket scientist (aeronautics engineers, actually) who asked me to come in and help this with a little old dual processor Linux box which was only staying up for about a week at a time. (That's an abysmal stability record for Linux).
They were running a 2.0.x kernel with SMP enabled on thing; which was never a good idea. I fetched and built a newer kernel and it was fine (it was a beta/developmental kernel --- but even those usually give much better uptimes than 1 week; so I didn't consider it to be much of a risk. The box was used solely for computation; so no other services or files were at risk.
Anyway, the manager there explained to me that the engineers in his group all wanted to use this particular machine instead of their Sun UltraSPARCs, their HP's and their other RISC boxes --- because they had found that the best Fortran compiler for them was from NAG (Numerical Algorithms Group: http://www.nag.com). NAG makes a commercial Fortran compiler and a number of libraries and other software products.
So, yes. There are fortran compilers for Linux.
There is a GNU fortran compiler; which is called g77; this is a Fortran '77 compiler which produces an intermediate code and then uses gcc to produce the optimized machine binaries. (http://www.gnu.org/software/fortran/fortran.html). It's apparently considered to be part of the GCC (GNU compiler collection) at this point. I'm not qualified to comment on wether g77 is any good, or how closely it conforms to the 1977 ANSI specification or anything like that. I notice that some of the Fortran '90 enhancements are supported, so g77 is as archaic as the '77 might imply).

(?) Thanks very much for your help! I was about to try that to see if it worked. I do not believe the g77 is installed on my system. I still have to apply the Errata updates, maybe then it will install the g77.

Yvonne


(?) Modules cannot load with kernel recompile

From Michael Hansen

Answered By Ben Okopnik, Chris Gianakopoulos

Hello TAG--

I have attempted recompiles of RH 6.2 several times, and have encountered similar problems every time. After recompiling the kernel, the new kernel will boot correctly but some modules don't load because of dependencies on other modules that are not loaded.

Just now, I have encountered a more fatal problem--no modules will load at all. When I try to "insmod" or otherwise load the module, it lists symbols that it cannot resolve. One in particular that I checked out--best_malloc--is a symbol that appears to be in the kernel itself. Every module seems to need it, and none can find it.

The modules themselves appear to be in the right place. ksyms -a appears to see the symbols that the modules are looking for, when those symbols aren't in other modules that aren't loaded.

So, two questions. (1) Is there a simple utility/series of steps for compiling and loading all modules and their dependent modules, avoiding potential problems in xconfig associated with not specifying all of the proper module dependencies, and (2) do you know why this latest recompile doesn't let any modules load at all due to external symbols that it can't find in the kernel?

Any help is appreciated.

(!) [Ben] Just a guess, off the top of my head - are you doing the "make modules" and the "make modules_install" steps? Here is the complete list of steps for a "from-scratch" kernel compile for my own system:
make mrproper # Not necessary for a recompile
make [config|menuconfig|xconfig] # Choose one; xconfig is easiest
make dep
make clean
make [zImage|bzImage] # I always use bzImage these days
make modules
make modules_install
Save the old kernel (I keep a "current" and an "old" copy) -
mv /boot/vmlinuz-2.2.17 /boot/vmlinuz-2.2.17-old
Put the new image in /boot and rename it -
cp /usr/src/kernel-source-2.2.17/arch/i386/boot/bzImage /boot/vmlinuz-2.2.17
I have symlinks, "/vmlinuz" and "/vmlinuz-old", to "/boot/vmlinuz-2.2.17" and "/boot/vmlinuz-2.2.17-old";
all that remains, since my "/etc/lilo.conf" is properly set up, is to run "/sbin/lilo":
Odin:~# lilo
Added Linux *
Added OldLinux
Added dos
Odin:~#
Save the old system map -
mv /boot/System.map /boot/System.map-old
Copy the new one -
cp /usr/src/kernel-source-2.2.17/System.map /boot
Save the old configuration file -
mv /boot/config-2.2.17 /boot/config-2.2.17-old
Copy the new one -
cp /usr/src/kernel-source-2.2.17/.config /boot/config-2.2.17
Obviously, all of the above can (and should) be put in a shell script with some options on what to run.
Done.
Note that if you try to run a new kernel with old modules (or vice versa, by not installing the new kernel properly), you'll get just the kind of errors that you're reporting.

(?) Regarding not making the modules... I did go through the process of

make modules ; make modules_install

and it appeared to copy the right object files in the right directory tree, and compiled cleanly.

Is it possible that the symbol table used to resolve external references between modules and the kernel has been corrupted?

(!) [Chris] Hey Mike,
This may or may not help you. I use SuSE 6.4 as my distribution (2.2.14 kernel). I too have to go through all of that cool build stuff. One thing that the SuSE distribution says to do. I have to copy /usr/src/linux/System.map to the root directory (/). That file contains kernel symbols which are needed by the modules to launch kernel functions correctly. I know that Linux is Linux, but, I must be careful when passing this information. It applies to the SuSE 6.4 distribution; maybe it applies to your Red Hat distribution.
Let someone with more Linux knowledge answer your other questions.
Chris G.

(?) Thx for the interest...should have laid out the entire process that I followed for compiling but didn't because I don't have linux on the net, needed to switch to Windows to send e-mail...

Still stumped. Something is really broken. I must be doing something wrong to not have the kernel compile right out of the box. Just can't find it. Followed all directions to the letter.

(!) [Ben] It's not necessarily you doing anything wrong. The compile-and-install procedure, as I have laid it out, is somewhat tedious (hence, my suggestion of a shell script) but not difficult - if you follow it step by step and it still doesn't work, you need to look at other things.
Where did you get the source? If possible, you should use the package that your distro producer has - they may have done some quirky stuff in the setup that needs to be there for it to work properly. In theory, you should be able to just download it from kernel.org, compile, and run - but people like RedHat have so many things already configured in that I'd rather not guess. Somehow, (mirabile dictu!) I've avoided doing a RedHat kernel recompile, and Debian has never cared where the source comes from, but it's a possibility.
Try "disabling" the old modules by renaming the directory that contains them -
mv /lib/modules/2.2.17 /lib/modules/2.2.17-old
Then, after doing the "make modules_install", check in "/lib/modules" to make sure that you have a new "2.2.17" directory, that there is a reasonable directory tree under it ("block", "fs", "misc", "net", etc.), and that the modules that should be there are indeed there. (Obviously, you'll have to change the numbers for your own kernel version.) I seem to remember having a problem, in the past, where "modules_install" failed rather quietly and did not create the directories or copy the modules... I'm trying to recall the fix, but the best I can come up with is that it had something to do with the Makefile syntax in "modules_install". Whatever it was, moving the old modules directory made the error obvious, and the fix wasn't a difficult one.
Whenever I've found myself in this kind of a maze of little passages, all alike, The Canonical Fix that always worked was a complete, from-scratch (meaning, including "mrproper" and "clean") compile, perhaps including deleting the existing source tree and re-unpacking the tarball or package. If that doesn't work, I'd either suspect the provenance of the source, or I'd write to the kernel maintainers with a complete description.
Of course, if you're building an experimental kernel, you're on your own. Subscribing to a developer's list might be the only answer.


(?) The "Now what" Experience: Using Apps After They're Installed

From Ray

Answered By Jim Dennis

Hiya. I admit it, I'm a newbie. Coming from a world of windows, it's sometimes difficult to get the grasp of what is being installed where, when a new app is installed. For example, I am using GNOME. If I install an app, does a shortcut automatically get placed in my programs bar? Does it depend on the app whether or not it does? Is there any sort of "standard" behaviour as far as installing programs and getting links to them on your desktop?
Thanks,
Ray

(!) [JimD] You're right. There isn't a standard way for applications to "install themselves" into the menus, icon groups or other UI of you system. That's primarily because there is no standard UI for Linux.
When you're in X under Linux then you could be running any of several user interfaces under it. Most of these are in the form of "Window managers" such as twm, fvwm, Enlightenment, icewm, Afterstep and sawfish (my current favorite).
Under Debian there is a system by which package maintainers can "register" the GUI or menuing interfaces to their programs and by which any window manager (or, presumably, any other menuing system) can update its menus. That works great for those applications that are available as properly maintained Debian packages.
I know that Red Hat and other RPM distributions have some similar mechanisms; but I don't think any of those has become a defacto standard across different distributions.
This is one area where the LSB (Linux Standards Base) may eventually offer considerable benefit to Linux users. Of course LSB and FHS (the File Hierarchy Standard) are for general purpose Linux distributions. We'd never expect embedded, or special purpose distributions to adhere to these standards. The purpose of LSB is to provide a way for ISV (independent software vendors) and other programmers to write their programs so that they can install and operate on any sort general purpose Linux system without having to code up twenty different mechanism for 40 different systems and 200 versions (just the differences among Red Hat versions 4.2, 5.x, 6.x and the newer 7.x would be enough to drive most ISV's crazy).
For now you just need to read the vendor's or maintainers docs and figure out what to run after you application is installed, and you have to read your window manager's docs to figure out how to configure your custom menu items.
Under GNOME you have a set of "panels" which are miniature applications that work with your window manager (usually sawfish or enlightenment). You can usually add items to your panels by "right clicking" (which actually means that you click with your "secondary mouse button" --- that might be the right or the left button depending on how you have your pointer configured). There are features in the standard panel menus for adding new items to your GNOME panels. These are completely independent of your window manager's menus.
You window managers' menus usually popup when you click on the "wallpaper" (called the "root window" in X parlance). For sawfish (formerly known as sawmill) you can just read the "info" (TeXinfo) pages using EMACS or the standalone "info" program. TeXinfo is the tool/format used for documenting many GNU programs. It is a sort of hypertext system (though it's somewhat different than the "hypertext" model of the WWW that most people have been using more often in recent years). Interactive "info" tutorials are built into the info utility and into the EMACS info package.
For most traditional UNIX/Linux X window managers you customize them, including their menus, by editing a text file and inserting definitions in what amounts to a small programming language. Each of these is somewhat different. In the case of sawmill/sawfish the programming language is derived from elisp (the version of LISP used/implemented by EMACS). However the menus are defined with a set of very simple lisp expressions which simply define the menus (which are lists of data structures containing the labels, commands and arguments of each of the items on your menus). That's not too surprising since LISP is the original LISt Processing language.
Hope that helps. Hopefully this is something that will get easier as Linux is used on more desktop workstations. The fact that Sun and other major workstation vendors have joined forces to back the GNOME project suggest that things will at least be good for GNOME users. Since GNOME is still a free and open source project that means that all of the information necessary to make programs interoperate with GNOME will also be available to KDE and other communities with competing user interface suites. So it shouldn't force us into using GNOME, either.
Until then, good luck and perservere.


(?) ISP and Internet.

From Neemc

Answered By Mike Orr, Jim Dennis

Hi all, I am Mike,

As far as I read your answers about ISP and Internet servers, I never found an answer about the difference between an Internet server and an ISP. I mean, what is the difference between an ISP and if I run my own Internet server which allow dial-in?

(!) [Mike] Traditionally, "Internet Service Provider" (ISP) has meant an organization that provides an upstream access point to the Internet (via dialup, DSL, T-1, etc). This can be a professional ISP company or (in large companies) an "internal ISP" run by their own IT staff. And of course, the big backbones are "ISPs to the ISPs". One can informally call personal server offering dialup connections to a few certain people some kind of ISP.
AOL and MSN used to be private networks with their own content, along with CompuServe, Prodigy, etc. They offered something very different from "Internet access", which meant a connection to the Internet and then you were on your own to find content. But now AOL has combined the two, stretching the definition of what an ISP is.
At the same time, people used to get their webhosting and e-mail via their own ISP, but now they are increasingly using organizations who do not offer dialup access directly. And now there are new services like remote backup or "word processing via the web" (which, parenthetically, are a serious application of the old "multiplayer game" concept). Are these organizations ISPs? It's debatable. If you take this definition to its limit, anybody with a server offering any Internet service is an ISP. I don't think most people would want to go that far.
(!) [JimD] If you have an Internet connection, and you allow people to dial-in (or otherwise access) the Internet through your connection --- then you are providing Internet service. If that is your primary business then you are certainly an ISP. Otherwise the point is somewhat moot.
Of course every ISP has to connect with or through other ISPs. The "Internet" is an "internetwork" of connected networks. (I know that's a tautology, but bear with me here). The Internet is an internetwork of networks which all speak TCP/IP and have agreed on a set of common address delegations and naming services.
Thus their can only be one delegation of the address 198.41.0.6 on the Internet. Likewise the name www.internic.net must be delegated to one authority (which can publish various addresses, mail exchange and other types of records about that name).
Of course it gets more complicated than that in many cases. For example it used to be common to have gateways between the Internet and various other online services and networks. Once upon a time AOL, CompuServe, Delphi, Fidonet and various other networks were NOT "on the Internet" --- though e-mail and some other services (file transfers) could be accessed through gateways. The distinction between a "gateway" and an "Internet connection" basically boils down to the matter of addressing and naming. Those networks didn't have globally direct routable IP addresses (DRIPs) and (thus) their internal nodes couldn't have name/records in the DNS (domain naming services) system.
Of course many corporations use their own internal IP addressing (usually following RFC1918 which reserves 10.*.*.*, 172.{16..31}.*.*/12 and 192.168.*.* from use in the global address space). Systems on these networks use application level proxies or NAT (Network Address Translation: specifically IP masquerading) to access the Internet.
Proxies are also known as "gateways." I friend of mine likes to say that "if your connecting to the 'net via NAT then your 'NAT' really on the 'net!" We can think of NAT as a network layer "transparent" proxying service. (And there are some protocols can don't work through NAT, or requiring kludges to "mostly" work through it).
Of course some companies may offer you "Internet service" through a set of NAT gateways and/or proxies. I think that some of the cable modem services, wireless and even some of the DSL services are NAT'd these days. Whether they are "really" ISPs is a moot point. If you can get the specific services you need through these companies then they can be "service providers" for you.
Of course, I prefer a traditional ISP (one that gives me a static block of DRIP addresses, a route to my dedicated line, a dial-up line for fail over and remote use, and control of my own DNS and even control of my reverse DNS --- which is only a subnet of a class C in my case). I pay a much higher rate for these services than most DSL, and cable modem customers though I get a relatively paltry bandwidth for it --- only 1.44Kbps over IDSL. I don't complain because this gives me the flexibility to do anything "on the Internet" as any ISP or corporation (only slower than the big guys). Besides, I pay less than a quarter of what a few friends of mine used to pay for 56K frame relay leased lines only five years ago.
So, I would conclude with the following definitions (and let the hair splitters pull out their loops and razors):
An "internet server" is any host which is "on the Internet" and providing services to clients over it. Usually this means "public services" (such as most web, FTP, DNS, etc that you've ever heard of). I would even say that a "server" could actually be a small cluster of systems which are providing a service as a group (usually behind some sort of load-balancing NAT router) constitutes an "internet server."
An ISP is a company or organization which provides internet services (connection to the world wide Internet address space, routing and naming system) to customers (as opposed to their own staff, departments or satellite offices).
(Note that I *don't* count companies, such which provide a stack of dedicated remote access lines their employees and let them access the Internet through their corporate connection as "ISPs" in this sense.)
A "tier 1" Internet connection is one which has an AS (autonomous system) number, which is a sort of routing address that is completely different then IP addresses, and uses that for "peering" (exchanging routing data) with multiple other tier 1 internetworks.
A "tier 1" ISP would logically be a company which has a tier 1 Internet connection and which provides Internet connections to customers. (Note that some organizations which have first tier Internet connections are not ISPs --- some large educational, governmental, and military organizations, for example).
On the next tier down are ISPs and organizations that lack AS numbers and which don't peer; but which do have CIDR blocks of DRIP addresses. (CIDR is "classless interdomain routing" --- a way of aggregating blocks of numerically adjacent addresses so that they entire block can be managed with a single entry in the global routing tables. Such organizations might be "multi-homed" (given them some load-balancing, and failover redundancy through their own policy based routing).
The lowest tier of ISPs aren't multi-homed (don't have multiple independent Internet connections) and/or don't have their own address block delegations. They have to get their addresses from their ISPs and they have no redundancy (or they are completely dependent on their single ISP, even if they do have multiple dedicated lines to them).
Of course there are places where customers rent rackspace and connect their computers to an Internet connection, and power. These are colocation facilities. In some cases you're renting whole cages. In most cases they are providing UPS (uninteruptible power supply and generator power backups), physical security, 24 hour monitoring, and other services (such as access to network tape drives for your backups and terminal servers for remote console access to your systems). Colocation facilities allow you to bring your computer to the Internet (rather than bringing the Internet all the way to your computer). They are an imminently logical approach when you need high speed and low latency at moderate cost for your internet servers.


(?) Virtual E-mail and POP Services with a Webmail Chaser

From MAMATHA C.V

Answered By Jim Dennis

dear sir/madam,

(!) [JimD] Sir for most of the TAG team, and Madam for Heather (our illustrious editor).
(!) [Heather] ...aww, shux. I have done any illustri-ing in a while :)

(?) i have created virtual e-mail domains and vpop accounts to virtual e-mail domains. DNS is configured. A record and ip address are set. virtual e-mail domains are identified through nslookup and telnet.

(!) [JimD] What kind of "virtual" e-mail domains did you create? What MTA (mail transport agent) are you using? sendmail, qmail, Postfix, Courier, exim? What POP daemon are you using? You've set A (address) records up in DNS? What about your MX records?
You've used nslookup (or dig) to confirm that your domains and hostname records appear as you intended them. However, you haven't explained to us what you did and how you think it's supposed to work.

(?) when i send mail to vpop account to virtual e-mail domain i am getting error

 ----------------------------------------------------------------------
 ----- The following addresses had permanent fatal errors -----
 <mamata@vvv.webber>
     (reason: system config error)
    ----- Transcript of session follows -----
 553 5.3.5 mail.webber. config error: mail loops back to me (MX problem?)
 554 5.3.5 <mamata@vvv.webber>... Local configuration error
 -------------------------------------------------------------------------
(!) [JimD] This example looks completely bogus. "webber" doesn't look like an Internet domain at all.
Obviously you don't understand the problem well enough to explain your expectations, give relevant excerpts from the config files that are involved, and provide details about which packages you are using. Either you don't understand enough to ask an answerable question, or you're too lazy to do so. (I hope it's the former).

(?) please send step by step procedure to create virtual e-mail domains and vpop accounts. is imap and pop3 server is sufficient or vpop3 server is required.How to check mails for vpop accounts.

(!) [JimD] No. The "step-by-step" procedure for creating domains and POP servers are covered in a number of HOWTOs and involve a large number of decisions that must be made based on an understanding of a very large body of information about networking. Also those steps and processes differ greatly based on which packages you select. The selection of packages is also a complex issue which should be based on a clear requirements analysis.
Your question amounts to a request for us to perform a rather involved consulting project for you. You should hire a consultant to provide these services. If your needs are for a non-profit or community service project, then you should solicit some local expertise to help you with the project.

(?) the frontend we are using is webmail.

(!) [JimD] I have recently set up something that sounds remarkably like what you need here. I grabbed the Courier MTA and webmail package from (http://www.courier-mta.org) site and built the MTA (esmtpd), POP and IMAP servers, and the SQwebmail CGI gateway (MUA: mail user agent).
Actually, I'm still setting it up. Unfortunately I haven't had time to write up the basic details and I certainly haven't had time to play with its advanced features and to figure out how to host virtual domains on it.
Maybe, in a month or two, I'll have enough experience with Courier and enough time to write up a HOWTO. I might also work on creating a suite of Debian packages for (some of) them (since Debian currently only support the Courier-IMAP daemon).

(?) please reply at the earliest

(!) [JimD] Sorry, but you need a whole lot more specialized help then we can give. Please feel free to write up a detailed explanation of what you're trying to do and how your trying to do it, and we might offer some further suggestions. As for "the earliest" please keep in mind that this is a volunteer effort. If you want timely service, pay for it.


(?) LILO: Password Protected Entries

From Tom Frye

Answered By Jim Dennis

I have LILO / GRUB installed as my boot loader, and I want to add BeOS to the list. I figured out how to do that, but is it possible to password protect that selection? BeOS can read / write to Linux without any security measures, so I need to block out users.

(!) [JimD] Do you have LILO or GRUB installed? I really doubt you'd be using both (one in the MBR and the other in the superblock?).
In /etc/lilo.conf you can specify a password. This can be done in the global section or in any "stanza"). If it is done in the global section then the "restricted" will allow you to "restrict" those images to being booted without a password IF and only IF they are being booted without any additional parameters.
So, set a password. Leave the "restricted" option off of your BeOS stanza(s) (so it/they always require(s) a password) and add it to your Linux stanza(s) (to prevent someone from simply using init=/bin/sh rw to bypass your desired policy of preventing console users access to your ext2 filesystems unless they have your passwords and respect the Linux permissions/ownership settings). Note that there exist some MS-DOS/MS-Windows utilities for accessing ext2 filesystems as well. So access to those should also be restricted if you want to protect yourself with more than a simple layer of obscurity.
Of course, securing your system from console access also requires that you change the default CMOS/BIOS settings to prevent booting from removable media (or physically lock the floppy and/or CD-ROM slots or remove those devices). You'll also have to set CMOS passwords to prevent the console user from simply changing the setting back. You'll also want to consider locking the case in its own cabinet or getting a case lock of some sort (so users don't simply open the case, short the CMOS/NVRAM battery, resetting it to factore defaults).
Finally you should be aware that some (most?) PC BIOS' include a factory password to allow their support staff to help hapless users who have set CMOS passwords and forgotten them. Luckily those are quite obscure --- I don't happen to know any of them. However, a persistent session with a search engine would probably find a few of them for me; and a bit of social engineering on a call to the PC's manufacturer would probably get me the one I wanted (if I was sitting in front of your machine trying to break-in).
I really wish I could recommend a BIOS manufacturer that I could guarantee *DIDN'T* have a backdoor password. I will be much happier when someone get a usable OpenBIOS replacement working for some reasonably available motherboard/chipset.
(I still won't someone to write a sane BIOS bootloader that stores a list of device/bootblock address with checksums in the NVRAM; and that has hardware write-protect pins/jumpers on the NVRAM; we won't have truly robust PCs until someone does so).


(?) Question in shell programming

From Jane Liu

Answered By Dan Wilder, Jim Dennis

I wanted to change the first letter of each line to upper case? How can I do it with awk?

Thanks, Jane

(!) [Dan] Here's one way:
#!/usr/bin/awk -f

{
a = substr($0, 1, 1)
b = toupper(a)
sub(a, b, $0)
print
}
"a" has the length-1 substring of the current input record, $0, beginning at the first character of the input line.
"b" has the upper-case equivalent of "a".
"sub" substitutes what's in "b" in place of the first match in the string for what's in "a". The third argument to "sub" may be left implicit, but I prefer not to do so, feeling that putting $0 in makes the operation of the program more obvious at a glance.
(!) [JimD] Here's a simple one liner:
awk '{ sub(/^./,toupper(substr($0,1,1))); print; }'
... substitute the first character of the implicit pattern space ($0) with the value returned by the "toupper()" function, when it's called on the substring of $0 (the default pattern space) from the first character and continuing for one character.
Then print the thing.
Can't get much simpler than that.

(?) Thanks a lot! It works perfectly.

Thanks again!
Jane


(?) qmail pain

From Mic Nowland

Answered By Dan Wilder

(?) G'day there,

I have a couple of machines named Lin and winy on my local network myplace.net.au connected to my RH6.1 NAT/Firewall, samba server, squid cache with caching DNS and using a part-time dialup connectin to my ISP myisp.com.au

Local2remote works fine, Qmail will rewrite the domain in From: field by setting QMAILHOST=myisp.com.au and QMAILINJECT=f in my enviroment no probs.

Emails from Lin@myplace.net.au addressed to winy@myplce.net.au get sent,noprobs there either. However, I cannot get qmail to rewrite the From: field to Lin@myisp.com.au when I send email from either Lin or winy to say billsux@microsloth.com it remains Lin or winy @myplace.net.au, which is wrong.

Do I need to use mess822 (gulp) or what ? Please help, I am at my wits end. Michael

(!) [Dan] There's probably a way to do it using Qmail, but sad to say, I haven't a clue, as my relationship with Qmail lasted only about two weeks.
You might consider asking your MUA (Mail User Agent, your email client) to use correct "From:" headers in the first place. Most MUAs now are able to adapt to working on private networks, where email headers should always reflect reachable addresses, not private ones.
Another possibility would be switching over to Postfix. In my admittedly limited experience, Postfix is much easier to configure than Qmail, and it will certainly do any reasonable header rewrite you might need.
Postfix will do the particular rewrite in question if you add the following line to /etc/postfix/main.cf:
masquerade_domains = $mydomain
The line is taken from /etc/postfix/sample-rewrite.cf, installed by "make install".
This simplicity is typical of Postfix configuration.
P.S. Postfix does Maildir delivery quite nicely, if you ask it to.


(!) Regarding backups

Answer From Bruce Harada

Comments by Heather Stern

Hi. I read your answer to the person trying to backup their notebook's hard drive with tar. The way I do backups of my notebooks is as follows:

  1. Start the notebook up from a bootdisk floppy that includes support for network connectivity and NFS (I use Slackware's bootdisk/rootdisk/pcmcia three-disk combination, but it requires some fiddling with).
  2. Mount a directory from the computer you want to make the backup to (I'm leaving out the setup requirements for NFS (/etc/export, etc.), since if you want to use this method, you're probably familiar with them already). One thing you should probably be careful of is that the exported filesystem should use no_root_squash to avoid permission problems when writing the backup file.
  3. Say your laptop has its HD as /dev/hda, and you've mounted the remote directory as /tmp/mnt/backup/ on the notebook. Do the following:
     # dd if=/dev/hda of=/tmp/mnt/backup/notebook-hda
    
    This will send the entire contents of /dev/hda to the remote directory as a single file.
     
    One thing some people might be saying here is, "What if the notebook's HD is larger than 2GB?" Some Linux systems support files larger than 2GB, but NFS (at least V2; I don't know about V3) almost certainly doesn't. In that case, you can try:
     # dd if=/dev/hda | gzip >/tmp/mnt/backup/notebook-hda.gz
    
    which will compress it for you (hopefully to below the 2GB limit, although it's probably a good idea not to try this unless you're positive that the final file will come in under 2GB). Compressing it will take longer than you think it should, though, so be ready to wait a while.
  4. When you need to restore the backup, just use the bootdisk to start up the notebook, mount the exported filesystem as before, and do:
     # dd if=/tmp/mnt/backup/notebook-hda of=/dev/hda
    
    or, if you compressed it,
     # gunzip -c /tmp/mnt/backup/notebook-hda.gz | dd of=/dev/hda
    
    This backup takes care of everything, including partition tables and bootblocks, which (in my book) makes it much more reliable than tar. I've used it to back up some of my older notebooks, with around 500MB hard drives, and the final (compressed) file was about 350MB. Both backup and restore worked fine, without any problems.

    That's about it - I hope it's of help.

    -- Bruce Harada

    (!) [Heather] it's worth noting that this works best when restoring to the same size hard drives, or especially, the exact same drive; a larger one may leave its extra space invisible, a smaller one will have bits falling off the end, and some drives of the same approximate size have different geometries, so fdisk may think strangely of you :(
    However for backing up your own notebook to a stable desktop server it works great!


    (?) uninstall linux

    From Gordon Van Vliet, Randy Filkin, Les Barron

    Answered By Ben Okopnik, Heather Stern... and Les Barron.

    i just read one of your previous posts re removing linux from a system.

    i installed linux mandrake 6 in a dual boot win98 setup.

    i just wanted to learn about linux a bit at a time but now im tired of it and want to remove it and lilo completley. I formatted the entire c drive and nothing would run because lilo was still there and parts of linux. How and where do I remove lilo? I read about the lilo -u , but where,when do i do this?

    Since I'm bothering you anyway.. I have a compaq presario with all the pre-installed crap. I would like to format everything completley and install a clean win98-me but even prior to any linux i tried this and it says this version of win is unsupported by your bios .so i am forced to use the compaq re-install disk that has all the garbage. what can I do to nuke everything and start fresh ??

    thanks for any help
    gordon

    (?) [Randy Filkin] does anyone have suggestions for uninstalling Linux Mandrake 7.2?

    I have searched high and low and cannot find any help in this regard.

    (!) [Ben] Strange; a quick Google search of the Web gives me over 1200 hits on "uninstall Linux" with 68 of those containing the word "Mandrake". Even a search of the past issues of LG comes up with 16 hits. What is your definition of "high and low"?

    (?) [Randy FIlkin] I have an HP Pavilion that had windows 98 on it. After exhausting all resources that I know of, I ran the recovery CD, doing a recover once or twice and then doing a full FDisk and then recovery.

    (!) [Ben] What could you possibly hope to recover after doing a "full fdisk"? I don't know which recovery CD you ran - Windows? Mandrake? There is no such generic term as a 'recovery CD', anyway - or what it was supposed to do, so the above provides no useful information.

    (?) [Randy Filkin] Everytime I would seem to successfully recover my original system configs and reboot,

    (!) [Ben] Which system? What are 'configs'?

    (?) [Randy Filkin] Linux would still be there, I would get the root password, and then I would once again insert my recovery CD and reboot to initiate the recovery process. I have checked their web page at http://www.linux-mandrake.com/en as well as help files on the CD and cannot find any info of getting rid of Linux

    (!) [Ben] Have you checked Microsoft's site for instructions on how to get rid of Windows? I haven't but I'd be willing to bet that you won't find anything like that - any more than you will find instructions on the General Motors site on how to trade in a Chevrolet on a Ford. You're looking for information in a place that obviously would not have it.

    (?) [Randy Filkin] Thank you for your time and attention!

    I am a very irritated customer of Linux. All I want to do is a successful uninstall of the O/S and no matter where I look in your documentation, I cannot find any info on this!

    (!) [Ben] No, you're not an irritated customer of Linux. You may be irritated, and you may be someone's customer - Mandrake's, perhaps? that is, assuming that you actually bought their CD - but not of Linux, since Linux doesn't have customers. Friends, perhaps. Fans. Advocates. Customers, no. Linux is an operating system and a community - not a business.
    Whenever someone writes in with a misconception as basic as that, I usually ignore their request, since it carries the presumption of "you owe me help, I'm an irritated customer!", and it's one I don't appreciate. All of us here at TAG are volunteers, and we put out the effort to do this for our own reasons - but I believe that all of us like to have our efforts recognized and appreciated; for me, it's one of the major 'returns' on my investment of time and effort here. To be told that we "owe" it is an up-front refusal to "pay" that appreciation and recognition, and a demand that I, personally, find delete-worthy.
    However, I'm going to go ahead and assume that your statement was based in lack of understanding rather than a "reputation hostage play" - plus, I have a habit of "paying in good coin" whenever I hijack someone's request to discuss a point of my own. So, here is my slight variation on what Jim Dennis has so capably covered in the past issues of LG (#s 25, 36, 46, and 48, to be exact):
    Assuming that you want to clear off the entire drive and have no concerns about losing any of the data that is on it, boot Linux and enter
    dd if=/dev/zero of=/dev/hda bs=512 count=1
    
    NOTE: this will completely wipe your entire Master boot Record! Not only will you not be able to boot from this drive, you will not even be able to read it once you've rebooted: it will require partitioning (via fdisk) and formatting. Be sure that you have your new OSs boot floppy close to hand!
    If you wish, you can partition the disk while still in Linux (wiping out the MBR only makes itself felt after you reboot); "fdisk" and "cfdisk" will happily write DOS partitions to your drive.
    If you have to do this from DOS, try entering the following commands:
    lock c:
    fdisk/mbr
    
    Several folks have reported having no luck with "fdisk /mbr" - which, in my long experience with it (I discovered it by reading the strings in "command.com" in DOS5.0 well before someone documented it as an "undocumented feature") both succeeds and fails silently. I believe that in the case of Windows-based installs, this is due to the fact that Windows disallows "raw writes" to the disk: a useful thing to prevent a certain percentage of viruses, but a hindrance when you need to fix something. "lock c:", above, "locks" the drive to allow them, and should make "fdisk/mbr" effective.
    If you have further questions, or need a really radical (but guaranteed to work) solution, please see my article "Clearing out the Master Boot Record" in the mid February 2001 edition of LG: http://www.linuxgazette.com/issue63/okopnik.html
    :)

    (?) [Randy Filkin] Thanks for your time and attention.

    (?) [Les Barron] Dear Answer gang
    Mandrake is the only system that I know of that uses a Linux extended partition that nothing else can read. could this be part of the problem.

    (!) [Ben] Just to correct wrong information: 'ext2' is the standard filesystem for Linux, whether Mandrake or otherwise. Saying that "nothing else can read [it]" shows, at the very least, lack of familiarity with the issue (a number of other OSs, including Solaris and MSWindows, are capable of reading 'ext2'-formatted partitions - though software may be required.)

    (?) [Les Barron] I formatted my hard drive before I found this out. Personally I find SuSE the easiest to set up & the most stable of the 6 or 7 distros that I have tried.

    ...flame bait and apologies for same, ellided. discoveries, though...

    (?) [Les Barron] I am very sorry about my previous statement. However what I actually meant is that Mandrake marks the extended partition type 85.

    I have made a mistake when I stated windows that I lost windows. I had windows98 on a primary partition and Windows 2000 on the first logical drive Windows2000 was no longer bootable after installing Mandrake. whereas redhat suse and others mark the extended partition as a win or dos type.

    I do not mean to knock any linux distribution I have enjoyed using all of them.

    I do very much enjoy the Linux Gazette and downloaded all of the back issues this evening.

    cheers :-) les

    (!) [Heather] Glad you're enjoying the Gazette, Les; it makes all my hard work worth more to me knowing folks find it helpful.
    (!) [Ben] As they say, "no worries". The etiquette of getting along with other, perhaps strongly opinionated, people ("opinionated, me? Surely you don't mean me!" <grin> ;) is a learned skill - one that I find is somewhat forcefully taught in the various Linux (and other) newsgroups. Be sure to bring along an asbestos overcoat at first, though. <smile>
    By the way, good move on downloading the back issues of LG. I find that they are an excellent "local" reference for me: I've zipped all the text versions into a single file, and do a "zipgrep" on it whenever I can't find an answer to a Linux question in the manpages or "/usr/doc". As a side note, I use "zip" and "zipgrep" because that combination returns the "internal" filename that matches the "grep", whereas "gzip" and "zgrep" do not.
    I haven't played with Mandrake all that much, except for fixing up a minor configuration problem on a friend's machine, but I do find it sort of surprising that it would mess up another OS. Does Mandrake actually automatically mark the partition with type 85, or is that an install option? If I recall correctly, '85' says that the entire extended partition should be of type 'ext2',
    (!) [Heather] This is not quite correct. While it is true that the (linux) fdisk label for type 85 is "linux extended" - it merely means logical sub items (I am led to believe) are allowed to be larger than those of DOS... I've never seen anything that enforced that its further contents should be ext2 at all, except (merely?) that DOS won't even look in there. It would be less useful if it did - swap volumes aren't ext2 !
    I've actually had to personally use this type to keep win98 from spotting the extend; with a standard type 5 extend... it went into deep space looking for a D: that simply wasn't there :( And hanging a newbie's system on boot we know is a Bad Thing(tm)
    (!) [Ben] ... which would indeed prevent Windows from being installed there, but it definitely should not do so automatically - especially if there's already a defined extended partition in place (I believe that it would be marked as '5' (DOS extended) or 'F' (Win95 extended).
    (!) [Heather] It should be possible to allow the D: and any other extra partitions to live in a type 5 or type F while declaring a new Extend of type 85 to house Linux partitions. That's the other thing. You can't have two of the DOS type extend volumes or MSwin will have a tantrum. I'm not sure two of type 85 will be allowed either. But I think you can have one of each safely.
    (Someone ought to test that.)
    (!) [Ben] Overwriting an existing partition definition would be even worse than anything that Windows does (overwriting an existing boot sector),
    (!) [Heather] This I agree with! Anyways the much more critical thing is that all the DOS visible portions have to be to the front of the drive. Unless MS has changed something this winter, it will stop searching when it finds partition types it disfavors, and if it doesn't know how to boot by then, you will hang.
    Which, sadly, is why we have all these questions about having a horrible time with a replaced MBR - most flavors of MS' bootloader simply won't chain over to other OS partitions (NT a possible exception, forcing it with LOADLIN is also possible) - so we have to replace the MBR with our own, which can be trained to do the reverse (boot windows safely). But, it isn't always perfect and when it fails - ouch! People have a good reason then to bail, but rarely know what it's safe to do next...
    ...of course the glitzy installers do NOT anticipate failing at their job, so folks have no real instructions what to do.
    There have been some fairly creative self-inflicted disasters seen amongst our querents.
    There needn't be very many of the linux-adopting population suffering this problem anymore - until it's just plain zero, I can simply say, every one of them who does, will be gnashing their teeth and asking someone for help.
    (!) [Ben] ... and would merit an emergency-level bug report to Mandrake. You might want to play with that, and if you can confirm it, you'd be doing the entire Linux community a favor by reporting it.

    (!) [Les Barron] They do have a fix for the problem posted at
    http://www.linux.mandrake.com

    I just wonder how many newbies this discouraged and stopped them using linux. However I suppose linux is not for those who give up easily.

    (!) [Ben] There, I agree with you completely. It does take a bit of perseverance - not to say a certain bloody-mindedness - to get over that initial hump. Once over, though, it's all downhill (note that I've very carefully refrained from saying which meaning of 'downhill' I refer to... :)

    (?) [Les Barron] Thank you for your forbearance I shall now retire my typing finger and forever hold my peace :-)cheers. Les Barron

    (!) [Ben] You might want to revisit that decision. Consider that your experience has caused this very useful (to any Mandrake folks) bit of information to percolate into a widely-read publication. That's a contribution that's got some good value to it - and the real strength of Linux, its underpinnings, is the fact that folks who use it are willing to give feedback on their experiences, good or bad. You've made a small but positive difference - and I invite you, and all of our readers, to set that sort of good example.
    (!) [Heather] Amen to that, brother AnswerDude.


    More 2¢ Tips!


    Send Linux Tips and Tricks to gazette@ssc.com


    How to Extract the Hardware address of Ethernet card in Linux.,

    Mon, 5 Feb 2001 11:31:22 -0800
    Dan Wilder (The Answer Gang)

    Vinayaka.B.S. wrote:
    Dear Sir.,
    Can u please guide me in the issue of extraction of Hardware address of Ethernet card in Linux by providing a code for the above., I'm using Linux 6.0 Hedwig Edition.,

    Thanking You.

    If you can get the card detected by the kernel at all, and successfully ifconfig'ed, ifconfig can then show you the hardware address:
    root@dilbert:/proc/net$ ifconfig
    lo        Link encap:Local Loopback
              inet addr:127.0.0.1  Mask:255.0.0.0
              UP LOOPBACK RUNNING  MTU:3924  Metric:1
              RX packets:3295144 errors:0 dropped:0 overruns:0 frame:0
              TX packets:3295144 errors:0 dropped:0 overruns:0 carrier:0
              Collisions:0
    
    eth0      Link encap:Ethernet  HWaddr 00:60:97:9D:36:98
              inet addr:192.168.1.3  Bcast:192.168.1.255  Mask:255.255.255.0
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:744305466 errors:40 dropped:0 overruns:2 frame:67
              TX packets:760536636 errors:0 dropped:0 overruns:0 carrier:365
              Collisions:11443106
              Interrupt:10 Base address:0xe000
    

    -- Dan Wilder


    Reading Tapes From Another Operating System

    Mon, 05 Feb 2001 02:35:29 -0600
    Jim Dillon (jdillon from maxbaud.net)

    If the tapes were created on an AS/400 they are probably in EBCDIC whereas your PC is probably using ASCII. I have successfully used the "dd" command to read tapes from an IBM mid-range computer. Depending on how the tape was created it may have "header records" in front of the data. One way to proceed would be to take the tape to an AS/400 and print a "VTOC" (volume table of contents). This would show the block size, etc. Try the "dd" command to read the tape. Also, try the "non-rewind tape option" (look in the /dev directory for your tape drive device, if it is "mt0" the non-rewind device is probably "nmt0". The non-rewind device allows you to position the tape read/write head to a particular file on the tape, rather than each read or write request re-winding the tape back to the start). It would be something like this "dd if=/dev/nmt0 of=myfile ibs=32768 obs=32768 cbs=512 conv=ascii".


    if = input file
    of = output file
    ibs = input block size
    obs = output block size
    cbs = convert block size (This is the record length of the records coming in from the tape, so you need to know the record length.)
    conv = ascii (This tells the "dd" program to convert the data to ascii).

    Using nmt0 instead of mt0 will cause the tape head to not re-wind so you can read the next file on a subsequent "dd" command.


    Mon, 05 Feb 2001 12:09:38 -0500
    Joe St.Clair (ksimach from ksimachine.com)

    This is in response to a question from Layton Davis in the Feb., 2001 issue about reading tapes from other OS'.

    The first question I would ask is how (software - command) is Layton attempting to read the tape? I often read tapes from Sun, AIX, HP, and others on my Linux box. The tapes have all been created using "tar".

    I set the block size for all tapes to "0" -
    mt -f /dev/st0 setblk 0

    I have to do this every time I load a new tape.

    I have 3 tape drives. The first uses old QIC-6150 tapes, very old but still works great. The second is a 4mm DAT tape drive. The third is a 8mm DAT drive, but I don't believe the type of drive will matter.

    I have been using Linux to read CAD data from the different flavors of Unix for about 4-5 years and have had to use the same method of setting the block size from the start. Some tapes may not need to have the block size set in this way but by setting it I can read anything that doesn't have a problem on the tape.

    Joseph St.Clair - KSI Machine & Engineering


    A bit of help for Ling Ling

    Sun, 04 Feb 2001 23:40:10 -1000
    Ben Beeson (beesond001 from hawaii.rr.com)

    Hello Answer Guys,

    I was catching up on your column recently and I noticed the below in the January edition (edition 61)of Linux Gazette.

    Ling Ling asked,

    ... I have a RH 6.2 server running as FTP server. Upon customer response, I will have to send certain syslog message to their LAN account, like say admin@system.com.

    Depending on what Ling Ling needs mailed from from the log file, "Logcheck" from http://www.psionic.com may be just what Ling Ling needs. I use this tool to selectively e-mail to myself at home and at work certain logfile entries from /var/log/messages and /var/log/secure. The logcheck utility can be trained to parse the logfiles for messages of various formats. That way, you don't have to send the complete logfile, only the entries you need to worry about. For my case, I am now aware of ftp connections, ftp file transfers, and various questionable connection attempts against services that I do not run, or otherwise reperesent signatures for possible attacks. I even get the source IP address and hostname logged from some other utilities that I run to try and keep up with my system's status. All this shows up in my e-mail at preselected intervals and sure beats wading through the complete log file everyday.

    Hope this helps,
    Ben Beeson


    REF: The Answer Gang - issue 63 - 5-linux anti virus

    Fri, 23 Feb 2001 01:44:36 -0500
    Ed Wiget (ewiget from rhpstudios.com)

    I just came acrossed an article in which a person asked about antivirus software being used on a mail server to check mail destined for Windows machines. One that I have tried, used, and recommend for just that is made by Kaspersky Labs/Central Command. The link is http://www.avx.com You can use gui or command line virus scanning, and it can be configured using cron jobs to scan individual folders, times, frequency. In my personal evaluations of more than 30 antivirus software packages for various operating systems and network topologies, the AVX line always ranks right up at the top. The Windows version has network scanning built-in, and the linux version can also scan NFS/Samba shares. The cost for full version is less than $50.00. They also have a trial version too for evaluation.

    --
    Thank You for Your time,
    Ed Wiget
    Senior Network Security Adviser


    $0.02 tip: tab width toggling in vim and emacs

    Thu, 15 Feb 2001 08:25:19 -0700 (MST)
    Theodore Roth (troth from verinet.com)

    When reading code written by other people, I often have to change my tab width setting in vim and emacs to make everything indent like the original author intended. To make this a simple, single key operation, I added the following to my .vimrc and .emacs files.

    Here's the .vimrc addition:

    See attached misc/tips/tabstops.vimrc.txt

    Note that the ^M is a single character (generated in insert mode with CTRL-V<return> ; ).

    Here's the .emacs version:

    See attached misc/tips/tabstops.emacs.txt

    Both of these use the F1 key, but it should be obvious how to change it to another key.

    Enjoy.

    Theodore Roth


    Looking for packages ...

    Mon, 12 Feb 2001 22:57:29 -0600
    Chris Gianakopoulos (The Answer Gang)

    Antonio Sindona wrote:
    Hi,
    I'm actually looking for the following packages:
    1) An application performance analisys tool, to understand the load for each process in terms of CPU, mem and so on.
    2) A simulation tool (something better than the SIMULA67 language ...)
    3) A network monitoring tool (possibly with graphic interface ...)

    May You suggest something to me (possibly free software) ?

    Thanks

    Hey Antonio,

    I cannot answer your first two questions. As far as a network monitoring tool is concerned, do you only need packet sniffer functionality. For LInux, there is a tool called ethereal. It collects packets and can dissassemble those packets.

    If a packet sniffer (for IP traffic) is not your desired goal, I will venture to guess that you really want a network monitoring tool which determines the health of your network. An example would be an SNMP (Simple Network Management Protocol) manager. An example of this would be HP OpenView. HP OpenView costs lots of money, and I am only citing this tool as an example of a network manager. SNMP network managers (the software) can display graphs of data throughput and all kinds of other stuff by retrieving variables from an abstract database called a MIB (Management Information Base). Is this what you desire?

    You can also monitor network traffic (in a kind of raw form) by using tcpdump. See the man page for tcpdump for its usage. I use tcpdump when I am doing network troubleshooting.

    I performed a search on www.google.com (a wonderful search engine) and got lots of hits. One interesting site that it found was at:
    http://rak.isternet.sk/win/linux-netman/monitoring.html

    I hope that this stuff helps you, Antonio.

    Good luck, Chris Gianakopoulos


    2c tip: universal X server and X on tv

    Sun, 11 Feb 2001 08:24:57 -0800
    Reiner Hammerschmidt (reiner.hammerschmidt from web.de)

    hello,

    here's a 2c tip for all who are lookin for a appropriate X-server: for a long time I was looking for a working X-server for my ATI rage fury card. But then i have heard of the wonderful framebuffer device which makes it possible to get nearly every graphics card to speak X. So I added fb device to my 2.2.14 kernel, made the devices and the magic began. In addition both 640*480 and 800*600 sizes appeared on my tv screen also :-) And all color depths are selectable. Detailed description can be found on the SuSE faq pages. Now I'm very happy i can also play (sound) with Tux in the living room.

    Cheers, Reiner


    Deleting directories with invalid names

    Mon, 29 Jan 2001 15:41:21 -0800
    Steve Johnson (steve from bbdltd.com)
    Mike Orr and
    Heather Stern (The Answer Gang)

    To delete the directory, just specify the entire path;

    rmdir /home/-h

    Or use option "--" to signify no more options. Many GNU commands follow this convention.
    rmdir -- -h
    

    -- Mike

    You don't have to remember to run pwd to figure out where "here" is. ./-h (dot slash dash h) would also get rid of the annoying -h filename, by referring to the current directory (dot).

    -- Heather


    Baffled & A Rather Unique Query in January 2001 Issue

    Wed, 31 Jan 2001 18:48:14 -0700
    Claude baker (cabaker from home.com)

    Baffled - When I first connected a Linux (RH 5.1) to a cable modem 18 months ago I experienced the same "problem" logging on - no password required. I formatted and reloaded 5 times in a month before I built a firewall. The requirement for a password has remained intact since I put a firewall between me and the Internet. By the way, the "experts" recommend reformatting to fix a compromised system unless you have a clear picture of precisely what happened.

    A Rather Unique Query (I hope) - I recently upgraded from RH 6.1 to RH 7.0 on one of my systems and had no graphics after the upgrade. After a bit of exploration, I found that RH 7.0 has switched to XFree86 Version 4.0. Version uses a new driver model and there aren't yet many drivers available. With a visit to XFree I found Version 4.0.2 which included a driver for my old Trident 9660.

    Claude Baker


    FreeSCO: "Free Cisco"

    Tue, 06 Feb 2001 17:22:32 -0800
    taylor864 (taylor864 from yahoo.com)

    First, let me comment that I think TAG is exceptional. I stumbled upon it by accident, and ended up reading every question and answer, and after this email, will be going to look for previous months.

    Glad you like it. I take it you have a passing interest in Linux. Would you like to join The Answer Gang and see questions as they are received throughout the month, and help us hash out answers to them?

    (This model won't scale past a couple of dozen gang members --- but we're O.K for now).

    Actually, getting folks their answers individually scales great! We get a lot more people their answers than we used to. But I'd need an Editor Gang after a while. -- Heather

    Anyhow, in reference to one of the questions asked about a firewall (Firewall for a SOHO From Tom Bynum), you suggested a 3 legged Linux box to do his routing / Firewalling. There is a free router / firewall called FreeSCo (stands for FREE ciSCO) (http://www.freesco.org) that is essentially a firewall on a floppy, with support for a DMZ. I uses (I believe) masq and IPChains. Runs a mimumum of services, etc. You most likely already knew about it, but I thought I'd pass this along (since the guy lives by your mom and all). Have a good 'un.

    -Ray

    I'd heard of FreeSCO and read a bit of their material over a year ago. I have to say that (reviewing their new site now) they seem of have come a long way. I'm also familiar with LRP (Linux Router Project) and it's derivative, Coyote --- which are listed on the the distributions pages at Linux Weekly News (http://www.lwn.net)

    I hadn't realized that FreeSCO was specified designed for three legged firewalls.

    -- Jim Dennis


    LILO problems

    Tue, 06 Feb 2001 10:30:25 +0000
    Shane Kennedy (skenn from indigo.ie)

    This may well be irrelevant, but I spend a lot of time swapping drives around on embedded systems, and the usual cause for the "LI" crash is that I haven't changed the system bios to match the drive currently connected.

    Keep up the good work

    Shane Kennedy


    Wanted Firewall Access, a script

    Wed, 07 Feb 2001 19:00:18 -0600
    Brad Felmey (bradf from i-vic.net)

    http://www.linuxgazette.com/issue62/lg_mail62.html#wanted/1

    You need to be root for all of this.

    Firstly, get a copy of ipmasqadm if it isn't already on the machine. Not sure?

    rpm -qa | grep ipmasqadm
    

    It's either there or it isn't. If not, RPMs are available for those who don't do source. http://rpmfind.net is your friend.

    Now then, we need to make a script that runs on bootup. I generally put all my firewall rules in a file /etc/rc.d/rc.firewall. First, a bit of security:

    chown root:root /etc/rc.d/rc.firewall
    chmod 755 /etc/rc.d/rc.firewall
    

    My machine doesn't need this next part, but in case yours doesn't run it automatically, open up /etc/rc.d/rc.local with the text editor of your choice, and put at the bottom:

    /etc/rc.d/rc.firewall
    

    Now, on to the script itself. This only covers the portforwarding stuff, since it appears you have NAT working just fine otherwise.

    See attached misc/tips/portforward.sh.txt

    Hope this helps, and hope I didn't misunderstand or misread the question. Good luck. -- Brad Felmey


    renaming ethernet devices - Feb 00 issue

    Thu, 8 Feb 2001 22:47:10 -0800
    Greg Nash (greg.n from cybereps.com)

    I had the same problem with 2 ne2000 compatible cards in the same machine - my solution (I think under RH5.2 at the time - don't know if it's still relevant) was to add the following to my conf.modules

    alias eth0 ne
    alias eth1 ne
    options eth0 -o io=yxyyy irq=zz
    options eth1 -o io=yxyyy irq=zz
    

    the -o was the part that took some researching

    Greg Nash



    Sat, 10 Feb 2001 00:00:41 +0100
    Eduardo Perez (eduperez from retemail.es)

    I was reading this article of your column, when an idea hit me: what about the mac address?

    You can read the mac address from each card to identify them, and use that information to configure them properly (I have not tried this, as I do not have any ethernet card around here).

    I hope this helps.


    NTPDATE binaries for solaris 6

    Thu, 22 Feb 2001 09:41:06 -0800 (PST)
    Heather (The Answer Gang)

    Hi,

    I have a question of where can I get the solaris version of this binary.

    This is the Linux Gazette. Unless Solaris has added Linux binary compatibility (and it might have, we dunno) we probably aren't the right place to be asking this.

    We do have Linux for Sparc if you think it would help... including boxed sets from a couple of vendors.

    Your cooperation will be greatly appreciated.
    Art.S

    I think there's an archive of toys for Sun at:
    http://www.sunfreeware.com

    ...but I don't know any more about it than that. Good luck.

    -- Heather Stern


    Trying to build a crash course...

    Tue, 13 Feb 2001 08:06:45 +0000
    Kevin Matthews (kevin.matthews from panasonic.co.uk)

    Hi Matt & TAG

    If you purchased the Mandrake as a packaged distro, then you should have their included books, which are a good kick off. If not look at:

    http://63.209.80.231/en/72doc.php3

    However there are 4 titles I have found very good for solving problems and overcoming the obstacles (sp?) of the adventure that is Linux:

    Linux for Windows NT/2000 Administrators: the Secret Decoder Ring
    Sybex International
    ISBN: 0782127304
    Running Linux
    O'Reilly UK
    ISBN: 156592469X
    Linux in a Nutshell
    O'Reilly UK
    ISBN: 0596000251
    RHCE Linux Exam Cram
    Certification Insider Press
    ISBN: 1576108287

    The first is a good all round tour for windows savvy people. the second two are virtually the standard refernce works ( I tried several other introductory titles before 'Running Linux' but they were not as good ) and the last is a good reference to test your progress and point out areas to investigate.

    Regards

    Kevin Matthews


    SGID Directories

    Sat, 10 Feb 2001 04:43:02 -0800
    Jim Dennis (The Answer Gang)

    Jim,

    Sorry to bother but one of your postings brought a question to my mind...

    "Any directory that is SGID will automatically set the group ownership of any files created in that directory to match that of the directory. This means that your webauthors can just create or copy files into the directory and not worry about using the chgrp (or chown) commands. "

    Does that further affect its subdirectories?

    Regards,
    Terry Lee

    Yes. Creating an SGID directory under Linux will normally make that group association of the directory become the default group assigment on new files that are created thereunder (if the user making creating the files or making those directories is a member of the associated group). In addition subdirectories below that point will also "inherit" the group association and the SGID setting.

    BTW, although it would be silly to create SGID directories that were world writable it does work. Users who are not members of the associated group can create files and directories but they will be associated with their primary group (as normal) and their subdirectories will not "inherit" the SGID setting).

    It's really much easier to see by experimentation than to convey by explanation.

    The main purpose for this behaviour is to allow users to create shared project directories. In conjunction with the umask command/setting it's possible for users ensure that the other members of their team will be able to write to selected files and directories by default.

    -- Jim Dennis


    smtp

    Mon, 5 Feb 2001 15:45:21 -0800
    Don Marti (The Answer Gang)

    Don Harvey wrote:
    I am trying to setup a Linux IPChains firewall for an NT network. I can get everything working except SMTP mail from the Internet. It stops at the Linux box and is not forwarded to the Exchange Server. What should I use?

    Run an SMTP bastion host on your "DMZ" network to handle all mail passing in and out. Don't expose your internal "full-featured" mail server to the outside. If you have one box filling both the roles of firewall and bastion host, this will work too.

    Mick Bauer's explains in LJ:
    http://noframes.linuxjournal.com/lj-issues/issue78/4241.html

    -- Don Marti


    Mandrake Linux and Cable modems - LG Feb 2001

    Tue, 13 Feb 2001 07:52:38 +0000
    kevin.matthews (kevin.matthews from panasonic.co.uk)

    Hi Ian & TAG ,

    Mandrake 7.2 has a utility to set up Internet sharing accessable via the DrakConf control panel. This would seem to be the easiest way to link the PCs to the net.

    I have yet to use this myself as I am still investigating the other things included with the 7.2 distribution; however I think you will find the new DrakConf much better than the previous version, and easier to use.

    The (very brief) Mandrake Documentation Page ref:
    http://63.209.80.231/en/doc/72/en/user.html/drakgw.html

    I couldn't find any more detailed info.

    Hope this helps

    Kevin Matthews


    Memory mystery? lots of tips

    Fri, 16 Feb 2001 15:54:42 -0400
    Alberto Ortiz (tarlong from hotmail.com)

    Something like this happened to me. I solve it by downloading a newer kernel and changing the lilo.conf like you did. Im also told that you may fix this by recompiling your kernel. This happened to me with Red Hat 6.2 (which, by that way, has kernel 2.2.14) so, i dont think it is an isolated problem. Good luck, hope this could help you out.

    alberto ortiz
    tarlong@hotmail.com



    Sat, 17 Feb 2001 05:40:07 -0500
    Sean (snmjohnson from iclub.org)

    Hello,

    Are you remembering to run lilo after editing lilo.conf? While this may seem like a silly question, I've done this very thing more times than I like to admit.

    Also, you might want to consider upgrading your kernel to either 2.2.18 or 2.4.1.

    Sean



    Thu, 8 Feb 2001 17:34:40 +1300
    Glenn (genright from paradise.net.nz)

    I could be wrong as linux newbie myself but,

    In my bios (Award) there is a setting for PNP OS under the PNP/PCI page. I set this to No and had no problems with installing either windoze or linux. I beleive it forces the OS to detect the system without relying on the BIOS settings.

    Good luck :-)

    This should not make any difference to memory detection - since IRQ and DMA are not involved in that process - but overall, this is a good tip that bears repeating. I've had problems with several machines, one with my own AMS TravelPro 150 laptop (Linux would not detect the ESS1688 sound card) until "Plug-and-Play-aware OS" was set to "No". In all the above cases, Windows, even though it was set up with the "PNP OS:On", had no problems with any of the installed hardware.

    -- Ben Okopnik



    Thu, 08 Feb 2001 17:39:21 +0100
    Roman Delaveaux (Delaveaux from heagmedianet.de)

    Hello Answer Gang,

    probably I have the solution for Jan Jakubik with the memory problem. I was wondering when my linux-box detects only 12 MB of RAM in an 384MB-RAM-machine. I checked my BIOS-settings and disabled "Memory hole at 16MB" . Now everything is fine.

    Mit freundlichen Gr&uuml;&Beta;en
    Roman Delaveaux


    distro version upgrade? (slackware)

    Mon, 26 Feb 2001 18:37:09 -0800 (PST)
    Heather Stern (The Answer Gang)

    Dan Blazek wrote:
    Hi,
    I think I'm running Slackware 2.2 (kernel is 2.0.27 for sure

    anyway). Is there some kind of cluster or patch bundle I can download to upgrade my box. Like a single package I can install to at least jump up to slackware 3? And if there is.. can you please tell me where to find it, and if there is there a special way to install it? Or am I going to be stuck installing a new image?

    I thought there wasn't one, but rarely say so without looking. And what do you know, I found:

    slackUp - The Slackware Auto-Upgrade Utility
    http://xfactor.itec.yorku.ca/~xconsole/download.html

    You should read its readme yourself, to check that it can handle your version. If it can't. get involved with the authors ... they haven't updated it in almost a year (or at least the webpage) and you may spark an entirely new round of development for the project.

    -- Heather

    Thanks, Dan.


    script on linuxgazette.com

    Sun, 4 Feb 2001 23:42:11 -0600
    Chad Whitten (cwhitten from intop.net)

    Chad Whitten wrote:

    trying to get the script you put on linuxgazette.com to work on my linksys dsl/cable router

    lynx -auth=\ :admin http://10.1.1.10/Status.htm -dump
    

    when i do this, it doesnt connect i have a username/password for the linksys and i tried putting in

    lynx -auth=admin:password http://...etc
    

    per the man page for lynx but still get same error message:

    Sending HTTP request.
    HTTP request sent; waiting for response.
    Alert!: Access without authorization denied -- retrying
    Retrying with access authorization information.
    Looking up 10.1.1.10.
    Making HTTP connection to 10.1.1.10.
    Sending HTTP request.
    HTTP request sent; waiting for response.
    Alert!: Can't retry with authorization!  Contact the server's WebMaster.
    Can't Access `http://10.1.1.10/Status.htm'
    Alert!: Unable to access document.
    
    lynx: Can't access startfile
    

    after some playing around, i got it with

    lynx -auth=\ 'admin\:password' http://10.1.1.10/Status.htm -dump
    

    Yep, those single quotes are really handy for preventing the shell from running off with your colons, alright. -- Heather


    Makes Windows Explorer Choke - fix!

    Sun, 4 Feb 2001 04:49:07 -0000
    Man in a BOX @ Crosswinds (miab from crosswinds.net)

    Had this problem myself when I partitioned my drive for Linux (fips). It's caused because doze uses its own timings for each drive and is stored in the IDE controler driver in your system / control panel - it assumes that the physical drive will never be paritioned so it never checks to see if the logical size has changed.

    Just remove this from Control Panel prior to a Linux installation / re-partitioning - next time windows loads it will re-discover your IDE controller and install the relevant drivers - no more problem.

    Hope this helps

    Simon


    FIPS is getting old, try Parted

    Sat, 03 Feb 2001 00:33:34 -0800
    Hugh Daniel (hugh from xisp.net)

    Well after several serious skirmishes MS-stupidity lost today! It turns out that the new FSF/GNU parted (use freshmeat.net...) does a better quicker job of shrinking both file system (FAT32 in my case) and partition the FIPS, and all the MS-shit tools!

    Note though that this is Mondays release of parted, but it works and quite cleanly. It's not a real end user tool, but it got the job done.

    Yea.

    So now I have RedHat-7.0 installing on my new laptop, it should be a very cool toy. Thanks for the support of just being there.

    Jim, you might want to point out in Answer Guy that FIPS is dated, that most folks don't know what they are talking about and that parted soves the problem quite nicely.

    Later.
    ||ugh

    Okay. I've copied TAG on this reply. I haven't played with parted. However, I haven't been running Linux on mixed system recently either. All of my recent system have been pure Linux (or non-PC's).

    I also haven't noticed any recent questions for which "FIPS" would have been an answer. So any old TAG issues that referred to FIPS are probably also quite dated.

    -- Jim Dennis

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


    HelpDex

    By Shane Collinge


    elvis.jpg
    freefonts.jpg
    gphoto.jpg
    lifesupport.jpg
    money.jpg
    winnewtechnophobia.jpg
    bruteaccess.jpg


    Linux Today is no longer carrying HelpDex due to on-line publishing budget cuts. I r-e-a-l-l-y thank Kevin and Paul from Linux Today for running me for so long and giving me the chance to get 250+ strips up there.

    What does that mean for Carol and Tux? I have no idea. There's a little stockpile I have at home so I'll run a few days past on Linux Today then probably switch back to my homepage (mrbanana), though (to be completely honest) without funding I'm not sure how long I'll keep the energy for.

    I'll miss doing it every day, it's a LOT of fun.

    [Your Editor told Shane we'd like to continue publishing HelpDex if he is able to continue it. I also pointed out that we need only 4-6 panels a month to make a "complete" article, and we can even run with 1 or 2 if that's all he can manage. -Mike.]

    I guess ideally I'd like to continue it exactly as it is now - I'm used to the format, the humour seems to have stabilised and people know where it is and what's going on.

    In terms of doing impromptu stuff, I'm more than happy to do that, for both you and LT as both of you have been a HUGE help in getting HelpDex seen. And hopefully HelpDex has helped your publications. Just let me know if you ever need anything. Maybe this is a good time to pull Maximux out of the cupboard again, too!

    [Funny, I was just thinking that. More Maximux!!

    Readers, send Shane your ideas for future HelpDex and Maximux cartoons. If he uses them, you'll see your name in print. -Mike.]


    Copyright © 2001, Shane Collinge.
    Copying license http://www.linuxgazette.com/copying.html
    Published in Issue 64 of Linux Gazette, March 2001

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


    ssh suite: Sftp, scp and ssh-agent

    By Matteo Dell'Omodarme


    The aim of this article is to provide an introduction to some useful programs in the SSH suite, i.e. sftp, scp, ssh-agent and ssh-add. In the following we suppose that sshd2 daemon is well configured and running.

    Sftp and scp overview

    Let's focus our attention on sftp and scp.
    The first one (Secure File Transfer) is a ftp-like client that can be used in file transfer over the network.
    It does not use the FTP daemon (ftpd or wu-ftpd) for connections, allowing a significant improvement in the system security. In fact, monitoring some logs file of our systems, we noted that about 80% of attacks in last month was against ftpd daemon. The use of sftp prevents all these tries since it permits to stop the potentially dangerous wu-ftpd.

    The second (Secure Copy) is used to copy files over the network securely. It is a replacement for rcp insecure command.

    Sftp and scp do not require any dedicated daemon since the two programs connect to sshd servers. In order to use sftp and scp you have to insert the following line in the configuration file /etc/ssh2/sshd2_config:

     
    subsystem-sftp                  sftp-server
    
    after this modification you must restart sshd.
    So you could use sftp and scp only to connect to hosts where sshd is running.

    Sftp

    Sftp uses ssh2 in data connections, so the file transport is as secure as possible.
    There are two main advantages in using sftp instead of ftp:
    1. Password are never transferred in clear text, preventing any sniffer attack.
    2. Data are encrypted during the transfer, making difficult to spy or modify the connection.
    The use of sftp2 is really simple. Let's suppose that you would connect via sftp to your account myname on host1. In order to do that use the command:
    sftp myname@host1
    
    some options could be specified from the command line (see the sftp manual page for a complete report).

    When the sftp2 is ready to accept commands, it will display a prompt sftp>. In the sftp manual page there are a complete list of the commands which the user can use; among them there are:

    • quit:
      Quits from the application.
    • cd directory:
      Changes the current remote working directory.
    • lcd directory:
      Changes the current local working directory.
    • ls [ -R ] [ -l ] [ file ... ]:
      Lists the names of the files on the remote server. For directories, the contents of the directory are listed. When the -R option is specified, the directory trees are listed recursively. (By default, the subdirectories of the argument directories are not visited). When the -l option is specified, permissions, owners, sizes and modification times are also shown. When no arguments are given, it is assumed that the contents of . are being listed. Currently the options -R and -l are mutually incompatible.
    • lls [ -R ] [ -l ] [ file ... ]:
      Same as ls, but operates on the local files.
    • get [ file ... ]:
      Transfers the specified files from the remote end to the local end. Directories are recursively copied with their contents.
    • put [ file ... ]:
      Transfers the specified files from the local end to the remote end. Directories are recursively copied with their contents.
    • mkdir dir (rmdir dir):
      Tries to create (destroy) the directory specified in dir.
    sftp2 supports glob patterns (wildcards) given to commands ls, lls, get, and put. The format is described in the man page sshregex.

    Since sftp use encryption there is drawback: the connection is slower (about a factor of 2-3 to my experience), but this point is of marginal interest considering the great security benefits.
    In a test conduced on our local network a Network Sniffer was able to catch a mean of 4 password by hour, from ftp connections. The introduction of sftp as standard protocol for transfer file across the network could eliminate this security problem.

    Scp

    Scp2 (Secure Copy) is used to copy files over the network securely. It uses ssh2 for data transfer: it uses the same authentication and provides the same security as ssh2.
    It is probably the simplest way to copy a file into a remote machine. Let's suppose you want to copy the file filename contained in the directory local_dir to your account myname on the directory remote_dir on host host1. Using scp you could enter from the command line:
    scp local_dir/filename myname@host1:remote_dir
    
    In such a way the file filename is copied with the same name. Wildcards can be used (read more about those from sshregex man page). The command:
    scp local_dir/* myname@host1:remote_dir
    
    copies all files from directory local_dir into the directory remote_dir of host1.
    The command:
    scp myname@host1:remote_dir/filename .
    
    copies the file filename from remote_dir on host1 to the local directory.
    Scp supports many options and allows copies between two remote systems as in the following example:
    scp myname@host1:remote_dir/filename  myname@host2:another_dir
    
    See its manual page for a complete presentation.

    Obviously, using scp, you must know the exact directory tree of the remote machine, so in practice sftp is often preferred.

    ssh key management

    SSH suite contains two programs useful to manage authentications keys, allowing the user to connect to a remote system without specifying a password or even a passphrase. These programs are ssh-agent and ssh-add.

    ssh-agent

    >From the manual page of ssh-agent we can read: "ssh-agent2 is a program to hold authentication private keys. The idea is that ssh-agent2 is started in the beginning of an X-session or a login session, and all other windows or programs are started as children of the ssh-agent2 program (the command normally starts X or is the user shell). The programs started under the agent inherit a connection to the agent, and the agent is automatically used for public key authentication when logging to other machines using ssh".

    There are two way to use ssh-agent depending on that you are running xdm or not.
    In the first case you should edit .xsession file, placed in the $HOME directory. There are two possible procedures:
    Copy .xsession to .xsession-stuff and modify .xession in such a way it contains only the line:

     
    exec ssh-agent ./.xsession-stuff
    
    Alternatively you could edit .xsession file and search for each line containing the expression "exec program". Modify these lines to the form "exec ssh-agent program".

    Log out from your X-session and restart it. ssh-agent will start the X-session as its own children and wait for ssh key to insert in its database.

    If xdm is not running the procedure to use ssh-agent is simpler because you can start your X session using the command:

    ssh-agent startx
    
    In such a way you have ssh-agent properly running.

    ssh-add

    Once ssh-agent is correctly in place you could add identities in its database using the command ssh-add. You could add identities only from processes which are children of a ssh-agent ancestor otherwise the following error message is displayed:
     
    Failed to connect to authentication agent - agent not running?
    
    The use of ssh-add is simple: from the command line issue the command:
    ssh-add
    
    ssh-add scans the file $HOME/.ssh2/identification which contains names of the private keys that are to be used in authentication. If this file doesn't exist, the standard name for the private key is assumed (i.e. $HOME/.ssh2/id_dsa_1024_a).
    If any public key file requires a passphrase, ssh-add asks for the passphrase from the user as in the following example:
    Adding identity: /home/matt/.ssh2/id_dsa_1024_a.pub
    Need passphrase for /home/matt/.ssh2/id_dsa_1024_a (..)
    Enter passphrase:
    
    You could obtain a list of all identities currently represented by the agent using the command ssh-add -l:
    Listing identities.
    The authorization agent has one key:
    id_dsa_1024_a: 1024-bit dsa, (...)
    

    Conclusions and useful links

    Many users of telnet, rlogin, ftp might not realize that their password is transmitted across the net unencrypted, but it is. The use of some secure protocols could allow a secure transmission over an insecure network.
    SSH, encrypting all traffic, effectively eliminates eavesdropping, connection hijacking, and other network attacks.

    These articles are only an introduction to the SSH suite; more about this topic could be found in the manual pages of ssh, sshd and sftp.

    You could get SSH suite from:
    www.ssh.com/products/ssh/, SSH master site or from a mirror site.
    Here you could also find some very interesting information about SSH technology and cryptography in general in the Tech corner.

    Otherwise you could check www.openssh.com where you could download openssh implementation of SSH protocol. The portable version is at www.openssh.com/portable.html.
    You could also read the openssh FAQ: www.openssh.com/faq.html.


    Copyright © 2001, Matteo Dell'Omodarme.
    Copying license http://www.linuxgazette.com/copying.html
    Published in Issue 63 of Linux Gazette, Mid-February (EXTRA) 2001

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


    Kaptain - A Dialog Creator

    By Paul Evans


    ``What Linux really needs ...'' is the beginning of an oft written statement which nearly as often ends with ``graphical front-ends for legacy console apps.'' To quote a certain magazine editor: ``Of course, what Linux needs are not just dialogs, but dialogs that optionally show you the command-line options they generate, so you can get used to which options do what.'' I add that it would also be nice if the dialogs were easy to write, so more people would bother to create them.

    What Kaptain can do for you

    Kaptain has the ability to display mixed widget types in a modern looking dialog which is created from a text file. The program can take care of most of the layout and widget types for you. You can even write tabbed and child dialogs. And, importantly, it can echo it's output to the command line for learning purposes (or the sheer delight of experimenting :-) ). It also has tooltips and WhatsThis to aid in this regard. You could even use it as part of a pipe and have it written on the fly!

    Linux is chock-full of powerful command line goodies like enscript and mpage, but, even if you were a member of their frequent-flyer program, you'd never be able to remember all the switches and options included with them. Kaptain is perfect for this sort of thing: lots of spinners, check-boxes and combos etc. Then there are those file conversion chores. I have constructed many, er, interesting looking pipelines to convert image, sound and text formats. The latter do surrender to a little bash function - as long as you don't need to change any options for any of the commands. By the time you write enough shell script to handle all the options... you need to write a man page for your shell script.

    pic of a tabbed dialog for enscript

    I wouldn't be writing this if Kaptain couldn't do all of that, but I'd be lying if I said that it looked easy to me right away. I'd like to re-stress the "me" in the preceding sentence: I'd never written in anything object oriented before. If you've done any at all, I'm sure Kaptain will be a cake-walk for you. And, if you haven't, don't fret. I'm living proof that you'll be writing scripts for Kaptain without stressing yourself overmuch.

    If you're already handy with the OO approach, I suggest you just download the thing and dive in - you'll love it. In fact, it isn't OO in the usual meaning. The author ``got the idea from Formal Language Theory (Maths), where grammars generating text are mathematical objects. So the words terminal, nonterminal are well known in FLT, but nowhere else. For those who have learnt such things, it's good to see something they are familiar with, for others these are just some new words. BTW, YACC also uses Context-Free Grammars.''

    The image is a thumbnail of the enscript dialog. You can click on it for a larger view.

    Even if you have no intention of writing anything, there are many example scripts in the Kaptain 400k source tarball to make it worth the download:

    • arping
    • crypt
    • curl
    • enscript
    • find
    • finger
    • grep
    • indent
    • ls
    • nslookup
    • open
    • ping
    • procmail
    • tar
    • weblint
    • whois
    • zangband
    After compile, the binary is about 100k.

    Now, as alluded to earlier, I had never done any scripting which involved '->', objects or inheritance at all. Sure, I'd copied and pasted Java like many others have, but I didn't really get it. Any changes were nearly pure trial and error. Anything that actually worked after I messed with it was pure accident.

    I think I just wasn't properly pre-disposed to learning it. After all, the only example of object oriented programming that I (or most other people) are familiar seeing as code, is Java. We're aware of Java, because it turns our normally speedy browsers into 3-toed sloths on vallium. I simply could not understand what all the hype was about since I always dreaded seeing 'loading java' or similar in Netscape. Apparently, it doesn't have to be that way. It's really a wonderful way to write once you get into it. I'd known for years about it being done even in perl, but I never got past my experience watching Java ruin an evening's browsing. I was recently vindicated in my attitude towards Java in the January 2001 issue of "Software Development". On page 26 the author states: ``I'm primarily a Java hacker ... My Plan A for dealing with a memory-hungry application ... is to wave my hand and snort 'Bah! That is why we have virtual memory.' The 20-GB hard disk on this system seems positively claustrophobic to me.'' I knew it! To be fair, this was in the introduction to an article on embedded, so I hope it was meant as humour. I hope.

    Let's create a dialog

    I can't think of any reason not to use my own first dialog as a starting point, so we're going to make a simple dialog to hear phone messages from vgetty.

    What we need to do

    Well, we want to display and play voice messages from a graphical user interface. The messages live in a directory named /var/spool/voice/incoming. We want to display the messages in a list, pick one and play it. Sounds simple - and Kaptain keeps it that way.

    The script

    I'm going to describe making a script executable here, because I dimly recall being mystified when I first started with Linux by what I took to be weird "comments" on the top of some scripts and I hope it may help others. Just skip down to The good stuff in order to avoid it.

    First, lets make a file called 'playmessage'. So, we open a shell and type "touch playmessage" or open our favourite editor and 'save as'. Whichever, at some point, you need to be editing a file called 'playmessage' or similar. A nice place to put this sort of thing is in "/home/yourname/bin", because it's likely allready a part of your path and you have permissions for it all the time. If the directory doesn't exist just create it with mkdir.

    The first line of our script will be a 'shebang' line. Any file under linux is 'executable', i.e. a program, if it has its x bit set. Even if it's not really a program, but only a script, the first line can tell the operating system how to handle it as if it were a real program. The upshot is that you can type the filename and it will be executed.

    Next we need to know just where kaptain was installed. Pop up an xterm or drop into console and type "which kaptain" and then enter. Mine happens to say "/home/paul/bin/kaptain", but yours is more likely to say "/usr/bin/kaptain" or "/usr/local/bin/kaptain". Now that we know where kaptain is installed, we can write our first line:

    #!/usr/bin/kaptain
    

    and save the file.

    We're ready to write our script. The last thing we need to do, before we launch right in, is to set the 'executable' bit on our new "program". Go back into your shell and make sure you're in the directory which contains 'playmessage'. Now type "chmod +x playmessage". This will set all the executable bits to on. Now a directory listing with 'ls' should show 'playmessage' in green with an asterisk beside it indicating that it's executable.

    The good stuff

    There are only ten lines in this dialog and two of them are just for show. The only things they do are to show a title and an icon. Really, we could do without the "Dismiss" button as well. I want to impress on you just how few lines you need in order to get a functional dialog. A 'copy and paste' plain text version is here.

    #!/home/paul/bin/kaptain
    
    start "Play Message" -> descr msglist;
    
    descr :horizontal -> title pic;
    title -> @text ("Phone Message player.");
    pic -> @icon("/usr/share/icons/large/kvoice.xpm");
    
    msglist :framed :horizontal -> msg buttons;
    msg -> @list(`ls /var/spool/voice/incoming`);
    buttons -> play close;
    play -> @action(play_rmd)="Play";
    close -> @close="Dismiss";
    
    play_rmd -> "rmdtopvf /var/spool/voice/incoming/"msg" | pvftowav | play -t wav - ";
    
    snapshot of the playmessage dialog

    Here's our first line:

    start "Play Message" -> descr msglist;

    Note the semi-colon at the end of the line. This is mandatory, just like perl. In fact Kaptain is quite "perlish" after a fashion. The main container is actually named 'start', this is also built into Kaptain's grammar and you must use this word for your first rule. The quoted string "Play Message" is optional and is used only for the dialog's window title.

    On the right, that is, after the "-&gt", you can see the words "descr" and "msglist". In Kaptain grammar these are known as 'nonterminals' and they refer to some area of the dialog. They may be named anything you like as long as they start with a letter. You can also specify as many areas as you like.

    So far, we've defined a dialog with two areas named "descr" and "msglist". If you try to run this without adding anything more it will fail. Why? Because, the areas named don't resolve to anything - we haven't defined them yet. These next three lines define the "descr" area of the dialog:

    descr :horizontal -> title pic;
    title -> @text ("Phone Message player.");
    pic -> @icon("/usr/share/icons/large/kvoice.xpm");
    

    The first line of "descr" is just about the same as the very first line of our script and it does pretty much the same thing. It defines two areas of the dialog. The only difference is the ':horizontal' option. This forces Kaptain to lay them out side by side instead of vertically. Of course now these new areas need to be terminated (or point to yet more areas) and they do in the next two lines following them. "title" now points to a text widget and "pic" points to an icon. Kaptain grammar calls these "specials". There's a list of all the currently available specials here. These include spinners, combos, file dialogs etc.

    These last lines complete the whole dialog by terminating the "msglist" area of the dialog:

    msglist :framed :horizontal -> msg buttons;
    msg -> @list(`ls /var/spool/voice/incoming`);
    
    buttons -> play close;
    play -> @action(play_rmd)="Play";
    close -> @close="Dismiss";
    
    play_rmd -> "rmdtopvf /var/spool/voice/incoming/"msg" | pvftowav | play -t wav - ";
    

    Again, we see a familiar line. "msglist" has just added two child areas to itself. Now that you know what the ":horizontal" option does, I think you can guess at the ":framed" option.

    The next line - the one for "msg" - is interesting. It's both simple and powerful. I'm sure you've figured out that "@list" is responsible for the list box shown in the dialog, but look where it gets it's contents from: a line of shell script! Anything in back-quotes (n.b. It's the key to the left of the "1" on your keyboard, the regular single quote won't work.) will be executed and it's standard out will be fed into the "special". You can stuff anything in there, "perl -e" - whatever, even multi-line.

    The only area left now is the one for the buttons. This area spins off two more children, one for each button we want. The play button shows another way to execute some shell commands, this time a pipeline for converting and playing raw modem files. That's it. Again, to see the script as plain text you may click here. It's nice to see it all together now that you know how it works. Simple as it is, you could tinker a bit if you like: feed the list your music directory and change the play command to your mp3 player for example. Process text files, convert images; it can be the basis for a lot of things.

    Anything this easy becomes nearly addictive and I was sorely tempted to start "embroidering" the script. Since I only have one way of dealing with temptation (I yield to it) a pic of the over-grown results is here and the script is here. This exercise was useful for two reasons: a) I got something to replace my now kde2-broken kvoice and b) I learned the limitations of Kaptain. You can't refresh lists or change anything after it's up (of course widget settings do change things). Commands are evaluated only at run-time. This is as it should be for a dialog program and I really was pushing the envelope with my little kvoice experiment. So let's do what I originally set out to show.

    A dialog for mpage

    snapshot of mpage dialog

    If you've seen the command line options for mpage you're probably afraid right now. Very afraid. But fear not. We're only going to use a small subset of mpage's options. And, because we've taken a good look at the basics, I'm not going to go through it line by line. I'm including this here to show off the @echo special more than anything.

    For those who aren't familiar with mpage, it's a command line program for printing multiple pages on a single page. You can print 2, 4 or 8 up, but you'd better have exceptional eyesight and a good printer for 8:1! The other noteworthy thing about mpage is that it has about 50 options you can feed it - in fact, the sheer number of options is listed under 'BUGS' in the man page :-) I'm sure I'll embroider this script over time too, but for now let's just choose between how many pages and the margin controls.

    Here's the script:

    #!/home/paul/bin/kaptain -V
    
    start :framed "mpage Mini-Dialog" -> file numpages margins buttons;
    
    file "File to print" -> @infile("*.txt");
    
    numpages :horizontal "Number of pages on each page" -> p1 | ! p2 | p4 | p8;
      p1 "1 pg" -> "1";
      p2 "2 pgs" -> "2";
      p4 "4 pgs" -> "4";
      p8 "8 pgs" -> "8";
    
    margins :horizontal "Margins" -> left right top bottom;
      left "Left" -> @integer(10,100)=40;
      right "Right" -> @integer(10,100)=50;
      top "Top" -> @integer(10,100)=20;
      bottom "Bottom" -> @integer(10,100)=30;
    
    buttons :horizontal -> echo print dismiss;
      echo -> @echo(cmd)="Echo";
      print -> @action(cmd)="Print";
      dismiss -> @close()="Dismiss";
    
    cmd -> "mpage -P -"numpages" -m" left "l" bottom "b" top "t" right" r "file;
    

    Plain text is here.

    When run from an xterm, you can make changes and click the "Echo" button over and over to see how the changes effect the command line without wasting any paper at all. To save more paper just take out the "-P" and everything will go to standard out even if you press print. To really enjoy playing with it change the cmd line to:

    cmd -> "mpage -" numpages " -m" left "l" bottom "b" top "t" right "r " file" >test.ps";

    then you can just view the output page with a viewer. Or you could add ";viewername test.ps" to the end and save a step - you get the idea.

    There is another article about Kaptain by hawkeye at Linux Today Australia.

    I haven't done a thorough job of describing everything Kaptain can do; there's heaps more I haven't shown or even mentioned. Kaptain comes with pretty good docs and plenty of examples though. The author of Kaptain is Terék Zsolt. He's doing a great job with Kaptain - which is still only at 0.51. If it gains wider use it can be of great value in teaching console apps and it can save all of us some mind-numbing tedium. Plus, it's the most painless way to experiment with output I've ever found. Don't wait for someone to write one for you - give it a shot yourself. Really. Mr. Terék will be pleased to post them on his website.

    There are other dialog programs for X out there: gdialog which is probably on your system already, Xdialog which has some nice date/time dialogs etc. is down-loadable from here. If one dialog app doesn't have exactly what you want there are always options. I'm sure there are others I just haven't tried yet. Mix and match them within the same script.


    Copyright © 2001, Paul Evans.
    Copying license http://www.linuxgazette.com/copying.html
    Published in Issue 64 of Linux Gazette, March 2001

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


    Mean Thoughts on the Linux Router Project

    By Mark Fevola


    Thinking about using a Linux box as a router? This article compares some older one-disk routers to the Linux Router Project (LRP).

    A few years ago there was a company called MorningStar Technologies (not to be confused with the financial firm ;) which was later bought out by Ascend. And if I'm not mistaken --someone please correct me-- Ascend was bought by Livingston, and Livingston was purchased by Lucent, ad nauseum. Or was it CompaqDigitalMicrocom 3ComMegahertz who bought it? Nevermind.

    The company MorningStar made routers. Two models were the MorningStar Express FR and the MorningStar Express Plus. MorningStar routers were cheap, too. One of their many competitors, Cisco Systems, charged $2500. for the same functionality in a router they charged $1450. for.

    The MSE FR was a heavy metal box about the size of a laptop and just as rack mountable. The Plus was a different animal altogether. The MorningStar Express Plus was actually a 386SX PC with 4MB RAM (yep that's right), a 1.44MB floppy, and a RISCom card ( == a V.35 serial port a.k.a. 'T1 port', see http://www.sdlcomm.com/).

    Like Ciscos, the MSE series of routers had their own command set, binaries, etc., the difference being the platform(s). The MSE software you could take one 1.44 disk and stick it into any PC with the right hardware (IRQ settings, port addresses must match as well) and voila, Instant Router.

    Once I had an MSE that died with extreme prejudice from a NYNEX power spike. We had no spare routers and the customer was down. In 1995 the quickest we could get another router was overnight, for a big phat charge that I would have to eat, and overnight was WAY TOO LONG for the customer to be down. I needed a router, fast. So I made one. I used a 386DX (the motherboard came from a local BBS in a modem trade or something) with 4MB RAM, a RISCom card lifted from an MSE, and a licensed copy of BSDi 2.0. It supported a 56K leased line from Bangor, ME to Ellsworth, ME for about a year and a half. I think it's hostname was Sloth or Gluttony but I'm not sure. Anyway this is an example of what the Linux Router Project (LRP) mutated from.

    And let's not forget another excellent weird router that I call 'The F-Box.' 'F' stands for Frankenstein, built out of spare parts. It's a router that runs on one 1.44 disk under DOS. The software is called IPRoute (see http://www.mischler.com/iproute/) by David F. Mischler. Grab a packet driver for your favorite NIC from http://www.crynwr.com/ and you're in business. If you need throttling (traffic-shaping, bandwidth-limiting controls) you do it in the hardware: Use a 286 to throttle an Ethernet connection to 56K. The 286 just can't keep up. Use a 386SX for ISDN speeds, etc. Do your own empirical studies in situ.

    The point is that from Day One, you could stick a V.35 port in a Unix box and <Presto!> turn that box into a router. Or two Ethernet cards and call it a bridge. Of course the kernel would need to support your hardware --in the early days there was no kernel support for RISCom cards. The pros and cons of an industry standard Cisco versus a sticky tape Linux box depend on the situation. Think about: Overhead, security, cost, command set, filtering rules, bus noise, traffic-shaping, complexity, cost-benefit, etc., etc., etc. Just weigh the specifics of 'which tool for the job.' Indeed, do your own research.

    I have not done a lot of work/research with LRP incarnation at linuxrouter.org as such but I am familiar with the "Materhorn Project [sic]" --I don't know why they spelled it that way. It's a brilliant Linux-oid implementation, taking up one disk (much like an MSE router) but running Linux command sets (like a BSDi box). The FAQ is here. However it does not run standard Linux commands 'ifconfig' and 'route', rather it runs a command called 'ip', which necessitates the learning of a new command set anyway. With this in mind I wonder why the 'L' stands for 'Linux.'

    Considering the practical, I don't see much difference between the MSE and Materhorn. For small networks you can RIP, NAT (Masqeuerade) or DHCP. But for larger networks it does not support gateD, and cannot route between Autonomous Systems (ASs). Source is available for gateD so I assume it just hasn't been assimilated by the LRP Borg yet. Give them time. However, unlike the MSE, Materhorn recognizes the loopback interface --probably because the last time I can remember MSE software being updated was 1995. And lastly, another difference is TFTP. The MSE has it, Materhorn does not have it.

    Besides the LRP there's a multitude of other devices, appliances, systems and software available to complete the same job. Simple gains in popularity and 'press coverage,' much like Napster versus Gnutella, Hotline, Scour, etc. have shown the spotlight on Linux for developers as well as consumers. You've heard of Napster, have you ever heard of Gnutella? Similarly, you've heard of Linux and the LRP. There are lots of other products out there. The DOS-based routers, for example, have a single thread of execution, and by design are much more secure and stable than any Unix/Linux/Freenix based product. Ever have a Single-Function-DOS box crash?

    How much of a NIST freak are you? I standardized my Alpha- and Intel-based servers to run the same version of Linux; every machine in the shop has an SMC NIC; all the PCs run the same version of Win 98 ; and all the routers are Cisco. There's something to be said for standardization. When Jackie in sales calls the help desk complaining that the network is down, we don't have to ask her what OS she's running, nor do we have to walk her through determining what NIC she's got. We have one CD and one set of drivers to be used on every machine.

    The servers very well should run Linux. But do we want to standardize every machine in the shop to run Linux? Each genre of task should be standardized --so if you're going to have one Linksys hub, you might as well have all your hubs Linksys. If you have one Cisco router, ditto. Linux on the diskless PC routers, ditto. Or if you can't afford a Cisco, your trade-off is money vs. time: The time it takes you to learn the LRP command sets. Besides, you already have Linux on the servers!

    There might be applications and situations for the LRP, I cannot see any. Not even embedded systems. Microsoft wants your refrigerator to run Windows CE; well, Linux developers are doing it too. That's good in a certain way, though it's bad in and of itself. To me, the LRP is a host of developers having wasting time. I hope at least they're having fun.


    Copyright © 2001, Mark Fevola.
    Copying license http://www.linuxgazette.com/copying.html
    Published in Issue 64 of Linux Gazette, March 2001

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


    The GNU GRUB Boot Loader

    By Jaswinder Singh Kohli


    What is a boot loader?

    A boot loader is a program that resides in the starting sectors of a disk, e.g., the MBR (Master Boot Record) of the hard disk. After testing the system during bootup, the BIOS (Basic Input/Output System) tranfers control to the MBR if the system is set to be booted from there. Then the program residing in MBR gets executed. This program is called the boot loader. Its duty is to transfer control to the operating system, which will then proceed with the boot process.

    There are a lot of boot loader programs available, including GNU GRUB (Grand Unified Boot Loader), Bootmanager, LILO (LInux LOader), NTLDR (boot loader for Windows NT systems), etc. I've chosen to discuss GNU GRUB and how to use it.

    What is GRUB?

    GRUB is a very powerful boot loader that can load a variety of operating systems such as Windows, DOS, Linux, GNU Hurd, *BSD, etc.

    Currently LILO is the most popular boot loader, used by almost everyone with multiboot systems. But if you use LILO, you have to remember to rerun LILO every time you change your configuration or install a new kernel. Also, LILO has less flexibility than GRUB.

    GRUB is another name for flexibility. Its latest release, 0.5.96.1, supports ext2 (a file system Linux uses), FAT16 and FAT32 (used by Win9x and ME), FFS (Fast File System used by *BSD UNIX), ReiserFS (a new journalling file system developed for Linux and integrated into Linux Kernel 2.4.1), and minix (an old file system developed for the MINIX OS, also used by earlier Linux). With GRUB, you can "see" into these file systems without even booting an operating system. For example, if you want to see the date and time stored in a text file and don't have time for the whole operating system to boot, you can use GRUB's shell (prompt "grup>) and type:

    grub> cat (partition number)/home/god/filename.txt.  
    
    You'll have all your file system contents, including dates and times.

    The best use of GRUB is that you can load any kernel on any partition right out of the box. For example, if you forget adding the newly compiled kernel to the list, you would normally need to boot, add it to the list and then reboot to use it. But with GRUB, you can simply use the shell and load the desired kernel image.

    I'll now explain the three primary steps to using GRUB: compilation, installation and configuration.

    STEP 1: Compiling and Installing GRUB

    Download the source of GRUB from ftp://alpha.gnu.org/pub/gnu/grub.

    Extract the compressed archive as "tar -xvzf filename.tar.gz"/ For me the filename was grub-0.5.96.1.tar.gz, so I did

    # tar -xvzf grub-0.5.96.1.tar.gz
    
    This command extracted a lot of files and directories to a directory called grub-0.5.96.1 Now do the following:
    [root@heaven ~/grub-0.5.96.1 ]# ./configure
    

    If you want to customize GRUB to include particular filesystem and network-card support, or to remove support of network cards you don't need, run:

    [root@heaven ~/grub-0.5.96.1 ]# ./configure --help
    

    This command will show you all the options. Now use the --enable and --disable prefixes to add or remove support for certain cards.

    (NOTE: GRUB supports network booting.)

    To start the compilation process, type:

    [root@heaven ~/grub-0.5.96.1 ]# make
    

    To install all the files in their proper places, type:

    [root@heaven ~/grub-0.5.96.1 ]# make install
    

    Now you are ready to really install grub GRUB.

    It's a good idea to keep all of GRUB's boot-related files in a directory such as /boot/grub . To do this, follow this simple procedure:

    1. By default all the files of GRUB are either installed in /usr/share/grub/i386-pc or /usr/local/share/grub/i386-pc depending upon how your shell variables are set.

    2. Make a new directory called /boot/grub. Then copy the following files to this directory:

    stage1
    stage2
    *_stage1_5
    

    I will explain these files later. Also copy the GRUB program (which may be in /usr/sbin or /usr/local/sbin) to the /boot/grub directory.

    Before installing GRUB, you need to know how GRUB understands your hard drive and partition information. First of all, counting starts from 0, not from 1. In Linux, your first hard drive attached to the primary master controller is called "hda". In GRUB it becomes "hd0". Likewise, your first floppy drive in GRUB is "fd0". So the first, second and third partitions on the first hard disk (hda1, hda2 and hda3), become "hd0,0", "hd0,1" and "hd0,2" in GRUB. NOTE: the comma is an integral part of GRUB partition nomenclature.

    To integrate the two fields (disk drive number and partition number) around the comma into one, use parentheses. For example: (hd0,0) (hd0,1) (hd0,2) and so on. (hd0,0) is first partition on first hard disk. Similarly, (hd1,5) is the sixth partition on second hard disk and (hd2,0) is first partition on third hard disk.

    Step 2: Installing GRUB

    Installing GRUB can be broken into three separate parts:

    1. Installation of "stage1" in MBR.
    2. Setting up the address or location, "stage2".
    3. Setting up a boot menu or set of options to choose which operating oystem to boot.

    Start installing GRUB by issuing the following command:

    [root@heaven /boot/grub ]# ./grub
    

    This command probes devices to guess BIOS drives and produces an output message. This may take a long time.

    end_request: I/O error, dev 02:00 (floppy), sector 0
    
        GRUB  version 0.5.96.1  (640K lower / 3072K upper memory)
    

    NOTE: Although it may seem surprising, GRUB does have minimal Bash-like line editing is supported. For the first word, TAB lists possible command completions. Anywhere else TAB lists the possible completions of a device/filename. You may be surprised to see this feature. Something like this then appears:

    grub> 
    

    Now, I assume that you have installed your Linux distro in the first extended partition in the first disk or /dev/hda5. Remember the GRUB naming convention and rename the above to (hd0,4). Type the following command:

    grub> install (hd0,4)/boot/grub/stage1 (hd0) (hd0,4)/boot/grub/stage2 p (hd0,4)/boot/grub/menu.conf
    
    Now let's examine this command in detail:
    install
    a built-in command that tells GRUB to install (hd0,4)/boot/grub/grub/stage1 to (hd0), the Master Boot Record.
    (hd0,4)/boot/grub/stage2
    tells grub where the stage2 image is located.
    p with the the following options: (hd0,4)/boot/grub/menu.conf
    sets the configuration file for displaying nice menus. I will later discuss the structure of the configuration file.

    We can also summarize that command as follows:

    1. install
    2. source_of_stage1
    3. where_to_install
    4. source_of_stage2
    5. p source_of_configuration_file

    You have now completed the basic hard drive installation.

    Installation on the floppy:

    To install GRUB on a floppy you need to know the 'dd' command and how it works. For a GRUB bootable floppy you need to put the stage1 and stage2 files on the starting sectors of floppy.

    Installing stage1 on a floppy

    Insert a formatted floppy disk and type:

    [root@heaven /boot/grub ]# dd if=stage1 of=/dev/fd0 bs=512 count=1
    

    Again, lets examine the command in detail:

    if=input file
    i.e., stage1
    of=output file
    i.e., floppy drive (this may be different on your computer)
    bs=bytes to read and write
    Here it is 512 bytes.
    count=how many times to perform this operation
    Each iteration copies the next "bs" number of blocks to the destination, consecuitively.

    Installing stage2 on a floppy

    [root@heaven /boot/grub ]# dd if=stage2 of=/dev/fd0 bs=512 seek=1
    

    Everything here is same as stage1 except for a new item called seek. Seek skips 1 "bs" value. For example, in the above command bs is 512, so seek=1 will skip the first 512 bytes of space on the floppy disk and continue at the 513rd byte. This will preserve the first operation by not overwriting the first 512 bytes written on stage1.

    You have now completed the basic floppy drive installation.

    STEP 3: Configuring GRUB

    In this section we will see how to boot into various operating systems and build the menu.conf file.

    Let's start with boot procedures supported by GRUB. Booting can be done in two ways:

    • A. Booting natively by calling the kernel.
    • B. Chain loading or giving control to another boot loader.

    Boot procedure using method A:

    1. Set the root device or tell GRUB your root file system.
    2. Tell GRUB where your kernel image is and pass the parameters to the kernel.
    3. Reboot and try it.

    To boot Linux, I have my kernel in /boot/ as bzImage and my root file system as /dev/hda5, or (hd0,4) in GRUB. So my booting procedure is as follows:

    1. root (hd0,4)   [This sets the root partition]
    2. kernel /boot/bzImage root=/dev/hda5   [This sets the kernel]
    3. boot   [This starts booting into Linux]

    Boot procedure using method B (this method assumes that you have another boot manager such as LILO or NTLDR installed in the partition):

    1. Set the root partition but do not mount it.
    2. Make that partition active
    3. Set the first sector of the device to which the control has to be transfered with command chain loader.
    4. Reboot and try it.

    Let's try another example with Windows installed in /dev/hda1 or (hd0,0). The procedure for booting with Windows is as follows:

    1. rootnoverify (hd0,0)
    2. makeactive
    3. chainloader +1   [+1 sets the first sector of the current root partition]
    4. boot   [transfers the control and quits GRUB]

    The menu.conf file: this is used for booting multiple operating systems and menu building. Building the menu.conf file is not difficult. It uses plain English, as you will see in this section.

    All the menu entries start with "title TITLENAME" without commas. You can set your TITLENAME to whatever you want.

    To make the menu for booting Linux:

    1. Set the title.
    2. Set the root partition .
    3. Set the kernel with right kind of parameters.
    4. Boot

    To make a working menu:

    title Debian GNU/Linux 2.2 kernel 2.4.1
    root (hd0,4)
    kernel /boot/bzImage.2.4.1
    boot
    #----
    

    (Hash (#) in front of a line is a comment.)

    To make a menu for Windows or DOS:

    title Windoze 
    rootnoverify (hd0,0)
    makeactive
    chainloader +1
    boot
    #----
    

    What if you want to have two verisons of Windows installed--say one for yourself and the other for your family--but the second one won't install because it says Windows is already installed?

    There is an easy way install two versions by hiding one partition during boot and then using the other. You can even password-protect your option so that no one loads your partition by mistake. Here's how to create two installations of Windows, hda1 and hda2 or (hd0,0) and (hd0,1), using the commands lock, password, hide and unhide.

    For Windows "My Entry":

    title My Entry
    lock
    unhide (hd0,0)
    hide (hd0,1)
    rootnoverify (hd0,0)
    makeactive
    chainloader +1
    boot
    #----
    

    To use the lock command effectively you need to specify the password command near the start of the configuration file. The syntax of password command is as follows: password secret ("secret" is the password). At any time you can enter the password by pressing p.

    For Windows "Family Entry"

    title Family Entry
    unhide (hd0,1)
    hide (hd0,0)
    rootnoverify (hd0,1)
    makeactive
    chainloader +1
    boot
    ----
    

    Anyone will be able to boot this entry as a password is not required.

    Here's another interesting trick in the using password command. To hide the entries in the default menu listing or configuration file, you can load a personal listing by using the following command:

    password secret
    

    /boot/grub/secret-list.conf In this command, "secret" is the password and /boot/grub/secret-list.conf is the password file. Before doing this you should set the root directive or give the full path. For example:

    password secret (hd0,4)/boot/grub/secret-list.conf
    

    One more important command is the "map" command, which you can use when you have two hard disks and an operating system such as Windows which doesn't like to be booted from the second hard disk. For example, you can map hd0 as hd1 and hd1 as hd0. In other words, you can virtually swap the two hard disks and load the desired operating system. The commands are as follows:

    grub> map (hd0) (hd1)
    grub> map (hd1) (hd0)
    

    For Booting FreeBSD:

    title FreeBSD 4.0
    root (hd0,4,a)
    kernel /boot/loader
    boot
    #---- 
    

    Here we are calling FreeBSD's loader. You see that the root (hd0,4,a) has three arguments as FreeBSD does virtual slicing of a single partition. We call the root partition "a". If FreeBSD occupies a complete second disk on your system, this would be root (hd0,a). So instead of calling the kernel we are calling the FreeBSD loader, which is better to talk to than the kernel.

    (NOTE: I recommend that before trying OpenBSD and GNU/Hurd, you keep working on doing chain loading.)

    You have now completed basic GRUB compiling, installing and configuring. The more you get to know GRUB, the more you will find GRUB to be an easy and powerful way to control booting.

    Miscellaneous GRUB commands:

    default xx
    where xx is the default entry to boot.
    timeout yy
    where yy is the time (in seconds) after which the default entry will boot.
    fallback zz
    where zz is the entry which will boot if, after the timeout, the first entry fails to boot.
    color
    This is used for colorising the menu. Its syntax is: color normal current_selection. Both the fields can have two values as foreground/background For example:
    color green/black or light-gray/blue
    
    You can also use corresponding numbers.

    REMEMBER: all values start from 0, so 0 is the first entry.

    In my next article, I plan to test Fire GNU/Hurd and OpenBSD and maybe some networking bootup. You'll have to wait for at least three or more months as I will be taking my exams in between. Keep watching.

    Any comments or mistakes can be forwarded to me at jskohli@fig.org.


    Copyright © 2001, Jaswinder Singh Kohli.
    Copying license http://www.linuxgazette.com/copying.html
    Published in Issue 64 of Linux Gazette, March 2001

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


    Displaying CVS Version Control Numbers in Webpages

    By Mark Nielsen


    1. Introduction
    2. Perl script displaying version number
    3. Security
    4. Conclusion
    5. References

    Introduction

    For a few years, I have been writing articles. A silly person named Phil Hunter from Central Ohio Linux User Group suggested to me several times to put version control on the articles. Of course, that is just one more thing to do in a long list of things to do. As usual, when certain things come together, then I pick up on old ideas and make them happen. The conditions were the following:
    1. After working at Cisco in the EMAN and INFOSEC groups, I learned how to use CVS in some detail. I printed out the CVS manual available at genericbooks.com. Now I use CVS for everything I do.
    2. After using SSI, PHP, Mason, ASP, EmbPerl, ePerl, and other Perl server side include modules for Apache for quite a few years, it became trivial to create a Perl script to open of a CVS file, read it contents, and print out the results.
    3. I have a lot of documents, and it is time I keep version control.

    Perl script displaying version number

    In order to make it easy so that every document can use the same command, I use this server side include command that comes with Apache. PHP, Perl ASP, Mason, and other server side scripting languages also have similar commands.
    <!--#include virtual="/ssi/cvs_version.pl"  -->
    

    I also have it configured so that all webpage can use server side includes commands by putting this into my apache httpd.conf file.

    
    <Directory "/usr/local/apache_gnujobs/htdocs">
    
        Options All Indexes FollowSymLinks MultiViews ExecCGI Includes 
    
        AllowOverride All
    
        Order allow,deny
        Allow from all
    </Directory>
    
    AddType text/html .shtml
    AddHandler server-parsed .shtml .html .htm .shtm
    

    Here is a text version of the perl script, or you can also copy and paste it from this document below.

    #!/usr/bin/perl
    
    print "Content-type: text/html\n\n\n\n";
    
      ### Get the name of the file being requested.
    my $Temp = $ENV{'REQUEST_URI'};
    my $Cvs = $Temp;
    
      ### Split the url by "/".
    my (@Junk) = split(/\//, $Cvs);
    
      ### Get the end of the url, which is the filename.
    my $File = pop @Junk;
    $Cvs =~ s/[^\/]+$//g;
    
      ### Attach the document root directory so we get the complete path to the
      ### file on our computer server. Also, attach the CVS/Entries name so that
      ### we get the CVS information.
    $Cvs = $ENV{'DOCUMENT_ROOT'} . $Cvs . "CVS/Entries"; 
    
      ### Open the file, and if we find a match, record it to $Match
    my $Match = "";
    open(FILE,$Cvs);
    while (my $Line = <FILE>) 
      {
      if ($Line =~ /$File/) {$Match = $Line; chomp $Line}
      }
    close FILE;
    
       ### If match is not found, print not found, otherwise get the information.
    if ($Match eq "") {print "No CVS information found. '$File'\n";}
    else 
      {
         ### Get the information we want and print it out.
      my ($Junk,$File,$Version,$Date,@Junk) = split(/\//, $Match);
      print "Version <b>$Version</b> : Date Last Changed <b>$Date</b>\n";
      }
    
    

    Security

    There is a potential problem with security when you use my perl script above. Anybody can read your files located in the CVS directories. I don't know if this is a big concern to most people, and it really isn't a concern to me, but just in case, I blocked reading of the files in any CVS directory by using these commands in my httpd.conf file for my Apache webserver. This is a simple way of doing it. I am not going to have any files or directories that end their names with the words "Root", "CVS", "Repository", or "Entries", so to me it works fine.
    <Files ~ "CVS$">
        Order allow,deny
        Deny from all
    </Files>
    <Files ~ "Root$">
        Order allow,deny
        Deny from all
    </Files>
    <Files ~ "Repository$">
        Order allow,deny
        Deny from all
    </Files>
    <Files ~ "Entries$">
        Order allow,deny
        Deny from all
    </Files>
    

    Conclusion

    Using CVS to manage version control of documents, programs, and scripts is great. Using CVS and my perl script to display the version number of the document is a satisfactory way of keeping version control of your documents. I have no need to make it more advanced, so it works for me.

    Some silly things to do:

    1. Check to see if CVS directory and files exist before opening up to read them. Doesn't matter since I assume the person putting in the server side include command should know what they are doing and it wouldn't really do anything bad anyways.
    2. Use a better regular expression match which will make the webserver reject "/CVS/" anywhere in the requested url from the client browser. This would be better than rejecting only specific files. This doesn't matter to me.
    3. This doesn't work with Alias in the httpd.conf file. At least, I don't think it does.
    4. Check to see if the date of the file matches the date in CVS. This lets you know if your document is out of sync with the CVS respository. This isn't important to me.

    References

    1. If this article changes, it will be available here http://www.gnujobs.com/Articles/15/CVS_SSI.html.
    2. CVS: Concurrent Versions System by Mark Nielsen

    Mark works as an independent consultant donating time to causes like GNUJobs.com, writing articles, writing free software, and working as a volunteer at eastmont.net.

    Copyright © 1/2001 Mark Nielsen
    Article Version 1.3 : Date Last Changed Sun Feb 25 21:13:16 2001


    Copyright © 2001, Mark Nielsen.
    Copying license http://www.linuxgazette.com/copying.html
    Published in Issue 64 of Linux Gazette, March 2001

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


    Learning Perl, part 2

    By Ben Okopnik


    "I realized at that point that there was a huge ecological niche between the C language and Unix shells. C was good for manipulating complex things  - you can call it 'manipulexity.' And the shells were good at whipping up things - what I call 'whipupitude.' But there was this big blank area where neither C nor shell were good, and that's where I aimed Perl."
     -- Larry Wall, author of Perl

    Overview

    In the first part, we talked about some basics and general issues in Perl - writing a script, hash-bangs, style - as well as a number of specifics, such as scalars, arrays, hashes, operators, and quoting methods. This month, we'll take a look at the intrinsic Perl tools that make it so easy to use from the command line, as well as their equivalents in scripts. We'll also go a little deeper into quoting methods, and get a bit of a start on regexes (regular expressions, or REs) - one of the most powerful tools in Perl, and one that deserves an entire book all its own. [1]
     
     

    Quote Mechanisms

    Most of you will be familiar with the standard quoting mechanisms in Unix: the single and the double quote, which I'd already mentioned in my previous article, have much the same functionality in Perl as they do in the shell. Sometimes, though, escaping all the in-line metacharacters can be a bit painful. Imagine trying to print a string like this:

    ``/// Don't say "shan't," "can't," or "won't." ///''

    Good grief! What can we do with a mess like that?

    Well, we could put in a whole bunch of escapes ("\"), but that would be a pain - as well as a case of the LTS ("Leaning Toothpick Syndrome"):

    print '\`\`\/\/\/ Don\'t...

    <shudder> Obviously not a good answer. For times like these, Perl provides alternate quoting mechanisms:

    q//        # Single quotes
    qq//       # Double quotes
    qx//       # Back quotes, for shell execution
    qw//       # Word list - useful for populating arrays

    Note also that the delimiter does not have to be '/', but can be any character. Now our job becomes a bit easier:

    print q-``/// Don't say "shan't," "can't," or "won't." ///''-;

    Simple, eh? By the way, this is something you would use only inside a script; the shell interpretation mechanism would make a horrendous mess of this if you tried it from the command line, especially things like back quotes and slashes.
     
     

    Perl Invocation

    "Hear my plea, O Perl of Great Wisdom!" Oh, never mind; I think that was standard in Perl3, and is now deprecated... :)

    The most commonly-used switch in invoking Perl, if you're running it from the command line, is '-e'; this one tells Perl to execute whatever comes immediately after it. In fact, '-e' must be the last switch used on the command line because everything after it is considered to be part of the script!

    perl -we 'print "The Gods send thread for the Web begun.\n"'

    "-w" is the "warn" switch that I mentioned the last time. It tells you about all the non-fatal errors in your code, including variables that you set but didn't use (invaluable for finding mistyped variable names) as well as many, many other things. You should always - yes, always - use "-w", whether on the command line or in a script.

    "-n" is the "non-printing loop" switch, which causes Perl to iterate over the input, one line at a time - somewhat like "awk". If you want to print a given line, you'll need to specify a condition for it:

    perl -wne 'print if /holiday/' schedule.txt

    Perl will loop through "schedule.txt" and print any line that contains the word "holiday", so you can get depressed about how little time off you actually have.

    "-p" is the invocation for a "printing loop", which acts just like "-n" except that it prints every line that it loops over. This is very useful for "sed"-like operations, like modifying a file and writing it back out (we'll discuss 's///', the substitution operator, in just a bit):

    perl -wpe 's/holiday/Party time!/' schedule.txt

    This will perform the substitution on the first occurrence of the word 'holiday' in any given line (see "perldoc perlre" for discussion of modifiers used with 's///', such as 'g'lobal.)

    The "-i" switch works well in combination with either of the above, depending on the desired action; it allows you to perform an "in-place" edit, i.e. make the changes in the specified file (optionally performing a backup beforehand) rather than printing them out to the screen. Note that we can't just tack an "i" onto the "wpe" string: it takes an optional argument - the extension to be appended to the backup copy - and the text that follows it is what specifies that extension.

    perl -i~ -wpe 's/holiday/Party time!/' schedule.txt

    The above line will produce a "schedule.txt" with the modified text in it, and a "schedule.txt~" that is the original file. "-i" without any extension overwrites the original file; this is far more convenient than producing a modified file and renaming it back to the original, but be sure that your code is correct, or you'll wipe out your original data!
     
     

    RegExes, or "Has The Cat Been Walking On My Keyboard Again?"

    One of the most powerful tools available in Perl, the regular expression is the way to match almost any imaginable character arrangement. Here (necessarily) I'll cover only the very basics; if you find that you need more information, dig into the "perlre" manpage that comes with Perl. That should keep you busy for a while. :)

    REs are used for pattern matching, most commonly with the "m//" (matching) and "s///" substitution) operators. Note that the delimiters in these, just like in the quoting mechanisms, are not restricted to '/'; in fact, the leading 'm' in the matching operator is required only if a non-default delimiter is used. Otherwise, just the "//" is sufficient.

    Here are some of the metacharacters used with REs. Note that there are many more; these are just enough to get us started:

    .        Matches any character except the newline
    ^        Match the beginning of the line
    $        Match the end of the line
    |        Alternation (match "left|right|up|down|sideways")
    *        Match 0 or more times
    +        Match 1 or more times
    ?        Match 0 or 1 times
    {n}      Match exactly n times
    {n,}     Match at least n times
    {n,m}    Match at least n but not more than m times
     

    As an example, let's say that we have a file with a list of names:

    Anne Bonney
    Bartholomew Roberts
    Charles Bellamy
    Diego Grillo
    Edward Teach
    Francois Gautier
    George Watling
    Henry Every
    Israel Hands
    John Derdrake
    KuoHsing Yeh
    ...

    and we want to replace the first name with 'Captain'. Obviously, we would go through the file with a printing loop and do a substution if it matched our criteria:

    s/^.+ /Captain /;

    The caret ('^') matches at the beginning of the line, the ".+" says "any character, repeated 1 or more times", and the space matches a space. Once we find what we're looking for, we're going to replace it with 'Captain' followed by a space - since the string that we're replacing contains one, we'll need to put it back.

    Let's say that we also knew that somewhere in the file, there are a couple of names that contain apostrophes (Francois L'Ollonais), and we wanted to skip them - or anything else that contained 'non-letter' characters. Let's expand the regex a bit:

    s/^[A-Z][a-z]* /Captain /;

    We've used the "character class" specifiers, "[]", to first match one character between 'A' and 'Z' - note that only one character is matched by this mechanism, a very important distinction! - followed by a one-character match of 'a' through 'z' and an asterisk, which, again, says "zero or more of the preceding  character".

    Oops, wait! How about "KuoHsing"? The match would fail on the 'H', since upper-case characters were not included in the specified range. OK, we'll modify the regex:

    s/^\w* /Captain /;

    The '\w' is a "word character" - once again, it matches only one character - that includes 'A-Z', 'a-z', and '_'. It is preferable to [A-Za-z_] because it uses the value of $LOCALE (a system value) to determine what characters should or should not be part of words - and this is important in languages other than English. As well, '\w' is easier to type than '[A-Za-z_]'.

    Let's try something a bit different: What if we still wanted to match all the first names, but now, rather than replacing them, we wanted to swap them around with the last names, separate the two with a comma, and precede the last name with the word 'Captain'? With regexes at our command, it's not a problem:

    s/^(\w*) (\w*)$/Captain $2, $1/;

    Note the parentheses and the "$1" and "$2" variables: the parentheses "capture" the enclosed part of the regex, which we can then refer to via the variables (the first captured piece is $1, the second is $2, and so on.) So, here is the above regex in English:

    Starting from the beginning of the line, (begin capture into $1) match any "word character" repeated zero or more times (end capture) and followed by a space, (begin capture into $2) followed by any "word character" repeated zero or more times (end capture) until the end of the line. Return the word 'Captain' followed by a space, which is followed by the value of $2, a comma, a space, and the value of $1.

    I'd say that regexes are a very compact way to say all of the above. At times like these, it becomes pretty obvious that Larry Wall is a professional linguist. :)

    These are just simple examples of what goes into building a regex. I must admit to cheating a bit: name-parsing is probably one of the biggest challenges out there, and I could have spun these example out as long as I wanted. Considering that the possibilities include "John deJongh", "Jan M.
    van de Geijn", "Kathleen O'Hara-Mears", "Siu Tim Au Yeung", "Nang-Soa-Anee Bongoj Niratpattanasai", and "Mjölby J. de Wærn" (remember to use those LOCALE-aware matches, right?), the field is pretty broad and very odd in spots. (Miss Niratpattanasai, after looking at something like "John Smith". would probably agree. :)
     

    Here's an important factor to be aware of in the regex mechanism: by default, it does "greedy matching". In other words, given a phrase like

    Acciones son amores, no besos ni apachurrones

    and a regex like

    /A.*es/

    it would match the following:

    Acciones son amores, no besos ni apachurrones
    |___________________________________________|

    Hmmm. Everything from the first 'A' (followed by zero or more of any character) to the last 'es'. How can we match just the first instance, then? To counteract the greed, Perl provides a "generosity" modifier to quantifiers such as '*', '+', and '?':

    /A.*?es/

    Acciones son amores, no besos ni apachurrones
    |______|

    There. Much better. For future reference, remember: if you're breaking up a string by matching its pieces with a series of regexes, and the last "chunks" are coming up empty, you've probably got a "greed" problem.
     
     

    The Default Buffer/Variable

    Some of you, especially those who have done some programming in the past, have probably been curious about some of the code constructs above, like

    print if /holiday/;

    "Print what if what? Where is the variable that we're checking for the match? Shouldn't it be something like 'if $x == /holiday/', the way it is in the shell?"

    I'm glad you asked that question. :)

    Perl uses an interesting concept, found in a few other languages, of the default buffer - also referred to as the default variable and the default pattern space. Not surprisingly, it's used in the looping constructs - when we use the "-n/-p" syntax in the Perl invocation, it is the variable used to hold the current line - as well as in substitution and matching, and a number of other places. The '$_' variable is the default for all of the above; when a variable is not specified in a place where you'd expect one, '$_' is usually the "culprit." In fact, '$_' is rather difficult to explain - it turns up in so many places that coming up with an algorithm is seemingly impossible - but it is wonderfully easy and intuitive to use, once you get the idea.

    Consider the following:

    perl -wne 'if ( $_ =~ /Henry/ ) { print $_; } pirates

    If a line in the "pirates" file, above, matches "Henry", it will be printed. Fine; but now, let's play some amateur "Perl Golf" - that's a contest among Perl hackers to see how many (key)strokes can be taken off a piece of code and still leave it functional.

    Since we already know that Perl reads each line into '$_', we'll just get rid of all the explicit declarations of it:

    perl -wne 'if ( /Henry/ ) { print; } pirates

    Perl "knows" that we're matching against the default variable, and it "knows" that the "print" statement applies to the same thing. Now, we apply a little Perl idiom:

    perl -wne 'print if /Henry/' pirates

    Isn't that nice? Perl actually allows you to write out your code with the condition following the action; kinda the way you'd say things in English. Oh, and we've snipped off the semicolon on the end because we don't need it: it's a statement separator, and there's no statement following
    "/Henry/".

    <grin> For those of you playing along at home, try

    perl -ne'/Henry/&&print' pirates

    It shouldn't be that hard to figure out; the '&&' operator in Perl works the same way as it does in the shell. Perl Golf is fun to play, but be careful: it's easy to write code that will work but will require lots of head-scratching to understand. Don't Do That. I may have to maintain your code tomorrow... just like you may have to maintain mine.
     

    In the first example, note the "binding operator", '=~', which checks for a match in the supplied variable. This is what you would use if you were matching against a variable other than "$_". There is also a "negative match" operator, '!~', which returns true if the match fails (the inverse of '=~'.)

    Note also that the available modifiers for simple statements, like that above, include not only the "if", but also "unless", "while", "until", and "for". All of these, and more, are coming up in Part 3...
     
     

    Ben Okopnik
    perl -we '$perl=0;JsP $perl "perl"; $perl->perl(0)'\
     2>&1|perl -ne '{print ((split//)[19,29,20,4,5,1,2,
    15,13,14,12,52,5,21,12,52,8,5,14,1,6,37,12,52,75])}'



    [1]. And in fact, has one - "Mastering Regular Expressions" by Jeffrey E. Friedl is considered to be a reference on the subject. It includes some wonderful examples, and literally teaches the reader to "think in regex".
     

    References:

    Relevant Perl man pages (available on any pro-Perl-y configured system):

    perl      - overview              perlfaq   - Perl FAQ
    perltoc   - doc TOC               perldata  - data structures
    perlsyn   - syntax                perlop    - operators/precedence
    perlrun   - execution             perlfunc  - builtin functions
    perltrap  - traps for the unwary  perlstyle - style guide

    "perldoc", "perldoc -q" and "perldoc -f"


    Copyright © 2001, Ben Okopnik.
    Copying license http://www.linuxgazette.com/copying.html
    Published in Issue 64 of Linux Gazette, March 2001

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


    Setting Up an International Keyboard with Xmodmap

    By Juraj Sipos


    1. Introduction

    This is a revision of my experimental howto published in Linux Gazette, which you may find here. I revised it because there is not the KIKBD utility in KDE 2.0 anymore and XFree86 4.x handles standard ISO8859-2 keycode definitions better than older versions. This information is fully concerned with the Xmodmap solution only, not the XKB one.
    [Note: This article covers XFree86 version 4.x, which may not be in your distribution yet. -Ed.]

    1.2 Quick start

    Make your own .Xmodmap file according to information in this file.

    Write the following to your .bash_profile in home directory:

    export LANG=language 
    export LC_ALL=language
    where "language" is the language you want to use. The languages can be found in the file locale.alias in /usr/X11R6/lib/X11/locale. Run the "exit" command on the console and log in again for bash to read the statement from ~/.bash_profile.

    Install fonts (best are ISO8859-2 Type1 fonts for Czech or Slovak), put them in path to your XF86Config. Start X Server.

    Please note that under certain circumstances the KDE 2.0 text editor doesn't display ISO8859-2 fonts even if you have them in path. The "Latin2" statement in this editor's menu seems not to work. Install another simple text editor where you can CHOOSE fonts (the old kedit from older KDE will do). Open a dialog window from menu, select font and choose ISO8859-2 encoding.

    Run the command "xmodmap ~/.Xmodmap" from an X terminal window to force the system to read the Xmodmap file.

    Switch the keyboard and enjoy.

    The other, XKB solution, which is not covered in this file but mentioned since it pertains to internationalization too, is another way of configuring international keyboard, and both the XKB and XMODMAP solutions are independent of one another. You may alternatively edit the /etc/X11/XF86Config file as explained in the Danish-HOWTO, or issue this command in an X terminal window for the Slovak keyboard:

    setxkbmap -model pc102 -symbols 'czsk(us_sk_qwertz)' setxkbmap cs -option grp:shift_toggle
    The "grp:shift_toggle" gives you an option to switch between keyboards You may also try to write
    Option "XkbOptions"         "grp:ctrl_shift_toggle"
    to your XF86Config file, which will change keyboards by pressing Ctrl and Shift at the same time.

    To see a variety of languages, look in the file symbols.dir in /usr/X11R6/lib/X11/xkb directory. Note that some symbols are only in sources and not in binaries.

    As you see, this looks quite complicated too and it gets even more difficult when you realize that many national keymaps are not included in the standard XFree86 binary distribution, although they are included in its sources. The kikbd utility for handling international keyboard layouts was removed from KDE 2.0 and documentation is quite insufficient. A simple way would be to start KDE, change the international keyboard settings and immediately write in the language you chose (this will work for German and other languages, but in Eastern European keyboards some letters will not function).

    Moreover, the KDE 2.0 command "kcmshell Personalization/kcmlayout" will not show you a Croatian or Macedonian keyboard. And although it shows a Czechoslovakian keyboard, Czechoslovakia does not exist as a country anymore and users may be confused with how to define the Czech or Slovak language separately.

    Some X Windows managers override .Xmodmap setting. If .Xmodmap doesn't work, a good way is to force the system to read it from your root (home) directory. You will do this by issuing the following command from an X terminal window:

    xmodmap ~/.Xmodmap

    After I installed the Slovak keyboard in KDE with Xmodmap file that used the standard definitions for ISO8859-2 letters (lcaron, scaron, etc.), I couldn't write in Slovak or Czech, but this is already explained in my howto published in Linux Gazette. That experimental solution is not necessary for the newer versions of XFree86.
     
     

    2. Setting up international keyboard in X Windows with Xmodmap

    It basically works like this:

    1. Standard solution uses the standard names for letters (scaron for s with a caron above it, uacute for ú - a slash above it).

    2. Experimental solution, where some keycode names from ISO8859-1 character set table will give you scaron, for example.

    Put the following in you Bash_profile:

    export LC_ALL=language 
    export LANG=language
    OR
    export LC_CTYPE=SK_SK 
    export LC_ALL=SK_SK 
    OR for csh shell 
    setenv LC_ALL=language 
    setenv LANG=language
    and have the standard Xmodmap file in your home directory. If you ask me where you may obtain such "standard" Xmodmap files, go to GNOME ../share directory. The file /usr/X11R6/lib/X11/locale/locale.alias contains the aliases for languages, so look there in order to find out what is ca_ES or br_FR, or to find out the exact syntax for your language (you cannot write "croatia" but you must write "croatian", not "Croatian"; this is very important, as Unix is case sensitive).

    Now you must install the pertinent language fonts and put its path statement in XF86Config file. If you want to internationalize your keyboard, use the standard Xmodmap definitions first and use right alt to switch between keyboards (if you use GNOME Xmodmap files). If it does not work, do the following:

    If you use KDE or GNOME and .Xmodmap does not work, force the system to read it as mentioned above by issuing the command "xmodmap ~/.Xmodmap". Alternatively, you can have 60 .Xmodmap files like .Xmo1, .Xmo2, .Xmo3, .Xmo4, etc., and you may force the system to read them (xmodmap  /.Xmo1). The dot means it is a hidden file and it is not necessary. You may also have xmo1, xmo2, or xmo3 Xmodmap files.

    You may write in a national keyboard only with applications that have access to your ISO8859-2 fonts (or other fonts), but this may not work with StarOffice or with other applications that have their own built-in fonts. StarOffice has its own fonts directory - for afm fonts in StarOffice/share/xp3/fontmetrics/afm, and for ps fonts in StarOffice/share/xp3/pssoftfonts, so you must add the ISO8859-2 fonts to these directories (to tell StarOffice to use these fonts too) and edit fonts.dir file and add the symlinked fonts there. Here is a script that will do it for you. Name it "so52", make it executable (chmod +x so52), copy it to the StarOffice/share/xp3 directory and execute it there.

    StarOffice 5.2 fully recognizes Word97 documents even written in other languages, but for the older versions or other editors, you may use a converter from iso8859-2 to win1250 encoding.

    StarOffice 5.2 can be thus used by professional translators who may translate in any languages and give outputs in MS Word97 or rtf format.

    Character sets

    The purpose of the following info is to help you build any .Xmodmap keyboard layout with iso8859-2 or other fonts. The ISO-8859-2 Character Table is included here for you to know which names are used. Much of this information is useful to build a keyboard with ISO-8859-1 characters only, or a combination of Eastern European characters and Western characters. If you're going to use other languages than the Central European or Western European ones, find a pertinent table for your ISO*** character set on Internet. There is gdkkeysyms.h file in (RedHat) /usr/include/gdk/gdkkeysyms.h which contains all the special names we're using here (it also contains names of Greek characters).

    Xmodmap with standard ISO8859-2 definitions

    The example of a standard .Xmodmap file from keycode 0x31 to 0x33. This file will make X Server correctly display lcaron, scaron, etc., if you use a newer version of XFree86 and have a LC_LANG=language and LC_ALL=language statements in your bash_profile. Just copy the following text from keycode 0x31 to 0x33 to my Xmodmap file published some time ago in Linux Gazette (delete the experimental definitions from keycode 0x31 to 0x33). [Text version of this listing.]
    keycode 0x31 = grave asciitilde semicolon dead_diaeresis
    keycode 0x0A = 1 exclam plus 1 
    keycode 0x0B = 2 at lcaron 2 
    keycode 0x0C = 3 numbersign scaron 3 
    keycode 0x0D = 4 dollar ccaron 4 
    keycode 0x0E = 5 percent tcaron 5 
    keycode 0x0F = 6 asciicircum scaron 6 
    keycode 0x10 = 7 ampersand yacute 7 
    keycode 0x11 = 8 asterisk aacute 8 
    keycode 0x12 = 9 parenleft iacute 9 
    keycode 0x13 = 0 parenright eacute 0 
    keycode 0x14 = minus underscore equal percent 
    keycode 0x15 = equal plus dead_acute dead_caron 
    keycode 0x33 = backslash bar ograve parenright
     

    This is the table you can use for building your Central European keyboard with standard Xmodmap solution.


    A caron is a reverse ^ above letter.

    Acute is a small dash like / above the letter (ú, which is uacute).

    Diaeresis is two dots .. above the letter.

    Dot is a dot above the letter (zdot).

    The following table will explain it even better:


     
     

    If you want to build an ISO8859-1 Xmodmap file for a German or Danish keyboard, you must have another map to know how these symbols are named unless you are familirar with them.

    The following Xmodmap entities on the right must be included in your Xmodmap file to have the East European keyboard layout.
     
     
     
    Central European characters
    Character Name Xmodmap and SGML entities
    NON-BREAKING SPACE nbsp
    CURRENCY SIGN curren
    BROKEN BAR brvbar
    SECTION SIGN sect
    DIAERESIS uml
    COPYRIGHT SIGN copy
    LEFT-POINTING DOUBLE ANGLE QUOTATION MARK laquo
    NOT SIGN not
    SOFT HYPHEN shy
    REGISTERED SIGN reg
    DEGREE SIGN deg
    PLUS-MINUS SIGN plusmn
    ACUTE ACCENT acute
    MICRO SIGN micro
    PILCROW SIGN para
    MIDDLE DOT middot
    CEDILLA cedil
    RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK raquo
    LATIN CAPITAL LETTER A WITH ACUTE Aacute
    LATIN CAPITAL LETTER A WITH CIRCUMFLEX Acirc
    LATIN CAPITAL LETTER A WITH DIAERESIS Auml
    LATIN CAPITAL LETTER C WITH CEDILLA Ccedil
    LATIN CAPITAL LETTER E WITH ACUTE Eacute
    LATIN CAPITAL LETTER E WITH DIAERESIS Euml
    LATIN CAPITAL LETTER I WITH ACUTE Iacute
    LATIN CAPITAL LETTER I WITH CIRCUMFLEX Icirc
    LATIN CAPITAL LETTER O WITH ACUTE Oacute
    LATIN CAPITAL LETTER O WITH CIRCUMFLEX Ocirc
    LATIN CAPITAL LETTER O WITH DIAERESIS Ouml
    MULTIPLICATION SIGN times
    LATIN CAPITAL LETTER U WITH ACUTE Uacute
    LATIN CAPITAL LETTER U WITH DIAERESIS Uuml
    LATIN CAPITAL LETTER Y WITH ACUTE Yacute
    LATIN SMALL LETTER SHARP S szlig
    LATIN SMALL LETTER A WITH ACUTE aacute
    LATIN SMALL LETTER A WITH CIRCUMFLEX acirc
    LATIN SMALL LETTER A WITH DIAERESIS auml
    LATIN SMALL LETTER C WITH CEDILLA ccedil
    LATIN SMALL LETTER E WITH ACUTE eacute
    LATIN SMALL LETTER E WITH DIAERESIS euml
    LATIN SMALL LETTER I WITH ACUTE iacute
    LATIN SMALL LETTER I WITH CIRCUMFLEX icirc
    LATIN SMALL LETTER O WITH ACUTE oacute
    LATIN SMALL LETTER O WITH CIRCUMFLEX ocirc
    LATIN SMALL LETTER O WITH DIAERESIS ouml
    DIVISION SIGN divide
    LATIN SMALL LETTER U WITH ACUTE uacute
    LATIN SMALL LETTER U WITH DIAERESIS uuml
    LATIN SMALL LETTER Y WITH ACUTE yacute
    LATIN CAPITAL LETTER A WITH BREVE Abreve
    LATIN SMALL LETTER A WITH BREVE abreve
    LATIN CAPITAL LETTER A WITH OGONEK Aogon
    LATIN SMALL LETTER A WITH OGONEK aogon
    LATIN CAPITAL LETTER C WITH ACUTE Cacute
    LATIN SMALL LETTER C WITH ACUTE cacute
    LATIN CAPITAL LETTER C WITH CARON Ccaron
    LATIN SMALL LETTER C WITH CARON ccaron
    LATIN CAPITAL LETTER D WITH CARON Dcaron
    LATIN SMALL LETTER D WITH CARON dcaron
    LATIN CAPITAL LETTER D WITH STROKE Dstrok
    LATIN SMALL LETTER D WITH STROKE dstrok
    LATIN CAPITAL LETTER E WITH OGONEK Eogon
    LATIN SMALL LETTER E WITH OGONEK eogon
    LATIN CAPITAL LETTER E WITH CARON Ecaron
    LATIN SMALL LETTER E WITH CARON ecaron
    LATIN CAPITAL LETTER L WITH ACUTE Lacute
    LATIN SMALL LETTER L WITH ACUTE lacute
    LATIN CAPITAL LETTER L WITH CARON Lcaron
    LATIN SMALL LETTER L WITH CARON lcaron
    LATIN CAPITAL LETTER L WITH STROKE Lstrok
    LATIN SMALL LETTER L WITH STROKE lstrok
    LATIN CAPITAL LETTER N WITH ACUTE Nacute
    LATIN SMALL LETTER N WITH ACUTE nacute
    LATIN CAPITAL LETTER N WITH CARON Ncaron
    LATIN SMALL LETTER N WITH CARON ncaron
    LATIN CAPITAL LETTER O WITH DOUBLE ACUTE Odblac
    LATIN SMALL LETTER O WITH DOUBLE ACUTE odblac
    LATIN CAPITAL LETTER R WITH ACUTE Racute
    LATIN SMALL LETTER R WITH ACUTE racute
    LATIN CAPITAL LETTER R WITH CARON Rcaron
    LATIN SMALL LETTER R WITH CARON rcaron
    LATIN CAPITAL LETTER S WITH ACUTE Sacute
    LATIN SMALL LETTER S WITH ACUTE sacute
    LATIN CAPITAL LETTER S WITH CEDILLA Scedil
    LATIN SMALL LETTER S WITH CEDILLA scedil
    LATIN CAPITAL LETTER S WITH CARON Scaron
    LATIN SMALL LETTER S WITH CARON scaron
    LATIN CAPITAL LETTER T WITH CEDILLA Tcedil
    LATIN SMALL LETTER T WITH CEDILLA tcedil
    LATIN CAPITAL LETTER T WITH CARON Tcaron
    LATIN SMALL LETTER T WITH CARON tcaron
    LATIN CAPITAL LETTER U WITH RING ABOVE Uring
    LATIN SMALL LETTER U WITH RING ABOVE uring
    LATIN CAPITAL LETTER U WITH DOUBLE ACUTE Udblac
    LATIN SMALL LETTER U WITH DOUBLE ACUTE udblac
    LATIN CAPITAL LETTER Z WITH ACUTE Zacute
    LATIN SMALL LETTER Z WITH ACUTE zacute
    LATIN CAPITAL LETTER Z WITH DOT ABOVE Zdot
    LATIN SMALL LETTER Z WITH DOT ABOVE zdot
    LATIN CAPITAL LETTER Z WITH CARON Zcaron
    LATIN SMALL LETTER Z WITH CARON zcaron
    CARON caron
    BREVE breve
    DOT ABOVE dot
    OGONEK ogon
    DOUBLE ACUTE ACCENT dblac

     

    3. How this Xmodmap solution works on various systems

    In GNOME this is not important, but to correclty use ISO8859-2 fonts with KDE 2.x native applications you should  change the i18n file (/etc/sysconfig/i18n) as follows:

    RedHat:
    LANG="sk_SK"

    where "sk_SK" is your langauge.

    Mandrake:
     SYSFONT=lat0-sun16
     LC_MONETARY=en_US
     LC_CTYPE=cs_CZ
     LC_NUMERIC=en_US
     LC_MESSAGES=en_US
     LANGUAGE=cs_CZ:cs
     LC_TIME=en_US
     RPM_INSTALL_LANG=en
     LC_COLLATE=en_US
     SYSFONTACM=iso15
     LANG=sk

    Or in FreeBSD 4.2 you edit /etc/profile in the following way:
       LANG=cs_CZ.ISO_8859-2; export LANG                                            # to write in Czech
       LC_MESSAGES=en_US.ISO_8859-1; export LC_MESSAGES           # to have English messages

    In the case of Mandrake or FreeBSD we will be using the map "cs" from the
    /usr/X11R6/lib/X11/xkb/symbols/ directory. You can always use the xmodmap
    solution with this, but an alternative way is to edit your map file
    accordingly where you replace definitions with your own. KDE 2.x also
    requires to choose from menu Personalization > Country and Language >
    iso8859-2 charset (or other charset). Only then it correctly displays
    ISO8859-2 fonts in its native applications. Here GNOME appears more user-friendly.

    The following pertains to situation where the i18n file was not changed.

    3.1 SuSe 7.0 with XFree86 3.3.6 and KDE 2.0

    You may use the Xmodmap file with standard ISO8859-2 keycode definitions (not "threequarters" but "scaron", etc.). Unfortunately, although you may immediately start writing with ISO8859-2 keycodes, the dead keys are not working properly and export LANG=language does not work here in order to make these dead keys work.

    After copying the Compose file from /usr/X11R6/lib/X11/locale/iso8859-2/ to the /usr/X11R6/lib/X11/locale/iso8859-1/, you may start elegantly working with dead keys. This was also tested on StarOffice 5.2. The FontPath must be in /etc/XF86Config, not in /etc/X11/Xf86Config. If you put the FontPath for ISO8859-2 fonts to the /etc/X11/Xf86Config file, StarOffice may not see these fonts properly. While working with StarOffice, you must NOT use the fonts from the StarOffice itself, but the ones from ../ISO8859-2 directory (they will automatically appear in the font menu after executing the above script).

    The following is the FontPath section for ISO8859-2 fonts from my SuSE 7.0 /etc/XF86Config file:

    FontPath "/usr/X11R6/lib/X11/fonts/ISO8859-2/Type1"

    FontPath "/usr/X11R6/lib/X11/fonts/ISO8859-2/Type1/afm"

    FontPath "/usr/X11R6/lib/X11/fonts/ISO8859-2/Type1/pfm"

    3.2 SuSE 7.0 with XFree86 version 3.3.6 and KDE 1.x

    Same as with KDE 2.0.

    3.3 Mandrake Linux 7.2 with XFree86 version 4.x

    Here only the LANG=language and LC_ALL=langauge statements in your bash_profile are sufficient (but not for KDE 2.x native applications). Apply the standard .Xmodmap keycodes (scaron, lcaron, not "threequarters" or "mu", etc.) and issue the command: "xmodmap  /.Xmodmap" and you may work by switching the keyboards by the Scroll Lock (if you use my Xmodmap file; if you use other Xmodmap file, try right Alt or whatever that is defined in that Xmodmap file).

    The FontPath statement in /etc/X11/XF86Config and /etc/X11/XF86Config does not have to be changed:

    FontPath "unix/:1"

    The XFree86 reads your new ISO8859-2 fonts automatically in /usr/share/fonts directory (same as in RedHat). Surprisingly, you do not have to copy the ../ISO8859-2/Compose file to ../ISO8859-1 directory and dead keys work nice. To use ISO8859-2 fonts with KDE 2.0 native applications, see the above i18n file for Mandrake 7.2.

    3.4 RedHat 6.0, 6.1 and 6.2 (XFree86 older version)

    Here the "experimental" .Xmodmap solution works ("mu" instead of "lcaron", etc.) and you must copy the Compose file from ../IS08859-2 to ISO8859-1 directory in order for dead keys to work. There is only one XF86Config file in /etc/X11 and its FontPath is the same as in SuSE 7.0 above.

    3.5 FreeBSD 3.1 and 3.2

    Same as in RedHat 6.0, 6.1, 6.2

    3.6 FreeBSD 4.x

    Same as FreeBSD 3.1 and 3.2. But FreeBSD 4.x handles better the LANG=language statemets with XKB. Here this depends also on XFree86. Because the FreeBSD guys are too conservative about the newer software, they ship FreeBSD with older versions of XFree86. In FreeBSD 4.1 the experimental .Xmodmap solution works and you have to copy the ../ISO8859-2/Compose file to ../ISO8859-1 directory to make the dead keys work. If you download the newer XFree86 version, apply the "standard" Xmodmap soilution. For FreeBSD 4.2, see the above /etc/profile file and modify it appropriately for you needs.

    4. Some national Xmodmap files

    • French
    • Croatian
    • Czech

    • Copyright © 2001, Juraj Sipos.
      Copying license http://www.linuxgazette.com/copying.html
      Published in Issue 64 of Linux Gazette, March 2001

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


      The Back Page


      About This Month's Authors


      Shane Collinge

      Part computer programmer, part cartoonist, part Mars Bar. At night, he runs around in a pair of colorful tights fighting criminals. During the day... well, he just runs around. He eats when he's hungry and sleeps when he's sleepy.

      Matteo Dell'Omodarme

      I'm a student at the University of Pisa and a Linux user since 1994. Now I'm working on the administrations of Linux boxes at the Astronomy section of the Department of Physics, with special experience about security. My primary email address is matt@martine2.difi.unipi.it.

      Mark Fevola

      Mark Fevola earned a BA in Technical Writing and a minor in Computer Science, Magna Cum Laude from the University of Maine. In 1994 he brought the commercial Internet to the State of Maine by founding the oldest Maine ISP. He spells grey with an 'e', never wears watches, hates mushrooms, reads books, and collects minerals.

      Mark Nielsen

      Mark works at ZING (www.genericbooks.com) and GNUJobs.com. Previously, Mark founded The Computer Underground. Mark works on non-profit and volunteer projects which promote free literature and software. To make a living, he recruits people for GNU related jobs and also provides solutions for web/database problems using Linux, FreeBSD, Apache, Zope, Perl, Python, and PostgreSQL.

      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.

      Juraj Sipos

      I live and work in Bratislava, Slovakia as a library information worker, translator and research reader at the Institute for Child Psychology. I published some of my poetry here and in USA, I translated some books from English (e.g., Zen Flesh, Zen Bones by Paul Reps). You can see some of my stories and poetry at http://www.crosswinds.net/~aproximetri/index.htm. Computers are my hobby.


      Not Linux


      News flash! Next version of Windows just announced

      [Windows CEMENT logo: CE + Me + NT]

      I wouldn't trust it any farther than I can throw it.


      Spams I have known

      Some of the funnier spams found in the Gazette mailbox.

      I have got your e-mail from the Web site and I am very interested in working for your company. I have a BS in Electrical Engineering and computer science and worked on my Master degree in Telecommunication engineering (not finished due to the lucrative market!).

      [Oh really? And which e-mail are you referring to? LG has certainly not been soliciting for engineers. -Mike.]

      Hello Again answerguy! If this message has reached you in error, please use the removal link at the end of this e-mail. However, I will do my part by keeping you informed...

      [Thanks for keeping us informed. NOT! -Mike.]

      Imagine how wealthy you would be now if you owned a chunk of a company like Yahoo or Hotmail. You would be loaded. However, if someone had contacted you a few years ago and offered you the opportunity to own a slice of one of these companies, what would you have done? I will tell you. You would have ignored the chance because you would have considered it a get-rich-quick scheme and relegated the proposal to the trashcan.

      [Darn right. -Mike.]

      Well, in January a brand new online community (name) is being launched and it is generally felt, by people who know about these things, that it is going to be as big, if not bigger, than the companies I have mentioned.

      I am offering you a chance to be part of this Company for FREE! True, there is an opportunity to invest $25, if you want to increase your earning power, but that choice is purely optional.

      You can condemn this message to the waste bin, but if you decide to do this, remember: in a few years time when [the company] is really big--you had the opportunity to be on board for no cost and you just couldn't be bothered.


      This is not Spam: This message is sent in compliance of the new email Bill HR 1910. Under Bill HR 1910 passed by the 106th US Congress on May 24, 1999, this message cannot be considered SPAM as long as we include the way to be removed.


      Having purchased a CD or CD package from DWE in the past, you are elegible for this special one time deal.

      MS Windows 98 SE - $20.00
      MS Windows 2000 Pro - $20.00
      MS Office 2000 Premium - $20.00
      MS Windows ME - $20.00
      
      [Since when has LG ever bought a CD? -Mike.]

      We are responding to your request for FREE analysis of your site. We feel there is very substantial potential to promote your site on the Internet. We have proprietary software and assortment of other Internet tools designed to make your site popular and bring traffic that is interested in your product area. This can put dollars in your pocket.

      [Oh dear, LG doesn't have enough readers! Never mind the mirrors in 50 countries we've attracted without an Internet consultant. -Mike.]

      International Aviation CD Database

      - 650,000 Aircraft Owners and Operators in 105 countries worldwide - includes telephone #'s and address corrections.

      - 54,000 Aviation Companies - Includes contacts, email addresses, website, phone, fax, much more.

      - 600,000 Pilots - Updated pilot list with phone #'s and address corrections.

      ALL ON ONE $259 CD-ROM.

      [Hmm, I guess this might be useful for something. -Mike.]

      This IPO company is reserving a portion of the shares offered for sale to individual investors and will not sell these shares to institutional investors. Shares will be sold on a first come first serve basis; you will not be bumped for a large investor! It is anticipated that the offering will close within the next 30 days. Any Subscription Agreement received after the deadline will be promptly returned. You need not purchase through a stockbroker and there are no commissions to be paid. Only a few investors have been chosen to invest in the IPO of a revolutionary company that may change the way real estate is sold.

      [So buying shares is now a "privilege"? -Mike.]

      Hello answerguy, Get Your Free Vacation Now. Go to the URL below an enter your email address and you are finished. THAT's IT. Enjoy you Free Vacation.

      [Why does Jim get all the free vacation offers? -Mike.]

      And the award for most ironic spam goes to...

      Are you still using an old operating system? Why not upgrade to a newer and more reliable version? You'll enjoy greater features and more stability.

      Microsoft DOS 6.22				$15
      Microsoft Windows 3.11				$15
      Microsoft Windows 95				$15
      Microsoft Windows 98 SE 			$20
      Microsoft Windows Millenium 			$20
      Microsoft Windows 2000 Pro 			$20
      Microsoft Windows 2000 Server			$50
      Microsoft Windows 2000 Advanced Server (25CAL)	$65
      
      [Oh, so DOS 6.22 is a "new" Operating System? I wonder what kind of "old" Operating System they expect somebody in 2001 to replace with DOS 6.22. -Mike.]

      Happy Linuxing!

      Michael Orr
      Editor, Linux Gazette, gazette@ssc.com


      Copyright © 2001, the Editors of Linux Gazette.
      Copying license http://www.linuxgazette.com/copying.html
      Published in Issue 64 of Linux Gazette, March 2001