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

Copyright © 1996-98 Specialized Systems Consultants, Inc.


Welcome to Linux Gazette!(tm)


Published by:

Linux Journal


Sponsored by:

InfoMagic

S.u.S.E.

Red Hat

Our sponsors make financial contributions toward the costs of publishing Linux Gazette. If you would like to become a sponsor of LG, e-mail us at sponsor@ssc.com.


Table of Contents
February 1998 Issue #25


The Answer Guy


The Weekend Mechanic will return.


TWDT 1 (text)
TWDT 2 (HTML)
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.


Got any great ideas for improvements! Send your comments, criticisms, suggestions and ideas.


This page written and maintained by the Editor of Linux Gazette, gazette@ssc.com

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


 The Mailbag!

Write the Gazette at gazette@ssc.com

Contents:


Help Wanted


 Date: Tue, 06 Jan 1998 17:09:31 +1000
From: Peter Scott webguru@planet-sex.com
Subject: Help - Adding third hard drive

I've been using Slackware Linux 2.0.29 for quite some time. I've managed with 2 drives with partitions for Win95 and Linux, but now I need to add another drive. It is recognised in the BIOS and can be found in Windoze, but I get no joy from Linux. I expected to be able to mount the drive straight away. Do I need to do some insnod or mke2fs or something.

    # mount /dev/hdc1 /mnt
    mount: the kernel does not recognize /dev/hdc1 as a block device
           (may# fdisk /dev/hdc

    # fdisk /dev/hdc
    Unable to open /dev/hdc
I've got a fealing that I need to reconfigure Lilo or something? I know that I've forgotten something obvious, but I've wasted hours without any joy.

thanx,
pete


 Date: Tue, 06 Jan 1998 19:55:08 +0000
From: George Russell george.russell@clara.net
Subject: Installing StarOffice 3.1 on Redhat 4.2

I'm having difficulties installing StarOffice onto my system. I've installed the rpms for static binaries, common files, english demos and english docs. I've run the setup script and done a user install, after updating libc and ld.so, and would like to now run the package. It says to install two daemons, svdaemon and svportmap . These both need something called rpc and the portmap daemon, which I can find no reference to on my system. How can I install these so that StarOffice will run. All help gratefully recieved.
--
George Richard Russell


 Date: Sat, 10 Jan 1998 05:55:26 -0600
From: ReXsOn RuLeZ abernal@theonramp.net
Subject: Question....

Hello there... sorry to bother with probably one of the stupidist questions in the world, but I want to install Linux on my computer; the problem is that I share a computer with my family and of course they don't have a clue of what I do so they don't care, they just want to be able to use office to do their work. I've looked around various Linux sites trying to find an answer but I've been unsuccesful. My question is this: As I told you I have a windows95 box and all the documents that

Are outthere focus on installing linux in a DOS environment which in my case and a lot of people it's history. I have a 3 gig hardrive that I think is partitioned already in 2 because I have a c: and d: I'm not sure if they're separate hardrives or one is partitioned. What I would like to know is what should I do here. I'm not sure if my second drive which is 1 gig is already formated for windows which I think it is because it has a recyble bin. I don't know what to do because I'm afraid that if I delete or erase the partition the whole thing will become one hardrive and I will have to erase everything to partition that one hardrive. I was kind of hoping there was a way or partitionin my second hardrive (d:) and leave a part for windows and another for Linux.

As I told you earlier I'm sorry to make this kind of questions but if I damage something of this computer my dad would prive me of even looking at it, and I don't want that to happen. I would really aprecciate your help since I'm really eagered to use Linux.

Thanx in advance for your help.

Rexson


 Date: Sat, 17 Jan 1998 20:39:14 -0400
From: Frank Nazario webmaster@prplaza.net
Subject: HI...

I've just finished browsing your Gazzettte and it is very cool...as a web administrator at http://www.prplaza.net I was fedup with the performance and slowness of an NT enviroment and decided kind of reluctant to migrate to Linux (right now i'm a green thumb at it)... But and a big BUT after seen a single processor pentium pro 200 server running linux redhat 5.0 and Apache Webserver blow the doors of a dual pentium pro 200 running on NT and IIS3.0...i was sold in the spot....never to touch Microsoft NT again ... and feeling good about it.

My problem is this one ... I've gone bananas in trying to find a document that explains how to install, in a step by step fashion, the Apache SSL "extensions" to one of my Apache WWW Webservers (the performance increase is awesome) can you or anyone that reads this help...

thanks beforehand for you response....

Frank Nazario San Juan, Puerto Rico


 Date: Sun, 18 Jan 1998 11:36:50 -0500
From: Michael Vore mvore@digex.net
Subject: Problems with CD-ROM

Admittedly I'm not sure where the problem lies, When using NT-4/Netscape Communicator-4 to view the cdrom all links look like "file:///El/lj/" Which of course will not be found. I have looked at the source to try to find why the double '//' and the '/El' come from. Any ideas? (and any work arounds??)

At the moment I don't have X running on my Linux machine - it's a new install of RedHat and during the upgrade I forgot to same the XConfig files.

mike


 Date: Mon, 19 Jan 1998 09:52:28 -0500 (EST)
From: Michael Stutz stutz@dsl.org
Subject: Help Wanted: SVGALIB Screenshots?

Is there any way to make a screenshot of a graphical program that runs on the console (_not_ in X)?


 Date: 21 Jan 98 11:28:04 -0500
From: Jonathan Smith SMITHJL@detroitedison.com
Subject: netcfg

I am using X to connect to my ISP via the netcfg command. I have it starting up at boot time. This works great, but I was wondering where the chat script and pppd command are hiding for the ppp interface that you can create via netcfg.

I was also wondering if there was a way to prevent my ISP from dropping me after a given time of activity. I am using a cron job to ping to my isp, but that does not seem to prevent this from happening. Should I try pinging to a server other than my ISP?

Thanks, Jonathan Smith.


 Date: Thu, 22 Jan 1998 02:38:11 -0800 (PST)
From: Jaume Vicent jvicent@yahoo.com
Subject: Sound Card MED3931

I'm a new Linux user (kernel 2.0.29). My sound card is a MED3931, with a chip OPTi 82c931.

As it is a PnP card, I use the isapnptools-1.9 package, loading the sound support as a module. I've tried configure it as a MAD16 or MSS (Microsoft Sound System) but it hasn't worked in any way.

I don't know if the problem is with the IRQ/DMA/IO settings (I use the same ones as with Windows 95) that I set in the /etc/isapnp.conf file, or it is that the sound driver (OSS/Free) just doesn't support this card.

Can you help? Thank you.


 Date: Thu, 22 Jan 1998 22:51:09 +0200
From: Asaf Wiener wasaf@writeme.com
Subject: from were can i download (for free) LINUX?

I have an inter pentium, and I would like to install LINUX in my computer. But, I don't know from were can i download the installation files (for free), I heard that LINUX is a free softwere, but i don't find a site that i can download for free LINUX. Please help me to find such a site (and also some install instractions).

Thank you,
Asaf wiener

Look on the Linux Resources page to find pointers to everything you need, http://www.linuxresources.com/ --Editor


 Date: Fri, 23 Jan 1998 14:59:00 +1100
From: Peter Lee peterl@localgov.wacher.com.au
Subject: POP3d Problem

I am having problem connecting to the POP3 Server in Linux. This problem only arise when a new email arrives or there are mails in my mailbox If I delete all my mails I can connect to the POP3 Server. Error message I get is:

ERR - being read already /usr/spool/mail/

I have removed the account and recreated it again. Still problem occurs. And I know I am the only one logged on. The only way I can read my mails is manually telneting to the Linux and use either pine or mail from the unix command

Any Suggestions ?

PETER LEE


 Date: Fri, 23 Jan 1998 13:02:25 -0003
From: RAFAGUI@if.ufrgs.br
Subject: Printing postcript ...

I really want to print some using postscript form but I can't ... So, I have read a lot of docs and unfortunately when I try to print some I just got the postscript language.

I tried configure the 'printcap' and so on but. My printer is a CANON 4200 Bj and I am running Slackware 96 Linux Version.

Oh: I just gave a look at the RedHat 5.0 comments and seems it make easier. I am thinking about purchase it.

Thanks a lot. I would appreciate a reply.

Regards,

Rafael.


 Date: Sat, 24 Jan 1998 08:09:51 -0500 (EST)
From: Casimer P. Zakrzewski zak@acadia.net
Subject: IBM 8514 monitor

Hi. I'm new to Linux, and my problem is installing my monitor, an IBM 8514, for use with X-Window. I use an S3 Virge 86C325 accelerator card.

After installing Red Hat 4.2, the monitor works fine for command line, but when I try using it for X-Window, the screen shrivels up to something less than a 3x5 recipe card! I've tried reconfiguring different combinations of color depths and screen resolutions, and have come up with everything from a blank screen to 'your worst nightmare'.

I'm stumped. I've tried the different FAQ sites, but can't find one that can give me a hint of how to configure this monitor for use with X-Window. I'd appreciate any help anyone can give me. I had to resort to installing Win95 and IE (which work for this monitor/card) just to send this out. Thanks in advance for any help I can get.

Zak


 Date: Sun, 25 Jan 1998 11:06:17 -0800
From: Apple Annie annel@cdsnet.net
Subject: Re: Remote address on Chat sites

