old-www/LDP/LG/issue91/lg_tips.html

666 lines
25 KiB
HTML

<!--startcut ==============================================-->
<!-- *** BEGIN HTML header *** -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Language" CONTENT="en-us">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="generator" CONTENT="lgazmail v1.4G.h">
<LINK REV="made" href="mailto:%20linux-questions-only@ssc.com%20"><TITLE>More 2 Cent Tips &amp; Tricks LG #91</TITLE></HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#0000AF"
ALINK="#FF0000">
<!-- *** END HTML header *** -->
<!--endcut ==============================================-->
<!--startcut =========================================================-->
<!-- *** BEGIN navbar *** -->
<A HREF="lg_mail.html">&lt;&lt;&nbsp;Prev</A>&nbsp;&nbsp;|&nbsp;&nbsp;<A HREF="index.html">TOC</A>&nbsp;&nbsp;|&nbsp;&nbsp;<A HREF="../index.html">Front Page</A>&nbsp;&nbsp;|&nbsp;&nbsp;<A HREF="http://www.linuxgazette.com/cgi-bin/talkback/all.py?site=LG&article=http://www.linuxgazette.com/issue91/lg_tips.html">Talkback</A>&nbsp;&nbsp;|&nbsp;&nbsp;<A HREF="../faq/index.html">FAQ</A>&nbsp;&nbsp;|&nbsp;&nbsp;<A HREF="lg_answer.html">Next&nbsp;&gt;&gt;</A>
<!-- *** END navbar *** -->
<!--endcut ===========================================================-->
<TABLE BORDER><TR><TD WIDTH="200">
<A HREF="http://www.linuxgazette.com/">
<IMG ALT="LINUX GAZETTE" SRC="../gx/2002/lglogo_200x41.png"
WIDTH="200" HEIGHT="41" border="0"></A>
<BR CLEAR="all">
<SMALL>...<I>making Linux just a little more fun!</I></SMALL>
</TD><TD>
<center>
<BIG><BIG><STRONG><FONT COLOR="maroon">More 2&cent; Tips!</FONT></STRONG></BIG></BIG><BR>
<!-- BEGIN tips -->
<STRONG>By <A HREF="mailto:linux-questions-only@ssc.com">The Readers of <i>Linux Gazette</I></A></STRONG></BIG>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
<center><STRONG>See also: The Answer Gang's
<a href="../tag/kb.html">Knowledge Base</a>
and the <i>LG</i>
<a href="http://www.linuxgazette.com/search.html">Search Engine</a></STRONG>
</center><HR>
<UL>
<!-- index_text begins -->
<li><A HREF="#tips.1"
><strong>Reading email headers</strong></a>
<li><A HREF="#tips.2"
><strong>colorful prompt sign</strong></a>
<li><A HREF="#tips.3"
><strong>About autofs and write permissions for floppy</strong></a>
<li><A HREF="#tips.4"
><strong>linux infrared</strong></a>
<li><A HREF="#tips.5"
><strong>On A Slower Computer</strong></a>
<li><A HREF="#tips.6"
><strong>Interesting take on C/C++/etc. by Jon Lasser</strong></a>
<li><I>Linux Journal's</I> Weekly News Notes
<a href="#tips.lj">Tech Tips</a>
<ul>
<li><A HREF="http://www.linuxjournal.com/modules.php?op=modload&name=NS-subscribe&file=newsletter"
>subscribe</A> to LJWNN
</ul>
<!-- index_text ends -->
</UL>
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.1"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">Reading email headers</FONT></H3>
Thu, 29 May 2003 12:10:21 -0600
<BR>Jason Creighton, Ben Okopnik (<a href="mailto:linux-questions-only@ssc.com?cc=linux-questions-only@ssc.com&subject=%20Re%3A%20%5BLG%2091%5D%202c%20Tips%20%231">the <em>LG</em> Answer Gang</a>)
<P><STRONG>
Hey, all -
</STRONG></P>
<P><STRONG>
A while ago, someone asked me how to read email headers to track a
spammer (Karl-Heinz, IIRC.) I kinda blew it off at the time (ISTR being
tired and not wanting to write a long explanation - sorry...) Lo and
behold, I ran across this thing on the Net - it's an ad site for a piece
of Wind0ws software which tracks (and maps the track - sooo cuuute!) the
path an email took based on the headers. The explanation there is a
rather good one; it's pretty much how I dig into this stuff when I get a
hankering to slam a couple of spammers (yum, deep-fried with Sriracha
sauce... I know, it wrecks my diet, but they're so <EM>nicely</EM> crunchy!)
</STRONG></P>
<P><STRONG>
The equivalent Linux tools that you'd use to do what these folks have to
write commercial software for are laughably obvious. Anyway - enjoy.
</STRONG></P>
<P><STRONG>
&lt;<A HREF="http://www.visualware.com/training/email.html"
>http://www.visualware.com/training/email.html&gt;</A>
</STRONG></P>
<P>
The same company puts out a 'traceroute' program that plots each hop on a
world map. Cute. Anyway, a google for:
</P>
<P><BLOCKQuote>
<A HREF="http://www.google.com/search?q=how+to+read+email+headers"
>http://www.google.com/search?q=how+to+read+email+headers</A>
</BLOCKQuote></P>
<P>
returns a fair amount of articles.
</P>
<P>
Jason Creighton
</P>
<blockquote><font color="#000066">Just to make it clear, Ben's talking about some mswin software, and I
dunno if he checked that it runs under WINE. But between following
Jason's advice, and xtraceroute
(<A HREF="http://www.dtek.chalmers.se/~d3august/xt"
>http://www.dtek.chalmers.se/~d3august/xt</A>) - <EM>our</EM> toy for traceroute
on a world map - the world of free software should be able to come up
with a similar tool. A curious tidbit is that IP addresses whose ranges
aren't known to the coordinate system end up at 0,0, the center of
Earth's coordinate system... deep underwater in the Atlantic Ocean, near
Africa. I wouldn't be too surprised if a lot of spammers live there.
Good spear-fishing, fellow penguins.
-- Heather</font></blockquote>
<!-- end 1 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.2"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">colorful prompt sign</FONT></H3>
Mon, 19 May 2003 11:44:26 +0100 (BST)
<BR>Thomas Adam (<a href="mailto:linux-questions-only@ssc.com?cc=cave_man@hotpop.com&cc=thomas_adam16@yahoo.com&subject=%20Re%3A%20%5BLG%2091%5D%202c%20Tips%20%232">The <em>LG</em> Weekend Mechanic</a>)
<BR>Question by JK Malakar (cave_man from hotpop.com)
<P><STRONG>
Hi all,
</STRONG></P>
<P><STRONG>
I have seen a colorful prompt sign in RH 9.0 box at a local computer book
shop today. but the operator ( who has recently taken migration from M$ to
Linux ) has told me that she doesn't know how to do this as the shop has
purchased the machine with RH 9.0 preloaded ( &amp; also with that colorful
prompt -
<IMG SRC="../gx/dennis/smily.gif" ALT=";)"
height="24" width="20" align="middle"> ). so could some one please tell me how to do this ?
</STRONG></P>
<P><DL><DT>
The <em>Linux Gazette</em> <A HREF="http://www.linuxgazette.com/faq/kb.html">knowledge base</A> finds the following article:
<DD><A HREF="../issue65/padala.html"
>http://www.linuxgazette.com/issue65/padala.html</A>
</DL></P>
<P>
which answers your question above
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle">
</P>
<!-- end 2 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.3"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">About autofs and write permissions for floppy</FONT></H3>
Thu, 22 May 2003 18:41:09 +0530
<BR>Kapil Hari Paranjape (<a href="mailto:linux-questions-only@ssc.com?cc=linux-questions-only@ssc.com,&cc=kapil@imsc.res.in&subject=%20Re%3A%20%5BLG%2091%5D%202c%20Tips%20%233">the <em>LG</em> Answer Gang</a>)
<P><STRONG>
I have just configured <TT>/etc/auto.master</TT> and <TT>/etc/auto.floppy.</TT> I can now
access the floppy without the need to mount it before. But I don't have
write access to it. Only root has write access to my floppy.
</STRONG></P>
<P><STRONG>
here are the files I configured:
</STRONG></P>
<P><STRONG><BLOCKQuote>
<TT>/etc/auto.master</TT> -
</BLOCKQuote></STRONG></P>
<pre><strong>/mnt/cdrom /etc/auto.cdrom --timeout=60
/mnt/floppy /etc/auto.floppy --timeout=30
</strong></pre>
<P><STRONG>
<TT>/etc/auto.floppy</TT> -
</STRONG></P>
<pre><strong>floppy -users,suid,fstype=vfat,rw :/dev/fd0
</strong></pre>
<P><STRONG>
Did I something wrong? What did I forget?
</STRONG></P>
<P><STRONG>
Thank you in advance for all information you could provide.
</STRONG></P>
<P><STRONG>
Elias Praciano
</STRONG></P>
<BLOCKQUOTE>
[Kapil]
The automatically mounted filesystems are mounted by the autofs daemon
which runs as root and thus a "user" entry will cause files to be
owned by "root".
</BLOCKQUOTE>
<BLOCKQUOTE>
One solution is to use the "mount" command as the user to mount the floppy.
</BLOCKQUOTE>
<BLOCKQUOTE>
Another solution is if the floppy is a dos floppy to put "umask=666" as
a mount option.
</BLOCKQUOTE>
<BLOCKQUOTE>
[Thomas]
I absolutely hate "autofs". I cannot stand it! How difficult can it be to
either type: &quot;mount&quot; or &quot;umount&quot;?? Still, each to their own I suppose
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle">
</BLOCKQUOTE>
<BLOCKQUOTE>
Am I right in assuming that autofs overrides <TT>/etc/fstab</TT> in some way? Or is
it that you specify "autofs" as the filetype within <TT>/etc/fstab</TT> ? Either
way it shouldn't really matter.
</BLOCKQUOTE>
<BLOCKQUOTE>
To be on the safe side, I would just make sure that the entry for your
floppy drive in "<TT>/etc/fstab</TT>" is genuine
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle">. By that I mean that you should
check that the options:
</BLOCKQUOTE>
<blockquote><pre>exec
rw
</pre></blockquote>
<BLOCKQUOTE>
are present.
</BLOCKQUOTE>
<BLOCKQUOTE>
IIRC, "supermount" used to do ...
</BLOCKQUOTE>
<BLOCKQUOTE>
[Jimmy]
Oh no! Supermount is evil! Especially for floppies. supermount tries to
figure out when the disk has changed, and mostly fails.
</BLOCKQUOTE>
<BLOCKQUOTE>
[Thomas]
If these suggestions still generate the same problem, please post us a
copy of your "<TT>/etc/fstab</TT>".
</BLOCKQUOTE>
<BLOCKQUOTE>
Ah....I mentioned it because I vaguely remember John Fisk mentioning it in
one of his Weekend Mechanic articles a long time ago.
</BLOCKQUOTE>
<BLOCKQUOTE>
Personally, I don't see why you don't just issuse:
</BLOCKQUOTE>
<blockquote><pre>mount
umount
</pre></blockquote>
<BLOCKQUOTE>
or <EM>even</EM> better, use "xfmount <TT>/dev/abc</TT>"
</BLOCKQUOTE>
<BLOCKQUOTE>
since as soon as you close "xftree", the device is umounted
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle">
</BLOCKQUOTE>
<BLOCKQUOTE>
[Ben]
I use a series of scripts (all the same except for the device name)
called "fd", "cdr", and "dvd" to mount and unmount these:
</BLOCKQUOTE>
<p align="center">See attached <tt><a href="misc/tips/dvd.sh.txt">dvd.sh.txt</a></tt></p>
<BLOCKQUOTE>
I could probably have one script like this with a bunch of links, and
use the name as the device to mount, but I'm too lazy to change
something that's worked this well and this long.
</BLOCKQUOTE>
<P><STRONG>
Thank you all!
</STRONG></P>
<P><STRONG>
Rahul's solution solved my problem. I added myself to the group 'floppy'
and changed the mountpoint group to 'floppy'. Then I changed the file
auto.floppy to:
</STRONG></P>
<pre><strong>floppy -users,gid=floppy,fstype=vfat,rw,umask=002 :/dev/fd0
</strong></pre>
<P><STRONG>
It's working fine now!
</STRONG></P>
<P><STRONG>
Thank you again. I learned a lot with you.
</STRONG></P>
<P><STRONG>
Best regards!
</STRONG></P>
<!-- end 3 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.4"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">linux infrared</FONT></H3>
Tue, 6 May 2003 02:30:55 +0300
<BR>klaudiu (<a href="mailto:linux-questions-only@ssc.com?cc=klaudiu@gmx.net&subject=%20Re%3A%20%5BLG%2091%5D%202c%20Tips%20%234">klaudiu from gmx.net</a>)
<P>
hi.
I'm using the circuit described there and it works great in linux with
lirc. Another programs that you will probably find useful are:
</P>
<blockquote><pre>lirc-xmms-plugin
smartmenu
irmix
xosd
</pre></blockquote>
<P>
and to recompile mplayer with lirc support.
The circuit cost me ~ 3$ (without the tools that I already had).
Hope that I helped. If you need more informations mail-me.
</P>
<HR width="10%" align="center">
<blockquote><font color="#000066">A disabled querent asked about LIRC in general ...
-- Heather</font></blockquote>
<BLOCKQUOTE>
[JK Malakar]
nice to hear your question on LIRC. yse I have made the home-brew IR
receiver which is easy to build as well as cheap also. now I can enjoy MP3,
MPlayer, xine etc and even shutdown the machine using my creative infrasuite
cd drive remote -
<IMG SRC="../gx/dennis/smily.gif" ALT=";)"
height="24" width="20" align="middle">
</BLOCKQUOTE>
<BLOCKQUOTE>
you will get everything at <A HREF="http://www.lirc.org"
>http://www.lirc.org</A>
</BLOCKQUOTE>
<BLOCKQUOTE>
[Robos]
For more infos about how and if you have a question I would say go and ask
the source: the lirc page has also a mailing-list where you can
surely ask some competent people.
</BLOCKQUOTE>
<BLOCKQUOTE>
OK, now your question: I have looked at LIRC myself AGES ago and wanted to
build that thing too. Didn't do it, mind you (forgot) but I think the
hardware and software part were quite well documented.
I looked again just now and this here <A HREF="http://www.manoweb.com/alesan/lirc"
>http://www.manoweb.com/alesan/lirc</A>
looks really nice and easy. If you think you have
problems with homemade stuff try either a TV card (can be had for as little
as 50Euros here in Germany), quite a lot of them feature a infrared port
already and are quite easy to set up (and you have the benefit of watching
and recording TV too
<IMG SRC="../gx/dennis/smily.gif" ALT=";-)"
height="24" width="20" align="middle"> or there are also some irda-adapters for all ports
(parallel, serial, even usb) to buy, but I think they are more expensive
than a tv card.
</BLOCKQUOTE>
<!-- end 4 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.5"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">On A Slower Computer</FONT></H3>
Wed, 7 May 2003 13:45:54 -0400 (EDT)
<BR>William Hooper (<a href="mailto:linux-questions-only@ssc.com?cc=whooper@freeshell.org&subject=%20Re%3A%20%5BLG%2091%5D%202c%20Tips%20%235">whooper from freeshell.org</a>)
<blockquote><font color="#000066">In reference to
<a href="../issue90/lg_mail.html@wanted.3">Help Wanted #3, Issue 90</a>
-- Heather</font></blockquote>
<P>
On a slower computer...
</P>
<P>
Now, small distros and distros-on-floppy we have by the dozens. But RH 8
compatible? Or kickstart floppies that chop out a bunch of that memory
hogging, CPU slogging stuff? An article on keeping your Linux installers
on a diet would be keen. Just in time for Summer, too. -- Heather
</P>
<HR width="10%" align="center"><P>
Definitely check out the RULE project (<A HREF="http://www.rule-project.org/en"
>http://www.rule-project.org/en</A>).
They have installers for <A HREF="http://www.redhat.com/">Red Hat</A> 7.x and 8.0 for low memory and older
processor machines. I have personally used it to install a minimal RH 7.3
system on a P75 with 16MB of RAM. Great stuff!
</P>
<P>
--
William Hooper
</P>
<BLOCKQUOTE>
[Thomas Adam, the <EM>LG</EM> Weekend Mechanic]
Indeed, William
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle"> I contibute to this project, since I myself use archaic
technology
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle"> I'm in the process of writing some docs for installing
XFree86 on a 486 with 16MB Ram using FVWM2.
</BLOCKQUOTE>
<BLOCKQUOTE>
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle">
</BLOCKQUOTE>
<blockquote><font color="#000066">I leave out the byplay of one-downmanship as Answer Gang folk chimed in
with the older and slower machines of yesteryear which either gave them
their start into Linux or still operate as some kind of server today.
The winner and new champeen of Lowball Linuxing is Robos, who wondered
why his 486/33 notebook with 16 MB RAM was even slower than its usual
glacial self - since all but 4 MB of the memory had come a little loose
and X had come up anyway. The winning WM for low end systems seems
to be FVWM, with a decent place for IceWM, and a surprise showing for
E - provided you use a theme on a serious diet. K is not recommended,
and we don't exactly recommend Gnome unless it's a quiet and lazy day
for you, either...
-- Heather</font></blockquote>
<!-- end 5 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.6"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">Interesting take on C/C++/etc. by Jon Lasser</FONT></H3>
Tue, 15 Apr 2003 20:27:14 +0100
<BR>Jimmy O'Regan (<a href="mailto:linux-questions-only@ssc.com?cc=jimregan@o2.ie&subject=%20Re%3A%20%5BLG%2091%5D%202c%20Tips%20%236">the <em>LG</em> Answer Gang</a>)
<P><STRONG>
I think C is used as often as it is because it's the lowest common
denominator - write a library in C, you can use it from any other
language. It won't be the same for any of the scripting languages
until Parrot is widespread.
</STRONG></P>
<P>
In case anyone's interested, I came across these links --
</P>
<P><DL><DT>
Call Perl code from Python
<DD><A HREF="http://aspn.activestate.com/ASPN/CodeDoc/pyperl/perlmodule.html"
>http://aspn.activestate.com/ASPN/CodeDoc/pyperl/perlmodule.html</A>
</DL></P>
<P><DL><DT>
Call Python from C or TCL (easily)
<DD><A HREF="http://elmer.sourceforge.net"
>http://elmer.sourceforge.net</A>
</DL></P>
<!-- end 6 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.lj"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy"><em>Linux Journal</em> Weekly News Notes - Tech Tips</FONT></H3>
Tue, 28 Jan 2003 14:55:08 -0800 (PST)
<BR>Linux Journal News Notes (<a href="mailto:linux-questions-only@ssc.com?cc=lj-announce@ssc.com&subject=%20Re%3A%20%5BLG%2091%5D%202c%20Tips%20%237">lj-announce from ssc.com</a>)
<h4 align="center"><br>Have Vim Help You Trim
</h4>
<P>
It's always inconsiderate to quote more of someone's posting than you
have to in a mailing list. Here's how to bind a key in Vim to delete
any remaining quoted lines after the cursor:
</P>
<blockquote><pre>map . j{!}grep -v ^\&gt;^M}
</pre></blockquote>
<P>
where . is whatever key you want to bind.
</P>
<HR width="10%" align="center">
<h4 align="center"><br>Your Bayesian Defender -- Train It Well!
</h4>
<P>
If you want to train a Bayesian spam filter on your mail, don't delete
non-spam mail that you're done with. Put it in a "non-spam trash"
folder and let the filter train on it. Then, delete only the mail
that's been used for training. Do the same thing with spam.
</P>
<P>
It's especially important to train your filter on mail that it
misclassified the first time. Be sure to move spam from your index to
your spam folder instead of merely deleting it.
</P>
<P>
To do the training, edit your crontab with crontab -e and add lines
like this:
</P>
<blockquote><pre>6 1 * * * /bin/mv -fv $HOME/Maildir/nonspam-trash/new/* $HOME/Maildir/nonspam-t
rash/cur/ &amp;&amp; /usr/local/bin/mboxtrain.py -d $HOME/.hammiedb -g $HOME/Maildir/no
nspam-trash
6 1 * * * /bin/mv -fv $HOME/Maildir/spam/new/* $HOME/Maildir/spam/cur/ &amp;&amp; /usr/
local/bin/mboxtrain.py -d $HOME/.hammiedb -s $HOME/Maildir/spam
</pre></blockquote>
<P>
Finally, you can remove mail in a trash mailbox that the Bayesian
filter has already seen:
</P>
<blockquote><pre>2 2 * * * grep -rl X-Spambayes-Trained $HOME/Maildir/nonspam-trash | xargs rm -
v
2 2 * * * grep -rl X-Spambayes-Trained $HOME/Maildir/spam | xargs rm -v
</pre></blockquote>
<P>
Look for more information on Spambayes and the math behind spam
filtering in the March issue of Linux Journal.
</P>
<HR width="10%" align="center">
<h4 align="center"><br>NTP: Whose Watch Are We Looking At, Anyway?
</h4>
<P>
It's easy to see what timeserver your Linux box is using with this
command:
</P>
<blockquote><pre> ntptrace localhost
</pre></blockquote>
<P>
But what would happen to the time on your system if that timeserver
failed? Use
</P>
<blockquote><pre> ntpq -p
</pre></blockquote>
<P>
to see a chart of all the timeservers with which your NTP daemon is
communicating. An * indicates the timeserver you currently are using,
and a + indicates a good fall-back connection. You should always have
one *, and one or two + entries mean you have a backup timeserver as
well.
</P>
<HR width="10%" align="center">
<h4 align="center"><br>Changing Directory the Smart Way
</h4>
<P>
In bash, you can make the cd command a little smarter by setting the
CDPATH environment variable. If you cd to a directory, and there's no
directory by that name in the current directory, bash will look for it
under the directories in CDPATH. This is great if you have to deal
with long directory names, such as those that tend to build up on
production web sites. Now, instead of typing
</P>
<blockquote><pre> cd /var/www/sites/backhoe/docroot/support
</pre></blockquote>
<P>
you can add this to your .bash_login
</P>
<blockquote><pre> export CDPATH="$CDPATH:/var/www/sites/support/backhoe/docroot"
</pre></blockquote>
<P>
and type only
</P>
<blockquote><pre> cd support
</pre></blockquote>
<P>
This tip is based on the bash section of Rob Flickenger's Linux Server
Hacks.
</P>
<HR width="10%" align="center">
<h4 align="center"><br>Can't Wait For Mozilla? Speed It Up.
</h4>
<P>
In order to store persistent preferences in Mozilla, make a separate
file called user.js in the same directory under .mozilla as where your
prefs.js file lives.
</P>
<P>
You can make your web experience seem slower or faster by changing the
value of the nglayout.initialpaint.delay preference. For example, to
have Mozilla start rendering the page as soon as it receives any data,
add this line to your user.js file:
</P>
<P><BLOCKQuote>
user_pref("nglayout.initialpaint.delay", 0);
</BLOCKQuote></P>
<P>
Depending on the speed of your network connection and the size of the
page, this might make Mozilla seem faster.
</P>
<HR width="10%" align="center">
<h4 align="center"><br>Window Frames My Way, Sawfish Says
</h4>
<P>
If you use the Sawfish window manager, you can set window properties
for each X program, such as whether it has a title bar, whether it is
skipped when you Alt-Tab from window to window and whether it always
appears maximized. You even can set the frame style to be different
for windows from different hosts.
</P>
<P>
First, start the program whose window properties you want to
customize. Then run the Sawfish configurator, sawfish-ui. In the
Sawfish configurator, select Matched Windows and then the Add button.
</P>
<HR width="10%" align="center">
<h4 align="center"><br>Merging Websites With ProxyPass
</h4>
<P>
You can't include web documents across domains with SSI, but with an
<A HREF="http://www.apache.org/">Apache</A> ProxyPass directive you can do it to map part of one site into
another.
</P>
<HR width="10%" align="center">
<h4 align="center"><br>ps doesn't need awk
</h4>
<P>
You don't need to pipe the output of ps through awk to get the process
ID or some other value you want. Use ps --format to select only the
needed fields. For example, to print only process IDs, type:
</P>
<blockquote><pre> ps --format=%p
</pre></blockquote>
<P>
To list only the names of every program running on the system, with no
duplication, type:
</P>
<blockquote><pre> ps ahx --format=%c | sort -u
</pre></blockquote>
<P>
If you have an ssh-agent running somewhere on your system and want to
use it, you can get the SSH_AUTH_SOCK environment variable from one of
your processes that does have the agent's information in its
environment:
</P>
<blockquote><pre>for p in `ps --User=$LOGNAME --format=%p`; do export `strings /proc/22864/environ | grep SSH_AUTH_SOCK` &amp;&amp; break; done
</pre></blockquote>
<P>
This is handy for cron jobs and other processes that start without
getting access to ssh-agent in the usual ways.
</P>
<!-- end 7 -->
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
<h5>This page edited and maintained by the Editors of <I>Linux Gazette</I><br>HTML script maintained by <A HREF="mailto:star@starshine.org">Heather Stern</a> of Starshine Technical Services, <A HREF="http://www.starshine.org/">http://www.starshine.org/</A>
<br>Copyright &copy; 2003
<br>Copying license <A HREF="http://www.linuxgazette.com/copying.html">http://www.linuxgazette.com/copying.html</A>
<BR>Published in Issue 91 of <i>Linux Gazette</i>, June 2003</H5>
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>
<!--startcut ==========================================================-->
<CENTER>
<!-- *** BEGIN navbar *** -->
<A HREF="lg_mail.html">&lt;&lt;&nbsp;Prev</A>&nbsp;&nbsp;|&nbsp;&nbsp;<A HREF="index.html">TOC</A>&nbsp;&nbsp;|&nbsp;&nbsp;<A HREF="../index.html">Front Page</A>&nbsp;&nbsp;|&nbsp;&nbsp;<A HREF="http://www.linuxgazette.com/cgi-bin/talkback/all.py?site=LG&article=http://www.linuxgazette.com/issue91/lg_tips.html">Talkback</A>&nbsp;&nbsp;|&nbsp;&nbsp;<A HREF="../faq/index.html">FAQ</A>&nbsp;&nbsp;|&nbsp;&nbsp;<A HREF="lg_answer.html">Next&nbsp;&gt;&gt;</A>
<!-- *** END navbar *** -->
</CENTER>
</BODY></HTML>
<!--endcut ============================================================-->