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


More 2¢ Tips!


Send Linux Tips and Tricks to [email protected]


Contents:


Re: Running Your Own Domain Over a Part Time Dialup

Date: Tue, 05 Jan 1999 15:41:52 -0800
From: John Stracke, [email protected]

If all you need is the ability to telnet into your Linux box, there is a simpler way (assuming your ISP gives you a Web site with CGI). First, create a script on your site called "updateIP.cgi":

#!/bin/bash
echo $REMOTE_ADDR >latestIP
and another called "telnet.cgi":
 
#!/bin/bash
echo Location: telnet://`cat latestIP`
echo
(Don't forget to make the CGI scripts executable.) Set up a cron job that will do "lynx -source http://www.example.com/~foo/updateIP.cgi >/dev/null 2>&1" every 15 minutes (or whatever). (Replace http://www.example.com/~foo/ with the URL of your site, of course.) Now you can set yourself a bookmark for "http://www.example.com/~foo/telnet.cgi"; when you go to it, your browser will be redirected to the telnet: URL and will (should) fire up a telnet session.

No need to pay somebody for Dynamic DNS or a domain name. If your ISP doesn't support CGI, you can probably hack up something with FTP instead.

--
John (Francis) Stracke


Boot SCSI with IDE Disk Too

Date: Wed, 6 Jan 1999 11:08:18 -0500
From: "DJ Delorie"[email protected]

Another way to make it boot SCSI first is to install the IDE drive on the *secondary* IDE controller, not the primary. Whether this works or not depends on the BIOS and the SCSI card.

--
DJ


TAG: ifconfig Reports TX Errors on v2.1.x Kernels

Date: Wed, 6 Jan 1999 16:42:49 +0100
From: Michel van de Ven, [email protected]

my 0.02 euro:

This is a problem with the net-tools used. The /proc/net format changed during 2.1.x development and old net-tools just can't grok it. The 2.1.x Documentation/Changes file states version and location of the net-tools you need to get correct results: for 2.2.0-pre4 it's v1.49.

It's generally a Good Thing to check Changes after patching the kernel tree. There are more things you need to consider when running a 2.[12].x kernel on a 2.0.x distribution, and Changes has the details.

Linux Gazette is a useful piece of work. Thanks!

--
Michel van de Ven


Triple booting

Date: Mon, 11 Jan 1999 12:22:14 +1000
From: "peter deVries", [email protected]

I read your article about booting linux and NT. I have a triple booting solution for you. I read this in the Jan99 PC@uthority so I can't claim the credit on this much

I recently saw a suggestion for triple booting NTFS, FAT32 and linux. Well here's a quick tip: Linux can be put into the NT boot menu. To do so, run lilo to create a boot sector of your linux partition, then run:

 
	dd if=/dev/hdc1 of=/dev/hda/bootsect.lnx bs=512 count=1
Replace /dev/hdc1 with your linux partition and /dev/hda/ with your mountpoint of your "C:" drive under NT. This copies your linux boot sector to a file which NT reads as C:\BOOTSECT.LNX. Then append C:\boot.ini with
 
	c:\bootsect.lnx="linux"
Reboot, and linux should work off the NT boot menu.

this is the article I saw word for word and found that it didn't work so here is a version that does. I did this before converting Win98 to FAT32 First make sure that the "C:\"partition is mounted

 
	mount -t msdos /dev/hda1 /mnt/win98
then reference it /mnt/win98 in the place of the /dev/hda1, so the line should look like this
 
	dd if=/dev/hdc1 of=/mnt/win98/bootsect.lnx bs=512 count=1
I found that is worked.

--
Peter deVries


Searching CD-ROMs

Date: Tue, 12 Jan 1999 19:18:15 +0200
From: Reuben Sumner, [email protected]

Here is a two cent tip that I have been meaning to submit for a long long time now.

If you have a large stack of CD-ROMS, finding where a particular file lies can be a time consuming task. My solution uses the locate program and associated utilities to build up a database of the CDs' contents that allows for rapid searching.

First we need to create the database, the following script does the trick nicely.

 
   #!/bin/bash
   onedisk()
   {
      mount /mnt/cdrom
      find /mnt/cdrom -maxdepth 7 -print | sed "s;^/mnt/cdrom;$1;" > $1.find
      eject -u cdrom
   }
   echo Enter name of disk in device:
   read diskname
   while [ -n "$diskname" ]; do
      onedisk $diskname
      echo Enter name of next disk or Enter if done:
      read diskname
   done
   echo OK, preparing cds.db
   cat *.find | sort -f | /usr/lib/findutils/frcode > cds.db
   echo Done...
Start with no CD mounted. Run the script. It will ask for a label for the CD, a short name like "sunsite1" is best. It will then quickly scan the CD, eject it and prompt for another. When you have exhausted your collection just hit enter at the prompt. A file called cds.db will be done. To make it simple to use copy cds.db to /var/lib (or anywhere else, that is where locatedb is on my system). Now create an alias like
 
       alias cdlocate="locate -d /var/lib/cds.db"
Now if I type "cdlocate lyx" I get
 
debian20_contrib/debian/hamm/contrib/binary-i386/text/lyx_0.12.0.final-0.1.deb
debian20_contrib/debian/hamm/contrib/binary-m68k/text/lyx_0.12.0.final-0.1.deb
debian20_contrib/debian/hamm/contrib/source/text/lyx_0.12.0.final-0.1.diff.gz
debian20_contrib/debian/hamm/contrib/source/text/lyx_0.12.0.final-0.1.dsc
debian20_contrib/debian/hamm/contrib/source/text/lyx_0.12.0.final.orig.tar.gz
lsa3/apps/wp/lyx-0.12.0-linux-elf-x86-libc5-bin.tar.gz
lsa3/apps/wp/lyx-0.12.0.lsm
lsa3/apps/wp/lyx-0.12.0.tar.gz
lsa4/docs/french/www.linux-france.com/lgazette/issue-28/gx/lyx
lsa4/powertools/i386/lyx-0.12.0-1.i386.rpm
lsa4/powertools/SRPMS/lyx-0.12.0-1.src.rpm
openlinux12/col/install/RPMS/lyx-0.11.32-1.i386.rpm
openlinux12/col/sources/SRPMS/lyx-0.11.32-1.src.rpm
suse53/suse/contents/lyx
In order to prevent locate from warning you that the database is old try touch -t 010100002020 /var/lib/cds.db to set the modification date to January 1 2020.

--
Reuben


Searching Multiple CD-ROM

Date: Fri, 15 Jan 1999 19:55:51 +0100 (CET)
From: JL Hopital, [email protected]

My English is terrible,so feel free to correct if you decide to publish...

Hello,i am a French linuxer and here is my two cent tips. If you have many CD-ROMs and want to retrieve this_file_I'm_sure_i_have_but_can't_remember_where, it can helps.

It consist of 2 small scripts using gnu utilities: updatedb and locate. Normally 'updatedb' run every night, creating a database for all the mounted file systems and 'locate' is used to query this system-wide database.But you can tell them where are the files to index and where to put the database.That's what my scripts does:

The first script (addcd.sh) create a database for the cd actually mounted.You must run it once for every cdrom.

The second ( cdlocate.sh ) search in the databases created by addcd.sh and display the cdname and full path of the files matching the pattern you give in parameter. So you can search for unmounted files !

To use:

Beware that locate's regular expressions have some peculiarities, 'man locate' will explain.

Hope this help and happy linuxing !

 
---Cut here------------------------------
# addcd.sh
# Author: [email protected]
# Create a filename's database in $DATABASEHOME for the cd mounted 
# at $MOUNTPOINT
# Example usage: addcd.sh Linux.Toolkit.Disk3.Oct.1996
# to search the databases use cdlocate.sh
CDNAME=$1
test "$CDNAME" = "" && { echo Usage:$0 name_of_cdrom ; exit 1 ; }
# the mount point for the cd-ROM
MOUNTPOINT=/mnt/cdrom
# where to put the database
DATABASEHOME=/home/cdroms
updatedb --localpaths=$MOUNTPOINT --output=$DATABASEHOME/$CDNAME.updatedb && \
echo Database added for $CDNAME
---Cut here--------------------------------
# cdlocate.sh
# Author : [email protected]
# Usage $0 pattern
# search regular expression in $1 in the database's found in $DATABASEHOME
# to add a database for a new cd-rom , use addcd.sh
test "$*" = "" && { echo Usage:$0 pattern ; exit 1 ; }
DATABASEHOME=/home/cdroms
cd $DATABASEHOME
# get ride of locate warning:more than 8 days old
touch *.updatedb
CDROMLIST=`ls *.updatedb`
for CDROM in $CDROMLIST
do
        CDROMNAME=`basename $CDROM .updatedb`
        locate --database=$DATABASEHOME/$CDROM $@ |sed 's/^/'$CDROMNAME:'/'
done


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


ANSWER: Re: Does Linux have multimedia support?

Date: Mon, 11 Jan 1999 15:08:23 -0600
From: Mike Hammel, [email protected]

Don Cramer wrote:

I was wondering if Linux now has, or will support any of the multimedia formats supported by Windows, such as AVI, JPG, WAV, MOV, etc?
Yes, all of these are supported in various ways. Animated formats (AVI, MOV, animated GIFs, etc) are supported through the xanim program, along with a host of other tools (xanim just has the widest range of animation format support). Xanim also has support for playing some types of audio embedded in the video file (such as audio that accompanies an AVI file). Sound formats (WAV, AU, etc) are supported via the "sox" program (that plays these formats) and the Linux sound drivers (which you can get either in the Linux distributions or a commercial version which supports a wide range of sound cards and is available from 4Front Technologies for about $20US). Static formats for graphics images (JPEG, GIF, TIFF, TGA, etc) are supported by lots of tools: the GIMP (GNU Image Manipulation Program, which is similar to Photoshop), xv (which is like LView), ImageMagick and NetPBM (which are both a collection of graphics viewer/manipulation tools). There are lots of tools for viewing/listening to multimedia files. You can try the Linux Multimedia Pages (I've forgotten the URL but I think its listed on SSC's Resources pages) and my Linux Graphics pages at www.graphics-muse.org/linux.html.

Multimedia on Linux is probably not quite what you're used to on Windows as far as how you use them, but the support for most of the well known and well used formats is available. What you can't do (at least I doubt you can) is run multimedia programs from CDs that are Windows specific programs. Those programs won't run (well, they might under WINE but I've never tried them) but their support files may be readable by some of the Linux/Unix programs I've mentioned above.