I am not a very literate person on the internet, so many of the vernaculars used are over my head. However, am having a problem of people "killing" me when they wish to , on Java Chat room. I would like to be able to eliminate my Remote number coming up with my user name . Is there a simple way of doing this? I do not desire these people to locate my server & other information. Thanks for your response, if you can give me help. If not, then thank you anyhow.

Sincerely yours,

Anne L


 Date: 27 Jan 98 13:18:56
From: dennis.j.smith dennis.j.smith@ArthurAndersen.com
Subject: Linux and VAX 3400 and 3300

I have just purchased a MicroVAX 3400 and 3300. I would like to put Linux on these two systems. Can you provide any help in this aspect.

Dennis


 Date: Wed, 28 Jan 98 15:54:55 MST
From: Antony Ware aware@acs.ucalgary.ca
Subject: Linux and Children

I've been hunting around for linux software for toddlers. My eldest (3) has had fun with xpaint, and he likes to "type", but there's a lot more going on at his level on my DOS partition. (:-(

So far, my searches in the linux world have turned up...nothing. Does anyone know of anything out there?

Cheers,

Tony Ware


General Mail


 Date: Mon, 5 Jan 1998 12:14:09 PST
From: Marty Leisner leisner@sdsp.mc.xerox.com
Subject: I don't like long articles

Glen Fowler's article comparing NT and linux processes is too long for the gazette (IMHO) and didn't print out good from netscape...

HTML is not the best media for everything, maybe the gazette should have an abstract and a URL for a postscript or tex master.

marty


 Date: Tue, 06 Jan 1998 11:07:06 +0100
From: Trond Eivind Glomsrød teg@pvv.ntnu.no
Subject: Linux and routing

In the January issue, you ask for readers to write an article on how to connect a LAN via just 1 IP address...

That is rather unnecesarry - there is a mini-HOWTO on it, called "IP Masquerade mini-HOWTO". Available from your favorite LDP mirror.

Trond Eivind Glomsrød


 Date: Tue, 13 Jan 1998 22:26:57 -0600
From: chris rennert lavithan@execpc.com
Subject: Rookie

Hello I am a newbie to Linux and I am very excited that I stumbled across the Linux Gazette.. I have been wanting to put up a home LAN with 2 pc's for some time ... and the article on SAMBA has put me on the right track. I am a computer science student here in Wisconsin and I love using linux. I will keep reading .. I just hope that you keep printing.. Thanks again and I hope I can contribute in the future to this great Mag.

Chris Rennert


 Date: Sat, 17 Jan 1998 01:32:06 -0700
From: Sean Horan sean@olam.ed.asu.edu
Subject: Server uptime

I'm sending this maybe as news, perhaps Linux stability and advocacy.

I heard that the record for keeping up a Linux server up continuously without reboot is six months. Here's the output from executing 'w' on our Linux 1.2.8 system.

1:48am  up 274 days, 17:05,  1 user,  load average: 1.09, 1.02, 1.00
User     tty      from             login@  idle   JCPU   PCPU  what
sean     ttyp1    sss2-01.inre.as  1:46am                      w
274 days, 24 hours a day. Never restarted. How common is this?

Let us know
--Sean


 Date: Sun, 25 Jan 1998 15:04:35 -0800
From: Sean Russell ser@javalab.uoregon.edu
Subject: Linux security

I'm not intending to kick of a debate of the merits of PAM, but I have a couple of comments and a question.

The question is, has anybody, commercial or freeware, started coding an MVS-like security system for Linux? Specifically, I'm interested in the fine granularity of access controls, the ability to deal with more than just file accesses, user configurable ACLs, and most importantly, security at the kernel level. One thing I find most distasteful about PAM is the fact that applications have to be PAM aware to make use of PAM's abilities. MVS security, on the other hand, is soft-linked into the IO layer of the kernel, and /all/ applications use that security model without knowing anything about it.

Anyone who has any comments on this, information, or leads, please email me.

Thanks!

--- SER


Published in Linux Gazette Issue 25, February 1998


[ TABLE OF 
CONTENTS ] [ FRONT 
PAGE ]  Next

This page written and maintained by the Editor of Linux Gazette, gazette@ssc.com
Copyright © 1998 Specialized Systems Consultants, Inc.

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


More 2¢ Tips!


Send Linux Tips and Tricks to gazette@ssc.com


Contents:


Linux - 2 Cents about vim for pico users

Date: Mon, 5 Jan 1998 23:07:20 +0100
From: Sven Guckes guckes@math.fu-berlin.de

I just read the "2 cent tips" again and I thought you might enjoy this tip:

Several people enjoy the editor "pico" but do not feel comfortable with an editor like "vim" for several reasons - one of these being that it is so easy to do reformat the current paragraph with ^J (control-j) within pico while it is so "difficult" within Vim. Well, all it takes is two mappings for Vim:

	nmap <C-J> vipgq
	nmap <C-J>    gq
Put these mappings into your setup file (on Unix and esp Linux this is ~/.vimrc) and you can use ^J to reformat the current paragraph or the currently highlighted text (use 'V' and some movement commands to do that, for example).

More tips can be obtained from these Pages:

	http://www.vim.org/		Vim Home Page
	http://www.vim.org/faq/		Vim FAQ
	http://www.vim.org/answ.html	Vim Answers Page
					(for everything not yet in the VIM FAQ)
	http://www.vim.org/rc		Sven's Huge Setup File with comments
And for those people who use "some vi" but never got the hang of it - here is a page about "why" you would want to use a vi clone such as Vim:
	http://www.vim.org/why.html
Enjoy!

Sven


My 1/50th of a Dollar

Date: Wed, 07 Jan 1998 01:27:09 +0000
From: Michael Katz-Hyman mkatshym@erols.com

Here is a small shell script I wrote to blink the scroll lock on my keyboard when new mail arrived.

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

#!/bin/bash
#
# Keyboard blinky thingy when you have new mail, sleeps 5 minutes if you
don't
#
# Michael Katz-Hyman (mkatshym@erols.com) running Linux 2.0.33 Red Hat
4.0

Mail_File = "/var/spool/mail/mkatshym"

# The static file is used to make the script a daemon (I just test to
see if  /bin/bash is present :- )

Static_File="/bin/bash"

LED_SET_COMMAND_ON = "/usr/bin/setleds +scroll"

LED_SET_COMMAND_OFF = "/usr/bin/setleds -scroll"

Sleep_Command = "/bin/sleep 2m"


# O.k. lets get started

while [ -e $Static_File ]; do
        while [ -s  $Mail_File ]; do

                $LED_SET_COMMAND_ON
                $LED_SET_COMMAND_OFF
        done

        if [ ! -sMail_FIle ]; then

                  /bin/sleep 5m
        fi
done
------------------------------------------------------------------

Michael Katz-Hyman


sound problems

Date: Wed, 7 Jan 1998 09:48:10 -0600 (CST)
From: Mike Hammel mhammel@stassw10

> Have installed RedHat 5.0 and configured the sound card using sndconfig.
> All went well and I heard the demo sound bite of Linus. However, I
> have never heard another sound since. When browsing web sites with sound,
> no audio is played. Anyone have any ideas? 
First, cat an audio file to the audio device: cat file > /dev/audio. If you get sound out then the device is fine. The problem is probably that you haven't configured your browser to play the audio. With Netscape you would use the Preferences->Navigator->Applications option. You'll need to configure the various audio types to be played using whatever tool you choose (I don't play much audio, so don't have anything configured in my browser to do so). The cat command will work with .au files, and maybe .wav (I think), but possibly not with others. You might want to look at the Linux Application and Utilities Page or the Linux Midi and Sound Page for hints on getting applications for playing sound files. Both of these have links on the Software Resources page at the Linux Journal: http://www.linuxresources.com/apps.html.

Hope this helps a little.

Michael J. Hammel


Filtering output of binary files

Date: Wed, 7 Jan 1998 14:56:05 -0500
From: Sylvain Falardeau sfalardeau@clic.net

When you do a cat/grep/etc. of binary files on a tty, the terminal may become unusable because of some control character.

Guido Socher (eedgus@aken104.eed.ericsson.se) suggests a

sed -e 's/[^ -~][^ -~]*/ /g'

to filter unprintable characters. You can simply use a

cat -v

and all the control characters are escaped to be printable. It's very useful when you are "cating" files and don't know if they contains control characters.


Easter Eggs in Netscape

Date: Thu, 8 Jan 1998 11:53:51 +0000 (GMT)
From: Caolan McNamara caolan@skynet.csn.ul.ie

* From: Ivan Griffin ivan.griffin@ul.ie
*
* These special URLs do interesting things in Netscape Navigator and Communicator.
*
* about:cache gives details on your cache
* about:global gives details about global history
* about:memory-cache
* about:image-cache
* about:document
* about:hype
* about:plugins
* about:editfilenew
*
* view-source:URL opens source window of the URL
*
* Ctrl-Alt-F take you to an interesting site :-)
At least some of the netscape developers have an about for themselves, e.g about:kahern.

C.


RE: Perl and HTML

Date: Thu, 08 Jan 1998 16:58:44 +0000
From: Carl Mark Windsor mbdtscw@cerberus.mcc.ac.uk

In reply to Gabriele Giansante (gvgsoft@madnet.it), whose return mail address does not seem to work.

