3327 lines
113 KiB
HTML
3327 lines
113 KiB
HTML
<HTML>
|
||
|
||
|
||
<!-- HTML HEAD INFORMATION ----------------------------------------------- -->
|
||
<HEAD>
|
||
<TITLE>Linux Gazette November, 1995</TITLE>
|
||
</HEAD>
|
||
|
||
|
||
|
||
<!-- HTML BODY ----------------------------------------------------------- -->
|
||
<BODY>
|
||
|
||
<H1><IMG ALIGN=MIDDLE SRC="./gx/homeboy_icon.gif">Linux Gazette November, 1995
|
||
</H1>
|
||
|
||
<H2>A Publication of the Linux HomeBoy WebPage Series</H2>
|
||
<H4>"The Linux Gazette...<I>making Linux just a little more fun...!</I>"
|
||
</H4>
|
||
|
||
<H5>Copyright (c) 1995 John M. Fisk <I>fiskjm@ctrvax.vanderbilt.edu</I><BR><BR>
|
||
The LINUX GAZETTE is now a member of the LINUX DOCUMENTATION PROJECT.<BR>
|
||
For information regarding copying and distribution of this material see the
|
||
<A HREF="./copying.html">COPYING</A> document.<BR>
|
||
Linux Home Boy Pages logo created using <EM>David Koblas'</EM> excellent
|
||
program XPAINT 2.1.1 </H5>
|
||
|
||
<HR>
|
||
<!-- --------------------------------------------------------------------- -->
|
||
|
||
|
||
|
||
<!-- TABLE OF CONTENTS --------------------------------------------------- -->
|
||
<H2><A NAME="toc">Table of Contents</A></H2>
|
||
<H3>Topics in this <EM></EM> issue include:</H3>
|
||
|
||
<UL>
|
||
<LI><A HREF="#mail">Salutations and the MailBag</A>
|
||
<LI><A HREF="#dosemu">Introduction to DOSEMU, by Alan Bailward</A>
|
||
<LI><A HREF="#garrot">Introduction to Garrot by Alan Bailward</A>
|
||
<LI><A HREF="#hack1">Building a Better <I>hack</I> Script by Ross J. Michaels</A>
|
||
<LI><A HREF="#hack2">Building another Better <I>hack</I> Script by Judith Elaine</A>
|
||
<LI><A HREF="#rcs">RCS: Managing System Config Files by Nickolas LeRoy</A>
|
||
<LI><A HREF="#supermount">Supermount: Mounting Floppies the <I>Very Easy</I>
|
||
Way by Daniel Sully</A>
|
||
<LI><A HREF="#inittab">Logging with Inittab by Eric Sorton</A>
|
||
<LI><A HREF="#setterm">More Setterm Fun by Gary Jaffe</A>
|
||
<LI><A HREF="#vi">Still <I>more</I> VI Tricks by Jens Wessling</A>
|
||
<LI><A HREF="#kscreen">Using <I>kscreen</I> to clean up that Screen Mess!</A>
|
||
<LI><A HREF="#xtitle">Changing that xterm titlebar interactively!</A>
|
||
<LI><A HREF="#floppy">Space Savings with a Floppy Library</A>
|
||
<LI><A HREF="#less">Less is just a Whole Lot More!</A>
|
||
<LI><A HREF="#colophon">Colophon</A>
|
||
</UL>
|
||
|
||
<P>
|
||
<HR>
|
||
<!-- --------------------------------------------------------------------- -->
|
||
|
||
|
||
|
||
<!-- NEWS FLASH SECTION -------------------------------------------------- -->
|
||
<H3><IMG ALIGN=BOTTOM SRC="./gx/news.gif"><I>News Flash!</I>
|
||
<IMG ALIGN=BOTTOM SRC="./gx/news_mirror.gif"></H3>
|
||
|
||
<H3><IMG ALIGN=BOTTOM SRC="./gx/info.gif"> This One's for You!</H3>
|
||
|
||
<P>
|
||
Well, I've had so much mail recently, and so many great suggestions
|
||
and such that this month's LG is "dedicated" to those of
|
||
you that have written. This thank you list is pretty long and
|
||
includes:
|
||
|
||
<UL>
|
||
<LI>Alan Bailward
|
||
<LI>Ross J. Michaels
|
||
<LI>Judith Elaine
|
||
<LI>Nick LeRoy
|
||
<LI>Daniel Sully
|
||
<LI>Eric Sorton
|
||
<LI>Gary Jaffe
|
||
<LI>Jens Wessling
|
||
</UL>
|
||
|
||
<P>
|
||
Again, I'd like to extend an open invitation to anyone that wants to
|
||
write and offer a suggestion, tip, trick, or idea. Thing is... any
|
||
time you do one of those
|
||
"slap-your-forehead-cause-this-is-just-too-cool"
|
||
maneuvers, then take a moment and drop a note!
|
||
|
||
<P>
|
||
Seriously!
|
||
|
||
<P>
|
||
If you've come across something that you think is pretty cool, or you've
|
||
finally gotten something to work, chances are that there are a LOT of others
|
||
who are in the same boat, but haven't had the good fortune of an epiphany
|
||
yet...
|
||
|
||
<P>
|
||
Share the wealth!
|
||
|
||
<P>
|
||
And don't worry about speling [sic!] or formats or how good your English
|
||
is... (as you can see from my writing, things are kinda lax around here :-)
|
||
just drop a note and I'll be happy to include it.
|
||
|
||
<P>
|
||
Thanks!
|
||
|
||
<H3><IMG ALIGN=BOTTOM SRC="./gx/info.gif"> Linux Gazette taking a Christmas
|
||
Break!</H3>
|
||
|
||
<P>Yup, things here have been so hectic lately that I've promised my wife
|
||
that I'll be taking a Christmas break from the Linux Gazette. I really do
|
||
need to spend some time with her and my family and so will probably NOT
|
||
be putting out a December edition.
|
||
|
||
<P>
|
||
Therefore, I just want to say that I hope you all had a great Thanksgiving
|
||
(I put on my requisite 3 pounds after stuffing myself repeatedly :-) and
|
||
wish you all a very Merry Christmas and Hanukkah Season!
|
||
|
||
<P>
|
||
|
||
<H3><IMG ALIGN=BOTTOM SRC="./gx/info.gif"> Two new host sites to the Linux
|
||
Gazette!</H3>
|
||
|
||
<P>
|
||
I'd like to thank <B>Phil Hughes</B> at the Linux Journal and <B>Alan
|
||
Cox</B> at ftp.linux.org for graciously offering to mirror the Linux
|
||
Gazette. For those of you who have been trying to access the LG from
|
||
Europe, you might appreciate the fact that now there's a friendly,
|
||
neighborhood mirror site on your side of "the pond" :-)
|
||
|
||
<P>
|
||
You'll find information about the LG at these sites:
|
||
|
||
<P>
|
||
<A HREF="http://www.ssc.com">The Linux Journal @ http://www.ssc.com</A><BR>
|
||
<A HREF="http://www.linux.org.uk">www.linux.org.uk</A>
|
||
|
||
<P>
|
||
If you're getting the LG from these sites, drop these folks a note and
|
||
let them know it -- and don't forget to say thanks! These folks are
|
||
providing the LG mirror as a free service to the Linux community.
|
||
Remember... your Mom always said to remember your "please &
|
||
thank you's..."
|
||
|
||
|
||
<H3><IMG ALIGN=BOTTOM SRC="./gx/info.gif"> Yes... I'm still working on getting
|
||
the LG available for ftp... :-(</H3>
|
||
|
||
<P>
|
||
I sincerely apologize for not getting the LG ready for anonymous ftp
|
||
this month. I know that it would help a LOT of you out to be able to
|
||
ftp it rather than trying to get a connection. Also, there are folks
|
||
who simply don't have WWW access but can do ftp.
|
||
|
||
<P>
|
||
Once again, I appreciate your patience. This is one of the December
|
||
projects and is a high priority.
|
||
|
||
<P>
|
||
I'll be putting an announcement in comp.os.linux.announce when things are
|
||
finally ready to go.
|
||
|
||
<P>
|
||
Also, a number of you have expressed an interest in <B>mirroring the
|
||
LG</B>. After considering how best to handle this I've decided to
|
||
the following:
|
||
|
||
<MENU>
|
||
<LI>
|
||
[1] I'll continue to maintain the Linux Gazette at the "official
|
||
sites" (Tennessee CommerceNet, RedHat Commercial Linux, The Linux
|
||
Journal, WWW.Linux.Org). That is, I'll be responsible for fixing all
|
||
of the messes that I've made and the lousy speling [sic].
|
||
<P>
|
||
|
||
<LI>
|
||
[2] However, since I've had requests to mirror the LG from Korea,
|
||
Czechoslovakia, Saudi Arabia, South Africa, Zambia, Venezuela, Sweden,
|
||
the UK, Denmark, etc..., and because the connections from the US to
|
||
some of these countries can be SO slow...
|
||
|
||
<P>
|
||
I've decided to make the LG freely available for mirror to anyone that
|
||
wants to do so. My only request is that, if you decide to do this, you
|
||
drop me a note and send me two things:
|
||
|
||
<UL>
|
||
<LI>the URL for the pages
|
||
<LI>the email address of whoever is maintaining it
|
||
</UL>
|
||
</MENU>
|
||
|
||
<P>
|
||
What I'm going to do is start a webpage of mirror sites so that any
|
||
of you that are trying to access these pages from a non-US location
|
||
can find a site closer to home. I'm also happy to have anyone mirror
|
||
the LG in the US as well, but I'm particularly interested in making
|
||
this available to folks who don't happen to live close to Nashville,
|
||
Tennessee :-)
|
||
|
||
<P>
|
||
Again, this is a high priority and I'll do my best to get things together
|
||
around mid- to late-December. I'll post an announcement on c.o.l.announce
|
||
when things are ready to go.
|
||
|
||
<H3><IMG ALIGN=BOTTOM SRC="./gx/info.gif"> We're working an a Mailing List!
|
||
:-) </H3>
|
||
|
||
<P>
|
||
Yup! This is VERY unofficial at the moment, but a couple of generous
|
||
souls have tentatively offered to try and get a mailing list up and
|
||
running for the Linux Gazette.
|
||
|
||
<P>
|
||
I've gotten a LOT of requests for this and frankly don't have the time
|
||
myself to do this (nor the technical expertise at the moment). But,
|
||
there are a couple serious Linux-heads out there that have offered their
|
||
services.
|
||
|
||
<P>
|
||
If things do work out, then y'all owe these guys a HUGE round of thanks.
|
||
Again, this is pretty tentative and it may not work out... these guys
|
||
still have other stuff to do, like go to work each day so that they can
|
||
get paid each Friday..., and so we'll see.
|
||
|
||
<P>
|
||
If things don't happen to work out, I'll let you know and I'll see if I
|
||
can work something else out. Keep your fingers crossed...
|
||
|
||
<P>
|
||
Thanks for your patience!
|
||
|
||
<H3><IMG ALIGN=BOTTOM SRC="./gx/info.gif">Precompiled binaries available for
|
||
XF-Mail!</H3>
|
||
|
||
<P>
|
||
After corresponding with several of you about getting XF-Mail to compile
|
||
I wrote the authors of XF-Mail and asked about precompiled bin's for Linux.
|
||
Gennady very kindly wrote back and mentioned that these are already
|
||
available via his ftp server:
|
||
|
||
<P>
|
||
Sender: <gena@Burka.NetVision.net.il><BR>
|
||
From: Gennady Sorokopud <gena@NetVision.net.il><BR>
|
||
To: John M. Fisk <fiskjm@ctrvax.Vanderbilt.Edu><BR>
|
||
Subject: RE: Precompiled binaries for Linux<BR><BR>
|
||
|
||
<P>
|
||
Hello John!
|
||
|
||
<P>
|
||
I certanly understand the problem, and i tried to solve it.
|
||
My site
|
||
<A HREF="ftp://burka.netvision.net.il/pub/xfmail/">
|
||
(burka.netvision.net.il/pub/xfmail)</A> contains precompiled
|
||
binaries for every platform including Linux. If you want to distribute
|
||
precompiled binary on other FTP sites then go ahead!
|
||
|
||
<P>
|
||
I don't make any limitation of xfmail's distribution and it's completely
|
||
free.
|
||
|
||
<P>
|
||
On 27-Nov-95 John M. Fisk wrote:
|
||
<PRE>
|
||
>Gennady,
|
||
>
|
||
>Hello!
|
||
>
|
||
>Say, I have a favor to ask and an offer to make... :-)
|
||
>
|
||
>After writing up XF-Mail in the Linux Gazette I've had quite a few
|
||
>letters about it... mostly quite positive. However, I've had a couple
|
||
>folks write LONG letters about the problems they've had getting it
|
||
>to compile. I can't begin to imagine what some of them are doing and
|
||
>I know that the current version of libxpm does NOT, at least according
|
||
>to one reader, work -- it compiles cleanly and then seg faults. When
|
||
>he compiled with the previous version of libxpm it worked fine.
|
||
</PRE>
|
||
|
||
<P>
|
||
Yes, i've seen this problem. Latest XPM library has some problems with xforms
|
||
toolkit.
|
||
|
||
<P>
|
||
[SNIP!]
|
||
|
||
<PRE>
|
||
--------
|
||
Gennady B. Sorokopud - System programmer at NetVision Israel.
|
||
E-Mail: Gennady Sorokopud <GENA@NETVISION.NET.IL>
|
||
Homepage: http://www.netvision.net.il/~gena
|
||
|
||
This message was sent at 11/27/95 13:35:26 by XF-Mail
|
||
</PRE>
|
||
|
||
<P>
|
||
So, for those of you that have been having trouble getting XF-Mail
|
||
to compile, you might try the bin's available at burka.netvision.net.il
|
||
which includes the XPM libraries you'll need as well.
|
||
|
||
<P>
|
||
Good luck!
|
||
|
||
<P>
|
||
Enjoy.
|
||
|
||
<P>
|
||
-- John
|
||
<HR>
|
||
<!-- --------------------------------------------------------------------- -->
|
||
|
||
|
||
|
||
<!-- WELCOME MESSAGE ----------------------------------------------------- -->
|
||
|
||
<H2><IMG ALIGN=BOTTOM SRC="../gx/text.gif"> Welcome to the November edition of
|
||
the Linux Gazette !</H2>
|
||
|
||
<P>
|
||
Well, as I've written many of you over the past couple weeks... I've gotten
|
||
thoroughly trounced at school recently. My nice, slow semester finally built
|
||
up a head of steam and I've gotten bull-dozed into the ground. Funny how
|
||
quickly the memories of miserable "all-nighter's" fades... :-)
|
||
|
||
<P>
|
||
Anyway, I mention that to say that I'm sorry this month's LG is coming out
|
||
late. I really appreciate your patience and understanding. This has been a
|
||
HUGE amount of fun and I've enjoyed chatting with a number of you via email.
|
||
|
||
<P>
|
||
Also, I wanted to clear up the copyright thing, since a couple of you wrote
|
||
about it. Basically, it's pretty simple:
|
||
|
||
<UL>
|
||
<LI>Respect the material as copyrighted by its author.
|
||
<LI>If you're using the Linux Gazette, or any of the HomeBoy pages for
|
||
personal, non-profit, or educational use, you may use it freely.
|
||
<LI>If you're using the Linux Gazette, or any of the HomeBoy pages for
|
||
commercial purposes, you do need to get permission. I would
|
||
like to encourage commercial use as well as non-commercial, but
|
||
would like to be notified of its use in this case.
|
||
<LI>If you're using the Linux Gazette, or any of the HomeBoy pages, and
|
||
decide to make modifications, you're welcome to do so with the
|
||
proviso that you clearly indicate which sections have been
|
||
modified and by whom.
|
||
</UL>
|
||
|
||
<P>
|
||
Pretty simple, eh?
|
||
|
||
<P>
|
||
The basic idea is that the Linux Gazette is a vehicle for the free exchange of
|
||
ideas! I know I'm sounding like a broken record here, but the point is worth
|
||
repeating.
|
||
|
||
<P>
|
||
Finally, I am planning to take a Christmas Break with my family. Things have been
|
||
busy around here and I desperately need to:
|
||
|
||
<UL>
|
||
<LI>Read, Tinker, and Write
|
||
<LI>Update the (desperately) outdated Linux Library and Linux Toybox pages
|
||
<LI>Spend time with my wife :-)
|
||
<LI>Balance the checkbook
|
||
<LI>Do the wash
|
||
<LI>Go pee
|
||
</UL>
|
||
|
||
Like I said... it's been kinda busy. Therefore, there probably won't be a Linux
|
||
Gazette for December. That's the <I>official</I> word. Unofficially, if I get
|
||
the time and am not taking time from family, I'll probably try to whip up a quickie
|
||
as I've been playing around with a few neat tricks recently that have been kinda
|
||
fun. As always, I really appreciate your patience.
|
||
|
||
<P>
|
||
I DO promise to finish the series on FVWM. I'm not going to promise when it'll
|
||
be finished since I haven't been able to keep these promises very well of late.
|
||
|
||
<P>
|
||
Cheers!
|
||
|
||
<P>
|
||
-- John
|
||
|
||
<HR>
|
||
<!-- --------------------------------------------------------------------- -->
|
||
|
||
|
||
|
||
<!-- MAILBAG ------------------------------------------------------------- -->
|
||
<H2><A NAME="mail"><IMG ALIGN=MIDDLE SRC="../gx/mail.gif">Salutations and the
|
||
MailBag </A></H2>
|
||
|
||
<P>
|
||
Well, as usual, mail in and out of <B>FiskHaus</B> (the 'ol Linux box here...)
|
||
was fairly brisk. I really appreciate the ideas and suggestions, criticisms and
|
||
reports of my lousy spelling and HTML errors, and just the chatty notes from one
|
||
Linux affectionado to another. I've tried hard to drop y'all (that's Nashville for
|
||
"all of you" :-) at least a short note. For those who asked for help,
|
||
I also tried to answer things as best I could.
|
||
|
||
<P>
|
||
Keep in mind... I'm NO Linux guru!
|
||
|
||
<P>
|
||
The Linux Gazette is born out of my own experiences, trials and mostly-errors,
|
||
and the kind suggestions and offerings of others much smarter and more experienced
|
||
than me. As far as I'm concerned, Linux is the perfect example of "lifetime
|
||
learning" which is what makes it a HUGE amount of fun.
|
||
|
||
<P>
|
||
Anyway, I'm starting to babble...
|
||
|
||
<P>
|
||
To all who've written... Thanks!
|
||
|
||
<P>
|
||
<IMG ALIGN=BOTTOM SRC="../gx/letter.gif"><B>PPP script follow up by Adam
|
||
Schlesinger</B>:
|
||
|
||
<P>
|
||
Date: Wed, 08 Nov 1995 09:28:37 CST<BR>
|
||
Sender: <adams@Morgan.COM><BR>
|
||
From: Adam Schlesinger <adams@Morgan.COM><BR>
|
||
To: <fiskjm@ctrvax.Vanderbilt.Edu><BR>
|
||
Subject: Thanks!!!!!<BR><BR>
|
||
|
||
<P>
|
||
Hi,
|
||
|
||
<P>
|
||
I just got linux up and running and I am about to try my ppp connection
|
||
- this could not have been more timely. I am a Unix C++ programmer -
|
||
but modems/hardware etc - make me nervous.
|
||
|
||
<P>
|
||
I do have one comment about one of your scripts (I dont mean to be
|
||
critical) - but from a pure unix perspective the handling of the dynamic
|
||
IP addressing is dangerous. On a standalone - you can get away with it
|
||
but it is not good practice.
|
||
|
||
<PRE>
|
||
127.0.0.1 localhost
|
||
$IP MyMachine.vanderbilt.edu MyMachine" > /etc/hosts
|
||
</PRE>
|
||
|
||
<P>
|
||
I would change this to identify the line containing
|
||
MyMachine.vanderbilt.edu and modify it for the new IP address. This
|
||
is easy to do in perl - or a dirty way would be to do something like the
|
||
following:
|
||
|
||
<PRE>
|
||
grep -v MyMachine.vanderbilt.edu /etc/hosts > /tmp/etc.hosts
|
||
echo $IP MyMachine.vanderbilt.edu >> /tmp/etc.hosts
|
||
cp /etc/hosts /etc/hosts.bak
|
||
cp /tmp/etc.hosts /etc/hosts
|
||
</PRE>
|
||
|
||
<P>
|
||
The other issue is that of permissions root should own /etc/hosts and
|
||
for general setup I think you are relying on a loose permision structure
|
||
- or you are running everything as root. It is safer to have a script
|
||
which runs as root (a setuid script) to do this type of processing.
|
||
|
||
<P>
|
||
Thanks for all your work - dont mind my 2 cents :->.
|
||
|
||
<P>
|
||
Thanks,<BR>
|
||
adam<BR>
|
||
<PRE>
|
||
--
|
||
----------------------------------------------------------------------
|
||
Adam Schlesinger
|
||
email@morgan: adams@morgan.com
|
||
email@home: mada@panix.com
|
||
work phone: (212)762-2289
|
||
----------------------------------------------------------------------
|
||
</PRE>
|
||
|
||
<P>
|
||
[Actually, I really DO appreciate Adam's 2 cents... His point is well taken
|
||
and I wanted to include it here to make a point. It's true that I still do a
|
||
lot of messing around on my system as <B>root</B>. This is admittedly not a
|
||
very good idea and I'm slowly moving away from this habit, especially after
|
||
dinging myself a couple times.
|
||
|
||
<P>
|
||
Because I use Linux on my home PC, a standalone system, and I'm the ONLY one
|
||
that uses it (my beloved wife is very supportive, but not exactly interested in
|
||
learning UN*X) I do take liberties that could not be taken in other settings.
|
||
|
||
<P>
|
||
This goes not only for the PPP scripts I've provided but for many of the suggestions
|
||
I've made. I'm not security oriented, at least not at the moment, and so it's up
|
||
to you to make sure your system is secure if you are in a multi-user environment.
|
||
|
||
<P>
|
||
<I>Caveat emptor</I> -- John]
|
||
|
||
|
||
|
||
|
||
<P>
|
||
<IMG ALIGN=BOTTOM SRC="../gx/letter.gif"><B>.hushlogin suggestion by Jeff Bauer</B>
|
||
|
||
<P>
|
||
Date: Thu, 09 Nov 1995 22:20:42 CST<BR>
|
||
From: Jeff Bauer <jeff@medsup.com><BR>
|
||
To: <fiskjm@ctrvax.Vanderbilt.Edu><BR>
|
||
Subject: hushlogin tip<BR><BR>
|
||
|
||
<P>
|
||
Just wanted to say that I admire your Linux Gazette. One suggestion
|
||
on your hushlogin tip.
|
||
|
||
<P>
|
||
change: touch .hushlogin -->>> touch ~/.hushlogin
|
||
|
||
<P>
|
||
This ensures that it gets put in the user's home directory. You might
|
||
also mention that .hushlogin is extremely useful for automated logins
|
||
(uucp, slip/ppp, expect) where the outpouring of free text may jangle
|
||
the login script. This feature is indispensible for a pen-based
|
||
application we use with the Apple Newton.
|
||
|
||
<P>
|
||
Kind regards.
|
||
|
||
<PRE>
|
||
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
|
||
<> Jeff Bauer Okay, I'm on the Internet. <>
|
||
<> Medical Support Services, Inc. Now where's the money? <>
|
||
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
|
||
</PRE>
|
||
|
||
<P>
|
||
[Many thanks to Jeff for setting this straight! --John]
|
||
|
||
|
||
|
||
|
||
<P>
|
||
<IMG ALIGN=BOTTOM SRC="../gx/letter.gif"><B>Follow-up on traps and clearing the
|
||
screen at logout by GarrettZilla</B> :-)
|
||
|
||
<P>
|
||
Date: Sat, 04 Nov 1995 23:30:02 CST<BR>
|
||
Sender: <gpn@osf1.gmu.edu><BR>
|
||
From: GarrettZilla <gpn@osf1.gmu.edu><BR>
|
||
To: <fiskjm@ctrvax.Vanderbilt.Edu><BR>
|
||
Subject: On using trap to clear the screen at exit time<BR><BR>
|
||
|
||
<P>
|
||
Although setting up traps to catch the shell exit and clear the screen is an
|
||
excellent way to do it (I use it at work where I have to use Korn shell), there
|
||
is an easier way in bash: simply put the command into file .bash_logout. This
|
||
file gets sourced when the login shell exits. This feature was copied from the
|
||
C shell, where the file is called .logout.
|
||
|
||
<P>
|
||
Setting up a trap is how to do it in Bourne or Korn shell, though - and so if
|
||
you are sticking to that subset and worried about backward compatibility, you
|
||
should probably should go that way.
|
||
|
||
<P>
|
||
Cheers,<BR>
|
||
Garrett<BR>
|
||
|
||
<P>
|
||
[I appreciate Garrett's note about using traps and .logout files. I'm afraid that
|
||
I have little experience using shells besides BASH and welcome input on matters
|
||
that I admittedly know little about. BASH is a very cool shell that has a LOT
|
||
of power. It's definitely a candidate for the 'ol "man bash | col -b >
|
||
bash.txt" trick... --John]
|
||
|
||
|
||
<P>
|
||
And now for all you hardcore DOS converts...
|
||
|
||
<P>
|
||
<IMG ALIGN=BOTTOM SRC="../gx/letter.gif"><B>Jed and Joe testimonials by Eric Hultin
|
||
and Jeppe Sigbrandt</B>
|
||
|
||
<P>
|
||
Date: Mon, 23 Oct 1995 17:06:21 CDT<BR>
|
||
From: Eric Hultin <ech3@lehigh.edu><BR>
|
||
To: <fisk@web.tenn.com><BR>
|
||
Subject: Linux Gazette<BR><BR>
|
||
|
||
<P>
|
||
I really like the gazette (I didn't know some of the little tips you
|
||
described) keep up the good work. I would like to give a little plug for one
|
||
of my favorite editors: jed
|
||
|
||
<P>
|
||
Why do I like jed? Well glad you asked, jed is a really cool editor that
|
||
colorizes the various files you edit. (You have to make sure the file
|
||
/usr/lib/jed/lib/jed.rc defines USE_ANSI_COLORS = 1;) You can set the colors
|
||
used in colorcoding later in the file. The c mode which colorizes c code is
|
||
invaluable, and the editor also colorizes other files such as .html and .tex
|
||
files to improve readability. Since I program a lot and learned c by messing
|
||
around with some code this editor was a real help to learning c IMHO, check it
|
||
out and see what you think. (It's on the AP series on the slackware
|
||
distributions.)
|
||
|
||
<PRE>
|
||
Eric Hultin x1373 | "Doctor's mistakes you bury,
|
||
ech3@Lehigh.edu | Engineer's mistakes you live with forever."
|
||
Undergraduate MechE | A.K.A. Atilla => telnet ech3.res.lehigh.edu 6789
|
||
"Frustration has taken it's control"- via Pantera my opinion of ME205
|
||
</PRE>
|
||
|
||
<P>
|
||
Date: Sun, 29 Oct 1995 20:10:18 CST<BR>
|
||
From: Jeppe Sigbrandt <jay@elec.gla.ac.uk><BR>
|
||
To: <fiskjm@ctrvax.Vanderbilt.Edu><BR>
|
||
Subject: vi ?? Heck no !!!!!!!!<BR><BR>
|
||
|
||
<P>
|
||
Hi again,
|
||
|
||
<P>
|
||
I've modified a line I remember reading in the gazette earlier on:
|
||
|
||
</PRE>
|
||
If you have to use vi use vim
|
||
If you have to use vim use jove
|
||
If you have to use jove use joe
|
||
</PRE>
|
||
|
||
<P>
|
||
Joe is the business. I discovered it today and nearly murdered the
|
||
vi afficionado who assured me vi could do everything and was great.
|
||
In 3 seconds I felt happy using it.
|
||
|
||
<P>
|
||
my cshrc file now looks like this:
|
||
|
||
<PRE>
|
||
alias "vi" joe
|
||
alias "vim" joe
|
||
alias "jove" joe
|
||
alias "edit" joe
|
||
</PRE>
|
||
|
||
<P>
|
||
Regards,<BR>
|
||
jay<BR>
|
||
|
||
<P>
|
||
ps: take this email with a grain of salt. I've only used joe for
|
||
three seconds. But that was enough for someone brought up on dos edit !!!
|
||
|
||
<P>
|
||
tip: try going into help screen. You'll see most commands are preceded by
|
||
ctrl+k. Do ctrl+k + r to insert a file. It'll ask for a name. You won't
|
||
know any. press tab tab, use the cursor to navigate in the directory
|
||
structure and select a file. Couldn't be easier or more intuitive. Well, OK
|
||
why do they use an 'r' to open and insert a file ?
|
||
|
||
<P>
|
||
[I really appreciated these guys writing because it is a great reminder about
|
||
preferences! :-) Great <I>Jehads</I> have been started, fanned by the undying
|
||
zeal of adherents to particulars OS's, programs, and ways of doing things. Face
|
||
it... I happen to like VIM and I'm pretty sold on this little prog, as much because
|
||
I've gotten used to it and can do things pretty quickly on it now. For Eric and
|
||
Jeppe, Joe and Jed were the ticket...
|
||
|
||
<P>
|
||
Cool thing about Linux... you've got a pretty rich offering of stuff to play
|
||
with. Explore and enjoy! --John]
|
||
|
||
|
||
|
||
|
||
<P>
|
||
<IMG ALIGN=BOTTOM SRC="../gx/letter.gif"> <B>urlget clarification by Jack Lund</B>
|
||
|
||
<P>
|
||
Date: Wed, 22 Nov 1995 10:01:12 CST<BR>
|
||
Sender: <zippy@cc.utexas.edu><BR>
|
||
From: Jack Lund <j.lund@cc.utexas.edu><BR>
|
||
To: <fiskjm@ctrvax.Vanderbilt.Edu><BR>
|
||
Subject: url_get and Perl<BR><BR>
|
||
|
||
<P>
|
||
Hi there.
|
||
|
||
<P>
|
||
One of your avid readers pointed me to your excellent online magazine,
|
||
which, lo and behold, had a letter about my url_get script. I'm really
|
||
glad that everyone seems to find it useful, and especially glad to hear
|
||
that it works well on Linux.
|
||
|
||
<P>
|
||
I *did* want to clear up one tiny misunderstanding - url_get *should*
|
||
work equally well under Perl 4 (specifically 4.036) and Perl 5 (you had
|
||
mentioned that you haven't tried it yet because you haven't upgraded to
|
||
5.001 yet).
|
||
|
||
<P>
|
||
Anyway, thanks much for the blurb and kudos, and congratulations on an
|
||
excellent magazine.
|
||
|
||
<PRE>
|
||
--
|
||
Jack Lund "The dead have risen from the grave,
|
||
Graphics Services and they're voting REPUBLICAN!!!"
|
||
UT Austin Computation Center -Bart Simpson
|
||
j.lund@cc.utexas.edu www: http://uts.cc.utexas.edu/~zippy/
|
||
</PRE>
|
||
|
||
<P>
|
||
[Many thanks to Jack for taking the time to write a note and clarify this!
|
||
Hopefully, now that the LG is being mirrored at a couple different locations,
|
||
getting a connection isn't as hard as it was in September. Still, give
|
||
Jack's prog a whirl and if you like it, drop him a note of thanks! --John]
|
||
|
||
|
||
|
||
|
||
<P>
|
||
<IMG ALIGN=BOTTOM SRC="../gx/letter.gif"> <B>xwininfo tip by Jason Lewis</B>
|
||
|
||
<P>
|
||
Date: Fri, 10 Nov 1995 02:18:05 CST<BR>
|
||
From: <krusty@blitzen.canberra.edu.au><BR>
|
||
To: <fiskjm@ctrvax.Vanderbilt.Edu><BR>
|
||
Subject: linux gazette<BR><BR>
|
||
|
||
<P>
|
||
Hi,
|
||
|
||
<P>
|
||
I just wanted to tell you that i think the Linux Gazette is really cool.
|
||
I like your style of writing, it brings the material to life :)
|
||
|
||
<P>
|
||
Anyway, i just wondered if you knew of this program called xwininfo.
|
||
|
||
<P>
|
||
If you run it, then click on a window, it prints up lots of info about
|
||
that window. One of the interesting bits of info is a geometry command to
|
||
get a window exaclty like that (perfect for cutting and pasting into
|
||
.fvwmrc or something)
|
||
|
||
<P>
|
||
Thanks alot for the work you put into the Gazette.
|
||
|
||
<P>
|
||
Jason
|
||
|
||
<P>
|
||
--
|
||
krusty@blitzen.canberra.edu.au
|
||
|
||
<P>
|
||
Date: Sat, 11 Nov 1995 16:56:49 CST<BR>
|
||
From: Jason Lewis 932535 <krusty@blitzen.canberra.edu.au><BR>
|
||
To: John M. Fisk <fiskjm@ctrvax.Vanderbilt.Edu><BR>
|
||
Subject: RE: linux gazette<BR><BR>
|
||
|
||
<P>
|
||
John
|
||
|
||
<P>
|
||
On Fri, 10 Nov 1995, John M. Fisk wrote:
|
||
|
||
<PRE>
|
||
> Thanks for the note! Yup... I've messed around a _little_ with this
|
||
> and you're right... you get GOBS of interesting info :-) I'm not
|
||
> quite wizardly enough to fully make use of it but it is kinda fun!
|
||
>
|
||
> thanks for the suggestion!
|
||
</PRE>
|
||
|
||
<P>
|
||
No worries, the most interesting thing for me is that i can resize and
|
||
position a window where i want it, then i can use xwininfo to get the
|
||
geometry command required to get a window in that place and of that size.
|
||
I don't have to think about it. i can just cut and paste the geometry
|
||
info straigh into the relevant line.
|
||
|
||
<P>
|
||
Anyway, seeya later.
|
||
|
||
<P>
|
||
Jason.
|
||
|
||
<PRE> ____________________________________________________________________________
|
||
/Jason Lewis - System Administrator for ucnet - krusty@blitzen.canberra.edu.au\
|
||
| Be alert. Be vigilant. Behave! |
|
||
\krusty@ise.canberra.edu.au __________________________________________________/
|
||
</PRE>
|
||
|
||
<P>
|
||
[This is yet <I>another</I> handy suggestion for making your ~/.fvwmrc tinkering
|
||
just a little easier. Getting your program windows <I>just</I> the right size is
|
||
one of those things that makes life a LOT easier and makes your desktop a lot
|
||
more functional. I tried Jason's tip and it really is pretty easy to use. Just
|
||
open up you favorite editor with your ~/.fvwmrc or system.fvwmrc file, arrange
|
||
your desktop the way you want it to look, and then run xwininfo in an xterm. You
|
||
can repeatedly fire it up, click on each window, get the information about its
|
||
geometry, and then paste the numbers right into your fvwmrc file. Very handy!
|
||
-- John]
|
||
|
||
|
||
|
||
|
||
<P>
|
||
<IMG ALIGN=BOTTOM SRC="../gx/letter.gif"> <B>Offline Web page viewing tip!</B>
|
||
|
||
<P>
|
||
Date: Thu, 16 Nov 1995 23:12:54 CST<BR>
|
||
From: <toms@worldgate.com><BR>
|
||
To: John Fisk <fiskjm@ctrvax.Vanderbilt.Edu><BR>
|
||
Subject: Linix-Gazette...2 cent tips!<BR><BR>
|
||
|
||
<P>
|
||
Just a 2 cent note to add to your collection. I'm hurrying to
|
||
send this as it seems most Linux'ers have similar realizations
|
||
to common problems. One of the easiest ways to save money on
|
||
'ppp' connect time is to save all your long web pages and then
|
||
read them Off-Line.(Linux-gazette-Oct)
|
||
|
||
<P>
|
||
If you want to save even more effort, save the files in SOURCE
|
||
mode and then it is possible to use any links for further browsing.
|
||
To do this, I used the NCSA httpd_1.3 server availible on
|
||
/sunsite.unc.edu/system/Network/infosystems/httpd_1.3.tar.gz
|
||
(Actually, it is on the Infomagic CD, a newer version is on Sunsite)
|
||
The directions can be read with a text editor (they are in http
|
||
source format). After installation, the web browser will 'see'
|
||
your saved html files in <http://localhost/...>
|
||
where the indexing feature of Netscape can access all files
|
||
in the httpd DocumentRoot directory and access your
|
||
home page. My homepage is just an edited copy of the best
|
||
bookmarks I have found and by backspacing over the 'Welcome.html'
|
||
to <DocumentRoot> I can load any html document and follow the
|
||
hard links. This makes a 3Meg homepage realistic!
|
||
|
||
<P>
|
||
This is an example of the 'BEST' of Linux. By having access to
|
||
a wealth of features, I can chose the software and mode of
|
||
operation I want. I tried to use Eudora for mail (with WIN)
|
||
but never had the warm fuzzies. At least LINUX will hang up my
|
||
modem without having to cycle power or pull the plug.
|
||
|
||
<P>
|
||
I think I have an appreciation for the development of LINUX as a
|
||
bootstrap operation. Just learning 'UNIX' administration was a
|
||
convoluted task, O'Reilly Books has made a lot of money on me.
|
||
|
||
<P>
|
||
I really enjoy your gazette, it will be a long time before I have all
|
||
the software I want. I'm trying 'CALDERA' but seem to have one foot
|
||
firmly planted on the command line. Bye for now.
|
||
|
||
<PRE>
|
||
----------------------------------------------------------------------------
|
||
|Disclaimer: Opinions expressed are my own, and | Do the neoLudites have |
|
||
|should be taken with a grain of NaCl, EVEN by me.| a Home Page Yet ? |
|
||
----------------------------------------------------------------------------
|
||
</PRE>
|
||
|
||
<P>
|
||
[Here's an interesting suggestion for all you budding WebMeisters out
|
||
there. I've started doing somthing similar to this only on a bit more simplistic
|
||
level: for web pages that I've wanted to save I merely save them as Source and
|
||
then use Netscape's R mouse button menu to save the image as well. <B>Presto!</B>
|
||
instant webpage. I've then put them all in the same directory and created a
|
||
bookmark entry for this directory. Now, to view the pages even when I'm not
|
||
"online" I just fire up Netscape, ignore the error messages, and
|
||
use the bookmark to get to the directory listing. --John]
|
||
|
||
|
||
<P>
|
||
<IMG ALIGN=BOTTOM SRC="../gx/letter.gif"> <B>Ooops!! :-( Thanks for catching
|
||
these mistakes -- Frank and Boaz Studnitzky</B>
|
||
|
||
<P>
|
||
Date: Tue, 28 Nov 1995 10:03:01 CST<BR>
|
||
From: <frust@iti.cs.tu-bs.de><BR>
|
||
To: <fiskjm@ctrvax.Vanderbilt.Edu><BR>
|
||
Subject: Missing <a><BR><BR>
|
||
|
||
<P>
|
||
Hi John!
|
||
|
||
<P>
|
||
There is a <a> missing in the October Linux Gazette.
|
||
|
||
<P>
|
||
The position is in the top line.
|
||
|
||
<P>
|
||
[snip!]
|
||
|
||
<P>
|
||
Bye, Frank.
|
||
|
||
<P>
|
||
Date: Wed, 29 Nov 1995 10:19:09 CST<BR>
|
||
Sender: <s3176015@csc.cs.technion.ac.il><BR>
|
||
From: Studnitzky Boaz <s3176015@csc.cs.technion.ac.il><BR>
|
||
To: <fiskjm@ctrvax.Vanderbilt.Edu><BR>
|
||
Subject: A small typo bug (wrong address)<BR><BR>
|
||
|
||
<P>
|
||
Check out your link to nic.funet.fi
|
||
It actually points to nic.funet.ni.
|
||
|
||
<P>
|
||
B.
|
||
|
||
<P>
|
||
[And finally... <B>many</B> thanks to these guys, (and admittedly a few others
|
||
as well :-), who wrote to inform of my butter-fingered foul-ups. Thanks to all
|
||
who've caught these things and let me know about them. Cheers! --John]
|
||
|
||
<P>
|
||
<A HREF="#toc"><IMG ALIGN=BOTTOM SRC="./gx/toc.gif"></A>
|
||
<A HREF="mailto: fiskjm@ctrvax.vanderbilt.edu"><IMG ALIGN=BOTTOM
|
||
SRC="./gx/sendmail.gif"></A>
|
||
<A HREF="./gazette_toc.html"><IMG ALIGN=BOTTOM SRC="./gx/index.gif"></A>
|
||
<A HREF="./linux/linux.html"><IMG ALIGN=BOTTOM SRC="./gx/home.gif"></A>
|
||
<BR><BR>
|
||
<HR>
|
||
<!-- --------------------------------------------------------------------- -->
|
||
|
||
|
||
|
||
|
||
<!-- DOSEMU ---------------------------------------------------------- -->
|
||
<H2><A NAME="dosemu"><IMG ALIGN=BOTTOM SRC="../gx/text.gif">An Intro to DOSEMU
|
||
by Alan Bailward</A></H2>
|
||
|
||
<P>
|
||
<CENTER><H2>An intro to <STRONG>DOSEMU</STRONG></H2></CENTER>
|
||
<CENTER><H3>Running DOS programs under Linux</H3></CENTER>
|
||
|
||
In the following, I will try to make sense of several issues:
|
||
|
||
<UL>
|
||
<LI>What it is, and why you would want it</LI>
|
||
<LI>What programs work and which don't</LI>
|
||
<LI>Where to get it</LI>
|
||
<LI>How to install it and get it running, all without crying</LI>
|
||
<LI>...and everything else</LI>
|
||
</UL>
|
||
|
||
<H2>What and Why</H2>
|
||
First things first. You <EM>can</EM> run <STRONG>DOOM</STRONG> under it
|
||
<G>.<P>
|
||
|
||
DOSEMU is a user program that allows the Linux kernel to run MS-DOS in a
|
||
"DOS box". This is basically a "virtual machine" - that belives that it is
|
||
alone on the computer, and has full control of the hardware and
|
||
software.<P>
|
||
|
||
To the software this does not seem to mean much. The DOS program
|
||
<EM>Terminate</EM>
|
||
can tell it is being run in a virtual machine, and 'msd' and 'mft' give
|
||
some
|
||
interesting results. On the whole though, programs don't seem NOT to work
|
||
because they are running under a DOS Emulator.<P>
|
||
|
||
<H2>What <EM>Will</EM> Work</H2>
|
||
Although I don't use DOSEMU to run a lot of DOS programs, I have had good
|
||
luck with the ones <EM>I</EM> have tried. Your milage may vary.<P>
|
||
Your best indication is the file
|
||
<A HREF="ftp://tsx-11.mit.edu/pub/linux/ALPHA/dosemu/EMUsuccess.txt">
|
||
EMUsuccess.txt</A>.
|
||
|
||
This gives a list of the many DOS programs that currently run perfectly, or
|
||
very close. The programs include games, utilities, and "real" programs. I
|
||
will also tell you that Windows 3.1 will run under DOSEMU. This requires
|
||
patching your kernel, and doing some other funky stuff - all available in
|
||
the
|
||
DOSEMU-Win3.1-HOWTO file. <P>
|
||
Generally I have found that the little programs work. EDIT, 4dos, arj,
|
||
pkzip and such work without a hitch. I have had occasional problems with
|
||
CSHOW, and
|
||
althought I can use TERMINATE - it reports a 14.4 connection, but it is
|
||
definately <STRONG>NOT</STRONG> going at over 1200! Telemate 4.20 was a
|
||
little
|
||
better. You will notice that for everything there is a little delay. My
|
||
486-33 would seem to be a 386-40, or a 486-25, depending on the program.<P>
|
||
My real "DOS" is Windows 95, btw, and DOSEMU has no problem with it. (gee,
|
||
I wonder how that can happen - isn't it a whole NEW OS? <G>).
|
||
|
||
<H2>Where?</H2>
|
||
At this time (Nov 1, 1995), the latest version of a "stable" DOSEMU is
|
||
0.60.3 This requires at least Linux 1.1.43. You can ftp the latest version
|
||
of DOSEMU from <A HREF="ftp://sunsite.unc.edu/pub/Linux/ALPHA/dosemu">sunsite.unc.edu</A> or
|
||
<A HREF="ftp://tsx-11.mit.edu/pub/linux/ALPHA/dosemu">tsx-11.mit.edu</A> or
|
||
<A HREF="ftp://dspsun.eas.asu.edu:/pub/dosemu">dspsun.eas.asu.edu</A>.
|
||
For the non-faint of heart, poke in the /Development sub-directory. <P>
|
||
|
||
<H2>Setup</H2>
|
||
<STRONG>RTFM!</STRONG> No, really!! The Quickstart.txt (included in the
|
||
DOSEMU .tgz file), is excellent, and is probably your best bet for a worry
|
||
free setup. What I <EM>would</EM> suggest is to look in section 2 of the
|
||
DOSEMU-HOWTO file. This tells you how to speed up compiling, and a few
|
||
other helpful hints.<P>
|
||
If you have a CDROM - take a look in the ./dosemu0.60.4/drivers/cdrom.c
|
||
file.
|
||
There is a flag that you have to set to allow the CDROM to recognize the
|
||
(included) program 'eject'. If you don't have this flag set to 1, and use
|
||
the
|
||
'eject' program, DOSEMU will not recognize when the CD has been changed,
|
||
and this will really screw you up :)<P>
|
||
Also note that when you setup DOSEMU's access to your other drives (below),
|
||
you
|
||
are still running out of UNIX. If you have your DOS drives mounted as 744
|
||
(-rwxr--r--), this will apply to DOSEMU as well! If you are logged in a a
|
||
non-root user, and trying to run program that writes to a log file, creates
|
||
temporary files or whatever - DOS will report that it "can't open file" or
|
||
whatever. I have mine mounted like this - and it is inconveniant, but
|
||
(IMHO), safer.<P>
|
||
|
||
<H2>Other stuff</H2>
|
||
Ok, the rest of this are just my babbling on. Problems, sucesses etc for
|
||
my
|
||
own DOSEMU OONE (Off Of Net Experiance).<P>
|
||
In the 'dosemu.conf' file, you can define a whole slew of parameters...
|
||
amount
|
||
of memory, EMS, XMS conventional, mouse, com ports etc. All of this is
|
||
well
|
||
documented within the file, and examples are given. If you don't
|
||
understand
|
||
a setting, do exactly what any self-respecting Linux hacker would do...
|
||
play with it. Or just leave it alone, and hope <G>. <P>
|
||
Because DOSEMU does grab control of the COM ports, you will find that if
|
||
you start it up, then switch to another VT and try to dial out with minicom
|
||
or DIP,
|
||
that the modem is locked by DOSEMU. You can either not allow DOSEMU to
|
||
look at the COM ports at all, or start your modem program <EM>before</EM>
|
||
you start
|
||
up DOSEMU. If you do the latter you will find a message on the screen when
|
||
you
|
||
exit DOSEMU that <STRONG>it</STRONG> couldn't get at the modem.<P>
|
||
|
||
You will more 'n likely set DOSEMU to boot up on the HD-image file. This
|
||
is an image of a drive, that DOSEMU uses as a boot drive. It is where you
|
||
put the command.com, msdos.sys, autoexec.bat, and config.sys files.
|
||
Basically you
|
||
pretend that it is your C: and you go from there.<P>
|
||
This will be your 'C:'. You can use the 'lredir' program to setup other
|
||
drives, so that DOSEMU can recognize them. You do this by invoking
|
||
something like:<P>
|
||
<TT>
|
||
C:\> lredir d: LINUXS\dosd
|
||
</TT><P>
|
||
This will mount the directory /dosd as DOSEMU's D:<P>
|
||
I have not found a way to get my "real" C: (mounted as /dosc), to become
|
||
DOSEMU's
|
||
C:. This would allow my batch files and stuff from the bygone era of DOS
|
||
to work properly. As it is, I have the following set on my computer:<P>
|
||
|
||
<PRE>
|
||
REALITY LINUX DOSEMU
|
||
------- ----- ------
|
||
/hdimage /hdimage C:
|
||
C: /dosc H:
|
||
D: /dosd D:
|
||
E: /dose E:
|
||
Linux Root / F:
|
||
CDROM /dev/cdrom G:
|
||
</PRE>
|
||
|
||
As you can see it is a little screwy. But it allows my to access
|
||
<STRONG>all
|
||
</STRONG> the data on my computers hard drives. <P>
|
||
You should note that by default, DOSEMU does not recognize more that C: and
|
||
D:.
|
||
If you try to go beyond that you will get the error that there are not
|
||
enough drives. I use the program <STRONG>LASTDRV.COM</STRONG> (that came
|
||
with <A HREF="http://www.quarterdeck.com">Quarterdeck's</A> QEMM) to make
|
||
DOSEMU give me all the drives I want.<P>
|
||
It also comes with another program called <STRONG>xdos</STRONG>. This is
|
||
exactly what you think it is. Although you can start up DOSEMU in an xterm
|
||
or something similar, the xdos program starts it up in it's own little box,
|
||
with
|
||
a more "correct" looking font :) I have found though, that graphics
|
||
programs
|
||
will cause problems under xdos.<P>
|
||
<H2>In conclusion</H2>
|
||
DOSEMU is an excellent program. It will allow a vast majority of DOS
|
||
programs
|
||
to run under Linux. It is, however, still <EM>just a DOS emulator</EM>.
|
||
Which means that programs will <STRONG>NOT</STRONG> run as fast under it as
|
||
they
|
||
would under native DOS. They come close though, and DOSEMU gets better all
|
||
the time.<P>
|
||
I just want to thank John M. Fisk for the opportunity to contribute to the
|
||
Linux
|
||
community, and to the DOSEMU team, for a great program (and I hope I didn't
|
||
screw up too bad anywhere in this artical). Happy Linuxing!!<P>
|
||
<A HREF=MAILTO:ALAN_BAILWARD@MINDLINK.BC.CA>Alan Bailward</A> (now
|
||
<A HREF="http://mindlink.net/alan_bailward/">URLed</A>!)<P>
|
||
|
||
<P>
|
||
[<I>This article, and the one following on Garrot, were very kindly submitted
|
||
by Alan Bailward. I owe a HUGE debt of gratitude for his work on these articles.
|
||
By all means, if you've appreciated his work or if you have comments or suggestions
|
||
please drop Alan a note. Thanks! --John</I>]
|
||
|
||
<P>
|
||
<A HREF="#toc"><IMG ALIGN=BOTTOM SRC="./gx/toc.gif"></A>
|
||
<A HREF="mailto: fiskjm@ctrvax.vanderbilt.edu"><IMG ALIGN=BOTTOM
|
||
SRC="./gx/sendmail.gif"></A>
|
||
<A HREF="./gazette_toc.html"><IMG ALIGN=BOTTOM SRC="./gx/index.gif"></A>
|
||
<A HREF="./linux/linux.html"><IMG ALIGN=BOTTOM SRC="./gx/home.gif"></A>
|
||
<BR><BR>
|
||
<HR>
|
||
<!-- --------------------------------------------------------------------- -->
|
||
|
||
|
||
|
||
|
||
<!-- GARROT ---------------------------------------------------------- -->
|
||
<H2><A NAME="garrot"><IMG ALIGN=BOTTOM SRC="../gx/text.gif">An Introduction to
|
||
Garrot by Alan Bailward</A></H2>
|
||
|
||
<P>
|
||
<CENTER><H2>GARROT</H2></CENTER>
|
||
<CENTER><H3>What and HOW</H3></CENTER>
|
||
What you will notice while running DOSEMU, is that your load average will
|
||
go up, and your memory will go down. This is because while DOSEMU is
|
||
running,
|
||
it is still sucking up your system resources (as DOS always seems to do
|
||
<G>). The way to get around this is to run a small program called
|
||
<STRONG>GARROT
|
||
</STRONG>. GARROT should be available in the dosemu sub-directory at your
|
||
favorite Linux FTP site.<P>
|
||
What GARROT will do is:<P>
|
||
<CITE>
|
||
[...] improve Linux performance by coercing the operating system running
|
||
inside
|
||
of DOSEMU to release the CPU back to the main system during idle periods.
|
||
</CITE>
|
||
<P>
|
||
GARROT runs as a TSR inside the DOSEMU session, so installation is simple,
|
||
especially since the .tgz file comes with the binary! All that I did was
|
||
make a sub-directory off of my DOSEMU's C: drive and put something similar
|
||
to the following line in my AUTOEXEC.BAT:<P>
|
||
<PRE>
|
||
lh c:?rrot?rrot -8
|
||
</PRE>
|
||
The number is an argument that the author has dubbed the "garrot constant".
|
||
|
||
<H2>The "garrot constant"?</H2>
|
||
The numeric argument gives the best balance of CPU time given to DOSEMU.
|
||
You are supposed to set it at approximately one-half of your Linux BogoMips
|
||
value. So if your BogoMips are 16.7 (like mine), you would start GARROT
|
||
with
|
||
the argument as 8 or 9.<P> [NOTE: I am using kernel 1.3.30, and the
|
||
BogoMips no
|
||
longer show up when I boot up. If you have a kernel that does this, and
|
||
you don't remember the value from an earlier kernel, check out the BogoMips
|
||
mini-HOWTO
|
||
(available in the linux/docs sudirecory of any self-respecting FTP site).
|
||
This has examples of what the BogoMips <EM>should</EM> be for x86
|
||
processers.]
|
||
<P>
|
||
|
||
<H2>The proof is in the TOP</H2>
|
||
The author of GARROT recommends that you can tell if the "garrot constant"
|
||
is working or not by running 'top'. Start up DOSEMU (without garrot) in
|
||
one virtual terminal, and 'top' in another. Note the CPU useage by the
|
||
program
|
||
'dos' in top. When you are looking at the VT with 'top', DOSEMU is idle,
|
||
and
|
||
should not be taking up the CPU that it is (44.1% in my case). Now edit
|
||
the
|
||
AUTOEXEC.BAT file and put the line with garrot in there. Then exit DOSEMU
|
||
and restart it.<P>
|
||
[Another note: I just found out that if you run garrot from the dos prompt
|
||
within DOSEMU, it will 'take a guess' as to the correct level (level =
|
||
constant)]<P>
|
||
Now when you look at the VT with 'top' running, you should see that the CPU
|
||
taken up by the 'dos' entry <EM>should</EM> be <STRONG>way</STRONG> down
|
||
(in
|
||
my case from 1.0 to 0.1). You can play with the "garrot constant" to get
|
||
the best mix of performance in and out of DOSEMU.<P>
|
||
<A HREF=MAILTO:ALAN_BAILWARD@MINDLINK.BC.CA>Alan Bailward</A> (now
|
||
<A HREF="http://mindlink.net/alan_bailward/">URLed</A>!)<P>
|
||
|
||
<P>
|
||
[<I>After Alan wrote the above article on DOSEMU he came through once again with
|
||
this sister article on the program Garrot. Please drop this guy a note and tell
|
||
him THANKS for the work that went into this! I'm absolutely serious when I say
|
||
that the Linux Gazette was never meant to be a one man act. I've started this
|
||
as a means of SHARING ideas and information and I really appreciate Alan's hard
|
||
work on this. --John</I>]
|
||
|
||
<P>
|
||
<A HREF="#toc"><IMG ALIGN=BOTTOM SRC="./gx/toc.gif"></A>
|
||
<A HREF="mailto: fiskjm@ctrvax.vanderbilt.edu"><IMG ALIGN=BOTTOM
|
||
SRC="./gx/sendmail.gif"></A>
|
||
<A HREF="./gazette_toc.html"><IMG ALIGN=BOTTOM SRC="./gx/index.gif"></A>
|
||
<A HREF="./linux/linux.html"><IMG ALIGN=BOTTOM SRC="./gx/home.gif"></A>
|
||
<BR><BR>
|
||
<HR>
|
||
<!-- --------------------------------------------------------------------- -->
|
||
|
||
|
||
|
||
|
||
<!-- HACK SCRIPT1 -------------------------------------------------------- -->
|
||
<H2><A NAME="hack1"><IMG ALIGN=BOTTOM SRC="../gx/text.gif">Building a Better
|
||
<I>hack</I> script by Ross J. Michaels</A></H2>
|
||
|
||
<P>
|
||
Date: Mon, 16 Oct 1995 08:09:06 CDT<BR>
|
||
From: System Administrator <sysadmin@rjm2.res.lehigh.edu><BR>
|
||
To: <fisk@web.tenn.com><BR>
|
||
Subject: Linux Gazette<BR><BR>
|
||
|
||
<P>
|
||
Here's a little something I whipped up. Thought you might be interested...
|
||
|
||
<PRE>
|
||
CUT-HERE-----------------------------------------------------------------------
|
||
#!/bin/bash
|
||
#
|
||
# Ross J. Micheals (1995)
|
||
# rjm2@lehigh.edu
|
||
#
|
||
# Distribute freely as long as no changes are made without my thumbs up
|
||
#
|
||
# Version 1.0
|
||
# Based upon an idea by Linux Gazette Author John M. Fisk (thanks!)
|
||
#
|
||
# This program is designed to make the control of multiple configuration
|
||
# files just a bit easier. (Ok, a _lot_ bit.)
|
||
#
|
||
#
|
||
# Syntax
|
||
# ----------------------------------------------------------------
|
||
# hack *filename*
|
||
# (Wildcards not tested yet!)
|
||
#
|
||
# where the user is ROOT
|
||
# and the *filename* is your standard text file
|
||
#
|
||
# This program will
|
||
# ----------------------------------------------------------------
|
||
# 1. Create /root/links and /root/config_dist if you don't have
|
||
# them already
|
||
#
|
||
# 2. Make a copy of *filename* and save it in $DIR_DIST as
|
||
# *filename.dist*. If the mirror of the distribution file
|
||
# already exists, do not make another.
|
||
#
|
||
# 3. Create a symbolic link in $DIR_LINKS to *filename*. This way
|
||
# you can call upon a particular filename a tad easier, and you
|
||
# will also have a nice list of all the configuration files that
|
||
# you have changed! (Great for backups and upgrades)
|
||
#
|
||
# 4. Fire up the editor *filename*. I think that's it.
|
||
#
|
||
###########################################################################
|
||
# CUSTOMIZEABLE SECTION #
|
||
###########################################################################
|
||
#
|
||
# Location where you want to put the copies of the distribution files
|
||
#
|
||
DIR_DIST='/root/config_dist'
|
||
#
|
||
# Location where you want symbolic links to all of the configuration
|
||
# files that you have changed
|
||
#
|
||
DIR_LINKS='/root/links'
|
||
#
|
||
# Default editor
|
||
#
|
||
EDITOR='emacs'
|
||
#
|
||
###########################################################################
|
||
#
|
||
# Current directory
|
||
#
|
||
CURR_DIR=`pwd`
|
||
|
||
# Make sure user is logged in as root
|
||
|
||
if [ "$LOGNAME" != "root" ]
|
||
then
|
||
echo "hack: user not logged in as root"
|
||
exit 1
|
||
fi
|
||
|
||
# Make sure the user typed in a filename to *hack*
|
||
|
||
if [ "$1" = "" ]
|
||
then
|
||
echo "hack: filename is missing"
|
||
exit 2
|
||
fi
|
||
|
||
# Make sure the filename to *hack* is a real file
|
||
if [ ! -f "$1" ]
|
||
then
|
||
echo "hack: filename is bad or is a directory"
|
||
exit 3
|
||
fi
|
||
BASENAME=`basename $1`
|
||
|
||
# Create $DIR_DIST and $DIR_LINKS if it does not exist already
|
||
if [ ! -d $DIR_DIST ]
|
||
then
|
||
echo "hack:" $DIR_DIST "not found"
|
||
echo "hack: creating" $DIR_DIST
|
||
mkdir $DIR_DIST
|
||
chmod 711 $DIR_DIST
|
||
fi
|
||
if [ ! -d $DIR_LINKS ]
|
||
then
|
||
echo "hack:" $DIR_LINKS "not found"
|
||
echo "hack: creating" $DIR_LINKS
|
||
mkdir $DIR_LINKS
|
||
chmod 711 $DIR_LINKS
|
||
fi
|
||
|
||
# Create the backup file (finally!)
|
||
|
||
if [ ! -f "$DIR_DIST/$BASENAME.dist" ]
|
||
then
|
||
cp $1 $DIR_DIST/$BASENAME.dist
|
||
echo "hack: creating file" $DIR_DIST/$BASENAME".dist"
|
||
elif [ -f $DIR_DIST/$BASENAME.dist ]
|
||
then
|
||
echo "hack:" $DIR_DIST/$BASENAME".dist already exists"
|
||
else
|
||
echo "hack: fatal error in destination file"
|
||
exit 4
|
||
fi
|
||
|
||
#
|
||
# Create the symlink
|
||
#
|
||
|
||
if [ -f $CURR_DIR/$1 ]
|
||
then
|
||
if [ $CURR_DIR = "/" ]
|
||
then
|
||
ln -s "$1" "$DIR_LINKS/$BASENAME"
|
||
echo "hack: linking" $1
|
||
elif [ ! -L $DIR_LINKS/$1 ]
|
||
then
|
||
ln -s "$CURR_DIR/$1" "$DIR_LINKS/$1"
|
||
echo "hack: (c) linking" $CURR_DIR"/"$1
|
||
fi
|
||
elif [ -f $1 ]
|
||
then
|
||
if [ ! -L $DIR_LINKS/$BASENAME ]
|
||
then
|
||
ln -s "$1" "$DIR_LINKS/$BASENAME"
|
||
echo "hack: linking" $1
|
||
fi
|
||
else
|
||
echo "hack: something is fundametally wrong here"
|
||
fi
|
||
|
||
$EDITOR $1
|
||
exit
|
||
CUT-HERE-----------------------------------------------------------------------
|
||
</PRE>
|
||
|
||
|
||
<P>
|
||
Feel free to include it in the next version of Linux Gazette. I am
|
||
also working on a small routine to check whether you used wild-cards or
|
||
not, if you want to wait for that relase. But, it seems to work
|
||
pretty well as is. Thank you so much for your enthusiasm.
|
||
|
||
<P>
|
||
<A HREF="mailto: sysadmin@rjm2.res.lehigh.edu">Ross J. Michaels
|
||
<sysadmin@rjm2.res.lehigh.edu></A>
|
||
|
||
<P>
|
||
[<I>A couple editions ago I made the suggestion that, in order to save
|
||
one's sanity, important system files, and probably one's... uh...
|
||
derriere... :-), you could save your original system config files using
|
||
a shell script like "hack". This was, admittedly, the merest
|
||
skeleton of a program and was meant more as a suggestion than a
|
||
full-blown program.
|
||
|
||
<P>
|
||
Well, several folks wrote back with MAJOR improvements and suggestions.
|
||
I want to thank these folks who include:
|
||
|
||
<UL>
|
||
<LI>Ross J. Michaels
|
||
<LI>Judith Elaine
|
||
<LI>Nick LeRoy
|
||
</UL>
|
||
|
||
What's so important about archiving all this stuff...? Well, you have
|
||
only to have a system crash or inadvertently delete/overwrite one of these
|
||
files to set you back HOURS of hard work. By all means do yourself a favor
|
||
and save your hard work! ;-) Also, keeping backups of all your system
|
||
files lets you tinker with a BIT of a parachute... if something gets totally
|
||
whacked out, you can retrace your steps. A pretty good caveat to keep in
|
||
mind is:
|
||
|
||
<P>
|
||
NEVER HACK WHAT YOU CAN'T UNHACK!
|
||
|
||
<P>
|
||
If you make changes, always give yourself a means of backing out completely
|
||
and restoring things to their original state. Practice safe LinuX! :-)
|
||
|
||
<P>
|
||
While you can implement a plan to save config files at ANY time, it's
|
||
probably ideal to do so when you're planning a system upgrade or reinstall.
|
||
I think you'll be impressed by the creativity and the thoughtfulness of the
|
||
ideas shared by these folks.
|
||
|
||
<P>
|
||
Please keep in mind that this and all material presented here is
|
||
copyrighted by its respective authors. If you modify any of these programs and
|
||
wish to make it publicly available, please contact the author. Most of all,
|
||
enjoy! -- John</I>]
|
||
|
||
<P>
|
||
<A HREF="#toc"><IMG ALIGN=BOTTOM SRC="./gx/toc.gif"></A>
|
||
<A HREF="mailto: fiskjm@ctrvax.vanderbilt.edu"><IMG ALIGN=BOTTOM
|
||
SRC="./gx/sendmail.gif"></A>
|
||
<A HREF="./gazette_toc.html"><IMG ALIGN=BOTTOM SRC="./gx/index.gif"></A>
|
||
<A HREF="./linux/linux.html"><IMG ALIGN=BOTTOM SRC="./gx/home.gif"></A>
|
||
<BR><BR>
|
||
<HR>
|
||
<!-- --------------------------------------------------------------------- -->
|
||
|
||
|
||
|
||
|
||
<!-- HACK SCRIPT2 -------------------------------------------------------- -->
|
||
<H2><A NAME="hack2"><IMG ALIGN=BOTTOM SRC="../gx/text.gif">Building Another Great
|
||
<I>hack</I> script by Judith Elaine</A></H2>
|
||
|
||
<P>
|
||
Date: Mon, 16 Oct 1995 19:47:49 CDT<BR>
|
||
From: Judith Elaine <blondie@cybertia.org.tenn.com><BR>
|
||
To: <fisk@web.tenn.com><BR>
|
||
Subject: linux program date<BR><BR>
|
||
|
||
<P>
|
||
Dear John,
|
||
|
||
<P>
|
||
Well, I'm sitting here skimming through the August and September copies
|
||
of the Linux Gazette as i download software i've been saving at work --
|
||
an 8 Meg tarred and compressed file.
|
||
|
||
<P>
|
||
I had taken your suggestion to write a backup script to heart last night
|
||
and wrote not only a script like your "hack," which so neatly stores
|
||
the original distribution, but also a program to save my modifications.
|
||
|
||
<PRE>
|
||
------------------------------- CUT HERE ------------------------------
|
||
#!/bin/sh
|
||
#
|
||
# /usr/local/bin/savemod -- in the spirit of safehack
|
||
#
|
||
# Copyright (c) 1995 Judith Elaine
|
||
#
|
||
#
|
||
DIR=/usr/local/modifications
|
||
\cp $1 $DIR/$1.`date +%d%h%y`
|
||
echo " " >> $DIR/$1.`date +%d%h%y`
|
||
echo "#>> "$PWD/$1" copied over on "`date` >> $DIR/$1.`date +%d%h%y`
|
||
echo Made a backup of $1.
|
||
------------------------------- CUT HERE ------------------------------
|
||
</PRE>
|
||
|
||
<P>
|
||
You'll note i use the "date" program and a technique called
|
||
command substitution, or something like that. I'm sure with some
|
||
fiddling around and reading the man page you'll figure out the important
|
||
points about date.
|
||
|
||
<P>
|
||
I'm using it here in several interesting (to me at least -- it's how i
|
||
sort out all my data analysis at work!) ways. First, i copy the file i
|
||
want to save to the "safe" directory and give it the same name PLUS
|
||
the date of the transfer. While i can find out useful last
|
||
modification times with ls, i can't archive multiple versions unless i
|
||
give them unique names. This automatically does that. (I suppose, if
|
||
you change files a lot during the day, you might want to append the
|
||
hour and minute, as well.) Thus, the invocation
|
||
|
||
<PRE>
|
||
# cp h h.`date +%d%h%y`
|
||
</PRE>
|
||
|
||
<P>
|
||
copies the file h to one with today's date appended at the end:
|
||
|
||
<PRE>
|
||
# ls h*
|
||
h h.16Oct95
|
||
</PRE>
|
||
|
||
<P>
|
||
The second way i use date is to add a comment line at the very end of
|
||
the file which notes the path of the original file ($PWD/$1 could
|
||
admittedly be a roundabout path, but it'll still make sense) and,
|
||
redundantly the date of the backup. I suppose i could add a line which
|
||
would append the file name to a backup tarring list, as you suggest we
|
||
keep in the August issue.
|
||
|
||
<P>
|
||
Hmmmm.
|
||
|
||
<P>
|
||
Just about halfway through the 8 Meg....
|
||
|
||
<P>
|
||
Thanks again for an EXCELLENT resource!
|
||
|
||
<P>
|
||
Cheers,
|
||
|
||
<P>
|
||
<A HREF="mailto: blondie@cybertia.org.tenn.com">Judith Elaine
|
||
<blondie@cybertia.org.tenn.com></A>
|
||
|
||
<P>
|
||
[<I>Boy... my "thank you" list just keeps getting long and
|
||
longer... :-) Sincerest thanks and kudos go to Judith Elaine for kindly
|
||
submitting this version of the hack script program. As you can see by
|
||
the Date: field, both Judith and Ross wrote at almost identical dates
|
||
confirming something I've suspected for quite some time... great minds
|
||
not only think alike, but synchronously as well! :-) After you've messed
|
||
around with these scripts drop Judith and Ross a note of thanks!
|
||
--John</I>]
|
||
|
||
<P>
|
||
<A HREF="#toc"><IMG ALIGN=BOTTOM SRC="./gx/toc.gif"></A>
|
||
<A HREF="mailto: fiskjm@ctrvax.vanderbilt.edu"><IMG ALIGN=BOTTOM
|
||
SRC="./gx/sendmail.gif"></A>
|
||
<A HREF="./gazette_toc.html"><IMG ALIGN=BOTTOM SRC="./gx/index.gif"></A>
|
||
<A HREF="./linux/linux.html"><IMG ALIGN=BOTTOM SRC="./gx/home.gif"></A>
|
||
<BR><BR>
|
||
<HR>
|
||
<!-- --------------------------------------------------------------------- -->
|
||
|
||
|
||
|
||
|
||
<!-- RCS ---------------------------------------------------------- -->
|
||
<H2><A NAME="rcs"><IMG ALIGN=BOTTOM SRC="../gx/text.gif">RCS: Managing
|
||
System Config Files by Nick LeRoy
|
||
</A></H2>
|
||
|
||
<P>
|
||
Date: Tue, 07 Nov 1995 14:42:15 CST<BR>
|
||
From: Nicholas R LeRoy <nleroy@norland.com><BR>
|
||
To: <fiskjm@ctrvax.Vanderbilt.Edu><BR>
|
||
Subject: Linux Gazette<BR><BR>
|
||
|
||
<P>
|
||
John..
|
||
|
||
<P>
|
||
Sent you some e-mail a while back about the Linux Gazette, and here's
|
||
another tip probably worth publishing. I haven't searched through all
|
||
issues yet, but I don't see it in there. If it is, sorry...
|
||
|
||
<P>
|
||
In your July issue, you describe copying files to /config_dist or such
|
||
for back-up purposes. Such a mechanism is useful, indeed, but I believe
|
||
that there is a *better* solution: RCS. Install the RCS package, and
|
||
let RCS store *all* your previous versions. This allows you to store
|
||
a change history, change description, etc. with all files. With RCS
|
||
you can ask: What did I change to my hosts file? I had an old version
|
||
of sendmail.cf that worked, and now its broken. What's changed?
|
||
I solved this problem once before. How? Etc.
|
||
|
||
<P>
|
||
Oh. RCS stands for Revision Control System, and is GNU software.
|
||
|
||
<P>
|
||
Here's a brief summary on the use of RCS. Pretend that the file you want
|
||
to manage is '/directory/file'.
|
||
|
||
<OL>
|
||
<LI> Obtain and install.<BR>
|
||
Probably should do: man rcsintro for an introduction<BR><BR>
|
||
|
||
<LI> To put a file under revision control:<BR>
|
||
cd /directory<BR>
|
||
mkdir RCS (not required, but recomended.)<BR>
|
||
ci -u file Puts the file under revision control.<BR>
|
||
answer questions Describe the file to RCS.<BR>
|
||
Note that file is now r--r--r-- (read only).<BR><BR>
|
||
|
||
<LI> To Check out a file:<BR>
|
||
co -l file Checks out the file (now writable).<BR>
|
||
You may now modify the file.<BR><BR>
|
||
|
||
<LI> When done, check it back in:<BR>
|
||
ci -u file (Will ask your for change description)<BR>
|
||
description_of_changes (Describe what you did to the file).<BR>
|
||
(File is now r--r--r-- again).<BR><BR>
|
||
|
||
<LI> To get a log of the file:<BR>
|
||
rlog file<BR>
|
||
|
||
<LI> To find differences between current and last checked in:<BR>
|
||
rcsdiff file<BR><BR>
|
||
|
||
</OL>
|
||
|
||
<P>
|
||
Many more things. Do read the man page. Its worth the effort to learn!
|
||
|
||
<P>
|
||
<A HREF="mailto: nleroy@norland.idcnet.com">-- Nicholas R. LeRoy
|
||
<nleroy@norland.idcnet.com></A>
|
||
|
||
<PRE>
|
||
+--------------------------------------+-------------------------------------+
|
||
| /`-_ Nicholas R LeRoy | Linux -- What *nix was meant to be. |
|
||
|{ }/ nleroy@norland.idcnet.com | gcc -- What C was meant to be. |
|
||
| \ * / Norland Corp +-------------------------------------+
|
||
| |___| W6340 Hackbarth Rd | Escape the Gates of Hell with |
|
||
| Fort Atkinson, WI 53530 | The choice of a GNU generation... |
|
||
+--------------------------------------+-------------------------------------+
|
||
| Hey -- These are my own ideas, not my employer's. Don't blame them... |
|
||
+--------------------------------------+-------------------------------------+
|
||
</PRE>
|
||
|
||
[<I>Nick's suggestion was one of those
|
||
"slap-your-forehead-for-not-thinking-of-this" kind of ideas. I'd been
|
||
using RCS for keeping track of the various programming assignments I'd been working
|
||
on at school. Using RCS for managing system configuration files is an excellent
|
||
idea and is a powerful method of keeping track of various CHANGES you've made
|
||
along the way. Nick is VERY right... RCS is definitely worth the effort to learn!
|
||
--John</I>]
|
||
|
||
<P>
|
||
<A HREF="#toc"><IMG ALIGN=BOTTOM SRC="./gx/toc.gif"></A>
|
||
<A HREF="mailto: fiskjm@ctrvax.vanderbilt.edu"><IMG ALIGN=BOTTOM
|
||
SRC="./gx/sendmail.gif"></A>
|
||
<A HREF="./gazette_toc.html"><IMG ALIGN=BOTTOM SRC="./gx/index.gif"></A>
|
||
<A HREF="./linux/linux.html"><IMG ALIGN=BOTTOM SRC="./gx/home.gif"></A>
|
||
<BR><BR>
|
||
<HR>
|
||
<!-- --------------------------------------------------------------------- -->
|
||
|
||
|
||
|
||
|
||
<!-- SUPERMOUNT ---------------------------------------------------------- -->
|
||
<H2><A NAME="supermount"><IMG ALIGN=BOTTOM SRC="../gx/text.gif">Supermount:
|
||
Mounting Floppies the <I>VERY Easy</I> Way by Daniel Sully </A></H2>
|
||
|
||
<P>
|
||
Date: Sat, 04 Nov 1995 23:54:50 CST<BR>
|
||
From: Daniel Sully <daniel@joshua.cco.net><BR>
|
||
To: <fiskjm@ctrvax.Vanderbilt.Edu><BR>
|
||
Subject: Neato linux util, and aliases<BR>
|
||
|
||
<P>
|
||
Hi there.. I've read all of your Linux Gazette issues, and think that you
|
||
are doing a great job! TLG, gives tips and neat little things that say
|
||
the O'Rielly books, or the LDP won't have, and i think that is a big draw..
|
||
|
||
<P>
|
||
2) I may be able to mirror the LG site.. but first just wondering, all of
|
||
the notices about your site being overloaded.. what type of
|
||
hardware/bandwidth do you have to be overloaded? I don't want to bog
|
||
down my system too much =) I am on a full T1 with a 80Mhz DX2 linux box,
|
||
for web serving..
|
||
|
||
<P>
|
||
c) For TLG: check out the supermount patches, available at:
|
||
|
||
<P>
|
||
<A HREF="ftp://sunsite.unc.edu:/pub/Linux/kernel/patches/diskdrives/supermount-0.4a.tar.gz">
|
||
sunsite.unc.edu:/pub/Linux/kernel/patches/diskdrives/supermount-0.4a.tar.gz</A>
|
||
|
||
<P>
|
||
it's a kernel patch that allows dynamic mounting of floppy and cdrom drives..
|
||
|
||
<P>
|
||
you just add a little to your /etc/fstab file, recompile the kernel, and
|
||
then, you can put a disk in the drive, cd /floppy and it mounts if for
|
||
you. You can even remove the disk, and it will auto umount..
|
||
|
||
<P>
|
||
AND.. for the 100 door prize.. for all the DOS converts, (most of us)
|
||
|
||
<P>
|
||
in ~/.bash_profile
|
||
|
||
<PRE>
|
||
alias a:='cd /floppya'
|
||
alias b:='cd /floppyb'
|
||
alias c:='cd /dosc'
|
||
alias d:='cd /dosd'
|
||
alias e:='cd /cdrom'
|
||
</PRE>
|
||
|
||
<P>
|
||
pretty cool huh? I think so... =)
|
||
|
||
<P>
|
||
Thanks for your time.
|
||
|
||
<P>
|
||
Daniel Sully<BR>
|
||
daniel@cco.net<BR>
|
||
.sig got eaten<BR>
|
||
|
||
|
||
<H3>And in reply to my question about mounting floppies read/write:</H3>
|
||
|
||
<P>
|
||
Date: Mon, 06 Nov 1995 11:13:53 CST<BR>
|
||
From: Daniel Sully <daniel@joshua.cco.net><BR>
|
||
To: John M. Fisk <fiskjm@ctrvax.Vanderbilt.Edu><BR>
|
||
Subject: RE: Neato linux util, and aliases<BR><BR>
|
||
|
||
<P>
|
||
No, I mount my floppies as
|
||
|
||
<PRE>
|
||
/ /floppya supermount rw,dev=/dev/fd0
|
||
</PRE>
|
||
|
||
<P>
|
||
in my fstab file... thats it.
|
||
|
||
<P>
|
||
Daniel<BR>
|
||
daniel@cco.net<BR>
|
||
|
||
<P>
|
||
On Mon, 6 Nov 1995, John M. Fisk wrote:
|
||
|
||
<PRE>
|
||
> Dan, I managed to get my hands on a copy of supermount and recompiled
|
||
> my kernel -- no trouble at all. I haven't played with it yet, but in
|
||
> looking over the docs noticed that you need to mount devices read only.
|
||
> Has this been a problem at all for you? CD's would obviously be read
|
||
> only, but floppies are often used for BOTH read and write op's, at
|
||
> least I use mine for that... I keep a lot of stuff archived to floppy
|
||
> to save on HD space and routinely cp to and from floppies... how do
|
||
> you get around this?
|
||
</PRE>
|
||
|
||
<H3>And for those of you who are interested... </H3>
|
||
|
||
<P>
|
||
Yup! After a bit of tinkering and a kernel recompile, supermount is up and
|
||
running on <B>FiskHaus</B> and it seems to be working great! If you're an
|
||
old DOS convert who's forever forgetting to "umount" those floppies
|
||
then you'll definitely want to give this thing a whirl.
|
||
|
||
<P>
|
||
FYI... I'm using kernel 1.2.13 and the supermount-0.4a.tar.gz file that can
|
||
be found on sunsite.unc.edu and mirrors as listed above. If you're interested,
|
||
here's what I found worked...
|
||
|
||
<P>
|
||
But before we proceed, let me <B>STRONGLY</B> urge you to read the README that
|
||
comes with this program. If you're doing your own Linux sysadmin then you need
|
||
to know what's going on. I'll tell you what <I>I</I> did to get this thing
|
||
working... it's up to you to make sure it'll work for your system.
|
||
|
||
<P>
|
||
<I>Caveat emptor...</I>
|
||
|
||
<P>
|
||
Basically, the steps are:
|
||
|
||
<OL>
|
||
<LI>unarchive the file and read the README's
|
||
<LI>apply the kernel patch
|
||
<LI>edit /etc/fstab
|
||
<LI>reboot the system
|
||
</OL>
|
||
|
||
<P>
|
||
When you unarchive the file you'll find the files:
|
||
|
||
<PRE>
|
||
supermount-0.4a-1.2.13.ud.gz
|
||
supermount-0.4a-1.3.30.ud.gz
|
||
supermount-README
|
||
</PRE>
|
||
|
||
The first file is the unified diff for the 1.2.13 kernel and the second is for
|
||
the 1.3.30 kernel for all you "riding the ragged edge of destruction"
|
||
kinda folks :-)
|
||
|
||
<P>
|
||
Gunzip the one you need and cp it to your /usr/src directory. And in the spirit
|
||
of "never fail to state the obvious..." it goes without saying that
|
||
you'll need a FULL kernel source to work with and not simply the includes.
|
||
|
||
<P>
|
||
After you've done this, to apply the patch simply enter:
|
||
|
||
<PRE>
|
||
patch -p0 < supermount-0.4a-1.2.13.ud
|
||
-OR-
|
||
patch -p0 < supermount-0.4a-1.3.30.ud
|
||
</PRE>
|
||
|
||
depending on which kernel you happen to be working with. You should see all
|
||
kinds of groovy messages go whizzing by. (Make sure you're in the /usr/src
|
||
directory when you try this little maneuver or else all those groovy little
|
||
messages will be replaced by a "Hmmm... this does'nt seem to be working"
|
||
kind of message.)
|
||
|
||
<P>
|
||
Speed readers -- you'll need to read quickly here, don't worry about content.
|
||
|
||
<P>
|
||
The rest of us will just hang out.
|
||
|
||
<P>
|
||
Now, assuming that this went smoothly (if not... you're on your own Pilgrim...)
|
||
You're ready to compile your new kernel. Since I've gone over this in the
|
||
past, suffice it to say that all you'll need to do is simply:
|
||
|
||
<PRE>
|
||
make config && make dep && make clean &&
|
||
make zImage (or whatever you'd like)
|
||
</PRE>
|
||
|
||
This will take you through the WHOLE process in one fell swoop (now where did
|
||
<I>THAT</I> little turn of speech come from, I wonder... :-<> ). You could
|
||
add a "make mrproper" to the front of all this mess. So, the
|
||
double ampersands will let the process continue as long as there are no errors.
|
||
If you've done the kernel compile thing before you should know how long this
|
||
will take. For most of us, it's the bag 'o Nachos and Gilligan's Island reruns
|
||
while this thing is cooking...
|
||
|
||
<P>
|
||
Oh, before I forget... and just so that you don't end up wasting your time... :-)
|
||
When you are doing the "make config" part you'll come across a line
|
||
that asks you:
|
||
|
||
<PRE>
|
||
Dynamic mounting of removable media?
|
||
</PRE>
|
||
|
||
this is where you'll need to answer "y" to compile in supermount
|
||
support.
|
||
|
||
<P>
|
||
Once this is done, and your new kernel is compiled, DON'T FORGET TO RERUN
|
||
LILO!! Believe me, I've had to reach for the boot disk more than once for
|
||
forgetting to do this... ;-) save yourself the hassle!
|
||
|
||
<P>
|
||
Now, all that's left to do is edit your fstab file. Again, a word of encouragement:
|
||
DON'T BUGGER THIS THING UP!
|
||
|
||
<P>
|
||
There, don't you feel affirmed?
|
||
|
||
<P>
|
||
Ok, ok... seriously... keep a backup of the fstab file. You've already read
|
||
three excellent suggestions in the articles above as to how to do this. Pick
|
||
your weapon! At the very least, make a copy of it and call it something like
|
||
"fstab.currently_working_version_that_I_promise_not_to_delete".
|
||
|
||
<P>
|
||
Use your discretion.
|
||
|
||
<P>
|
||
Now, once again: read the README! It'll tell you what you'll need to add
|
||
for <I>your</I> system. Here's what mine happens to look like at the moment:
|
||
|
||
<PRE>
|
||
#------------------------------------------------------------------------------
|
||
#
|
||
# file: /etc/fstab
|
||
#
|
||
# This sets up the various filesystems which can be mounted at boot up or
|
||
# manually. First we'll set up the boot up filesystems:
|
||
#
|
||
# device mount type options dump fsck
|
||
#------- ----- ---- ------- ---- ----
|
||
/dev/hdb8 swap swap defaults 0 1
|
||
/dev/hdb6 / ext2 defaults 0 1
|
||
/dev/hdb7 /usr/local ext2 defaults 0 1
|
||
none /proc proc defaults 0 0
|
||
/dev/hda2 /c msdos defaults 0 2
|
||
/dev/hdb5 /f msdos defaults 0 2
|
||
#/dev/hda5 /os2 hpfs defaults 0 2
|
||
#------------------------------------------------------------------------------
|
||
#
|
||
# Now, set up the filesystems that can be manually mounted. Use the option
|
||
# "noauto" to keep mount* from mounting the fs at bootup.
|
||
#
|
||
# /dev/fd0H1440 /fd0 ext2 user,noauto 0 0
|
||
# /dev/fd0H1440 /a msdos user,noauto 0 0
|
||
/dev/sbpcd /cdrom iso9660 ro,noauto 0 0
|
||
#
|
||
# Below, let's try using the "supermount" prog which has been compiled into
|
||
# the kernel.
|
||
#
|
||
/ /a supermount rw,fs=msdos,dev=/dev/fd0 0 0
|
||
/ /fd0 supermount rw,fs=ext2,dev=/dev/fd0 0 0
|
||
</PRE>
|
||
|
||
As you probably will notice, I'm stretching the rules just a <I>little</I> bit
|
||
by mounting the floppies for both the msdos and the ext2 filesystems as read
|
||
AND write. DON'T DO THIS YOURSELF WITHOUT READING THE README FILE!
|
||
|
||
<P>
|
||
...well, unless you're the kind to run around with slippery pool on a hot day
|
||
with scissors in your hand... ;-)
|
||
|
||
<P>
|
||
Anyway, edit your fstab file, reboot the system, and you should be ready to
|
||
play! First, however, you might want to check and see what "mount"
|
||
tells you about your filesystems. Simply enter:
|
||
|
||
<PRE>
|
||
mount
|
||
</PRE>
|
||
|
||
and you should see something similar to this:
|
||
|
||
<PRE>
|
||
/dev/hdb6 on / type ext2 (rw)
|
||
/dev/hdb7 on /usr/local type ext2 (rw)
|
||
none on /proc type proc (rw)
|
||
/dev/hda2 on /c type msdos (rw)
|
||
/dev/hdb5 on /f type msdos (rw)
|
||
/ on /a type supermount (rw,fs=msdos,dev=/dev/fd0)
|
||
/ on /fd0 type supermount (rw,fs=ext2,dev=/dev/fd0)
|
||
</PRE>
|
||
|
||
The last two entries should look familiar! Now, if everything's set up OK
|
||
then you're golden!
|
||
|
||
<P>
|
||
You can now dispense with the "mount - umount" cycle each time you
|
||
insert your floppies. Just pop one of those badboys in and command your
|
||
system to:
|
||
|
||
<PRE>
|
||
ls -l /fd0
|
||
</PRE>
|
||
|
||
When I do this now... yup, this is a <I>live</I> demonstration folks...
|
||
Madam... please get your child back... please don't push or shove...
|
||
|
||
<P>
|
||
When I type this in I get:
|
||
|
||
<PRE>
|
||
total 1299
|
||
-rw-r--r-- 1 root root 534714 May 31 14:46 mfm-stat-bin.tar.gz
|
||
-rw-r--r-- 1 root root 67359 May 30 13:39 xcolorsel.tar.gz
|
||
-rw-r--r-- 1 root root 230145 May 30 12:59 xfm-1.3.2.tar.gz
|
||
-rw-r--r-- 1 root root 112640 May 31 14:49 xgoups-1.3.tar.gz
|
||
-rw-r--r-- 1 root root 64204 Jan 20 1995 xinfo-1.01.tar.gz
|
||
-rw-r--r-- 1 root root 297522 May 5 1995 xkeycaps-2.28.tar.gz
|
||
-rw-r--r-- 1 root root 11256 May 30 15:25 xvset-0.90.tar.gz
|
||
</PRE>
|
||
|
||
for one of my archive disks.
|
||
|
||
<P>
|
||
Notice, I <I>didn't</I> have to "mount" anything before doing this
|
||
and I won't have to "umount" anything when I'm done. No smoke, no
|
||
mirrors, and my fingers never leave my hand... :-)
|
||
|
||
<P>
|
||
You get the point... go out and enjoy!
|
||
|
||
<P>
|
||
[<B>Addendum:</B> Supermount is designed to work with BOTH floppies and
|
||
CDROM's. However, after a lot of tinkering around, I wasn't able to get
|
||
the CDROM support to work correctly. It worked correctly only with the
|
||
first CD that was inserted, thereafter it didn't appear to recognize a
|
||
media change and would not <I>ls</I> or <I>cd</I> correctly after changing CD's.
|
||
Now... this DOESN'T mean that it doesn't work, it only means that <I>I</I>
|
||
couldnt' get it to work on my system.
|
||
|
||
<P>
|
||
As a kludge, I found that if I manually "umount'd" and remounted
|
||
/cdrom that things worked OK, but this sort of defeated the purpose of
|
||
using it.
|
||
|
||
<P>
|
||
Because of this, I'll leave it up to you to play around with it. The
|
||
README file describes what you'll need to do to include CDROM support
|
||
(hint: ro,fs=iso9660,dev=/dev/cdrom). If you get it working, drop me a
|
||
note... I'm using a stock Creative Labs SB16 Card and the Creative 2X
|
||
IDE CDROM drive attached to the SB16 card. If you get it working, let me
|
||
know what your hardware setup is.
|
||
|
||
<P>
|
||
Thanks! --John]
|
||
|
||
<P>
|
||
<A HREF="#toc"><IMG ALIGN=BOTTOM SRC="./gx/toc.gif"></A>
|
||
<A HREF="mailto: fiskjm@ctrvax.vanderbilt.edu"><IMG ALIGN=BOTTOM
|
||
SRC="./gx/sendmail.gif"></A>
|
||
<A HREF="./gazette_toc.html"><IMG ALIGN=BOTTOM SRC="./gx/index.gif"></A>
|
||
<A HREF="./linux/linux.html"><IMG ALIGN=BOTTOM SRC="./gx/home.gif"></A>
|
||
<BR><BR>
|
||
<HR>
|
||
<!-- --------------------------------------------------------------------- -->
|
||
|
||
|
||
|
||
|
||
<!-- INITTAB ---------------------------------------------------------- -->
|
||
<H2><A NAME="inittab"><IMG ALIGN=BOTTOM SRC="../gx/text.gif">Logging with Inittab by
|
||
Eric Sorton</A></H2>
|
||
|
||
<P>
|
||
Date: Sun, 22 Oct 1995 01:31:27 CDT<BR>
|
||
From: <eric@smtp.db.erau.edu><BR>
|
||
To: John M. Fisk <fiskjm@ctrvax.Vanderbilt.Edu><BR>
|
||
Subject: RE: Linux Gazette<BR><BR>
|
||
|
||
<PRE>
|
||
> I've had several requests for information about the "init" program
|
||
> and a comparison between the SysV style and the "other style ?"
|
||
> (I'm sorry, I really can't recall at 5:30 am what the other one is)
|
||
</PRE>
|
||
|
||
[<I>the "other style" is BSD :-) --John</I>]
|
||
|
||
<PRE>
|
||
> Anyway, there have been a couple questions about this and how to
|
||
> make effective use of init.
|
||
>
|
||
> If that falls within the realm of your expertise then any ideas,
|
||
> suggestions, or instructions as to how best to use it would be
|
||
> quite helpful!
|
||
</PRE>
|
||
|
||
<P>
|
||
I'm somewhat familiar with BSD style (I admin SunOS 4.1.? for
|
||
the school) and I've used Slackware, which is BSD, for about
|
||
a year. I've just installed RedHat, which is SYSV and am
|
||
currently trying to unwind that ball of yarn. Although I
|
||
can tell the difference between the two, I can't do much
|
||
else. So, I'm not much of an expert and wouldn't feel
|
||
comfortable talking about a subject I don't know much about.
|
||
|
||
<P>
|
||
Here's a tip if you can fit it in somewhere ... It deals
|
||
with the inittab file. I needed/wanted to display a log
|
||
file to a VT ... I'd seen people do it using syslog and
|
||
redirecting syslog to the VT (ask me and I'll explain), but
|
||
my log file didn't go through syslog. I came up with this
|
||
solution.
|
||
|
||
<P>
|
||
Put the following line in your initab:
|
||
|
||
<PRE>
|
||
c7:45:respawn:/usr/bin/tail -f /var/adm/log.smb >> /dev/tty7
|
||
</PRE>
|
||
|
||
<P>
|
||
Here's a short explination of the fields:
|
||
|
||
<UL>
|
||
<LI>c7 is the VT (use c1 for VT1, c2 for VT2, etc...)<BR><BR>
|
||
<LI>45 are the runlevels, use this for a default Slackware,<BR>
|
||
use 3 for a default RedHat.<BR><BR>
|
||
<LI>respawn makes it come back if the process dies for<BR>
|
||
some reason...<BR><BR>
|
||
<LI>/usr/bin/tail is the command to run, in this case<BR>
|
||
tail -f, which displays the tail end of a<BR>
|
||
file and continuously displays new stuff<BR>
|
||
as it is appened to the file.<BR><BR>
|
||
<LI>/var/adm/log.smb is the filename to display on<BR>
|
||
the VT.<BR><BR>
|
||
<LI>/dev/tty7 is the VT to display to, should match the<BR>
|
||
first field.<BR><BR>
|
||
</UL>
|
||
|
||
<P>
|
||
Hope that is clear, its a little rough, but I believe it
|
||
will get the point across. Feel free to clean it up and
|
||
put it in the Gazette, I've found it to be a useful tip.
|
||
|
||
<PRE>
|
||
--
|
||
/-=-=-=-=-=-=-=-=-=-=-<<< ERIC F SORTON >>>-=-=-=-=-=-=-=-=-=-=-\
|
||
| eric@db.erau.edu -- Embry Riddle Aeronautical University |
|
||
| Graduate Administrator Aerospace Engineering Computer Systems |
|
||
| Phone: (904) 226-6752 Office: E&T 208 |
|
||
|-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-|
|
||
| Certainly the game is rigged. Don't let that stop you; |
|
||
| if you don't bet, you can't win. --RAH |
|
||
\-=-=-=-=-=-=<<< HTTP://ERAU.DB.ERAU.EDU/~ERIC/ >>>=-=-=-=-=-=-/
|
||
</PRE>
|
||
|
||
<H3>Logging messages to files & the console...</H3>
|
||
|
||
<P>
|
||
The full details of using <B>syslog</B> for system error logging are a bit more
|
||
than I want to get into at the moment. However, Eric did bring up an issue that
|
||
is probably worth mentioning here: printing system messages to both file and
|
||
screen.
|
||
|
||
<P>
|
||
BSD-style error logging, as is frequently used with various Linux distributions,
|
||
utilizes the <B>syslog</B> daemon to route system and error messages from various
|
||
processes and programs and write them to a specified output. This facility is
|
||
available for quite a few processes including printing, mail, the kernel, login
|
||
authentication, and so forth. For those of you who've set up PPP and used the
|
||
README that comes with the ppp-2.1.2[x] distribution you've read the suggestions
|
||
regarding setting up error logging.
|
||
|
||
<P>
|
||
Again, not to go into a full blown discussion of error logging... it is possible
|
||
to have syslog write system messages to both file and console by including an
|
||
entry for the process you want in /etc/syslog.conf.
|
||
|
||
<P>
|
||
Using the PPP setup example: error logging for PPP is provided by including:
|
||
|
||
<PRE>
|
||
local2.* /var/adm/ppplog
|
||
local2.* /dev/console
|
||
</PRE>
|
||
|
||
in your /etc/syslog.conf file.
|
||
|
||
<P>
|
||
The thing to point out is that there are <I>two</I> entries for the
|
||
"local2.*" logging facility. The first logs the output to the usual
|
||
administrative logging file /var/adm/ppplog. Obviously, you can specify any
|
||
filename you wish for this purpose. The next line also logs the output of
|
||
"local2.*" but this time sends it to /dev/console -- your screen!
|
||
By including dual stanzas for both file and console output you can log
|
||
messages to multiple outputs.
|
||
|
||
<P>
|
||
For an enjoyable and very enlightening discussison of the various aspects of
|
||
system administration I'd highly recommend to you the book:
|
||
|
||
<P>
|
||
<B>Essential System Administration, Second Edition by Aeleen Frisch</B><BR>
|
||
Pub: O'Reilly, ISDN: 1-56592-127-5
|
||
|
||
<P>
|
||
Aeleen Frisch is a marvelous writer with a wealth of practical experience. She
|
||
writes in a task-oriented fashion that provides information about how to get
|
||
things done as well as how things work! This second edition also includes a
|
||
number of sections devoted to Linux, as well as the other popular commercial
|
||
UNIX iterations.
|
||
|
||
<P>
|
||
This is definitely one of those books to put on your Christmas List...!
|
||
|
||
<P>
|
||
--John
|
||
|
||
<P>
|
||
<A HREF="#toc"><IMG ALIGN=BOTTOM SRC="./gx/toc.gif"></A>
|
||
<A HREF="mailto: fiskjm@ctrvax.vanderbilt.edu"><IMG ALIGN=BOTTOM
|
||
SRC="./gx/sendmail.gif"></A>
|
||
<A HREF="./gazette_toc.html"><IMG ALIGN=BOTTOM SRC="./gx/index.gif"></A>
|
||
<A HREF="./linux/linux.html"><IMG ALIGN=BOTTOM SRC="./gx/home.gif"></A>
|
||
<BR><BR>
|
||
<HR>
|
||
<!-- --------------------------------------------------------------------- -->
|
||
|
||
|
||
|
||
|
||
|
||
<!-- SETTERM ---------------------------------------------------------- -->
|
||
<H2><A NAME="setterm"><IMG ALIGN=BOTTOM SRC="../gx/text.gif">More Setterm Fun
|
||
by Gary Jaffe</A></H2>
|
||
|
||
<P>
|
||
Date: Sun, 05 Nov 1995 21:05:00 CST<BR>
|
||
Sender: <gary@shadow.net><BR>
|
||
From: Gary Jaffe <gjaffe@shadow.net><BR>
|
||
To: <fiskjm@ctrvax.Vanderbilt.Edu><BR>
|
||
Subject: setterm suggestion<BR><BR>
|
||
|
||
John --<BR><BR>
|
||
|
||
<P>
|
||
I love reading your tips on Linux. I particularly enjoyed the article on
|
||
setterm. You suggested adding the following to your ~/.bash_profile
|
||
|
||
<PRE>
|
||
case "$V_TERMINAL" in
|
||
"/dev/tty1") setterm -background black -foreground white -store;;
|
||
"/dev/tty2") setterm -background black -foreground white -store;;
|
||
"/dev/tty3") setterm -background black -foreground white -store;;
|
||
"/dev/tty4") setterm -background black -foreground white -store;;
|
||
"/dev/tty5") setterm -background black -foreground white -store;;
|
||
"/dev/tty6") setterm -background black -foreground white -store;;
|
||
esac
|
||
</PRE>
|
||
|
||
<P>
|
||
You might try adding the following to your /etc/rc.d/rc.local file instead.
|
||
|
||
<PRE>
|
||
setterm -background black -foreground white -store >/dev/tty1
|
||
setterm -background black -foreground white -store >/dev/tty2
|
||
setterm -background black -foreground white -store >/dev/tty3
|
||
setterm -background black -foreground white -store >/dev/tty4
|
||
setterm -background black -foreground white -store >/dev/tty5
|
||
setterm -background black -foreground white -store >/dev/tty6
|
||
</PRE>
|
||
|
||
<P>
|
||
This has the advantage of not having to go through this code every time you
|
||
login. If you set the background color to anything but black, you might also
|
||
want to clear the screen as follows.
|
||
|
||
<PRE>
|
||
clear >/dev/tty1
|
||
</PRE>
|
||
|
||
<P>
|
||
<A HREF="mailto: gjaffe@shadow.net">Gary Jaffe <gjaffe@shadow.net></A>
|
||
|
||
<H3>And just one more thought...</H3>
|
||
|
||
<P>
|
||
This is the cool thing about Linux... there's usually several ways of getting
|
||
things done and they are all pretty fun to tinker with! Gary's suggestion not
|
||
only allows you to set each terminal color, but gets things set up without your
|
||
having to log in first!
|
||
|
||
<P>
|
||
Mucho Cool!
|
||
|
||
<P>
|
||
Also, after playing with <B>setterm</B> a bit more I found that if you include the
|
||
"-bold" option you can get foreground color enhancement. In other words,
|
||
I've currently got VT1 set up to be yellow text on a blue background. If you type
|
||
in simply:
|
||
|
||
<PRE>
|
||
setterm -foreground yellow -background blue -store
|
||
</PRE>
|
||
|
||
the "yellow" is actually rather brown :-( However, to brighten things
|
||
up a bit, try adding:
|
||
|
||
<PRE>
|
||
setterm -foreground yellow -bold -background blue -store
|
||
</PRE>
|
||
|
||
and things will look a LOT better! :-)
|
||
|
||
<P>
|
||
Give it a whirl!
|
||
|
||
<P>
|
||
<A HREF="#toc"><IMG ALIGN=BOTTOM SRC="./gx/toc.gif"></A>
|
||
<A HREF="mailto: fiskjm@ctrvax.vanderbilt.edu"><IMG ALIGN=BOTTOM
|
||
SRC="./gx/sendmail.gif"></A>
|
||
<A HREF="./gazette_toc.html"><IMG ALIGN=BOTTOM SRC="./gx/index.gif"></A>
|
||
<A HREF="./linux/linux.html"><IMG ALIGN=BOTTOM SRC="./gx/home.gif"></A>
|
||
<BR><BR>
|
||
<HR>
|
||
<!-- --------------------------------------------------------------------- -->
|
||
|
||
|
||
|
||
|
||
<!-- VI TRICKS ---------------------------------------------------------- -->
|
||
<H2><A NAME="vi"><IMG ALIGN=BOTTOM SRC="../gx/text.gif">Still <I>more</I> VI
|
||
Tricks by Jens Wessling</A></H2>
|
||
|
||
<P>
|
||
Date: Sat, 14 Oct 1995 10:35:02 CDT<BR>
|
||
From: Jens Wessling <wessling@emunix.emich.edu><BR>
|
||
To: <fisk@web.tenn.com><BR>
|
||
Subject: Vi Rules!!<BR><BR>
|
||
|
||
<P>
|
||
Hi,
|
||
|
||
<P>
|
||
I just wanted to share some interesting vi tricks with you and see if
|
||
might be interested in putting them in the gazette.
|
||
|
||
<P>
|
||
The first time I used vi, my reaction was much the same as everyone
|
||
elses is the first time they encounter it. yechhh!! This makes no
|
||
sense. Then, over time, I got more and more used to it. I made one
|
||
brief attempt to use emacs, spent 45 minutes trying to get out, and
|
||
vowed to return to my old faithful editor, vi.
|
||
|
||
<P>
|
||
The one thing that I have found true of people who use vi, is that the
|
||
longer anyone uses it, the less objectionable it becomes. It is now
|
||
more common for me to have random escape sequences in other editors,
|
||
than it is for me to try to input in command mode in vi.
|
||
|
||
<P>
|
||
First, did you know that vi comes with a configuration file. (like just
|
||
about every other Linux program) You might think that it would be
|
||
called .virc. It is not. It is called .exrc. This, for those of you
|
||
who do not know, is because vi is a full screen derivation of the line
|
||
editor ex. In fact, in some places, vi and ex are both calls to the
|
||
same program, which then uses arv[0] to determine whether or not to run
|
||
it full screen or not.
|
||
|
||
<P>
|
||
Well, what can you do with this .exrc file you ask. Well, I will tell
|
||
you. First of all, I can't stand the silly 8 character default for
|
||
tabs. That is way way to large for programming. By the time you have
|
||
embedded a loop or two, you are shooting off of the screen. To change
|
||
this to something more reasonable, try adding 'set tabstop=3'. This
|
||
will take care of setting it for you. You can also use this to set any
|
||
of the other vi set commands, like beautify, timeout, autoindent, etc.
|
||
Check them out.
|
||
|
||
<P>
|
||
The next vi trick is a good one. If you have used one of the new
|
||
Windows based word processors, you may have seen a "new" feature. It is
|
||
usually billed as a continuous spell checker or something like that.
|
||
What it does is check what you are typing as you go, and if it
|
||
recongnizes a misspelling, it corrects it immediately. Well, vi has
|
||
been doing this for years. And here is how it works. Try adding the
|
||
following to your .exrc file.
|
||
|
||
<PRE>
|
||
ab cant can't
|
||
ab dont don't
|
||
ab HW Hello World
|
||
</PRE>
|
||
|
||
<P>
|
||
Now re-enter vi and try typing cant dont and HW. When you type these, they
|
||
are immediately replaced by what you put on the right side of the ab command.
|
||
|
||
<P>
|
||
This may not seem immediately useful, but it can be extended to do much more.
|
||
Try adding the following:
|
||
|
||
<PRE>
|
||
ab homead sMyNameCtrl+vReturn123 MyStreetCtrl+vReturnMy Twn, MyState
|
||
</PRE>
|
||
|
||
<P>
|
||
Now when you type home, it will print out your address. Another handy one
|
||
that I use is:
|
||
|
||
<PRE>
|
||
ab ee wessling@emunix.emich.edu
|
||
</PRE>
|
||
|
||
<P>
|
||
Now it takes only two key-strokes to put my e-mail address in any document.
|
||
In case you are worried, it won't replace the ee in 'week' for example.
|
||
|
||
<P>
|
||
This should work on almost all vi editors, but no guarantees. This is just
|
||
a very small example of what you can do with vi. It is very powerful and
|
||
easily customizable.
|
||
|
||
<P>
|
||
By the way, there is plenty more where that came from.
|
||
|
||
<PRE>
|
||
|
||
jEnS Wessling
|
||
|
||
--
|
||
==========================================================================
|
||
==== Jens Wessling == "A compiler ought to compile the ====
|
||
==== wessling@emunix.emich.edu == comments and ignore the code." ====
|
||
==== == M. Minsky(or close to it) ====
|
||
==========================================================================
|
||
</PRE>
|
||
|
||
<H3>just my 2 cents... </H3>
|
||
|
||
<P>
|
||
Jens' letter brought to mind a truism that my Mom used to tell me all the
|
||
time when I was a kid:
|
||
|
||
<P>
|
||
"There's no arguing about taste."
|
||
|
||
<P>
|
||
I happen to like and use VIM a lot and find, like Jens, that the more I get
|
||
used to it the more I like it and the faster I can get things done. In
|
||
reality, the same could probably be said if I'd started to use Emacs first,
|
||
or Jed, or Joe, or... :-) Since the grist of flamewars is often issues
|
||
of preference, I appreciate NOT getting flamed for airing my admittedly
|
||
biased preferences. I'd be ecstatic (or, well... pretty pleased at the
|
||
very least... :-) if someone who knew something about Emacs wrote in with
|
||
some ideas or suggestions for using it. I'm still in the process of learning
|
||
Emacs and can't say that I've had too many epiphanies yet...
|
||
|
||
<P>
|
||
Here's just a couple more little tips to help VI users on their way...
|
||
|
||
<UL>
|
||
<LI>You know that using the "/" forward slash lets you
|
||
grep through your file, but using the "?" question
|
||
mark (in command mode) lets you perform a backwards search.
|
||
Also, hitting the letter "n" will repeat your search
|
||
in whichever direction you were last going.
|
||
|
||
<P>
|
||
So, for example, if you were looking for each occurance of a
|
||
URL beginning with "sunsite.unc.edu" you'd simply
|
||
enter:
|
||
|
||
<PRE>
|
||
/sunsite.unc.edu
|
||
</PRE>
|
||
|
||
while in command mode and the search would take you to the next
|
||
instance of this entry. Hitting "n" lets you repeat this
|
||
forward search. Now, hitting "?" will let you do a
|
||
backwards search. Hit "n" now and it'll continue to do
|
||
a backward search.
|
||
<P>
|
||
|
||
<LI>Want to repeat a prior command but are too lazy to type it all in? :-)
|
||
Hey, that's cool... we can do this... Just hit the "."
|
||
period while in command mode and <I>Shaaa Zzzamm!!</I> instant
|
||
"your-wish-is-my-command" type dito service!
|
||
<P>
|
||
|
||
<LI>Hey, ever typed something up, gone to print it, and realized that your
|
||
margins were <I>just</I> a bit too long and your sentences were
|
||
getted decapitated at the ends...?
|
||
|
||
<P>
|
||
Bummer! ;-)
|
||
|
||
<P>
|
||
Well, you could go back and try to hack around with moving things
|
||
around, OR you could let the nifty little program <B>fmt</B> do
|
||
a bit of formatting for you. This handy dandy little app will
|
||
format the stuff piped into it into neat little 72 column
|
||
paragraphs. It doesn't justify the text, but it DOES keep your
|
||
right hand margins at about 72 so everything gets printed nicely.
|
||
|
||
<P>
|
||
Since I'm using VIM, I can highlight the text I want to format using
|
||
the "v" option while in command mode. Moving the cursor
|
||
highlights the text I want to pass to fmt. Now, just hit the
|
||
"!" exclamation point key and type in "fmt"
|
||
after the exclamation point.
|
||
|
||
<P>
|
||
Hit ENTER and, PRESTO!, instant neatness.
|
||
|
||
<P>
|
||
Very cool.
|
||
|
||
<P>
|
||
Now, you can do the same thing from the command line: Just
|
||
type in the row numbers that you want to process followed by
|
||
the exclamation point. So, if you want to format lines 10
|
||
through 50, you'd type in:
|
||
|
||
<PRE>
|
||
:10,50! fmt
|
||
</PRE>
|
||
|
||
<P>
|
||
hit the ENTER key, and it's done!
|
||
<P>
|
||
</UL>
|
||
|
||
<P>
|
||
<A HREF="#toc"><IMG ALIGN=BOTTOM SRC="./gx/toc.gif"></A>
|
||
<A HREF="mailto: fiskjm@ctrvax.vanderbilt.edu"><IMG ALIGN=BOTTOM
|
||
SRC="./gx/sendmail.gif"></A>
|
||
<A HREF="./gazette_toc.html"><IMG ALIGN=BOTTOM SRC="./gx/index.gif"></A>
|
||
<A HREF="./linux/linux.html"><IMG ALIGN=BOTTOM SRC="./gx/home.gif"></A>
|
||
<BR><BR>
|
||
<HR>
|
||
<!-- --------------------------------------------------------------------- -->
|
||
|
||
|
||
|
||
<!-- KSCREEN ---------------------------------------------------------- -->
|
||
<H2><A NAME="kscreen"><IMG ALIGN=BOTTOM SRC="../gx/text.gif">Using <I>kscreen</I>
|
||
to clean up that Screen Mess!</A></H2>
|
||
|
||
<P>
|
||
Ok... here's one that really makes my obsessive-compulsive tidy left brain
|
||
just sing...
|
||
|
||
<P>
|
||
Ever been messing around with something... you know... minding your own business
|
||
and trying to get a bit of work done when all of a sudden...
|
||
|
||
<P>
|
||
<I>Shaaa ZZzammm!!!</I>
|
||
|
||
<P>
|
||
There's a bit of crackling and popping and suddenly you're looking at a screen
|
||
full of Sanskrit...?
|
||
|
||
<P>
|
||
Arrggghhh...!!! MEGA-BUMMER! :-(
|
||
|
||
<P>
|
||
I was recently trying to get the recent version of <B>xfig</B> to compile with
|
||
jpeg support and it stubbornly refused to link in the jpeg stuff after 20 minutes
|
||
of compiling. Well, in trying to track down the miscretant functions I did a
|
||
"grep jpeg_destroy_compress * " or something like that, looking for
|
||
the errant function and suddenly my screen is full of Sanskrit. That's what you
|
||
get for grepping a bunch of object files...
|
||
|
||
<P>
|
||
No joke.
|
||
|
||
<P>
|
||
OK, well... wanna be like <I>that!</I>... so I just logged out to clear things
|
||
up and... Hmmm...
|
||
|
||
<P>
|
||
Still lookin' at Sanskrit...
|
||
|
||
<P>
|
||
Bummer.
|
||
|
||
<P>
|
||
BUT! Wait! This is Linux, folks, not some cheap imitation OS... (we'll refrain
|
||
from naming names, eh?) and this one's easy to fix!
|
||
|
||
<P>
|
||
The solution is a simple:
|
||
|
||
<PRE>
|
||
echo -ne "\017"
|
||
</PRE>
|
||
|
||
<P>
|
||
Cool, eh? :-)
|
||
|
||
<P>
|
||
This handy little item works even on the terminal that's all buggered up. No
|
||
need to try to kill anything and certainly no need to reboot just to clean up
|
||
a little mess. You won't be able to see exactly what you're typing which is
|
||
where the "kscreen" thingy comes in...
|
||
|
||
<P>
|
||
Like a lot of helpful little command line items, this one is ideally suited to
|
||
make a little fuction out of and stick in your ~/.bash_profile. So, edit your
|
||
~/.bash_profile, for all of you BASH users out there, and include:
|
||
|
||
<PRE>
|
||
kscreen() { echo -ne "\017" }
|
||
</PRE>
|
||
|
||
<P>
|
||
Now, you're all set! Anytime things get buggered up, you just type in the
|
||
secret incantation "kscreen" (for Kleen SCREEN) and, there you go...,
|
||
a squeeky klean screen once again!
|
||
|
||
<P>
|
||
Now, just in case you think you're going to forget it... just add the line to
|
||
the ~/.bash_login or the ~/.bash_profile:
|
||
|
||
<PRE>
|
||
echo -ne "\017"
|
||
</PRE>
|
||
|
||
since these get sourced whenever you login, to clear up your screen, in case you
|
||
forget the incantation, you just log out and log back in.
|
||
|
||
<P>
|
||
Go ahead... give this thing a whirl... even your Mom will think you're pretty
|
||
smart :-)
|
||
|
||
<P>
|
||
<A HREF="#toc"><IMG ALIGN=BOTTOM SRC="./gx/toc.gif"></A>
|
||
<A HREF="mailto: fiskjm@ctrvax.vanderbilt.edu"><IMG ALIGN=BOTTOM
|
||
SRC="./gx/sendmail.gif"></A>
|
||
<A HREF="./gazette_toc.html"><IMG ALIGN=BOTTOM SRC="./gx/index.gif"></A>
|
||
<A HREF="./linux/linux.html"><IMG ALIGN=BOTTOM SRC="./gx/home.gif"></A>
|
||
<BR><BR>
|
||
<HR>
|
||
<!-- --------------------------------------------------------------------- -->
|
||
|
||
|
||
|
||
<!-- XTITLE ---------------------------------------------------------- -->
|
||
<H2><A NAME="xtitle"><IMG ALIGN=BOTTOM SRC="../gx/text.gif">Changing that
|
||
xterm titlebar interactively!</A></H2>
|
||
|
||
<P>
|
||
Here's kind of a fun little item...
|
||
|
||
<P>
|
||
You know that there are all <I>kinds</I> of fun things that you can do with
|
||
xterms... make them big, make them small, change fonts, set colors, execute
|
||
programs, do console logging... all kinds of fun things that I hope in the
|
||
future to have time to write up fully. One of those things that you can do
|
||
is set the xterm title using the "-T" command line option. For
|
||
instance...
|
||
|
||
<P>
|
||
Suppose you're finally getting tired of seeing the same 'ol blah-looking
|
||
"xterm" title every time you fire one of these guys up. So... in
|
||
a fit of daring, you decide that what you <I>really</I> want that thing to
|
||
say is something like "And what is your wish, Oh Grand One...?".
|
||
|
||
<P>
|
||
You know... something more in keeping with your position in life... :-)
|
||
|
||
<P>
|
||
No sweat!
|
||
|
||
<P>
|
||
You just fire up an xterm using the 'ol command line:
|
||
|
||
<PRE>
|
||
xterm -T "What is your wish, Oh Grand One...?" &
|
||
</PRE>
|
||
|
||
and <I>voila!</I>, instant obeisance! Gotta love this subservience thing...
|
||
It's <I>YOUR</I> system... rule it! Linux is at your beck and call!
|
||
|
||
<P>
|
||
Welcome to benevolent despotism...
|
||
|
||
<P>
|
||
Hmmm... getting a bit carried away here, eh? :-)
|
||
|
||
<P>
|
||
Anyway, you get the point. You can change the title to anything your heart
|
||
desires. But suppose that you want to <I>interactively</I> change the title?
|
||
Or, more to the point, you actually want the titlebar to display some kind of
|
||
useful information other than just reminding you about what program it is.
|
||
That is, suppose you want to change the title <I>after</I> the thing is started
|
||
up or you want to be able to make it display some useful bit of information.
|
||
Well, let's see what we can do here.
|
||
|
||
<P>
|
||
For those of you who can get your hands on a copy of the "X Window System
|
||
User's Guide" by O'Reilly, there's a section on Customizing X Window using
|
||
command line options in Chapter 9. One of the interesting things that is described
|
||
is using escape sequences to force an xterm to display the current working
|
||
directory. This is described nicely on page 259. Thing is, you need to be using
|
||
the C Shell in order to make this work because it uses the "cwd"
|
||
variable to keep track of where you are. In the process of tinkering around with
|
||
this I wasn't able to get BASH to cooperate, BUT, I did learn a couple tricks that
|
||
are kinda fun.
|
||
|
||
<P>
|
||
Without going into a long discussion of what escape sequences are and how they
|
||
are used, suffice it to say that you can use them to interactively update the
|
||
xterm titlebar.
|
||
|
||
<P>
|
||
Careful..!! This just <I>might</I> get kinda fun... :-)
|
||
|
||
<P>
|
||
Probably the easiest way to do this is to add an entry to your ~/.bash_profile
|
||
and include either an fuction or an alias. Let's see how this is done.
|
||
What you'll need to include is something like the following:
|
||
|
||
<PRE>
|
||
#
|
||
# use these functions to set the title and label for xterms interactively
|
||
# See the description of this in the "X Window System User's Guide" on p 764
|
||
#
|
||
# The number argument to pass sets the action to take:
|
||
#
|
||
# 0 = change Window/Icon name and Window Title
|
||
# 1 = change Window/Icon name
|
||
# 2 = change Window Title
|
||
#
|
||
# xtitle() let's you set the xterm title interactively. If you invoke it without
|
||
# any arguments, it defaults to "terminal: xxxx date: xxxx" format
|
||
#
|
||
xtitle()
|
||
{
|
||
if [ "$*" != "" ]; then
|
||
echo -n "]2;$*"
|
||
else
|
||
echo -n "]2;xterminal:`/usr/bin/tty` date: `date '+%A %B %d, %Y'`"
|
||
fi
|
||
}
|
||
|
||
#
|
||
# xlabel() let's you set the xterm Window and Icon name
|
||
#
|
||
xlabel() { echo -n "]1;$*" }
|
||
|
||
#
|
||
# xtime() prints the current date and time in the xterm titlebar
|
||
#
|
||
xtime()
|
||
{
|
||
echo -n "]2;current date: `date '+%A %B %d, %Y %l:%M %p'`"
|
||
}
|
||
|
||
#
|
||
# now, do a similar sort of thing so that we get a more functional xterm
|
||
# title
|
||
#
|
||
if [ "$?PROMPT" ]; then
|
||
if [ "$TERM" = "xterm" ]; then
|
||
echo -n "]2;xterminal:`/usr/bin/tty` date: `date '+%A %B %d, %Y'`"
|
||
fi
|
||
fi
|
||
</PRE>
|
||
|
||
So, let's see what's going on here.
|
||
|
||
<P>
|
||
The basic idea here is that by sending an escape sequence to xterm, you can
|
||
cause it to perform certain actions, which in this case is updating the titlebar.
|
||
The way you do this is by using the <B>echo -n</B> command followed by the
|
||
escape sequence enclosed in double quotes.
|
||
|
||
<P>
|
||
If you're using the VI editor, the way to enter literal characters (such as an
|
||
ESCAPE or CTRL-G) is using the CTRL-V, which allows you to enter characters
|
||
literally or insert the decimal byte value of the character. You'll need this
|
||
feature in order to enter an escape character and the CTRL-G character. What
|
||
you'll enter is the following:
|
||
|
||
<PRE>
|
||
ESC ] 2 ; <I>text string</I> CTRL-G
|
||
</PRE>
|
||
|
||
You'll need to enclose all this stuff in double quotes, BTW. So, when you enter
|
||
this in your ~/.bash_profile, or wherever, you'll type in:
|
||
|
||
<PRE>
|
||
echo -n "
|
||
</PRE>
|
||
|
||
and then hit CTRL-V followed by the ESCAPE key. What this does is insert the
|
||
literal ESC key into the file, which is represented by the "^["
|
||
character. You'll then enter the rest of the stuff until you get to the end
|
||
where you'll again hit CTRL-V followed by the CTRL-G keystroke. Believe me,
|
||
this is a LOT easier to do than it is to explain... :-) Tinker with it a bit
|
||
and you'll see how easy it is. Honest :-)
|
||
|
||
<P>
|
||
So, looking at the examples above, there are a couple variations on this theme.
|
||
The first, "xtitle" let's you interactively set the title simply by
|
||
invoking it as:
|
||
|
||
<PRE>
|
||
xtitle "What's up, Doc?"
|
||
</PRE>
|
||
|
||
As you can see, if you invoke this with a character string following it, then
|
||
it displays this string. If you invoke it without an argument, it defaults to
|
||
to following line:
|
||
|
||
<PRE>
|
||
else
|
||
echo -n "]2;xterminal:`/usr/bin/tty` date: `date '+%A %B %d, %Y'`"
|
||
</PRE>
|
||
|
||
which outputs something like:
|
||
|
||
<PRE>
|
||
xterminal: /dev/ttyp0 date: Saturday November 25, 1995
|
||
</PRE>
|
||
|
||
on the titlebar. Notice that you're using the "backquotes"
|
||
or, more correctly, the <B>grave</B> character to enclose the commands for
|
||
<B>/usr/bin/tty</B> and <B>date</B>.
|
||
|
||
<P>
|
||
This is where <I>mega-coolness</I> steps in!
|
||
|
||
<P>
|
||
See, in this case I've used the <B>tty</B> command to indicate which TTY I'm
|
||
using. I've also used the <B>date</B> command which, in usual UN*X fashion,
|
||
has a bazillion command line options that let you do all kinds of fun things.
|
||
These two commands output the terminal and the date. Kinda functional, but
|
||
nothing to write home to Mom about, you say...
|
||
|
||
<P>
|
||
But wait! There's a paradigm thingy here!!
|
||
|
||
<P>
|
||
See, using the basic escape sequence feature lets you output all kinds of fun
|
||
stuff. By using command substitution -- enclosing a command in backquotes
|
||
which passes the output to the parent command -- you have tremendous control
|
||
over what can be output.
|
||
|
||
<P>
|
||
Look, for example, at the <B>xtime</B> function. It also uses the
|
||
basic escape sequence idea but this time, outputs the current time to the
|
||
title down to the present hour and minutes. Anything that gives you this type
|
||
of single line output can potentially be used. Time to put on the 'ol thinking
|
||
hats and be creative! :-)
|
||
|
||
<P>
|
||
Go ahead... get nuts!
|
||
|
||
<P>
|
||
Finally, if you want the titlebar to be customized each time you fire one up,
|
||
check out the last function listed. What you'll notice is that it consists of
|
||
an "if" statement that tests whether we're using an xterm (X Terminal)
|
||
or are at a character terminal. If we're using an xterm, it sends the escape
|
||
sequence specified. Now, again, there's nothing that says that you can't
|
||
customize this to be whatever you want... if you <I>really</I> need the affirmation
|
||
of "Oh, Most Exalted Grand PooBah", then who am I to stop you... :-)
|
||
|
||
<P>
|
||
Enjoy!
|
||
|
||
<P>
|
||
Oh, BTW, two last little points.
|
||
|
||
<P>
|
||
You'll notice in the comments above the function definitions the mention of
|
||
changing the window title, the window & icon name, or all three. You do
|
||
this by changing the argument following the " ESC ] " character pair.
|
||
The options include:
|
||
|
||
<PRE>
|
||
0 = change Window/Icon name and Window Title
|
||
1 = change Window/Icon name
|
||
2 = change Window Title
|
||
</PRE>
|
||
|
||
I've chosen to change the Window Title only, but as you can see you can change
|
||
the window and icon names as well as the window title using this method.
|
||
|
||
<P>
|
||
And finally...
|
||
|
||
<P>
|
||
If you happen to be using VIM in an xterm you'll notice that when it starts up
|
||
it sends its own escape sequence (you're not the only kid on the block that knows
|
||
this trick...) which puts the file name in the titlebar. When you're done editing,
|
||
it exits which a fond farewell that I'll leave to you to discover. If you want
|
||
to quiet this habit, simply add the following to your ~/.vimrc file:
|
||
|
||
<PRE>
|
||
set notitle
|
||
</PRE>
|
||
|
||
This prevents a titlebar display and leaves your handiwork unmolested.
|
||
|
||
<P>
|
||
Have fun!
|
||
|
||
<P>
|
||
<A HREF="#toc"><IMG ALIGN=BOTTOM SRC="./gx/toc.gif"></A>
|
||
<A HREF="mailto: fiskjm@ctrvax.vanderbilt.edu"><IMG ALIGN=BOTTOM
|
||
SRC="./gx/sendmail.gif"></A>
|
||
<A HREF="./gazette_toc.html"><IMG ALIGN=BOTTOM SRC="./gx/index.gif"></A>
|
||
<A HREF="./linux/linux.html"><IMG ALIGN=BOTTOM SRC="./gx/home.gif"></A>
|
||
<BR><BR>
|
||
<HR>
|
||
<!-- --------------------------------------------------------------------- -->
|
||
|
||
|
||
|
||
|
||
<!-- FLOPPY LIB ---------------------------------------------------------- -->
|
||
<H2><A NAME="floppy"><IMG ALIGN=BOTTOM SRC="../gx/text.gif">Space Savings with
|
||
a Floppy Library</A></H2>
|
||
|
||
<P>
|
||
This one's kind of a nothin' burger little idea that just <I>might</I> be of
|
||
help to those who are a little cramped for HD space.
|
||
|
||
<P>
|
||
I don't know about the rest of you, but there always seems to be a LOT more
|
||
stuff that I'd like to install and tinker with than I have the HD space for.
|
||
Now the 'ol Linux partition is already pushing 600MB and I'm still having to
|
||
conserve on space to have room for all the great progs out there to play with.
|
||
I recently started archiving documents to floppy in a space-saving effort and
|
||
have found that it actually works pretty well!
|
||
|
||
<P>
|
||
If you've got one of those Texas-sized multi-Gig drives and you're just loaded with
|
||
real estate, you're not going to be very interested in this, but if you're
|
||
having to keep cramped quarters, this idea might be of some small help.
|
||
|
||
<P>
|
||
The basic idea is simple:
|
||
|
||
<OL>
|
||
<LI>Save ALL the documentation for the programs that you've installed --
|
||
either the programs that get installed with the various
|
||
distributions, or the ones that you've gotten the sources or
|
||
binaries to and installed yourself.
|
||
<P>
|
||
|
||
<LI>Gzip these little rascals. By using the "gzip -9" option
|
||
you can squeeze these guys down to an impressively small size.
|
||
This is Space Saver Suggestion #1.
|
||
<P>
|
||
|
||
<LI>Now, move all these compressed documents to floppies. Now granted,
|
||
floppies aren't cheap and with hard drive costs dropping daily
|
||
this may or may not be economical for you. I got a bunch of the
|
||
cheapo no-name 50-count floppies for a little over $20 at one of
|
||
the local computer head shops.
|
||
|
||
<P>
|
||
What you might want to consider is setting up an A disk, a B disk,
|
||
a C disk, and so forth... set up a series of disks and save programs
|
||
alphabetically on these. Start with 26 disks and then add as you
|
||
need.
|
||
|
||
<P>
|
||
I've formatted my floppies using ext2fs. This is admittedly a bit
|
||
of inefficiency since ext2 is a good filesystem but it does take
|
||
up a bit of space all by itself. Still, there's not a great space
|
||
cost involved and I like to be able to save using long file names
|
||
and without having to convert text files from UNIX -> DOS. Using
|
||
ext2 allows this.
|
||
|
||
<P>
|
||
Anyway, you can reformat the disks if you want to use the ext2 or
|
||
minix filesystem, or whatever you want, and then move files to
|
||
floppy. Simply create a directory for each program and then move
|
||
the gzip'ed docs to that directory.
|
||
<P>
|
||
|
||
<LI>Now, whenever you need to re-read the docs for a particular program
|
||
you have only to pull the disk, which you've neatly arranged
|
||
alphabetically, pop it in, and <B>zless</B> the files to view
|
||
it. This lets you view the file without having to uncompress it.
|
||
</OL>
|
||
|
||
<P>
|
||
The <B>zless</B> program, BTW, is a pretty simple little shell trick:
|
||
|
||
<PRE>
|
||
#!/bin/sh
|
||
for args
|
||
do
|
||
zcat $args | less
|
||
done
|
||
</PRE>
|
||
|
||
that simply zcat's the files to <B>less</B>. You can now read the docs without
|
||
having the copy anything to your HD and without having to uncompress anything.
|
||
This works surprisingly well and is quite fast. For all of you who've set up the
|
||
<B>supermount</B> program this is especially fast since you have only to pop the
|
||
disk in to start reading.
|
||
|
||
<P>
|
||
Pretty slick, IIDSSM. (...that's <I>If I Do Say So Myself...</I>)
|
||
|
||
<P>
|
||
Now, I admit that this is kind of "Hints by Heloise"'ish... but
|
||
if it lets you squeeze <I>one</I> more little program onto your HD, then it's
|
||
worth it! And maybe next month we'll talk about getting cat pee out of your
|
||
couch. ;-)
|
||
|
||
<P>
|
||
Anyone have any other space savers...? (I know, I know... besides the
|
||
" rm -rf /c/windo..." trick...)
|
||
|
||
<P>
|
||
And just one more thought about the topic of archiving stuff...
|
||
|
||
<P>
|
||
It might not be a bad idea to think seriously about archiving the program
|
||
sources for the apps that you've compiled yourself and installed. The logic
|
||
for this is pretty simple. Not all programs will let you unfurl the sources and
|
||
then type in "make" and have a program compile cleanly. Most of the
|
||
time you have to edit the Makefile or Imakefile, and not infrequently you have to
|
||
do more than a little tinkering with the sources to get things to compile without
|
||
complaint. After going to all the work to get things to compile, it's probably
|
||
not a bad idea to save these changes.
|
||
|
||
<P>
|
||
Again, we're talking pretty simple stuff here:
|
||
|
||
<OL>
|
||
<LI>Once things compile cleanly, get rid of the extraneous stuff -- this
|
||
is usually simply a matter of doing a "make clean" which
|
||
get's rid of all the object and temp files and such. Just remember
|
||
to do this <I>after</I> you've done a "make install" or
|
||
else you might find your executable mysteriously vanishing...
|
||
<P>
|
||
|
||
<LI>Next, jot yourself a quick README of your own and include at least
|
||
the commands you need to get things to compile. Again, this
|
||
is probably going to be little more than a "make",
|
||
"make install", "make install.man". But
|
||
occasinally there's a funky command line option that's needed
|
||
and it'll save you time otherwise spent re-reading the original
|
||
README's.
|
||
<P>
|
||
|
||
<LI>Now, simply tar & gzip the distribution and change the name
|
||
to something like "program_name-1.34-MINE.tar.gz"
|
||
which let's you know that you've compiled it and made the
|
||
needed customizations.
|
||
<P>
|
||
</OL>
|
||
|
||
<P>
|
||
You may not need to do this at all if you have an adequate means of doing a
|
||
system backup. If you don't, and you anticipate having to reinstall your system,
|
||
then being able to quickly recompile and reinstall from sources may be of
|
||
benefit.
|
||
|
||
<P>
|
||
Anyway, just a thought. ;-)
|
||
|
||
<P>
|
||
<A HREF="#toc"><IMG ALIGN=BOTTOM SRC="./gx/toc.gif"></A>
|
||
<A HREF="mailto: fiskjm@ctrvax.vanderbilt.edu"><IMG ALIGN=BOTTOM
|
||
SRC="./gx/sendmail.gif"></A>
|
||
<A HREF="./gazette_toc.html"><IMG ALIGN=BOTTOM SRC="./gx/index.gif"></A>
|
||
<A HREF="./linux/linux.html"><IMG ALIGN=BOTTOM SRC="./gx/home.gif"></A>
|
||
<BR><BR>
|
||
<HR>
|
||
<!-- --------------------------------------------------------------------- -->
|
||
|
||
|
||
|
||
|
||
<!-- LESS ---------------------------------------------------------- -->
|
||
<H2><A NAME="less"><IMG ALIGN=BOTTOM SRC="../gx/text.gif">Less is just a
|
||
Whole Lot More!</A></H2>
|
||
|
||
<P>
|
||
Here's a final 2 cent quickie... Sort of FYI
|
||
|
||
<P>
|
||
For those of you who haven't yet discovered this great little program
|
||
you really need to give <B>less</B> a whirl. For those of you who have,
|
||
here's a little something that I just discovered recently.
|
||
|
||
<P>
|
||
The other day I was looking through a bunch of usenet news articles trying
|
||
to find one that I knew I'd saved on 3 button mice. Well, after grepping
|
||
through the lot of them, I finally came up with several possibilities and
|
||
decided to have a look at them. Being in a time-expediency kinda mood I
|
||
tried a:
|
||
|
||
<PRE>
|
||
less *.news
|
||
</PRE>
|
||
|
||
maneuver on those files that I thought might have what I was looking for.
|
||
This loads up less with a bunch of files to scan. So, what's the trick?
|
||
Here's a couple things that less will let you do:
|
||
|
||
<PRE>
|
||
:n move to next file
|
||
:p move to previous file
|
||
:v edit the file using VI
|
||
h fire up the online help
|
||
</PRE>
|
||
|
||
By hitting a colon followed by either an "n" or a "p" you
|
||
can move to the next or previous file respectively. Want to edit the file?
|
||
Hit a colon followed by a "v" and suddenly you're in VI, ready to edit.
|
||
Curious about what other cool stuff you can do with less... just hit a
|
||
"h" and the online help screen pops up.
|
||
|
||
<P>
|
||
The multiple-file paging capacity is particularly helpful if you're wanting
|
||
to view several files at once. The editing capacity is also pretty helpful
|
||
if, as you're reading, you decide to edit the file.
|
||
|
||
<P>
|
||
Nothing to get too excited about but still... Kinda slick.
|
||
|
||
<P>
|
||
<A HREF="#toc"><IMG ALIGN=BOTTOM SRC="./gx/toc.gif"></A>
|
||
<A HREF="mailto: fiskjm@ctrvax.vanderbilt.edu"><IMG ALIGN=BOTTOM
|
||
SRC="./gx/sendmail.gif"></A>
|
||
<A HREF="./gazette_toc.html"><IMG ALIGN=BOTTOM SRC="./gx/index.gif"></A>
|
||
<A HREF="./linux/linux.html"><IMG ALIGN=BOTTOM SRC="./gx/home.gif"></A>
|
||
<BR><BR>
|
||
<HR>
|
||
<!-- --------------------------------------------------------------------- -->
|
||
|
||
|
||
|
||
<!-- COLOPHON ---------------------------------------------------------- -->
|
||
<H2><A NAME="colophon"><IMG ALIGN=BOTTOM SRC="../gx/text.gif">Colophon</A></H2>
|
||
|
||
<P>
|
||
Well, congrats... you made it!
|
||
|
||
<P>
|
||
Thanks for hanging in there. I'd like to say a very heart-felt thanks once
|
||
again to all the folks who've written and offered their sincere encouragement
|
||
and kind advice, suggestions, ideas, tips & tricks, or just dropped a note
|
||
to chat about Linux. I've learned a lot from y'all and I appreciate it more
|
||
than you can know. I especially appreciate the folks who've written from
|
||
abroad for whom English is not a "mother tongue". English is,
|
||
admittedly, not the easiest language to learn and I appreciate the effort
|
||
many of you put out to write.
|
||
|
||
<P>
|
||
That said, I also want to thank again the kind cast of folks that wrote and
|
||
who's letters and messages ended up in this month's LG. This ain't a one
|
||
man "dog & pony" show! :-) If you've found something useful
|
||
here drop these folks a note and let them know it!
|
||
|
||
<P>
|
||
Finally, what's the <B>latest toy</B> around here...?
|
||
|
||
<P>
|
||
Well, now that I've started doing a bit of C++ programming at school, I've
|
||
really become intrigued by <B>Tcl/Tk</B> programming. For those of you
|
||
who haven't played with this stuff, it is just too way cool!
|
||
|
||
<P>
|
||
I've been playing with several very cool programs, which really need to be
|
||
in the 'ol Linux Toybox..., and these include:
|
||
|
||
<UL>
|
||
<LI><B>ical</B> which is a very cool, and very useful personal
|
||
calendar/todo/appointment manager. I've used the XVIEW
|
||
program xcalendar for a while and it is pretty minimalistic,
|
||
although adequate for simple needs. I've also tried the
|
||
absolutely fantastic program <B>plan-1.4.x</B> which is a
|
||
real powerhouse program. Any of you that have used this
|
||
will know what I mean. It's a great program.
|
||
|
||
<P>
|
||
Still, I've found that I gravitate to the programs that have
|
||
just the right mix of features -- the things that I really use.
|
||
Plan was a bit of overkill for the simple things that I need
|
||
on a day to day basis, while xcalendar was a bit too spartan.
|
||
<B>Ical</B> has been a true pleasure and I've started using
|
||
it a lot. I'll leave it to you to be the judge.
|
||
|
||
<P>
|
||
|
||
<LI><B>addressbook</B> is another very cool Tcl/Tk program that is
|
||
also "just right". As the name implies it is an
|
||
addressbook with a lot of very nice extras. I've <I>just</I>
|
||
started playing around with this one and haven't even had
|
||
time to enter all the "friends -n- family" numbers
|
||
yet...
|
||
|
||
<P>
|
||
Still, it looks to be a great little program which should be
|
||
a lot of fun. I'm thinking of creating a GoodStuff button
|
||
bar with several of these "desktop apps" which can
|
||
be called up easily. There are several of these little
|
||
programs such as <B>ical, addressbook, xpostit, and plan</B>
|
||
that really help with day to day organization. I'll let you
|
||
know how things work out.
|
||
|
||
<P>
|
||
<LI><B>xskim</B> which is part of the <B>skim</B> package. For those
|
||
of you that have standalone systems and get you mail and news
|
||
over a PPP or SLIP link, you really should give this little
|
||
program a whirl.
|
||
|
||
<P>
|
||
I've used a few of the news readers including <B>xrn, tin,
|
||
PINE (which has a newsreader feature), & rn</B>. These
|
||
all work fairly well but are VERY slow with the NNTP server
|
||
I use at school. In a fit of frustration, I finally started
|
||
looking around for a better, or at least faster, newsreader
|
||
and came across <B>skim</B>.
|
||
|
||
<P>
|
||
This great little program allows you to do all of your usenet
|
||
newsgroup reading offline, which is VERY convenient. After
|
||
the basic setup, which is well documented and is quite easy,
|
||
you simply create a list of newsgroups that you want to
|
||
subscribe to and when you invoke it, it'll first get all of
|
||
the subject headers for the groups you're intersted in. You
|
||
then pick the articles you think look interesting and it'll
|
||
then go back and pick up only those articles and then save
|
||
them to disk.
|
||
|
||
<P>
|
||
Thus, you pick up only the articles you're intersted in AND
|
||
you can read them offline.
|
||
|
||
<P>
|
||
<I>Mucho</I> too way cool! :-)
|
||
|
||
<P>
|
||
I use the <B>xskim</B> X interface, a Tcl/Tk app, for all
|
||
of this. It is admittedly a bit less than "full
|
||
featured" but it works quite well and has been very
|
||
reliable. I've now able to keep up with several of the
|
||
comp.os.linux.xxxxx groups which is GREAT!
|
||
|
||
<P>
|
||
The other very nice thing about <B>xskim</B> is that because
|
||
it's written in Tcl/Tk it is eminently hackable. I've been
|
||
tinkering around with it a bit and have had a lot of fun
|
||
learning about Tcl/Tk from it.
|
||
</UL>
|
||
|
||
<P>
|
||
Now, all of these programs can be found, if I recall correctly... :-), on
|
||
sunsite or one of its mirrors. Forgive me for not giving a URL for these
|
||
but I just haven't had the time to chase them down this week.
|
||
|
||
<P>
|
||
Also, if any of you are interested in <B>Tcl/Tk</B>, there's a HUGE amount
|
||
of really great stuff to play with out there. You can't begin to imagine
|
||
just what's other there until you do a little 'Net crusin' at Yahoo and
|
||
do a "Tcl" search. It's really worth your while if you're at
|
||
all interested.
|
||
|
||
<P>
|
||
A couple great web pages devoted to Tcl/Tk stuff include:
|
||
|
||
<P>
|
||
<A HREF="http://web.cs.ualberta.ca/~wade/Auto/Tcl.html">
|
||
Tcl/Tk Resources</A><BR>
|
||
<A HREF="http://www.sunlabs.com:80/research/tcl/">Tcl/Tk Project At Sun
|
||
Microsystems Laboratories</A><BR>
|
||
<A HREF="http://www.sco.com/Technology/tcl/Tcl.html">TCL WWW Info</A><BR>
|
||
|
||
<P>
|
||
If you're seriously interested in learning Tcl/Tk programming you'd do
|
||
well to look for <B>Brent Welch's</B> homepage. He was a Ph.D grad student
|
||
in <B>John Osterhout's</B> lab and has written an excellent book entitled
|
||
<CITE>Practical Programming in Tcl and Tk</CITE>. There's a postscript
|
||
file of the book draft available via anonymous ftp for those who might be
|
||
interested in purusing it.
|
||
|
||
<P>
|
||
Both John Osterhout and Brent Welch have written books on Tcl and Tk programming.
|
||
I just bought John Osterhout's book with a bit of birthday money and am enjoying
|
||
reading bits and pieces of it between study/programming/cram sessions (which
|
||
generally means while I'm in the bathroom... ;-)
|
||
|
||
<P>
|
||
These are definitely items to add to your Christmas wish-list!
|
||
|
||
<P>
|
||
Finally, there's a VERY cool Linux page that y'all should stop by and enjoy:
|
||
|
||
<P>
|
||
<A HREF="http://www.xnet.com/~blatura/linapps.shtml">The Web Wanderer's List
|
||
of Linux Applications</A>
|
||
|
||
<P>
|
||
The guys maintaining this page have done something that I was recently thinking
|
||
of doing... and did it a LOT better than I would have been able. They've
|
||
assembled a fairly comprehensive list of programs that will run on the Linux
|
||
platform and provided the URL for the homepages for these programs. These
|
||
are all categorized by type, so that if you're interested in Graphics, Text
|
||
Processing, Utilities, or whatever, just drop down to that group and start
|
||
purusing. A short description of the program is included to give you an
|
||
idea about what it does.
|
||
|
||
<P>
|
||
Very cool.
|
||
|
||
<P>
|
||
I've been there a few times and have really enjoyed it a LOT. Check it out.
|
||
Also, if you're a program author, you might want to consider stopping by and
|
||
giving them your URL.
|
||
|
||
<P>
|
||
Anyway, hope you enjoyed this month's LG! :-)
|
||
|
||
<P>
|
||
See ya next year!
|
||
|
||
<P>
|
||
-- John
|
||
|
||
<P>
|
||
<A HREF="#toc"><IMG ALIGN=BOTTOM SRC="./gx/toc.gif"></A>
|
||
<A HREF="mailto: fiskjm@ctrvax.vanderbilt.edu"><IMG ALIGN=BOTTOM
|
||
SRC="./gx/sendmail.gif"></A>
|
||
<A HREF="./gazette_toc.html"><IMG ALIGN=BOTTOM SRC="./gx/index.gif"></A>
|
||
<A HREF="./linux/linux.html"><IMG ALIGN=BOTTOM SRC="./gx/home.gif"></A>
|
||
<BR><BR>
|
||
<HR>
|
||
<!-- --------------------------------------------------------------------- -->
|
||
|
||
|
||
<!-- FOOTER -------------------------------------------------------------- -->
|
||
<H4>Got any <I>great</I> ideas for improvements! Send your
|
||
<A HREF="mailto:fiskjm@ctrvax.vanderbilt.edu">comments, criticisms, suggestions,
|
||
and ideas.</A></H4>
|
||
|
||
<BR>
|
||
<IMG ALIGN=BOTTOM SRC="./gx/small_homeboy.gif">
|
||
<A HREF="./linux/linux.html">Back up to Linux HomeBoy WebPage</A><BR><BR>
|
||
|
||
|
||
<I>This page written and maintained by:</I><BR>
|
||
<ADDRESS>
|
||
<A HREF="./jmf.html">John M. Fisk</A> at <A HREF="mailto:fiskjm@ctrvax.vanderbilt.edu">
|
||
fiskjm@ctrvax.vanderbilt.edu</A>
|
||
</ADDRESS>
|
||
<!-- --------------------------------------------------------------------- -->
|
||
|
||
</BODY>
|
||
</HTML>
|