--
Michael J. Hammel, The Graphics Muse


ANSWER: Re: Linux and UNIX

Date: Wed, 06 Jan 1999 11:48:17 -0800
From: Drew Bloechl, [email protected]

The distinction between Linux and UNIX is, at this point, only in name. UNIX is a trademark of the X/Open Group and requires a fee for branding a product as a flavor of UNIX. Some vendors have considered getting UNIX certification for their particular brand of Linux, but I haven't heard of any of them actually doing it. Linux does, however, support the POSIX standards and others required for the UNIX branding, so it could be considered a flavor of UNIX even if it isn't quite official.

--
Drew


ANSWER: Linux and UNIX

Date: 06 Jan 1999 09:44:02 -0600
From: Omegaman, [email protected]

you asked:

I am a 2nd year computer science student. I have looked everywhere for the answer and found only basic answers. My question is what exactly is the difference between Linux and UNIX, excluding size and speed. I would appreciate it if you could just send me a few of the differences.

For all intents and purposes Linux *is* Unix -- ie. it is another unix variant. UNIX is not a single operating system, anyway. It is now a brand managed by the Open Group. That means that Operating System vendors (or Linux distribution vendors) may apply for Unix certification and branding. They pay money and TOG runs a bunch of tests and basically says, "ok, that's unix."

