old-www/LDP/LG/issue33/lg_tips33.html

961 lines
34 KiB
HTML

<!--startcut ==========================================================-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>More 2 Cent Tips & Tricks LG #33</title>
</head>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#A000A0"
ALINK="#FF0000">
<!--endcut ============================================================-->
<H4>"Linux Gazette...<I>making Linux just a little more fun!</I>"
</H4>
<P> <hr> <P>
<!-- QUICK TIPS SECTION ================================================== -->
<center>
<H1><A NAME="tips"><IMG ALIGN=MIDDLE ALT="" SRC="../gx/twocent.gif">
More 2&#162; Tips!</A></H1> <BR>
Send Linux Tips and Tricks to <A HREF="mailto:gazette@ssc.com">
gazette@ssc.com
</A></center>
<p><hr><p>
<H3>Contents:</H3>
<ul>
<li><a HREF="./lg_tips33.html#hammel">
Newbie Help Redux (1)</a>
<li><a HREF="./lg_tips33.html#greene">
Re: Help Wanted : newbie (2)</a>
<li><a HREF="./lg_tips33.html#christopher">
Clearing the Screen (1)</a>
<li><a HREF="./lg_tips33.html#eisen">
Re: simultaneous versions of kernels</a>
<li><a HREF="./lg_tips33.html#hammel2">
Question about your Linux Gazette post</a>
<li><a HREF="./lg_tips33.html#brown">
COBOL Compilers for Linux</a>
<li><a HREF="./lg_tips33.html#david">
Resetting the term (2)</a>
<li><a HREF="./lg_tips33.html#smith">
Re: Help Wanted : newbie (3)</a>
<li><a HREF="./lg_tips33.html#clapp">
2c tip -- more fun with pipes</a>
<li><a HREF="./lg_tips33.html#collver">
2 cents tip: Un-tar as you download</a>
<li><a HREF="./lg_tips33.html#mcnamara1">
Re: Help Wanted: Looking for an Xwin Server software that runs under Win95/NT</a>
<li><a HREF="./lg_tips33.html#mcnamara2">
Re: Help wanted for a (Cheap) COBOL combiler for Linux</a>
<li><a HREF="./lg_tips33.html#ramos">
Re: Clearing the Screen (3)</a>
<li><a HREF="./lg_tips33.html#blenk">
Unix Tip</a>
<li><a HREF="./lg_tips33.html#lambard1">
rc.local Tip</a>
<li><a HREF="./lg_tips33.html#kang">
Yet another method of resetting scrambled terminal after dumping binary data.</a>
<li><a HREF="./lg_tips33.html#smith2">
Rick's quick and dirty screen-saver</a>
<li><a HREF="./lg_tips33.html#malyshkin">
MS Word & Netscape</a>
<li><a HREF="./lg_tips33.html#burns">
Pulling Files from NT</a>
<li><a HREF="./lg_tips33.html#hammel3">
Re: The wisdom of US West...</a>
<li><a HREF="./lg_tips33.html#ferney">
RE: Clearing the Screen (4)</a>
<li><a HREF="./lg_tips33.html#andreas">
Re: Keeping track of your config files</a>
</ul>
<P> <hr> <P>
<!--================================================================-->
<a name="hammel"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
Newbie Help Redux (1)
</H3>
Date: Tue, 01 Sep 1998 10:50:21 -0500<BR>
From: Mike Hammel, <A HREF="mailto:mjhammel@fastlane.net">
mjhammel@fastlane.net</A>
<P>
Quick answers to get you started:
<P>
<font color="navy">
1. I have grown fat and lazy with Win 98 and find myself looking for
"Display Properties" and such. I'm very familiar with C and such and am
not afraid of hacking scripts or the like, but my problem is thus: Where
is a (succinct) list of what gets run when, from where, and why. I'd
love to tweak everything if only I could find it.
</font>
<P>
A. Take a look at /etc/rc or possibly /etc/rcX.d, where X is 1,2,3,
etc. I don't have RH5.1 but I think it uses the System V init system,
so these directories should exist. If so, this is where you find the
scripts that get run at boot time. For more details, you should look
into the "init" tool. I suspsect this is covered in depth in some of
the newer Linux system management texts. It's not hard to understand,
really. There are different run levels, and scripts for specific run
levels get run at start up to get things going and again at shutdown to
bring them down again.
<P>
<font color="navy">
2. I have something called an "Ensoniq Audio PCI" sound card with
"legacy emulation" I don't even know how to begin to get this thing
working. What are the first steps in enabling hardware?
</font>
<P>
A. Commercial solution: http://www.4front-tech.com. This is a
commercial sound driver but don't fret - it's only $20 and works like a
champ right out of the box. I have it and have had zero problems. I've
suggested it to a few other folks and they all seemed to like it too.
There is a non-commercial version of this same set of drivers available
for Linux too. But I punted on it when I heard about the commercial
driver.
<P>
<font color="navy">
3. Where do I get information on mounting drives?
</font>
<P>
A. mount -t fat32 /mount_pt_dir or possibly mount -t vfat
/mount_pt_dir. I don't use MS on my box so can't remember which one of
these works with FAT32 partitiions but I'm fairly sure one of them
does. In any case, other folks are likely to respond with more detailed
answers on this one.
<P>
<font color="navy">
4. I think my printer works (at least text does), but how do I print
things (man pages)?
</font>
<P>
A. xman will print the pages as postscript but you need to set up a
print spooler using Ghostscript. A print spooler is just a locical
printer name that accepts print requests, processes them with some
filters and then feeds them to the printer of choice. Ghostscript will
translate Postscript input into the printer command language for your
printer. I keep forgetting where the Ghostscript FAQ (including
download info) is at, but you can find it by searching on Yahoo. That's
what I always do.
<P>
The hard way to set up printers is to learn about configuring
/etc/printcap. However, my RH4.2 system has a fairly decent printer
configuration utility so I suspect 5.1 has an even better one. The bad
news is I can't remember the program's name (it's in my fvwm2rc at home
and I never type it by hand). Check the documentation that came with
the CD. I know it's mentioned in there.
<P>
Best of luck.
<P>
Michael J. Hammel
<P> <hr> <P>
<!--================================================================-->
<a name="greene"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
Re: Help Wanted : newbie (2)
</H3>
Date: Tue, 01 Sep 1998 07:37:43 +0200<BR>
From: "Anthony E. Greene", <A HREF="mailto:agreene@pobox.com">
agreene@pobox.com</A>
<P>
<font color="navy">
From: Dennis Lambert, opk@worldnet.att.net <BR>
I have grown fat and lazy with Win 98 and find myself looking for
"Display Properties" and such.
KDE (<A HREF="http://www.kde.org/">http://www.kde.org/</A>) is supposed to be a more integrated desktop
environment, and Gnome (<A HREF="http://www.gnome.org/">http://www.gnome.org/</A>) is coming along.
I'm very familiar with C and such and am
not afraid of hacking scripts or the like, but my problem is thus: Where
is a (succinct) list of what gets run when, from where, and why. I'd
love to tweak everything if only I could find it.
</font>
<P>
Linux is a complex OS, so the list isn't succint. There's a description of
the boot process in the System Administrator's Guide. If you're new to
Linux, I'd recommend you give the SAG a good browse. There's *lots* of
useful information there. You should have an HTML copy installed in
/usr/doc/LDP/sag.
<P>
The Network Administrator's Guide (/usr/doc/LDP/nag) is also good to have,
but the HOWTO's are better if you just need "cookbook" style docs. The
HOWTO's are in /usr/doc/HOWTO. You should fire up Midnight Commander (mc)
from the command line and take a look around /usr/doc.
<P>
<font color="navy">
I have something called an "Ensoniq Audio PCI" sound card with "legacy
emulation" I don't even know how to begin to get this thing working.
What are the first steps in enabling hardware?
</font>
<P>
There is a PCI-HOWTO and a Sound-HOWTO.
<P>
<font color="navy">
Where do I get information on mounting drives (FAT 32 especially)
</font>
<P>
In the Config-HOWTO or the archives of the Red Hat mailing lists.
<P>
<font color="navy">
I think my printer works (at least text does), but how do I print things
(man pages)
</font>
<P>
Text and postscript are easy. Fortunately most things are convertable to
postscript. In this case use:
<PRE>
man -t <i>CommandOrSubject</i> | lpr
</PRE>
This is covered in the <tt>man</tt> page.
<P>
If you haven't joined any of the Red Hat mailing lists, you might consider
doing so. Be warned though; they tend to be busy lists
(http://www.redhat.com/support/).
<P>
Welcome to Linux...
<P>
Tony
<P> <hr> <P>
<!--================================================================-->
<a name="christopher"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
Clearing the Screen (1)
</H3>
Date: Sat, 05 Sep 1998 11:56:53 -0700<BR>
From: Anthony Christopher, <A HREF="mailto:anthonyc@blarg.net">
anthonyc@blarg.net</A>
<P>
I have seen a lot of hints for restoring a trashed screen or window, but
none of them mention the <tt>reset</tt> and <tt>clear</tt> commands.
Are these commands
deprecated, do they have unwanted side effects, or are they
ineffective in certain situations?
<P>
When I have cat'ed an executable, I usually just type: <tt>reset &lt;ENTER&gt;</tt>
and let the garbage scroll off the screen.
<P>
If, for some reason, I find the garbage characters annoying,
I follow this command by typing: <tt>clear &lt;ENTER&gt;</tt>
<P>
Anthony Christopher
<P> <hr> <P>
<!--================================================================-->
<a name="eisen"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
Re: simultaneous versions of kernels
</H3>
Date: Fri, 4 Sep 1998 22:01:22 +0200<BR>
From: Henner Eisen, <A
HREF="mailto:eis@baty.hanse.de">eis@baty.hanse.de</A>
<P>
Just my 0.02 Euro:
<P>
Most of the installation problems are caused by interaction with the
linux distribution's default installation method. You can easily work
around this by simply not installing your compiled kernel. Lilo and
insmod support loading directly from the compilation directory.
<P>
Just unpack your kernel in an arbitrary directory, say /home/kernel/linux-test,
apply any patches and compile: <tt>make [x|menu|old]config; make dep;
make zImage modules</tt>. But do neither <tt>make install</tt> nor
<tt>make modules_install</tt>.
<P>
Then add something like this to your /etc/lilo.conf:
<PRE>
# Linux bootable partition config begins
# test new (not installed) kernel just compiled in directory
# /home/kernel/linux-test.
image = /home/kernel/linux-test/arch/i386/boot/zImage
root = /dev/hda3
label = test
append= " MODPATH=/home/kernel/linux-test/modules/ "
# Linux bootable partition config ends
#
</PRE>
and run <tt>lilo</tt> whenever you have recompiled your kernel image.
<P>
When booting, choose "test" from the lilo prompt. The kernel will pass
MODPATH to the environment of init and any startup routines that insmod's
kernel modules will fetch them automatically from the kernel compilation tree.
<P>
(If you additionally want to insmod some modules by hand from a root shell,
MODPATH might be unset. But scripts can still extract that information from
/proc/cmdline).
<P>
Henner
<P> <hr> <P>
<!--================================================================-->
<a name="hammel2"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
Question about your Linux Gazette post
</H3>
Date: Fri, 4 Sep 1998 10:14:47 -0600 (MDT)<BR>
From: "Michael J. Hammel", <A HREF="mailto:mjhammel@fastlane.net">
mjhammel@fastlane.net</A>
<P>
<font color="navy">
In a previous message, mjsendzi@engmail.uwaterloo.ca says:
is there an url for this program?
</font>
<P>
No, not that I know of. A couple of people have asked this. It's part of the
core set of files in my Red Hat 4.2 distribution. Units has been around so
long, and is available on so many different Unix platforms, that I suspect
most distributions have a copy of it somewhere. On my RH4.2 it's under
/usr/bin.
<PRE>
mjhammel(ttyp2)$ type units
units is /usr/bin/units
mjhammel(ttyp0)$ units
501 units, 41 prefixes
You have: 3 miles
You want: kilometers
* 4.828032
/ 0.20712373
</PRE>
Michael J. Hammel
<P> <hr> <P>
<!--================================================================-->
<a name="brown"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
COBOL Compilers for Linux
</H3>
Date: Thu, 03 Sep 1998 22:54:19 -0500<BR>
From: <A HREF="mailto:cbbrowne@hex.net">cbbrowne@hex.net</A>
<P>
Concerning the following, recently posted in Linux Gazette:
<P>
<font color="navy">
I have a friend who is doing a refresher course in Cobol in a Unix
environment. I have suggested that she run Linux, and pick up a cheap /
shareware copy of a Cobol compiler for Linux from somewhere. Knowing
absolutely nothing about either Linux or Cobol, am I dreaming, or is there a
realistic alternative to the compilers I have seen retailing for ~$1,500 US?
I'd really appreciate any help/advice anyone can offer.
</font>
<P>
There are several possible COBOL options in the Linux realm; for details
see:<BR>
<A HREF="http://www.hex.net/~cbbrowne/languages07.html">
http://www.hex.net/~cbbrowne/languages07.html</A>
<P>
There's not anything yet that could be considered 100% viable outside of
(rather expensive) commercial options; obviously these sorts of things don't
happen without there being a population of people who are interested enough
to be willing to invest the time necessary to implement something.
<P>
cbbrowne@hex.net
<P> <hr> <P>
<!--================================================================-->
<a name="david"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
Resetting the term (2)
</H3>
Date: Thu, 03 Sep 1998 16:44:25 -0700<BR>
From: david, <A HREF="mailto:david@kalifornia.com">
david@kalifornia.com</A>
<P>
You posted a program to reset your console should the text become
garbled. I thought I would mention that most distributions, Slackware
notably, come with such a program that does this and more.
<P>
<tt>reset</tt> will clear your tty, restore sane tty settings, and perform
general tty cleanups. You should find this little utility just about
anywhere :)
<P>
David
<P> <hr> <P>
<!--================================================================-->
<a name="smith"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
Re: Help Wanted : newbie (3)
</H3>
Date: Wed, 2 Sep 1998 22:46:15 +0200 (CEST)<BR>
From: <A HREF="mailto:rsmith@xs4all.nl">rsmith@xs4all.nl</A>
<P>
<font color="navy">
In anwser to your questions in the September issue of the Linux
Gazette:<BR>
I recently purchased Red Hat 5.1 and got it running. Evidently I was lucky in that I have a fairly full FAT 32
Win 98 drive and kind of stumbled through the defrag / fips / boot to CD / repartition / full install with LILO
process. Everything worked, but I'm a little nonplussed. A few topics I'd absolutely love to get feedback
on...
Turns out I have a lousy WinModem. I can see the feedback now, (Run it over with your car)
</font>
<P>
Yep. Buy a *real* modem.
<P>
<font color="navy">
I have grown fat and lazy with Win 98 and find myself looking for "Display Properties" and such. I'm
very familiar with C and such and am not afraid of hacking scripts or the like, but my problem is
thus: Where is a (succinct) list of what gets run when, from where, and why. I'd love to tweak
everything if only I could find it.
</font>
<P>
Daemons, boot time initialization: see the man page for `init'.
There'll be an assortiment of scripts in /etc/rc.d or /etc/init.d and
/etc/rcX.d (where X = 0 to 6) that do your system's boot-time setup.
<P>
For X, especially XFree86, you can fiddle with the XF86Config file,
which should reside somewhere in /etc. Or if you have an X server
running you can use `xvidtune'. The programs and window-manager started
by the X server are usually in a file called xinitrc or xsession.
<P>
<font color="navy">
I have something called an "Ensoniq Audio PCI" sound card with "legacy emulation" I don't even
know how to begin to get this thing working. What are the first steps in enabling hardware?
</font>
<P>
You'll probably need to compile a new kernel. The sound driver that
comes with the kernel supports this card. install your distribution's
kernel source package, cd to /usr/src/linux and read the README.
<P>
<font color="navy">
Where do I get information on mounting drives (FAT 32 especially)
</font>
<P>
Read the manual for `mount' and `umount'. Make sure you have a kernel
with (V)FAT support compiled in.
<P>
<font color="navy">
I think my printer works (at least text does), but how do I print things (man pages)
</font>
<P>
Use the <tt>lpr program</tt>. It is a print spooler. You might want to fiddle
with /etc/printcap to enable your printer to print PostScript (via
GhostScript).
<P>
<font color="navy">
I'm not an idiot, not even a "dummy", but what is a good book to answer the basic questions? I have "Linux
in a Nutshell" and it has a very good command reference and a few other things, but doesn't help in
tweaking things.
</font>
<P>
I haven't read many books on Linux, just *lots* of manpages and HOWTO's
(in /usr/doc/HOWTO). Ask around in linux newsgroups.
<P>
<font color="navy">
I don't really expect anyone to answer all of these concerns, but any little help would be greatly
appreciated.
</font>
<P>
Hope this helps... :-)
<P>
Roland
<P> <hr> <P>
<!--================================================================-->
<a name="clapp"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
2c tip -- more fun with pipes
</H3>
Date: Wed, 2 Sep 1998 11:59:49 -0400<BR>
From: Larry Clapp, <A HREF="mailto:lclapp@iname.com">lclapp@iname.com</A>
<P>
After reading the "Un-tar as you download" 2-cent tip from
scgmille@indiana.edu in issue 32, I thought you might like this,
too.
<P>
Say you have a program with a large initial startup time. After
that, the program reads a line from a file, processes it, reads
the next line, processes it, etc, until EOF. You would like to
process a single line of data without suffering through the
initial startup each time. Try this:
<PRE>
mkfifo input_fifo
rm input_file
touch input_file
tail -f input_file >> input_fifo &
long_program input_fifo &
</PRE>
When you want to feed it some data, say
<PRE>
echo data1 data2 data3 >> input_file
</PRE>
The tail will wake up, read the line, output it to the fifo (aka
"named pipe"), the program will wake up, read the data from the
pipe, process it, and go back to sleep.
<P>
(You only have to do the mkfifo once; after that, it sticks
around. On some systems (e.g. my Sun at work, where I came up
with this), instead of <tt>mkfifo&nbsp;<i>filename</i></tt>, use
<tt>mknod&nbsp;<i>filename</i></tt>
p".)
<P>
To shut things down, kill the <tt>tail</tt>. The program will get an EOF
condition, and shut down normally.
<P>
Of course, a better solution might be to rewrite the program to
read from stdin, and then say
<PRE>
tail -f input_file | long_program -
</PRE>
but you can't always do that. Also, neither of these ideas will
work if the program reads the whole file, and then processes each
line from an internal list.
<P>
-- Larry Clapp
<P> <hr> <P>
<!--================================================================-->
<a name="collver"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
2 cents tip: Un-tar as you download
</H3>
Date: Wed, 02 Sep 1998 03:46:20 -0700<BR>
From: Ben Collver, <A HREF="mailto:collver@dnc.net">collver@dnc.net</A><p>
<font color="navy">
<tt>tail -f --bytes=1m file-being-downloaded.tar.gz | tar -zxv</tt><BR>
<tt>tail -f --bytes=1m file.tar.bz2 | bunzip2 - | tar -xv</tt>
</font>
<p>
I've noticed that sometimes <tt>tail -f</tt> does not work reliably. An
alternative if you have lynx is:
<PRE>
lynx -source http://www.url.dum/file.tar.gz | tee file.tar.gz | tar zxm
lynx -source ftp://ftp.url.dum/file.tar.bz2 | tee file.tar.bz2 | bunzip2 - | tar xm
</PRE>
<P>
Ben
<P> <hr> <P>
<!--================================================================-->
<a name="mcnamara1"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
Re: Help Wanted: Looking for an Xwin Server software that runs under win95/nt
</H3>
Date: Wed, 02 Sep 1998 11:31:08 +0100 (IST)<BR>
From: Caolan McNamara, <A HREF="mailto:Caolan.McNamara@ul.ie">
Caolan.McNamara@ul.ie</A>
<P>
<font color="navy">
From: Mark Inder, mark@tts.co.nz <BR>
We use a Red Hat 4.2 machine in our office as a communications server. This is
running well with the facility oftelnet connections for maintenance, diald for
PPP dial up - internet and email, and uucp for incoming mail.
I would like to run an X server on my windows PC to be able to use X client
software on the Linux PC over the local Ethernet. Does anyone know of a
shareware for freeware version which is available.
</font>
<P>
Try the list at <A
HREF="http://www.rahul.net/kenton/xsites.html#XMicrosoft">
http://www.rahul.net/kenton/xsites.html#XMicrosoft</A>
<P>
this one is free for example
<A HREF="http://www.microimages.com/www/html/freestuf/mix/">
http://www.microimages.com/www/html/freestuf/mix/</A>
<P>
Caolan
<P> <hr> <P>
<!--================================================================-->
<a name="mcnamara2"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
Re: Help wanted for a (Cheap) COBOL combiler for Linux
</H3>
Date: Wed, 02 Sep 1998 11:27:20 +0100 (IST)<BR>
From: Caolan McNamara, <A HREF="mailto:Caolan.McNamara@ul.ie">
Caolan.McNamara@ul.ie</A>
<P>
<font color="navy">
From: Andrew Gates, andrewga@fcf.co.nz <BR>
I have a friend who is doing a refresher course in Cobol in a Unix environment.
I have suggested that she run Linux, and pick up a cheap / shareware copy of
a Cobol compiler for Linux from somewhere. Knowing absolutely nothing
about either Linux or Cobol, am I dreaming, or is there a realistic alternative
to the compilers I have seen retailing for
$1,500 US? I'd really appreciate any help/advice anyone can offer.
</font>
<P>
I haven't ever used Cobol, but at <A
HREF="http://www.deskware.com/cobol/cobol.htm">
http://www.deskware.com/cobol/cobol.htm</A>,
there's a Cobol for Linux under development for download (for free I believe).
Might be good to check it out, and to find out if it's of any use yet.
<P>
Caolan
<P> <hr> <P>
<!--================================================================-->
<a name="ramos"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
Re: Clearing the Screen (3)
</H3>
Date: Tue, 01 Sep 1998 19:00:31 -0700<BR>
From: "Mark J. Ramos", <A HREF="mailto:mjramos@sprintparanet.com">
mjramos@sprintparanet.com</A>
<P>
In the September issue you described some C code that can clear the
screen when it gets screwed up from binary dumps to the terminal. There
is a much easier way and it all it requires is the keyboard ;) Simply
type "echo control-v escape-c" where and hit enter. The "control-v"
allows you to type in the "escape-c" literally.
<P>
This has worked much better for me then some other methods such as
"reset" which comes with your favorite Linux distribution but like a
compiler it isn't always there. This key sequence is *always* available
on an ANSI terminal.
<P>
Mark Ramos
<P> <hr> <P>
<!--================================================================-->
<a name="blenk"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
Unix Tip
</H3>
Date: Tue, 1 Sep 1998 20:01:31 -0400<BR>
From: Ian C. Blenk, <A HREF="mailto:eicblenke@Neurotic.Intermedia.Com">
eicblenke@Neurotic.Intermedia.Com</A>
<P>
As an addendum to Allan Peda's Tip in Linux Gazette issue 32,
here is a quick tip that applies to most DEC emulators (vtXXX):
<PRE>
echo ^V^O
</PRE>
That's echo, control-V, control-O. The control-V portion
escapes the control-O (terminal reset) from your shell.
The echo just puts the control-O right back to your terminal
emulator/dumb terminal (works great on true DEC terms too! :)
<P>
This works for most Unix flavors. No code. Easy to remember.
<P>
Ian Blenke
<P> <hr> <P>
<!--================================================================-->
<a name="lambard1"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
rc.local Tip
</H3>
Date: Tue, 1 Sep 1998 14:24:07 -0700 (PDT)
From: Creede Lambard, <A HREF="mailto:fearless@moosylvania.net">
fearless@moosylvania.net</A>
<P>
I've been reading the Linux Gazette for a couple of months now and I
think it's great, especially the tips.
<P>
Here's one for you to consider that was inspired by Dennis Lambert's "Help
Wanted" letter in issue #32. I hope it doesn't duplicate something you've
already published.
<P>
To those of us used to the warm, fuzzy DOS world of CONFIG.SYS and
AUTOEXEC.BAT, the complexities of the /etc/rc.d startup heirarchy can be
nothing short of intimidating. Well, I decided to make it a little less
so. I started by putting these lines at the top of /etc/rc.d/rc.local:
<PRE>
echo "==============================================="
echo " "
echo "Now running rc.local"
echo " "
echo "==============================================="
</PRE>
Now, when I start up Linux I can tell just when my local configuration
starts to run, and if I'm having problems I can see whether they happen
before or after rc.local starts. You can learn other things, too -- I
learned that rc.sysinit gets run on startup and shutdown!
<P>
Unfortunately, especially if you have a fast system, you can miss error
messages as they scroll by and dmesg doesn't always echo the information
you need to solve a problem. I was seeing error messages in rc.local, but
I couldn't tell what they were because they went by too fast. So, I wrote
a Perl one-liner:
<PRE>
perl -e "print 'Press ENTER to continue: '; $x = &lt:STDIN&gt;;"
</PRE>
This prints a prompt, then waits for you to press ENTER before it
continues. (Yes, there's probably an easier way to do this with bash or
some utility, but I already know Perl and I'm still learning bash. [grin])
By putting this at the bottom of rc.sysinit I made the boot-up sequence stop
so I could see the error message, and of course once I saw it I knew
exactly how to fix it. I comment out the line unless I need it, of course
-- if everything is working right I want Linux to take me straight to the
login prompt!
<P>
Here's hoping this helps someone.
<P>
Creede Lambard
<P> <hr> <P>
<!--================================================================-->
<a name="kang"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
Yet another method of resetting scrambled terminal after dumping binary data.
</H3>
Date: Mon, 14 Sep 1998 03:55:54 +0000<BR>
From: Sang Kang, <A HREF="mailto:sang@mocha.dyn.ml.org">
sang@mocha.dyn.ml.org</A>
<P>
Perhaps this is the simplist solution:
<PRE>
echo '\017'
</PRE>
that's it.
<P>
Sang Woo Kang
<P> <hr> <P>
<!--================================================================-->
<a name="smith2"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
Rick's quick and dirty screen-saver
</H3>
Date: Wed, 16 Sep 1998 09:10:04 -0400<BR>
From: "R. Smith", <A HREF="mailto:riter311@gte.net">
riter311@gte.net</A>
<P>
Here's a shell script which cycles through jpgs:
<PRE>
#!/bin/sh
# showjpg Rick's quick and dirty screen saver.
# Run from an xterm. Controll 'C' should get you out. Or run in
# background with '&' and use kill.
# forever
while [ 1 ]; do
# The path to your jpgs
for file in /usr/local/images/jpg/*.jpg
do
xsetbg $file
sleep 20
done
done
</PRE>
<tt>xsetbg</tt> is from the xloadimage package. It's the same as:
<PRE>
xloadimage -onroot -quiet
</PRE>
Sleep is in seconds. Use <tt>convert</tt> from the
ImageMagick package to convert .gif or .bmp to .jpg.
<P>
Rick
<P> <hr> <P>
<!--================================================================-->
<a name="malyshkin"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
MS Word & Netscape
</H3>
Date: Tue, 15 Sep 1998 07:58:56 -0400<BR>
From: Vladislav Malyshkin, <A HREF="mailto:mal@mail1.nai.net">
mal@mail1.nai.net</A>
<P>
I wish to contribute 2 cents story.
<P>
One-click view of MSWord files in Netscape.
<P>
There is a sad fact, that some people use MSWord to exchange documents.
When one one gets such file in a mail on Linux (s)he can use MSWordView,
but this requires:
<PRE>
Save file
Convert from .doc to .html
Start Netscape to view it
</PRE>
This 2 cents tip is about how to reconfigure netscape in order to view
MSWord documents in one click.
<P>
To do this:
<ul>
<li>Download and install MSWordView from
<A HREF="http://www.csn.ul.ie/~caolan/docs/MSWordView.html">
http://www.csn.ul.ie/~caolan/docs/MSWordView.html</A>.
Usually it takes just <tt>./configure ; make ; make install</tt>
<li>Edit file .mailcap in your home directory (create it if it does not
exist). Add one line into this file:
<PRE>
application/msword; ns="%s"\; nf="${ns}".html\; mswordview "${ns}" >"${nf}"\;\
netscape -remote 'openURL(file:'"${nf}"')' \; sleep 2 \; rm "${nf}"
</PRE>
</ul>
Vladislav
<P> <hr> <P>
<!--================================================================-->
<a name="burns"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
Pulling Files from NT
</H3>
Date: Mon, 14 Sep 1998 23:29:10 +0000<BR>
From: Michael Burns, <A HREF="mailto:michaelburns@earthlink.net">
michaelburns@earthlink.net</A>
<P>
Nothing groundbreaking here but, being a newbie to Linux and Samba I was
having a difficult time getting Samba set up and needed to get some
large files from an NT server to a Linux machine. I do not have any NFS
programs for NT but do have a Web/FTP server running on NT so my
temporary but quick solution was to put the files I needed into my NT
server's FTP directory and download them from there.
<P>
Michael Burns
<P> <hr> <P>
<!--================================================================-->
<a name="hammel3"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
Re: The wisdom of US West...
</H3>
Date: Thu, 17 Sep 1998 19:30:16 -0600 (MDT)<BR>
From: "Michael J. Hammel", <A HREF="mailto:mjhammel@fastlane.net">
mjhammel@fastlane.net</A>
<P>
<font color="navy">
Michael J. Hammel wrote:
I haven't checked, but doesn't IPv6 have 6 dot-values? And are they larger
than 8 bit values? Just curious. I haven't heard much about IPv6 in
awhile and wondered how we haven't run out of IP space yet without it.
</font>
<P>
From: Jay Kominek, <A HREF="mailto:jay.kominek@colorado.edu">
jay.kominek@colorado.edu</A> <BR>
IPv6 addresses take the form of 'FEDC:BA98:7654:3210:FEDC:BA98:7654:3210'
8 16-bit hexadecimal chunks. All kinds of fun. Luckily, if you have a string
of zeros in your address, you can do something like 1080::8:800:200C:417A
<P>
To save yourself some typing.
<P>
I hope I'm not running some place's DNS when IPv6 becomes popularized.
<P>
Relevent RFCs:
<ul>
<li>1883 Internet Protocol, Version 6 (IPv6) Specification. S. Deering &
R. Hinden. December 1995. (Format: TXT=82089 bytes) (Status: PROPOSED
STANDARD)
<li>1884 IP Version 6 Addressing Architecture. R. Hinden & S. Deering,
Editors. December 1995. (Format: TXT=37860 bytes) (Obsoleted by
RFC2373) (Status: PROPOSED STANDARD)
<li>1886 DNS Extensions to support IP version 6. S. Thomson & C. Huitema.
December 1995. (Format: TXT=6424 bytes) (Status: PROPOSED STANDARD)
</ul>
<P> <hr> <P>
<!--================================================================-->
<a name="ferney"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
RE: Clearing the Screen (4)
</H3>
Date: Wed, 23 Sep 1998 08:44:10 -0600<BR>
From: Robert Ferney, <A HREF="mailto:rferney@spillman.com">
rferney@spillman.com</A>
<P>
<font color="navy">
From: Allan Peda, allan@interport.net<BR>
A few days ago a classmate "accidentally" cat'ed a file to the screen.
He asked asked me what he could do to reset his confused vt100, as
<tt>clear</tt> wasn't sufficient.</font>
<P>
<tt>reset</tt> works very well for this.
The command <tt>reset</tt> will effectively reset the screen by sending it the
proper escape sequence. since <tt>reset</tt> looks up the escape sequence from
the terminfo library so it works on just about any terminal. If this
fails, sometimes a
<PRE>
$ stty sane
</PRE>
will do the trick.
<P> <hr> <P>
<!--================================================================-->
<a name="andreas"></a>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
Re: Keeping track of your config files
</H3>
Date: Mon, 21 Sep 1998 22:30:58 +0200<BR>
From: Andreas
<P>
Your idea for keeping track of those files by linking
them to a central directory is good.
<P>
Another idea I am using frequently is keeping track
of the modifications by either employing SCCS or RCS
(or whatever derived utility available).
<P>
Combining both ideas means for SCCS based systems: Use e.g.
<PRE>
$ cd /
$ sccs -d/root/SCCS create etc/inittab
</PRE>
if you share a lot of these files across several systems, but there
are some files that may differ you probably like to type
<PRE>
$ sccs -d/root/SCCS -p`hostname` create etc/lilo.conf
</PRE>
Which results in the following tree:
<PRE>
/root
|-/SCCS
| |-etc
| | |-s.inittab
| | |-apollon
| | | |-s.lilo.conf
| | |-jupiter
| | | |-s.lilo.conf
...
</PRE>
For daily use I recommend to keep all the files 'checked-out',
i.e. 'sccs edit' always after 'sccs create' and otherwise 'sccs
deledit'.
The above commands should also be abbreviated by aliases.
<P>
For the RCS used admins I recommend 'cvs', but this
means a bit more work ....
<P>
Andreas
<P> <hr> <P>
<!--================================================================-->
<center>Published in <I>Linux Gazette</I> Issue 33, October 1998</center>
<P> <hr> <P>
<!--================================================================-->
<A HREF="./index.html"><IMG SRC="../gx/indexnew.gif" ALT="[ TABLE OF
CONTENTS ]"></A> <A HREF="../index.html"><IMG SRC="../gx/homenew.gif"
ALT="[ FRONT PAGE ]"></A> <A HREF="./lg_mail33.html"><IMG SRC="../gx/back2.gif" ALT=" Back "></A>
<A HREF="./lg_bytes33.html"><IMG SRC="../gx/fwd.gif" ALT=" Next "></A>
<P> <hr> <P>
<h5>This page maintained by the Editor of <I>Linux Gazette</I>,
<A HREF="mailto: gazette@ssc.com">gazette@ssc.com</A><BR>
Copyright &copy; 1998 Specialized Systems Consultants, Inc. </H5>
<P>
<!--startcut ==========================================================-->
</body>
</html>
<!--endcut ============================================================-->