--------------------------------------------------------------
Gabriele,

The #!/usr/local/bin/perl line is what is used to indicate that this is a perl script, but netscape is not clever enough to know this, it has to be told.

Go to Options / General Preferences / Helpers and edit (if it exists) or create (if it doesn't) the following configuration

Description:  Perl Script
Type:         application/perl
Suffix:       pl
Tick the Application box and put the path
Application:  /usr/sbin/perl   <-----(or the path to your perl)
Sorry if you have heard this all before!

Carl


Update locate

Date: Sat, 10 Jan 1998 19:16:31 +0000
From: Joaquim Baptista px@helios.si.fct.unl.pt

Both Redhat and Slackware (not sure about Debian) install the package updatedb. This package has two programs:

- "updatedb" scans the filesystem and generates a database of existing files.
  This is run every night as root.
- "locate" is run by users to quickly locate files on the filesystem,
  using the database generated by updatedb.
My problem is that "updatedb" runs at 4:40 in the morning, and my machine is rarely running at 4:40. Thus the database is never updated and "locate" never finds any recent file.

The solution is not very simple: updating the database hits the disk hard and takes some time; it is hardly a task to be performed every hour.

My solution is to run a script every hour that updates the database only if it is more than 24 hours old. I (ab)used find to do the task.

Here is the script "run-updatedb":

#!/bin/sh
/usr/bin/find /var/spool/locate/locatedb -mtime +1 -exec \
    /usr/bin/updatedb \
    --prunepaths='/tmp /usr/tmp /var/tmp /mnt /cdrom /floppy /var/spool' \;
I also had to change the crontab for root: I commented the old line that runs updatedb at 4:40, and added a line that runs my script every hour:
0 * * * *   /usr/local/sbin/run-updatedb 1> /dev/null 2> /dev/null
One final note: I believe that both Redhat and Debian have "super-crontabs." That means that you must fish around in /etc (/etc/cron?) for extra crontab files (long live Slackware!).

Best regards,
Joaquim Baptista, alias pxQuim


Doing spaces in file names

Date: Tue, 13 Jan 1998 18:16:48 -0800 (PST)
From: Mark Lundeberg ae885@pgfn.bc.ca

If you think Win95/NT filenames are better than Linux ones, think again. In bash, (this may work in csh, but I never use it) use quotes to enclose the filename in the parameters of a program:

echo "test" > "spaced name"

and do an ls, and you see a space in the middle of the filename! This can be used for confusing people, by going:

echo "Hi" > "test "

(notice the space at the end of "test ").

Then, someone tries to open the file "test" as it looks from ls, but all it does is open a new file.

PS: The ext2 filesystem allows names of up to 255 chars long, just like Loseows 95.

Go Linux!


Mailing binary files to Microsoft clients

Date: Fri, 16 Jan 1998 12:37:22 +0000 (GMT)
From: Ivan Griffin ivan.griffin@ul.ie

Mailing binary files to Microsoft clients...

Quite often I receive a mail with an attachment in that weird Microsoft format which is not quite MIME. It's easy for a Unix client to decode such attachments -- save the message as a file, and run uudecode or the excellent freeware uudeview on it.

However, sending a mail message to such a Microsoft mail user is a little different -- you cannot send them a standard MIME message (unless they are using Exchange I believe). I have found the following script useful in such situations.

Say, for example, I wanted to send a file foo.gif to user mike. I would run my script as follows:

msmail_encode foo.gif > mail_message

Then I would read the mail message into the body of the message I wanted to send. This script could easily be improved to include automatic mailing, and editing of the mail message proper.

#!/bin/sh
echo "[[ $1 : 2628 in $1 ]]"
echo ""
echo " Microsoft document attached. "
echo ""
echo " Regards, "
echo " Ivan."
echo ""
echo "The following binary file has been uuencoded to ensure successful"
echo "transmission.  Use UUDECODE to extract."
echo
cat $1 | uuencode $1  

By the way, I have no idea what the 2628 above refers to. It is a number generated somehow by Microsoft mail clients, but they don't seem to need it, so the 2628 is a value I received once in a mail message.

Regards,
Ivan.


Linux and Routing

Date: Sat, 17 Jan 1998 11:02:43 -0800
From: James C. Carr jccarr@nwlink.com

I am not sure if you have already received a reply regarding your question on routing a LAN to the 'net, so I thought I'd go ahead and give it a shot. The CC to Linux Gazette is just in case no one else has sent in a more elaborate reply. ;) Also, this is something that was mentioned back in Linux Journal number 43 ( November 1997 ), so most of this stems from that particular article, "IP Masquerading Code Follow-UP". To avoid re-hashing someone else's wonderful article, I'll just skim over what I use here at my own home.

======================================================================
Linux and Routing with ipfwadm
======================================================================

Getting Linux to route information between a LAN and the 'net will require you to re-compile the kernel with IP Masquerading support. Of course, one could also use firewalls and disable the routing, but I don't have experience with that just yet. If your kernel version is < 2.0.30, you'll need to enable the "Code Maturity Level" option at re-compilation -- this gives you access to the other Network Options in the kernel, such as IP Masquerading support.

After installing the new kernel, obtain and install the ipfwadm program; this usually comes installed on a base Debian 1.3.1 system, and is easily obtainable for Red Hat. Executing ipfwadm from my end includes the following commands:

	/sbin/ipfwadm -F -p deny
This portion breaks down as follows:

-F -- Notify ipfwadm that you're modifying the IP forwarding rules.
-p -- Tell ipfwadm that you want to deny the forwarding of incoming packets.

I've experienced certain web pages that will not open with this option set; it's probably some Microsoftian plot, you know. ;)

	/sbin/ipfwadm -F -a m -S 192.168.0.0/24 -D 0.0.0.0/0
-F is the same as above.
-a -- Append the following rule to the list, in this case, we're (m) masquerading the following rule.
-S -- We're going to masquerade the computers in the 192.168.0.* address range. Since this is a "local" set of IP numbers, it'll work with all computers on the LAN with these IP addresses.
-D -- The forwarding destination will be 0.0.0.0, the equivalent of the gateway address on a PPP defaultroute.
	/sbin/ipfwadm -F -l -n
Let's make sure this thing is up and running.

-l -- List all IP # forwarding rules;
-n -- convert the information to numeric format.

Of course, you'll need to have assigned your computers with IP addresses within the 192.168.0.* range to use the exact commands above. On my own setup, the primary computer gets 192.168.0.1, and the others fall in succession. Be sure to have all the computers that are being masqueraded set their gateway address to the primary, e.g. secondary.my.com (192.168.0.2) uses primary.my.com (192.168.0.1) as its gateway to the 'net.

For a far more in-depth article regarding this type of set-up, I do suggest reading Chris Kostick's article "IP Masquerading Code Follow-up" in the November 1997 issue of Linux Journal. Not only does it cover the basics, but the author also explains a few more subtle aspects to ipfwadm. Besides, without the help of this article, I wouldn't even know the small amount about ipfwadm that I do. :)

======================================================================

I hope this helped at least a little,

-- James


Linux and Routing 2

Date: Tue, 6 Jan 1998 13:25:57 -0500 (EST)
From: Paul Lussier, plussier@LanCity.COM

> I plan on getting a cable modem soon, so the bandwidth would be pretty
> high, so that is why I have decided to try to make this connection
> provide for my whole house via a LAN connection in my home. What I
> have read is that you could use the private IPs, meaning the 10.x.x.x
> or so, 192.168.x.x and some others for the IP of the LAN and have
> these connect to some box (the LINUX box?) that would provide its
> connection to the internet to the inside LAN connected to the box. Is
> the problem that you would have to route the assigned address to the
> private IPs for the LAN use. I have also read that this would slow
> down the connection a bit or something, but that is a price I am
> willing to pay. So, the summary of the question is how would I be able
> to connect many computers to the internet via just 1 assigned IP
> address? I would like to be able to do it using my LINUX box connected
> to the internet via cable modem, and to my LAN via an Ethernet
> link. Any help is much appreciated, thanks.

This caught my attention, especially since I'm the Unix admin for Baynetworks Broadband Technology Division (formerly LANcity) and we pretty much invented this technology, along with being the leader in the Cable modem industry :) Now that I've got the plug in for company I'll get down to your problem :)

I first must admit that 1.) I don't own a cable modem (I can't get cable, long story :( and 2.) I don't do any routing of this nature. But I have read a lot about it, and I do work with cable modems, so I think I can help a little :)

The first thing to understand is that with Linux, you don't want to be routing, and definitely do not want to run routed to do what you want to accomplish. Rather, you want to be doing IP forwarding/IP masquerading which you would enable in the kernel by re-configuring/re-compiling a new kernel. You'll definitely want to scour the HOWTOs, I believe there is one on this subject. In addition, you may want to check out the Linux Network and/or Systems Administrator's guides, as they too, probably have some good infomation in them. Other good references may be:

The Firewalling and Proxy Server HOWTO is probably the best bet, now that I look, since what you really want to do is set up firewall to prevent people from coming in, and a proxy server to allow your internal lan to get out.

Some words of caution. DO NOT HAVE YOUR LAN CONNECTED AT THE TIME OF THE CABLE MODEM INSTALLATION!!!! MediaOne, Cablevision, Time Warner, and most of the other cable companies (we deal with them all here) will refuse to connect a LAN to their broadband network. Simply remove your hub or coax cable from view, and let them do what they need to do, then connect everything else up after they leave. =20