Of course, there are other relevant standards, such as POSIX. No standard fully covers the differences between branded or unbranded Unix implementations.

My question to you is, which unix variant are you referring to? There are so many, Solaris, HP-UX, Digital Unix, AIX, SCO, and BSDI, to name some common ones. SCO is sometimes thought of as the main UNIX as it is the direct descendent of AT&T's original System V source.

Of course, the BSD (Berkeley) derived variations play a pivotal role in Unix history as well. All of the Unix variant's mentioned above including Linux incorporate functionality and ideas from both primary Unix flavors as well as incorporating their own ideas.

System V (SCO) style unix, for example, has a different boot structure than BSD. Most recent Linux distributions use System V style boot scripts. But Linux systems also incorporate BSD style printing mechanisms. The GNU command-line tools used on Linux systems are much enhanced and extended versions of their System V and BSD counterparts. GNU ls has many more options than what many unix vendors may ship. To further confuse the issue, GNU tools can be used to replace vendor-supplied commands if desired.

Are we having fun yet?

Your best bet is to read up on Unix history to understand why unix (small u) is not one Operating System but a family of Operating Systems with similar characteristics. Filesystem structure and permissions, basic commands, process sheduling, boot method and dozens upon dozens of other characteristics add up to define an OS as "unix". Linux falls quite handily into this family despite the lack of (expensive and arguably meaningless) Open Group unix branding.

