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


More 2¢ Tips!


Send Linux Tips and Tricks to [email protected]


New Tips:

Answers to Mail Bag Questions:


motd $0.02 tip

Date: Tue, 27 Apr 1999 01:53:44 PDT
From: primes, [email protected]

For many Linux home boxes, the message-of-the-day file (/etc/motd) serves no real purpose. I've instead used it to display ascii art, something like a splash screen, which changes every hour. i've found this to be a welcome change from the normally blank motd at each login, at least visually.

Just create a new directory, say /etc/splash and dump all your ascii art files there. next as root, add an hourly cron job with the following script. This script cycles through each ascii file alphabetically and the sed command works using gnu sed. Different versions of sed might require slight changes.

#!/bin/sh
# Different splash screens (motd) every hour.

cd /etc/splash/

[ -f .splash ] &&
SPLASH=`/bin/cat .splash`

[ -z "$SPLASH" ] ||
[ ! -f "$SPLASH" ] &&
SPLASH=`/bin/ls | /bin/sed -n '1p'`

/bin/cp "$SPLASH" ../motd && {
    /bin/ls | /bin/sed -n '1h;/^'$SPLASH'$/{${x;p;q;};n;p;}' >.splash
}
You can also replace the ascii files with more informative motd files to be displayed each day of the week by issuing daily cron jobs instead of hourly. This can be done for example to remind me of the things i'm supposed to do for the day.

--
primes


IP Addresses

Date: Mon, 26 Apr 1999 02:52:34 +0000
From: Allen Grace, [email protected]

In your New Tips section you've published a tip describing a method of finding the IP address for a PPP session with a Perl script.

There is a simpler way, which you may like to append to his tip. Under bash:

IPADDR=`/sbin/ifconfig | \
        grep P-t-P | \
        awk 'BEGIN{FS=" "} {print $2}' | \
        awk 'BEGIN{FS=":"} {print $2}'`
And then you do whatever you like with $IPADDR.

This will work for the same ifconfig output as the gentlemen who submitted the Perl script.

N.B. There are formatting issues here. The command list must be enclosed in backquotes, but the font used for Netscape mail doesn't seem to have a backquote character, as it has substituted the forward quote.

Cheers and many thanks for the enjoyable reading.

--
Allen


Tips in the following section are answers to questions printed in the Mail Bag column of previous issues.


ANSWER: LG39 - Dodgy Hard Drive

Date: Tue, 20 Apr 1999 17:11:59 +0200
From: Nick Brown, [email protected]

hda: SAMSUNG SV0644A, 6105MB w/490kB Cache, CHS=778/255/63, UDMA hdb: FUJITSU MPC3064AT, 6187MB w/0kB Cache, CHS=838/240/63, UDMA hdc: ST34321A, 4103MB w/128kB Cache, CHS=8894/15/63, UDMA

I hit a related but different problem after a BIOS upgrade, which led me to the kernel sources. There is a routine in there which gets old-style (lots of heads, fewer cylinders) info for the first two HDs only. If you have partitioned the disk with, say, FDISK, or possibly even with Linux when it was hda, then you will have old-style head/cyl counts in the partition tables. You'll probably find that fdisk, lilo, etc, are complaining about your disk's geometry as well.

One possibility is to try booting with the kernel option hdc=<c>,<h>,<s> - see the BootPrompt HOWTO. Another might be to completely zap the disk (writing 512 zeroes with dd to /dev/hdc should do it) and repartition it under Linux.

In my opinion, this "extra" treatment of just hda/hdb is a bug - the system should work out the "old-style" geometry of all the IDE drives in a consistent manner. Mark Lord, who maintains much of the IDE code, thinks that the old-style init code should be junked for 2.3.

I patched my kernel to fix my problem (which was causing the CHS numbers for hda to be overwritten by data for a SCSI drive), but it wouldn't work for yours. You might try editing ide.c in your kernel source tree and reducing the routine probe_cmos_for_drives() to an empty pair of {} braces.

--
Nick


Linux, PalmIII, and Email

Date: Tue, 20 Apr 1999 13:35:02 +0100BR From: Stephen Crane, [email protected]