You will need 2 Ethernet NICs in the system which will be connected to the broadband, one for the cable modem and one for the internal LAN.. Most cable companies will gladly provide and install one for you (MediaOne charges $120 for a 3C509 + labor). I recommend telling them you have a NIC, and going out and buying one and installing it yourself.

The cable modem, in reality, is NOT a modem. It's an Ethernet Bridge. When the modem^H^H^H^H^Hbridge boots/powers up it does a bootp request to a server at the cable companies central office to obtain an IP address. The NIC is also assigned an IP address, which (at least with MediaOne) is registered to the MAC address on the NIC (MediaOne doesn't want you to move the modem to another computer after they leave. They apparently check the modems from time to time to see what MAC they're connected to). Therefore, you want your proxy server/firewall configured so that it prevents all incoming connections from the cable modem and allows only outgoing connections. You want the IP forwarding/masquerading set up to allow other systems on your private lan to use the proxy server as a proxy server (I'm not sure if using the term gateway here is correct).

Some other interesting tidbits of information about cable modems and cable companies:

  1. Do not expect support for running a LAN over the cable modem from the cable company. They don't want you to do it, they won't help you do it.
  2. Do not expect to put up a web server to be accessed by from the internet. You are a client, not a server. This technology,though fully capable of performing in this manner, is not being deployed for use this way. Cable companies WILL shut you down for running a server of anykind on your end of the network, and it can be *forever* :(
  3. Spammers love cable/broadband networks. There have been several cases where a broadband network customer has been used by spammers and were subsequently shutdown for life by the cable company. What happens is the person decides to connect their private LAN to the cable modem but sets the firewall up incorrectly. Spammers search cable/broadband networks for proxy servers/firewalls (Usually Win95/NT) that allow incoming connections and then use that system to spam the entire cable/broadband network making the spam appear as if you sent it. Usually you will be given 1 warning by the cable company, but there have been cases where none was given and the customer was completely shut down.
  4. The current BayNetworks LANcity modems (the LCp product) being deployed in homes is limited to 1 MAC address connection (which means you can't plug the modem into a repeater/mini-hub in order to connectit to multiple systems). It is sotfware upgradable to 16 MACs, but you'll pay a fortune for it to the cable company. However, an ethernet switch works wonders :)
  5. Current modems are capable of transmitting at 10Mbs in both directions, but are usually deployed throttled back to a trasmit speed of 300Kbs and a recieve speed of 1.5Mbs. You want more bandwidth, they'll be happy to charge you more money :)
I hope this helps a little bit. Feel free to e-mail me if you have any questions.

Seeya, Paul


Netscape's Abouts

Date: Tue, 20 Jan 1998 16:00:46 +0100
From: "Stefan K." kampi@physik3.gwdg.de

I've read the article about the about's of Netscape... Here's some more (some of them may not work or simply do nothing)

about:montulli
about:nihongo
about:francais
about:plugins
about:document
about:license
about:cache
about:global
about:image-cache
about:memory-cache
about:security
about:hype
about:blank
about:mozilla
about:security?subject-logo=
about:security?
about:security?banner-mixed
about:security?banner-insecure
about:security?banner-secure
about:security?banner-payment
mocha:
javascript:
livescript:
view-source:
about:FeCoNtExT=123

PEACE!
kampi


Netscape on the Desktop

Date: Sat, 24 Jan 1998 06:46:22 -0500
From: Tim Hawes tim@donet.com

I do a lot of my web development work at home on my Linux box. Netscape for Linux does not automatically check for an existing Netscape session. As a result, if you try to run two different Netscape sessions, you will get an error message box with something like the following:

        Netscape has detected a /home/thawes/.netscape/lock
        file.

        This may indecate that another user is running
        Netscape using your /home/thawes/.netscape files.
        It appears to be running on host localhost under process-ID 316.

        You may continue to use Netscape, but you will
        be unable to use the disk cache, global history,
        or your personal ceritificates.
Blah, blah, blah.

If you are like me, and like to have links to URL's using Netscape on your menus, FVWM GoodStuff or desktop icons, this can be a real nuisance, having to completely start a new Netscape session each time. Or you can have them link with this:

netscape -remote 'openURL(your.url)

But then none of your links will work if Netscape is not currently running. This shell script will look for the lock file that Netscape creates when it is started. If it does not find the lock file, it will start a fresh Netscape session. If it does find it, it will send a netscape -remote command to your current session with the URL you provide in the argument. If you do not provide a URL, netscape will simply give you a popup message indicating that you did not specify a URL. If you do not want Netscape to start up a new window for the URL, just get rid of the "new-window" in the argument in the shell script.

#!/bin/sh
if [ -L $HOME/.netscape/lock ]
        then exec /usr/local/netscape/netscape -remote
'openURL('$*',new-window)';
        else exec /usr/local/netscape/netscape $*;
fi
exit 0
There are limitations with this script. First of all, if Netscape did not exit cleanly after the last session, then the lock file will still be present in your ~/.netscape directory. The script will then try to execute a netscape -remote command and will error out with the console message that Netscape is not running on :0.0. If you are not redirecting your console messages anywhere, then you will not see anything except Netscape not-starting.

1. Do a ps to see if there are any zombie processes left over from your last netscape session.
2. Kill all zombie processes
3. $ rm ~/.netscape/lock
4. retry

I am sure there is a way to automate this through a shell script as well, but I have not yet any time nor motivation to write it. Some other shortcomings include trying to start Netscape composer with the -remote argument for a currently running netscape session. But then this is probably why you should never name a shell script after the actual binary it attempts to start.

All in all, if you envy the functionality of Netscape on Windows 95, automatically checking for an existing netscape session to send the browser surfing, and starting a new session if it does not find it, well, here is a simple solution for Linux users, using the power of the shell.

Tim Hawes


Re: Printing Problems

Date: Sat, 31 Jan 1998 20:09:18 +0100 (MET)
From: Roland Smith, rsmith06@ibm.net

>Anyone that can help me. I'd love to hear it. I try running
>lpr, but everytime I get no name for local machine.
>How do I set this and/or what is the problem.
>Manish Oberoi

It sounds like you're using LPRng. This is a new version of lpr that's more suitable for networks. It is included in the newer Slackware releases and maybe others.

My solution was to grab the bsdlpr.tgz package from ftp.cdrom.com and use that (This is meant for Slackware). Otherwise you can search the Net for "bsdlpr".

-- Roland


Re: Using a 386 Computer

Date: Sat, 31 Jan 1998 20:13:09 +0100 (MET)
From: Roland Smith, rsmith06@ibm.net

>I used to have a 386 25 MHz computer. Not long time ago I bought a
>Pentium 200 MHz computer. Since then I have not played with 386.
>Is there any easy and economical way to connect the 386 to the
>Pentinum computer where I will install the Release 5.0. If so,
>what I can do with it or at lease what I can learn from it.

If you connect both machines with a parallel cable, and configure PLIP into the kernel on both machines, you can have your own little network. A 386 should at least work nice as a terminal, even if it might not run X :-)

-- Roland


Published in Linux Gazette Issue 25, February 1998


[ TABLE OF 
CONTENTS ] [ FRONT PAGE ]  Back  Next


This page maintained by the Editor of Linux Gazette, gazette@ssc.com
Copyright © 1998 Specialized Systems Consultants, Inc.

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


News Bytes

Contents:


News in General


 March Linux Journal

The March issue of Linux Journal will be hitting the newsstands this week. The focus of this issue is Graphical User Interfaces with articles on XView, GTK+, X-Designer and CDE. Check out the Table of Contents.


 Netscape Announces Plans To Make Source Code Free

January 22, 1998

Netscape Communications Corporation today announced bold plans to make the source code for the next generation of its highly popular Netscape Communicator client software available for free licensing on the Internet. The company plans to post the source code beginning with the first Netscape Communicator 5.0 developer release, expected by the end of the first quarter of 1998.

Netscape is releasing its currently available Netscape Navigator and Communicator Standard Edition 4.0 software products immediately free for all users.

In addition, the company separately announced the launch of an aggressive new software distribution program called "Unlimited Distribution" to broadly distribute its market-leading Internet client software for free. Unlimited Distribution enables Original Equipment Manufacturers (OEMs), Internet Service Providers (ISPs), telecommunications companies, Web content providers, publishers and software developers to download and redistribute Netscape Communicator and Netscape Navigator easily with "no strings attached."

To read and post reactions about this latest announcement, Linux Journal has added a discussion group to our pages.


 Linux in the News

Eric Raymond's article "The Cathedral and the Bazaar" evidently made the rounds at Netscape and helped convince them that giving away Navigator source code was a good idea. If you've never read it, now is a good time.

Check out the article by Barton Crockett on msnbc: A Titanic Challenge to Microsoft

The February issue of Dr. Dobb's Journal has an interview with Larry Wall, the creator of Perl.


 The SEUL Project

The SEUL (Simple End-User Linux) Project is an organization dedicated to developing a free Linux distribution that presents a viable alternative to commercial PC operating systems. Currently based on Red Hat Linux, the SEUL distribution will cover many different aspects of Linux.

For more information:
Roger Dingledine, seul@seul.org
http://www.seul.org/


 The Linux Clothing Project