See Unix Guru Universe for some more info http://www.ugu.com/
Also see the geek-girl site for some more history and info http://www.geek-girl.com/unix.html

--
Omegaman


ANSWER: Re: Help Lotus Notes

Date: Wed, 06 Jan 1999 10:07:34 GMT
From: Anthony E. Greene, [email protected]

In your letter to Linux Gazette #36, you wrote:

I have a Linux box, with SuSE, and a Lotus Notes server. I want to e-mail the status of my workstation to another user that belongs to the Notes Network. Does anybody know how to do that, or just the concepts to do this?

Just pipe the output of a command to mail. For instance, I have a cron job that mails a weekly status report to the members of my workgroup. This helps remind the boss that the Linux box is stable and doing useful work.

Assuming you want to do something simple like uptime, the command line would look like:

 
    /usr/bin/uptime | /bin/mail -s "Uptime Report" [email protected]
The script I run is a little more complex because it gathers statistics from various logs:
 
#!/bin/bash
#
# Script: wsr (Weekl;y Status Report)
#
# Purpose: Summarize the relevant activity of the server for the past week.
#
# Author: Anthony E. Greene [email protected]
#
echo " "
echo "Uptime"
echo "------"
/usr/bin/uptime
echo " "
echo "Mail Transactions"
echo "-----------------"
MAILSENT=`/bin/grep -c "stat=Sent" /var/log/maillog.1` 
MAILRCVD=`/bin/grep -c "from=" /var/log/maillog.1`
MAILCOUNT=$[$MAILSENT+MAILRCVD]
MAILRATE=$[$MAILCOUNT/24/7]
echo "$MAILCOUNT ($MAILRATE transactions per hour)"
echo " "
echo "Web Documents Served"
echo "--------------------"
WEBCOUNT=`/bin/grep -c " 200 " /var/log/httpd/access_log.1`
WEBRATE=$[$WEBCOUNT/7]
echo "$WEBCOUNT ($WEBRATE transactions per day)"
echo " "
# End of Script
The cron job is:
 
     /usr/local/sbin/wsr | /bin/mail -s "Weekly Status Report" staff
The "staff" email address is a sendmail alias that points to the actual email addresses of the members of the workgroup. As long as outgoing mail works, this will do what you need.

--
Anthony E. Greene


ANSWER: Re: Intellimouse

Date: Wed, 06 Jan 1999 11:53:15 -0800
From: Drew Bloechl, [email protected]