Hi Mark,
If you have sendmail set up correctly from your Linux box to your ISP, the process should be transparent. When you sync email from the Palm (using PilotManager http://www.moshpit.org/pilotmgr/) it transmits the email from the Linux user-id (i.e., the user-id under which you ran the sync) via sendmail or whatever MTA you've configured.

Hope this helps. If you need help on setting up email to your ISP, have a look at the Mail HOWTO. If you have to, there are very few lines in the standard /etc/sendmail.cf (from RedHat) which need to be changed. Cheers,

--
Steve


Uninstalling Software

Date: Wed, 21 Apr 1999 12:43:01 -0400 (EDT)
From: [email protected]

Have you had any articles on uninstalling application software in Linux.

There is no such thing as a generalized uninstall method in linux. it really depends on the way you installed the software.

Two widespread package formats (.deb and .rpm) come with their own install utilities which are also able to uninstall packages. Please see your system documentation (or manpages) on the various options these installers offer.

If you just installed from a .tgz (or .tar.gz) archive containing the binaries your mostly lost, since tgz offers no uninstall mechanism at all. All you can do is watch the system at installation time and manually remove the files.

If you compiled the sources by yourself make sure to keep a copy of the makefile, since recent applications often come with a 'make uninstall' directive. If you don't have the makefile or the makefile doesn't offer a uninstall option your just as lost as with a .tgz binary

--
olaf


KDE - so what?

Date: Fri, 23 Apr 1999 08:49:26 +0100
From: Derek, [email protected]

Lou,

Am I just being obtuse, or does KDE feel like a heavy, bloated, resource-intensive desktop environment? If that's what I wanted, I would stay with M(I'm sorry, I can't say the word)t. Features and benefits be damned, FVWM2 comes real close to the type of responsiveness I feel should be expected of the desktop ... KDE doesn't even come close.
You're not being obtuse, but you are missing the point. KDE comes in pieces, so if you don't want a particular feature bloating up your system and hogging your resources, comment it out of the startup script. Don't need the sound manager? Switch it off. Don't want the background manager? Switch it off. Don't need the panel? Switch it off. Of course, if you do that, you won't be using KDE anymore, and you won't get the benefits of the environment.

The "GUI tax" is something you have to pay if you want as nice environment. Pretty pictures and sounds cost memory, disk space and CPU time. With Linux and KDE you have a choice. Some would say that Fvwm2 is a complete resource hog, and why can't we all just use a CLI from a console? We can, but you don't have to. You pays yer money and takes yer choice. On this platform at least, that's an option, only you don't have to pay any money.

And WHY hasn't anyone else complained? At least, not in a forum that I've been aware of. Is it that everyone is so enamored of the acceptance that Linux has been getting that they are afraid to rock the boat?
Because everyone else just makes a simple decision. "Does this do what I want at a cost I'm prepared to pay?" If it does, they use it. If it doesn't, they use something else which better matches their needs. Linux isn't about complaining. It's about solving problems. If you can write a desktop environment which does all the nice things KDE does within the resource constraints matched by Fvwm2, I'll use it.
On the other hand, I suppose that we (the Linux user community) feel like we can pass this KDE thing off as a ready replacement for W(I'm sorry, but I can't say that word, either)s, given that it is so slow and bloated that W(you know)s users will feel right at home. Yeah, that's the ticket, we'll make 'em feel right at home.
Nope, we're just offering another solution to user's problems. It might be, in your opinion, another slow, bloated solution, but it's faster than Windows, more stable, open source and free of charge. It suits a lot of people. If it doesn't suit you, fine. Use something else. No need to moan about it...

--
Del


What is a *.ajr file?

Date: Fri, 23 Apr 1999 00:44:35 +0200
From: Steve Crane, [email protected]

Hans Jensen replied to an erlier 2c tip:

I think what you see here is the result of Win98 stumbling over a filename with multiple periods in it. I get a similar result on Win95, as well as on Win-NT4.0, only the name in my case is mangled into xxx_tar.tar. So when you have the dialog for the download on screen, you can simply change the name into something like xx.tgz, which is unpacked by e.g. WinZip with the same ease as if it were a real ZIP file. Note for LG: maybe this would be an alternative for the names you use on the website?
This appears to have been a bug in one of the Internet access components used by Windows. The error occurred in files downloaded from both Internet Explorer and Netscape.

However, the bug appears to have been corrected as I have not seen file names being broken on downloads from either browser since I have installed Internet Explorer 5.

--
Steve


CD Autoloader

Date: Wed, 28 Apr 1999 19:16:32 +0000
From: Francois Desarmenien, [email protected]
I have Caldera OpenLinux 1.2 with 2.2.5 kernel installed. I need to know if the NEC 4X6 CD changer is supported under Linux, and so how do you set up Linux to access the 3 other platters?
I'll suppose NEC 4x6 CD changer is an SCSI device.

If it is, it is made of two distinct SCSI devices:

  1. A cdrom player
  2. A medium changer robot
which share the same SCSI id with 2 distinct LUNs.

Here is my idea (maybe it will require some hack, but maybe not):

Leonard N. Zubkoff ( [email protected] ) wrote a piece of software that d rives a medium changer robot for DDS tape loaders. It is called MTX and can be found at www.dandelion.com/Linux . Works as a breeze.

As the notion of "medium changer devices" is well defined and very generic in SCSI RFCs, I suspect the SCSI inquiries for the cdrom changer should be very close to tape changer ones, so this code could probably do the job.

Unfortunatly, I have no such cdrom changers, so I haven't tried it. But I'm sure it is worth the test.

--
Francois Desarmenien

Re: CD autoloader

Date: Thu, 29 Apr 1999 09:47:54 PDT
From: "Trenton Hergesell", [email protected]

I should have added that it is an ATAPI compliant device ( IDE Primary channel, Slave drive). Thank you for your response. I have recently upgraded to Caldera 1.3, but I am having problems upgrading the Kernel.

--
Trenton


RE: Problem with the proxy

Date: Thu, 22 Apr 1999 12:41:19 -0500
From: "Nicholas R LeRoy", [email protected]

The socks5 package can be found at www.socks.nec.com. It works quite well. Linux is well supported, as well.

--
Nick


Re: what is my dialup (ppp) IP number?

Date: Sat, 1 May 1999 19:10:40 +1000
From: Matthew Hawkins, [email protected]

pppd passes this to the ip-up script as the 4th argument.

man pppd.

--
Matt


Published in Linux Gazette Issue 41, April 1999


[ TABLE OF 
CONTENTS ] [ FRONT PAGE ]  Back  Next


This page maintained by the Editor of Linux Gazette, [email protected]
Copyright © 1999 Specialized Systems Consultants, Inc.