Check out http://genocide.adept.co.za/lcp/ to have your questions answered.

We're planning another t-shirt, with ordering opening on the 1st of February, 1998. All the info is on the page.

For more information:
Albert Strasheim, UUNET Internet Africa, fullung@ilink.nis.za


 Stampede Linux Logo Contest!

Along with the highly anticipated release of Stampede Linux 0.55 (heber), the developers felt it time to have an official logo. The developers also felt that they should look elsewhere for development of said logo. This contest is a result of the looking elsewhere bit. (Yes, prizes are part of this contest =]).

For more Information:
Matt Wood, Stampede Linux Head Developer, skibum@beer.stampede.org
http://www.stampede.org/


 12th SYSTEMS ADMINISTRATION CONFERENCE (LISA '98)

December 6-11, 1998
Boston, Massachusetts

The LISA '98 program is put together by a volunteer committee of experienced systems administrators. The Program Committee welcomes your submission. The Call for Participation is now available at http://www.usenix.org/events/lisa98/

Sponsored by USENIX, The Advanced Computing Systems Association Co-Sponsored by SAGE, the System Administrators Guild


 Japanese Word Processor

Perhaps you'd like to work on another exciting project? There is a Windows application, called JWP -- a Japanese Word Processor. This package was written by Stephen Chung, and as a GNU product it is freely distributable. I've used it extensively over the past few years, and it is a *great* package.

Unfortunately, JWP is only available for Windows right now, which is locking out a lot of people under other platforms who might benefit from it. As Stephen is quite busy with full-time work and maintaining the Windows versions (he's developing version 2.00 now), Steve Frampton has decided to go ahead with a port to X-Windows.

The JWP-Port Project home page contains more information on the JWP package as well as the JWP-Port project itself. If you are interested, please visit the page at http://qlink.queensu.ca/~3srf/jwp-port/.

For more information:
Steve Frampton, 3srf@qlink.queensu.ca


 A 3D CAD Application for Linux Project

FreeDesigner is intended to be a fully extendable Computer Aided Design and Drafting (CAD) application for Linux and other Unix type operating systems. Initially K Desktop Environment and GNOME/GTK frontends will be investigated, although it will be written as "toolkit inspecific" as is possible, by utilizing a GUI abstraction layer in FreeDesigner Core.

For more information:
Fleming, Petersen & Associates, http://www.fpa-engineers.com/OD/


 Artificial Intelligence

Interested in Artificial Intelligence, Eveolutionary Computing, Connectionism, Artificial Life, and/or Software Agents? Want to find out what software is available for Linux in these areas? Or are you just curious?

If so, check out my Linux AI/Alife mini-HOWTO at: http://www.ai.uga.edu/~jae/ai.html

For more information:
John A. Eikenberry, jae@bob.coe.uga.edu


 Digital Domain and Red Hat Linux

Digital Domain used Red Hat Linux not only for special effects in the movie Titanic but also in commercials that debuted during this Superbowl. Here's Red Hat's press release.


Software Announcements


 eVote 2.2

Date: Wed, 28 Jan 1998

eVote image
eVote is a freely available add-on to email list-servers that gives the members of the list the ability to poll each other. After installation of the software, the administrator is not involved. All participants have the power to open polls, vote, change their votes and view each other's votes if the particular poll was so configured. The underlying specialized data-server, The Clerk, is also freely available for Linux systems only. eVote 2.2 is available in both English and French.

For more information:
Marilyn Davis, mdavis@deliberate.com, http://www.Deliberate.com/


 FunktrackerGOLD 1.1

FunktrackerGOLD 1.1 has been released. FunktrackerGOLD is a module editor for Linux that allows you to compose digital music (similar to Fasttracker, Impulsetracker etc for those who are familar with them).

For more information:
Jason Nunn, jsno@dayworld.net.au
http://www.downunder.net.au/~jsno/proj/unix_projects/


 Quikscript

Quikscript is a PostScript text formatting and typesetting program. It enables documents to be prepared on any type of hardware, using visible layout marks to control the appearance of the output, and produce output on a PostScript printer by despatching Qs and the document file to the device. No processing is performed by the host hardware; all processing is done within the printer.

The advantage that Quikscript provides, other than portability, is precision of control over output. Because it is written in PostScript, it is interpreted at run-time within the printer. It is possible to create documents that modify the Quikscript program during execution. It is very easy to include other PostScript programs or fragments with Quikscript. It is possible to use special PostScript fonts, such as hand-generated ones. Graphics generated from a variety of sources can be easily included, as can text output from computer programs. It is possible to embed Quikscript within a document, such as an advertisement or a telephone bill.

The Quikscript distribution is available by anonymous ftp from "ftp.adfa.oz.au" in the directory "pub/postscript". It may also be accessed through the World Wide Web at URL http://www.cs.adfa.oz.au/~gfreeman/

For more information:
Graham Freeman, g-freeman@adfa.oz.au


 YP-Tools & YP-Server

Version 1.4 of the YP (NIS version 2) tools for Linux has been released. This package contains ypcat, ypmatch, ypset, ypwhich and yppasswd. You need this package for GNU C Library 2.x and Linux libc 5.4.21, but you should use libc 5.4.36 or later due some NIS bugs in libc. It replaces the old yp-clients 2.2 on this systems.

You could get the latest version from: http://www-vt.uni-paderborn.de/~kukuk/linux/nis.html

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

Version 1.2.7 of an YP (NIS version 2) Server for Linux has been released. It also runs under SunOS 4.1.x, Solaris 2.4 - 2.6, AIX, HP-UX, IRIX, Ultrix and OSF1 (alpha).

The programs are needed to turn your workstation in a NIS server. It contains ypserv, ypxfr, rpc.ypxfrd, rpc.yppasswdd, yppush, ypinit, revnetgroup, makedbm and /var/yp/Makefile. This is NOT an NIS+ (NIS version 3) Server ! ypserv 1.2.7 is available under the GNU General Public License.

You could get the latest version from: http://www-vt.uni-paderborn.de/~kukuk/linux/nis.html

For more information:
Thorsten Kukuk, kukuk@vt.uni-paderborn.de


 Motif 2.1 for Linux

The latest and best release of Motif (version 2.1) is now available for the best operating system! Linked against both glibc (yes, it DOES work with RedHat 5) and libc (ie it works with Debian, Caldera, RedHat 4.0).

For more information:
LSL, http://www.lsl.com/, motif@lsl.com
NC Laboratories, http://www.nc-labs.com, sales@nc-labs.com


 NetTracker

NetTracker is one of the most powerful, yet easy to use Internet and Intranet usage tracking programs on the market today. NetTracker allows marketing professionals, webmasters and ISPs to get the essential information they need to make informed decisions regarding their web sites.

A demonstration of NetTracker can be seen at [http://www.sane.com/demo/], and a free 30 day evaluation copy can be downloaded from [http://www.sane.com/eval/].

For more information:
Sane Solutions, info@sane.com


 SCEPTRE-90

SCEPTRE-90 a program for the analysis and simulation of electrical nonlinear networks and dynamic systems is now available for Linux users (free of charge). The ftp site, where the program can be found is: novilux.fh-friedberg.de/pub/sceptre_linux.

Detailed documentation in english and german as well as many samples are included in the archive file.

For more information:
Prof. Dr. Wolf-Rainer Novender, novender@novilux.fh-friedberg.de


 BANAL 0.04 (free bookkeeping software)

BANAL is a bookkeeping system that allows you to track invoices, clients, projects, TODOs, bank accounts and expenses. BANAL is a client/server application so you can keep one set of books on your system while allowing everyone access.

For this release, BANAL can store your information, list (and allow searching of) information and generate invoices, income and expense statements. You can also make and use recurring and memorized transactions to ease the burden of creating them manually. Check the TODO file, that is included with the distribution, for an idea of what is coming in the next release.

If you want to obtain BANAL and try it out, ftp to: ftp://sunsite.unc.edu/pub/Linux/apps/financial/accounting.

For more information:
Matthew Rice, Matthew.Rice@ftlsol.com


 Aegis 3.1 - Software Configuration Management System

Aegis is a transaction-based software configuration management system. It provides a framework within which a team of developers may work on many changes to a program independently, and Aegis coordinates integrating these changes back into the master source of the program, with as little disruption as possible.

http://www.canb.auug.org.au/~millerp/aegis.html

For more information:
Peter Miller, millerp@canb.auug.org.au


 Free CORBA 2 ORB - omniORB 2.4.0

The Olivetti and Oracle Research Laboratory has made available the second public release of omniORB (version 2.4.0). We also refer to this version as omniORB2. omniORB2 is copyright Olivetti & Oracle Research Laboratory. It is free software. The programs in omniORB2 are distributed under the GNU General Public Licence as published by the Free Software Foundation. The libraries in omniORB2 are distributed under the GNU Library General Public Licence.

Source code and binary distributions are available from our Web pages: http://www.orl.co.uk/omniORB/omniORB.html

For more information:
Dr. Sai-Lai Lo, S.Lo@orl.co.uk
http://www.orl.co.uk/omniORB/omniORB_240/


 New Linux STREAMS Release

Linux STREAMS (LiS) version 1.12 is now available. This version supports kernels 2.0.24 through 2.0.33. By mutual consent of the authors, the licensing terms have been changed to the GNU Public Library License. This allows linking of proprietary STREAMS drivers with the LiS code. This version contains an install script which automates the installation.

It can be downloaded from ftp.gcom.com from the directory /pub/linux/src/streams-1-15-98.

For more information:
Mikel L. Matthews, mikel@gcom.com


 Speech Enhancement by Kalman Filtering Package

If you are interested in speech enhancement, signal processing in general, or applications of Kalman filtering, read on. Mr. Kybic has just finished his diploma work, entitled "Kalman Filtering and Speech Enhancement" which includes, among other things, an implementation of a Kalman smoothing based speech enhancement algorithm, working on speech signal corrupted by slowly changing coloured additive noise. Tested on Linux and HP-UX. Parallel version using PVM. It is not perfect but might be inspiring anyway. Free for non-commercial use.

http://cmp.felk.cvut.cz/~kybic/dipl

For more information:
Jan Kybic, xkybic@sun.felk.cvut.cz


Published in Linux Gazette Issue 25, February 1998


[ TABLE OF 
CONTENTS ] [ FRONT 
PAGE ]  Back  Next


This page written and maintained by the Editor of Linux Gazette, gazette@ssc.com
Copyright © 1998 Specialized Systems Consultants, Inc.

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


The Answer Guy


By James T. Dennis, answerguy@ssc.com
Starshine Technical Services, http://www.starshine.org/


Contents:


 Removing LILO, Reinstalling MS-DOS

From: Stephen Britton, sbritton@westnet.com

My parents just told me that I have to give our extra machine (a 486 running Red Hat 4.1) to my younger brother, who only knows Windows. I have formated the drive with MS-DOS, but I can't seem to figure out how to remove LILO. I recall reading somewhere that it can be done by c:\fdisk /mbr But that doesn't seem to be working. Please help, he is returning to College next week!!

 That should do it. However -- which version of MS-DOS are we talking about. This option was introduced in MS-DOS 5.0. Although it wasn't documented at the time it is widely used to recover from a variety of boot viruses.

If that that doesn't work -- boot from a Linux floppy -- zero out the whole partition table and MBR (dd if=/dev/zero of=/dev/hda -- for a primary IDE, or of=/dev/sda for the primary SCSI and count=1 (or 2 or so)).

Then you can boot from a DOS installation floppy and it will insist that you run fdisk and will treat the drive as though it was brand new and previously unformatted/partitioned.

(Technically you only have to zero out or put anyting other that 0x55AA as the last two bytes of the MBR -- that's the signature that tells FDISK that this drive has been previously partitioned. However, it's just easier to zero out the whole mess.)

Naturally this will make all of the data on the drive inaccessible -- but I suspect you already knew that was going to happen anyway.

Alternatively -- if fdisk /mbr doesn't work -- you should find out *why*. If this is an early version of DOS -- you should probably try to get a copy of 5.0 or later (or consider Caldera's OpenDOS). I suppose you could also consider installing Win '95, considering the likelihood that your brother will need access to TCP/IP utilities like web browsers and some e-mail package.

On the one hand I hate to push some further down the throat of the snake -- on the other hand we should always do our best to act in the best interests of our customers -- even when they're our pesky brothers.

 P.S. I tried talking him into taking Linux, but he's locked into the Windows mindset.

 Trying to convince someone of something is usually a losing proposition. Try to understand his real requirements -- and offer the best advice you can.

It may be that Windows is the best environment for him. It may also be that there are over-riding constraints that force him to choose a Windows compatible platform.

I think that many organizations are now "chained" to the Microsoft aggenda by their current investment in their existing data files (all their spreadsheets, documents, and many of their small, departmental mailing lists, and databases are locked into various versions of the proprietary .DOC, .XLS, and other data formats).

Microsoft clearly intends to maintain this state. I guess that is has been the core of their strategy for the last five years (since about the release of Win 3.0 or 3.1).

(It is also not unique to them -- most major commercial hardware and software vendors have tried to "lock" their customer into upgrade paths. Companies like DEC, IBM, and HP have each had their VMS, MVS, MPE OS' with this aggenda. Consequently their efforts at Unix have often been "skunkworks" -- and have been highly politicized for over a quarter of a century).

I ask people to consider this tidbit in their long range planning. Truly optimizing for the present requires looking to the future as well.

-- Jim


 Running as root on Standalone Systems -- DON'T

From: griffin@ameritech.net

What advantages are there, if any, to running your single-user system as a normal user and not root?

 If you're absolutely perfect, you never make a typing mistake or issue a wrong command, or a right command from a wrong directory with the wrong arguments, *and* you only run perfect software, with no bugs in it at all, *and* you are totally disconnected from the world (you don't get any e-mail, never use netnews, or IRC etc) -- then you *might* be sort of safe running as root on your system.

If you simply don't care about your data and you like the idea of rebuilding your system configuration from scratch then throw all caution to the wind and go for it.

However, for the vast majority of us, it's the most minimal bow to prudence to log in as an unprivileged user for the vast majority of work you do at your system.

The advantages are:

The disadvantages mostly relate to convenience. A typical microcomputer user from a DOS, Windows, OS/2, MacOS, AmigaDOS, CP/M or similar background is used to being able to edit any file and change any setting directly and quickly.

By maintaining the discipline of only doing administrative tasks from a 'root' login -- and all of your other work from one or more 'user' accounts you are forced to pause and consider the implications of what you're doing.

It's also nice that you can partition your work into distinct domains -- you can always play games from your 'player' account -- and none of those games can damage you're thesis project, or financial records, or whatever.

Personally I think this could use some improvement. I'd like to see a system whereby by each user is implicitly the manager of a group of "roles." For single-user home systems this would be basically the same as using your root account to create new psuedo users for yourself. On multi-user systems it would delegate the task of creating new roles and rolegroups to the user --- so that each user's "base account" in effect becomes an administrator of this own roles.

The problem I see with that is that there's no support in Unix for it. I think it would take alot of work to build a set of tools to support it (and many of these tools would have to be SUID 'root' in traditional Unix systems -- or would require some totally different lower level support such as a variant of a "capabilities" system. In any event these tools would be very security sensitive -- and early versions would probably be the cause of numerous exploits.

However, none of that matters to the home user with root access to his own box.

-- Jim


 More on Netscape Mail Crashes

From: Chris, colohan@cs.cmu.edu

In http://www.linuxgazette.com/issue24/lg_answer24.html, you suggest removing the ~/.netscape tree to stop Netscape Mail from crashing. I have had the same problem several times, and it does not appear to be anything in that directory -- it is the mail files themselves. It appears as though Netscape will occasionally put a wee bit of corruption in your ~/nsmail/[Inbox, Trash, etc.] files, which prevents it from reading them. And it crashes when it encounters any corruption in these files. It also seems to crash if your trash gets too large. (Anything over 1MB seems hopeless).

So one solution is to back up your mail elsewhere, and erase your mail directory. Then Netscape will create new, valid, empty mail folders, and stop crashing for a while. Another solution is to open the files yourself (they are just text files), and erase any messages that look suspect.

 These sound like excellent troubleshooting suggestions, recovery procedures and workarounds.

I believe I also mentioned that my e-mail is far too important to me to entrust to Netscape (or any "new" product). For years I used 'elm' and before that it was 'mush' (mail user's shell). The switch from 'elm' to MH (using emacs' mh-e and Gnus interfaces) was nerve-wracking. (I deal with over a hundred messages a day -- and it's at the core of my business that I "keep up" on administration and security issues for my customers).

My biggest customer (another consultant in a different specialty) has also made this switch, after over a decade of using emacs' RMAIL. As you can imagine there have to be some pretty extensive advantages to a package to warrant changing from one client to another. (Merely having a "prettier" interface and a few bells and whistles isn't nearly enough).

Consequently I will probably stay in a poor position to answer questions about NS's mail and news readers.

As for the fact that NS crashes when encountering corruptions in folders and messages -- that's just poor quality control and poor coding. As usual the issues of "time-to-market" and "pretty interface" dominate the development of commercial products.

The nature of the computer software industry practically guarantees that the most widely used commercial products will have bugs of this sort. This is the result of a set of corporate priorities that don't match typical customer priorities -- and is a byproduct of the selection process by most software is purchased.

I could go on about this for many pages. Since I worked in the software industry for a long time -- I had a lot of time to observe the process first hand. (Since I was doing tech support I also had an abundance of free neural cycles to think about the issues, as well). Here's a few observations that will help explain my conclusion:

When you go through all of this -- even if you don't agree with half of the observations -- it's easy to see why so many people live in quiet desperation, hating their most important software.

Sadly it takes *really* bad software to fail as a result of its bugs. dBase IV comes to mind. It doesn't take much for really high quality software to fail as a result of poor marketing (or the superior marketing and industry dominance of competitors). DESQview comes to mind.

By contrast almost all free software is chosen by end-users based on recommendations from other end-users. It is produced by people whose only rewards are: access to their own tool to solve their own problems, the satisfaction of having lots of users, and some chance for fame and sincere admiration. They gain nothing by claiming more than they deliver (except more e-mail with more support questions).

Luckily we, Linux and free software users, are blessed with alternatives. These systemic problems are what I think we are really "free" of.

-- Jim


Copyright © 1998, James T. Dennis
Published in Issue 25 of the Linux Gazette February 1998


[ TABLE OF 
CONTENTS ] [ FRONT PAGE ]  Back  Next

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


Review of "A Practical Guide to Linux" by Mark Sobell

By Bernard Doyle


Several months ago, with some trepidation and the assistance of a friend who is somewhat more knowledgeable than myself about computer hardware, I took the plunge and installed Linux on my Pentium PC.

Soon after, I downloaded a pile of assorted How-To's, FAQS and Tutorials from the Internet to start doing something useful with Linux. The downloaded documentation was handy but I frequently had trouble finding answers to important questions. After a month I purchased 2 books - Running Linux by Welsh & Kaufman and A Practical Guide to Linux by Mark Sobell. Welsh & Kaufman's Book is a well known, highly regarded, authoritative book on Linux. It is fundamentally about how to set up the major Systems and Hardware and how they interact.

Sobell's book, by way of contrast, approaches Linux from a software perspective. There is little, if any, overlap between the two books, even when they are talking about the same thing. The two books effectively work opposite sides of the Linux street. There is also a contrast in the styles of the two books. Welsh and Kaufman are somewhat "chatty" while Sobell basically tells it like it is with little or no opinion thrown in.

Although there is a chapter on System Administration, Sobell's book concentrates on showing how to use the Linux variants of the standard Unix software packages. There are chapters on X-Windows, vi, emacs, Linux Internet and Networking Software, bash (2 chapters on this important subject), the TC Shell, the Z Shell and Programming Tools.

Learning the bash Shell by Cameron Newham and Bill Rosenblatt (published by O'Reilly) covers the use of bash in more detail than Sobell's book, but I suspect it is a little advanced for the beginner. Sobell's chapters on bash were the most informative and useful information that I have come across so far. Being something of a scripting/batch file afficianado the two chapters on bash provided just the information I needed to produce a host of useful custom scripts.

The Command Summary takes up about a third of the book and maintains the high standards of the rest of the text. Sobell uses internal page references quite freely. This often results in a lot of page turning. I assume this was done to avoid repetition of material, and given the vast amount of material that could be included in a book on Linux/Unix software this is a reasonable compromise as it leaves more room for additional material.

This is not a book for solving Linux hardware or installation problems. If you are looking for that sort of information then get Welsh and Kaufman's book, or download the relevant "How-Tos" (or both). This is the book to use if you want to do learn how to do useful things with the software. The book manages to cover almost all the major software topics, and it covers them well.

I do have some quibbles with the book. The Table of Contents uses a typeface that is much too large, As a result it runs from page xvii to page xlvii. (That's 31 pages for the Roman numerally challenged) Hopefully, the next edition will address this issue.

One notable Linux/Unix Utility not mentioned at all is Perl. A short 5-6 page reference to it in the Linux Utility Program Section or an Appendix would have been nice. Summarising Perl in 5-6 pages is possibly a tall order, but I would have liked some mention or reference to it.

Although the book gives a good rundown on accessing Linux Documentation and Software from the Internet, a Bibliography of Linux/Unix books would have been good. "Running Linux" does have a Bibliography, so if you have that book as well then I guess you have the information anyway (although it's a little out of date).

The book is an adaptation of Sobell's other Practical Guides to the Unix System and this shows, and it's not necessarily a bad thing either. However, given the nature of the Linux community, I doubt whether photographs of a mouse and keyboard are necessary. On the positive side, the book is professionally organized, indexed and referenced. It is substantially larger than the other Practical Guides to Unix by the same author as well.

In the light of the high quality of the book overall, all of the above criticisms are minor and easily overlooked. The book is far and away the best I have seen on the market for quickly and effectively using Linux software. If you have a copy of A Practical Guide to Linux and Running Linux along with a few appropriate "How-Tos", you should be able to get solutions to most of your Linux questions as well as productively use your system.


Copyright © 1998, Bernard Doyle
Published in Issue 25 of Linux Gazette, February 1998


[ TABLE OF CONTENTS ] [ FRONT PAGE ]  Back  Next


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


Bourne/Bash:
Shell Programming Introduction

By Rick Dearman


Sooner or later every UNIX user has a use for a shell script. You may just want to do a repetitive task easier, or you may want to add a bit more kick to an existing program. An easy way to accomplish this is to use a shell script. One of the first shell scripts I wanted was something that would change a directory full of files which were all in capital letters to lowercase. I did it with this script:

LCem.sh

1       #!/bin/sh
2
3       DIR=$1
4
5       for a in `ls $DIR`
6       do
7              fname=`echo $a | tr A-Z a-z`
8             mv $DIR/$a $DIR/$fname
9       done;
10      exit 0
11       #this script will output and error if the file is already lowercase, and assumes argument is a directory

Line one tells the computer which shell to use, in this case it is "sh" the bourne shell ( or this may be a link to the bash shell ). The combination of the two symbols #! are special to the shell and indicates what shell will run this script. It IS NOT IGNORED like other comment lines. Line 3 sets a variable called DIR to equal the first argument of the input. (Arguments start at $0, which is the name of the shell script or in this case LCem.sh ).

In line 5 we enter a control loop. In this case it is a for loop. Translated into english this line means for every entry "a" that I get back from the command `ls $DIR` I want to do something. The shell will replace the variable name $DIR to whatever was typed on the command line for you. Line 6 starts the loop.

Now in line seven we make use of the UNIX utilities available , `echo` and `tr`.  So what we are doing is echoing whatever the current value of $a is and piping it into tr which is short for translate. In this case we are translating uppercase to lowercase, and setting a new variable called fname to the result.

In line eight we move the file $DIR/$a, whatever it may be to $DIR/$fname. Line nine tells the shell to go back and do all the other $a variables until it is done. And finally line 10 we exit the script with an error code of zero. Line eleven is a comment.

This script  wouldn't have been needed to change one or two file names, but because I needed to change a couple of hundred it saved me lots of typing.  To get this to run on your machine you would have to chmod the file to be executable. Like this `chmod +x LCem.sh` .  Or you could evoke the shell command directly and give it the name of your script like this `sh LCem.sh`. Using the comment and exclamation mark combination would tell the kernel what shell to evoke and is the normal way to do things. But remember if you use the #! then the file itself needs to have execution permissions.

It is only eleven lines but it shows us a lot about shell scripting. We have learned how to get the computer to run the script using the #! combination. This combination of a comment mark and a bang operator, or as some people call it an exclamation mark, is used to start a shell script without having to evoke the shell first.  We learned that a # is how we can write a comment into our script and have them ignored when the script is processed. We learned how to pass arguments to the script to get input from the user, and  we know how to set a variable. We have glanced at one of the many control structures we can use to control the functionality of a script.

Don't worry if you didn't really get all of that. We shall now move on to explaining some of the most common decision making / control structures. The first one we want to look at is the `if` statement. In every programming language we want to be able to change the flow of the program based on various conditions. For example if a file is in this directory do one thing. If it isn't do something else. The syntax for the if command is:

if expression then
    commands
fi

So if the expression is true the statements inside the if block are executed. Lets look at a simple example of the if statement.

WhoMe.sh

1    #!/bin/sh
2
3    # set the variable ME to the first argument after the command.
4    ME=$1
5
6    # grep through the passwd file discarding the output and see if $ME is in the file
7    if  grep $ME /etc/passwd > /dev/null
8    then
9    # if $ME is in the file out put the following line
10        echo "You are a user"
11    fi
 
 
 Notice the extensive use of comments on lines 3, 6, and 9. You should try to comment you scripts as much as possible because someone else may need to look at it later. In six months you may not remember what you were doing, so you might need the comments as well.

Using the if statement we can now correct some of the errors which would occur in the lowercasing script. In LCem.sh the script will hang if the user doesn't input a directory as an argument. To check for an empty string, we would use the following syntax:

if [ ! $1 ]

This means if not $1. The two new things here are the use of the bang operator, or exclamation mark as the symbol for NOT.  So lets add this new knowledge to our program.
#!/bin/sh

1    if [ ! $1 ]
2    then
3    echo "Usage: `basename $0` directory_name"
4     exit 1
5    fi
6
7    DIR=$1
8
9       for a in `ls $DIR`
10    do
11           fname=`echo $a | tr A-Z a-z`
12     mv $DIR/$a $DIR/$fname
13    done;

Now if the user types in the command but not the directory then the script will exit with a message about the proper way to use it, and an error code of one.

 But what if we really did want to change the name of a single file? We have already got this command wouldn't it be nice if it could cope. If we want to do that then we need to be able to test if the argument is a file or directory. Here is a list of the file test operators.
 
 

Parameter

Test

-b file True is file is a block device
-c file True if file is a character special file
-d file True if the file is a directory
-f file True if file is a ordinary file
-r file  True if file is readable by process
-w file True if file is writeable by process
-x file True if file is executable
There  are more operators but these are the most commonly used ones. Now we can test to see if the user of our script has input a directory or a file. so lets modify the program a bit more.

1    #!/bin/sh
2
3    if [ ! $1 ]
4    then
5     echo "Usage: `basename $0` directory_name"
6     exit 1
7    fi
8
9    if [ -d $1 ]
10    then
11     DIR="/$1"
12    fi
13
14    if [ -f $1 ]
15    then
16     DIR=""
17    fi
18
19    for a in `ls $DIR`
20    do
21        fname=`echo $a | tr A-Z a-z`
22        mv $DIR$a $DIR$fname
23    done;

We inserted lines nine through seventeen to do our file/directory checks. If it is a directory we set DIR to equal "/$1" if not we set it blank. Notice we now put the directory slash in with the DIR variable and we've modified line 22 so that there is no slash between $DIR and $a. This way the paths are correct.

We still have a few problems with our script. One of them is that if the file which is getting moved already exists then the scripts outputs an error. What we want to do is check the file name before we attempt to move it. Another thing is what if someone puts in more than two arguments? We'll modify our script to accept more than one path or filename.

The first problem is easily corrected by using a simple string test and an if statement like we have use earlier. The second problem is slightly more difficult in that we need to know how many arguments the user has input. To discover this we'll use a special shell variable which is already supplied for us. It is the $# variable, this holds the number of arguments present on the command line. Now what we want to do is loop through the arguments until we reach the end. This time we'll use the While loop to do our work. Finally we shall need to know how to compare integer values, this is because we want to check the number of time we have gone through the loop  to the number of arguments. There are special test options for evaluating integers, they are as follows
 
 
Test Action
int1 -eq int2 True if integer one is equal to integer two
int1 -ge int2 True if integer one is greater than or equal to integer two
int1 -gt int2 True if integer one is greater than integer two
int1 -le int2 True if integer one is less than or equal to integer two
int1 -lt int2 True if interger one is less then interger two.
int1 -ne int2 True if integer one is not equal to integer two
 

Using this new knowledge we'll modify our program.

1    #!/bin/sh
2
3    if [ ! $1 ]
4    then
5         echo "Usage: `basename $0` directory_name"
6     exit 1
7    fi
8
9    while [ $# -ne 0  ]
10    do
11                 if [ -d $1 ]
12                 then
13                       DIR="/$1"
14                  fi
15
16                  if [ -f $1 ]
17                 then
18                       DIR=""
19                  fi
20
21                  for a in `ls $DIR`
22                  do
23                          fname=`echo $a | tr A-Z a-z`
24                  if [ $fname != $a ]
25                   then
26                             mv $DIR$a $DIR$fname
27                   fi
28                  done;
29
30                  shift
31    done

What we've done here is to insert a while loop on line 9 which checks to see if the arguments listing is equal to zero. This may seem like we just created an infinite loop but the command on line 30 the shift saves us. You see the shift command basically discards the command nearest the command name. (LCem.sh) and replaces it with the one to the right. This loop will succeed in discarding all the arguments eventually and then will equal zero and exit our loop.

And finally note the if statement on line 24, this checks to see if the file name is already lowercase and if so ignores it.

I hope you have enjoyed this brief introduction to Bourne / Bash programming. I would encourage you to try some of these examples for yourself. In fact if you want you could make this script much better by using a switch like -l to lowercase and -u to uppercase and modifying the script to handle it.
 

I take full responsibility for any errors or mistakes in the above documentation. Please send any comments or questions to rick@ricken.demon.co.uk

REFERENCES:

The UNIX programming environment
by Brian W. Kernighan & Rob Pike
Published by Prentice Hall

Inside UNIX
Published by New Riders


Copyright © 1998, Rick Dearman
Published in Issue 25 of Linux Gazette, February 1998


[ TABLE OF CONTENTS ] [ FRONT PAGE ]  Back  Next

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


Clueless at the Prompt

By Mike List, troll@net-link.net


Welcome to installment 5 of Clueless at the Prompt:

Here's this month's account of the triumphs, trials and tribulations that I caused myself or encountered since the last time, and a couple tips that may come in handy and increase your understanding of linux.


*Changing Disks:

If you make partitions the same size as your previous disk's, you can simply hook up your new disk as slave(See the documentation that comes with your new drive, or sometimes there's a diagram on the top of the disk that shows jumper settings to configure the disk as master, slave, or only disk.), and use the "dd" command. You'll have to mount the old disk first, use fdisk to set the partitions to the desired size, then mount each partition separately, if you mount your partitions one at a time, you'll avoid having the whole old disk contents try to settle on your new disk.

*Backups:

If you have any serious need of any of the information on your old disk, I can't stress the value of periodic backups enough. Even if you just backup the configuration files you worked so hard to tweak to your liking, and maybe your checking account balance, anything that you don't have to remember or reinvent is a Good Thing(tm).

If you adopt the strategy of selective backups, you can easily fit them on a floppy or three, rather than using a whole tape or zipdisk to backup what you have already on your installation media. I think that especially if you installed from a CD, the plain vanilla install like you did the first time, can put you back on your feet when combined with a backup of only those files you wrote or modified, and and any special software that wasn't included in the distribution. To find out what files and libraries are required to run an app, you can use


    ldd filename

Another command that you can use to find out more about files is, strangely enough, file. File can be used as


    file filename
     

which will give information about other files, as well as executables. Yet one more helpful command is which, used like


   which executable
   

where executable is the command used to start the application as in


   which makewhatis
   
 

to find out where the executable is located, pretty handy if you are modifying your path statement.


*Oh did I mention backups?

I stress this because I know from experience that failing to backup your data is an extremely stupid and easy thing to do, but since I apart from the cardiac care unit and the nuclear reactor I don't have anything mission critical on my box right now, I'm still too lazy to back it up. Please excercise a little cautious computing if anyone's data needs to be secure


*A little bit about FVWM configuration files(fvwm-1.x):

with a little text editting, you can configure your Xdesktop to your liking. FVWM-2.x uses m4 macros, which I haven't even tried to acquaint myself with yet. FVWM is configurable in either system.fvwmrc or a .fvwmrc in your home directory, so you can set a consistent set of applications system-wide or change the defaults to your idea of a convenient desktop. Most of the possible modifications are explained in comments preceding the line to be editted or uncommented, and if you have X applications that aren't included in the default popups, all you have to do is follow the examples of those already there, usually something like
   Exec "PROGNAME"   exec progname -options &
   

the "&" causes the program to execute in the background, which keeps it from monopolizing X. Note that some apps, such as ImageMagick don't seem to want to share, and those will have to be exec'ed without the "&". Also non-X apps can usually be run by invoking an xterm or rxvt, in which case the titlebar can be changed to reflect the program name, as in


 Exec  "Top" exec color_xterm -font 7x14 -T Top -n Top -e top &
   

which starts a color_xterm running top. Top, in case you aren't familiar, basically lists the amount of resources each process is using. For more info type

  
    man top
    

or better yet just type

    top
    

*Some stuff you may not hear anywhere else (so basic they forgot to tell you):

Redirecting output: you obviously can print a file to your monitor screen, and with a little luck even to a piece of paper via your printer, but did you know you can print a file to another VT or serial terminal or even to another file? By using the ">" or "<" symbols, you can do command line tricks that will impress your friends, cure male pattern baldness and hangovers, and make you irresistable to the opposite sex. Your mileage, as they say, may vary, unfortunately.

Some examples:


        cat filenamehere>>anotherfile
	

This one will add the contents of one file to another file, as in chapters 1 and 2 could be added together for reasons of continuity to make a fluid read that would otherwise be broken up by having to cat the successive chapters

 
        cat hellaracket.au >/dev/audio or /dev/dsp
	

is another example of redirecting the output of a command or file to somewhere other than standard output which is another way of saying your monitor.

Another feature is command line batching of commands. If you type several commands separated by semicolons, each command will execute when the previous one exits. A good example, is:

 
      make config; make dev; make clean; make zImage
      

which will perform each of the steps necessary to compile a kernel. As soon as the first command exits or is closed, the next one starts Any group of commands that you would like to run in succession can be done in this manner.

Another device you can use to your advantage with a little imagination is the pipe, signified by the "|" symbol. Pipe is a pretty good description of what it does, which is to "pipe" the output of one command into another command for further processing. One example that springs to mind is

    
    cat filename | pr -l56>/dev/lp0
    

which come to think of it, is another example of redirection as well. The above command takes the results of the cat command pipes it to a filter "pr", and redirects the output to /dev/lp0 to print a file in a reasonably attractive manner. For some of the options available to "pr", try

  
    man pr
    

This filter is particularly useful if you find lpr to be beyond your present capability, as I have :(. You should be aware however, that this will only work as root, or with a lot of permission hacking, which is probably best left undone, as it can cause security problems if /dev/lp0 is made available to regular users.


*That terminal finally works!! What worked:

If you have been reading this column for a while, you might recall I mentioned a vt 220 that I couldn't get working. I got impatient and got rid of it. but sometime later I ran into a wyse 150 and decided to try it again. This time I hit paydirt, thanks to a member of the Kalamazoo Linux Users Group, Scott Yellig. The magic bullet was the letter -L which was unreported in the serial HOWTO, but Scott is pree sharp at that stuff.When used in the /etc/inittab (Slackware) this line,
    
    s2:12345:respawn:/sbin/agetty -L 9600 ttyS1 vt100
    

if modified to reflect the serial port used, in this case com port 1 in DOS lingo. This line can also be used with a 8086 or above to emulate a serial terminal, if used with the proper cable. The proper cable, usually called a null modem, is often sold as a serial printer cable.

A serial terminal is a very good option when used with a Linux box as it allows more than one user on the system at a reasonable cost compared to buying another computer. The local university surplus disposal has them for about $25US, and you may find them for free. 8086, 8088, and 286 boxes, which will also serve the purpose can be gotten just as cheaply, depending on what hardware is att