There's a program called imwheel that supposedly does this in XFree86, although I haven't tried it myself. Its homepage is http://solaris1.mysolution.com/~jcatki/imwheel/ and the freshmeat appindex for it is http://freshmeat.net/appindex/1998/08/15/903164189.html

--
Drew


ANSWER: Re: Does Linux have multimedia support?

Date: Wed, 06 Jan 1999 12:03:26 -0800
From: Drew Bloechl, [email protected]

Well, the short answer is "yes." :) There are a number of Linux applications that can view and/or edit these types of files.

The Gimp ( http://www.gimp.org/ ) can edit almost every graphics format known to man, and could be considered a good alternative to Photoshop. You can see quite a few others at http://core.freshmeat.net/appindex/x11/graphics.html

In regards to the video formats, XAnim ( http://xanim.va.pubnix.com/ ) can view most of these without any problem.

As for sounds, there are a plethora of programs for doing almost anything you could think of that involve sounds. For starters, take a look at http://core.freshmeat.net/appindex/console/sound.html and http://core.freshmeat.net/appindex/x11/sound.html for a few of the available sound apps. Have fun. --
Drew


ANSWER: Re: IP Masquerading

Date: Wed, 06 Jan 1999 12:08:58 -0800
From: Drew Bloechl, [email protected]

There's another HOWTO at http://eunuchs.org/linux/ip_masq/ip_masq_content.html I haven't tried setting up IPMasq myself, so I'm not sure how much this good this will do, but I hope it helps a bit.

--
Drew


ANSWER: Re: Netscape help

Date: Wed, 06 Jan 1999 12:16:45 -0800
From: Drew Bloechl, [email protected]

This one's pretty easy. If you're lucky, your settings are only corrupted. This is fixed by removing the ".netscape" (or just "netscape", without a leading dot, I'm not sure which offhand) directory from affected users' home directories.

If Communicator itself is broken, you can remove the /usr/local/netscape directory and reinstall Netscape from the .tar.gz file that I assume you downloaded. If you installed it from an RPM or some other sort of package, I would read the manpage for the package manager and remove it using rpm or dpkg or what have you. Good luck.

--
Drew


ANSWER: TX errors with 2.1/2.2 kernels

Date: Wed, 6 Jan 1999 17:33:23 -0800 (PST)
From: David, [email protected]

I noticed in your mailbag several letters talking about errors on network devices.

The correct answer is to upgrade the net-tools package. The format of many /proc files has changed. In particular, those used by ifconfig. I recommend browsing through linux/Documentation/Changes for everyone. I would even suggest it be mandatory reading. =)

--
David


ANSWER: Wheel Mouse under Linux

Date: Fri, 08 Jan 1999 20:46:58 +0100
From: "Torben D. Jensen", [email protected]

This appeared in Jan '99 issue:

From: James Jackson
Does anybody know how to enable the wheel on an Intellimouse under Linux? (Red Hat 5.2)

I am sending this to gazette as well, because it might be of general interest.

Look at

http://www.inria.fr/koala/colas/mouse-wheel-scroll/

He might be able to help you.

--
Torben


ANSWER: Re: I have two ideas for articles

Date: Mon, 25 Jan 1999 17:04:58 +0100 (CET)
From: Gerd Bavendiek, [email protected]

You wanted to get rid of "Start" in fvwm95. Edit your .fvwm95rc like this:

 
*FvwmTaskBarAutoStick
# here I changed Start to Linux
*FvwmTaskBarStartName Linux
*FvwmTaskBarStartMenu StartMenu
*FvwmTaskBarStartIcon mini-exp.xpm
*FvwmTaskBarShowTips
You might want to have a look at an article I wrote a few months ago:

http://linuxgazette.net/issue21/fvwm.html

Regarding the virtual desktop issue, have a look into your /etc/X11/XF86Config. In the screen section look for the keyword virtual. Change it to

 
        Virtual     0 0
to switch off the virtual screen.

--
Gerd


Published in Linux Gazette Issue 37, February 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.