353 lines
12 KiB
HTML
353 lines
12 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
|
|
<html> <head>
|
|
<title>More 2 Cent Tips & Tricks</title>
|
|
</head>
|
|
<body>
|
|
<H4>"Linux Gazette...<I>making Linux just a little more fun!</I>
|
|
"</H4>
|
|
|
|
<hr>
|
|
<!-- QUICK TIPS SECTION ================================================== -->
|
|
<H2><A NAME="tips"><IMG ALIGN=MIDDLE ALT="" SRC="../gx/twocent.gif">More 2¢ Tips!
|
|
</A></H2>
|
|
|
|
<p><hr><p>
|
|
<H3>Contents:</H3>
|
|
<ul>
|
|
<li><a HREF="./lg_tips09.html#emacs">Emacs Control M Trick</a>
|
|
<li><a HREF="./lg_tips09.html#xterm">XTerm Title Trick 2</a>
|
|
<li><a HREF="./lg_tips09.html#vi">VI Trick -- Commenting Code</a>
|
|
<li><a HREF="./lg_tips09.html#find">Newbie Tip on Find</a>
|
|
<li><a HREF="./lg_tips09.html#sendmail">Masquerading with SendMail</a>
|
|
<li><a HREF="./lg_tips09.html#upgrade">Linux Upgrade</a>
|
|
</ul>
|
|
|
|
<P>
|
|
<hr>
|
|
<!-- ===================================================================== -->
|
|
<H3><IMG ALIGN=MIDDLE ALT="" SRC="../gx/lil2cent.gif"><a name="emacs">Emacs Control M Trick</a></H3>
|
|
|
|
<P>
|
|
Date: Fri, 09 Aug 1996 20:15:45 -0500<br>
|
|
From: David Ishee <ishee@erc.msstate.edu><br>
|
|
To: fiskjm@ctrvax.Vanderbilt.Edu<br>
|
|
Subject: $0.02 tip for removing Control M in emacs<br>
|
|
<P>
|
|
After looking at issue 8 about how to remove the pesky Control-M
|
|
character in vi (vim or whatever) I had to also tell how it could be
|
|
done in emacs. Say you loaded up a file that has the ^M all over the
|
|
place. No problem, say M-x replace-string RET C-q C-M RET RET and you're
|
|
done. Emacs rulz!!
|
|
<P>
|
|
David
|
|
<P>
|
|
|
|
<hr>
|
|
<!-- ===================================================================== -->
|
|
<P>
|
|
<H3><IMG ALIGN=MIDDLE ALT="" SRC="../gx/lil2cent.gif"><a name="xterm">XTerm Title Trick 2</a></H3>
|
|
|
|
<P>
|
|
Date: Tue, 13 Aug 1996 20:45:39 +0100<br>
|
|
From: Caolan McNamara <9312811@ul.iea><br>
|
|
To: fiskjm@ctrvax.Vanderbilt.Edu<br>
|
|
Subject: XTerm title tricks in Linux Gazette #6.<br>
|
|
<P>
|
|
Just scanning through back issues and came across the tip to keep the hostname
|
|
of the machine your currently logged into in your xterm titlebar (and
|
|
wanted to add my 2 cents).
|
|
<P>
|
|
I work in a room of 30 linux boxes, so to keep track of which one I'm logged
|
|
into despite logging in from one to another and logging out, I put
|
|
<pre>
|
|
alias precmd 'echo -n "\033]2;"`hostname`"\007"'
|
|
</pre>
|
|
(course anything could be put here)
|
|
<br>
|
|
in my .cshrc. Keeps my titlebar updated at all times. As a precmd its run after
|
|
every command but its a tiny overhead and steps around the issue of trying to
|
|
detect log-outs.
|
|
<br>
|
|
C.
|
|
<br>
|
|
<PRE>
|
|
--
|
|
Real Life: Caolan McNamara Local: caolan@skynet
|
|
College: 9312811@ul.ie Quote: Happiness is a small sig.
|
|
</PRE>
|
|
<P>
|
|
|
|
<hr>
|
|
<!-- ===================================================================== -->
|
|
<H3><IMG ALIGN=MIDDLE ALT="" SRC="../gx/lil2cent.gif"><a name="vi">VI Trick--Commenting Code</a></H3>
|
|
|
|
<P>
|
|
Date: Fri, 23 Aug 96 10:30:06 EDT<br>
|
|
From: dane@cci.com (Daniel Engel)<br>
|
|
To: gazette@ssc.com<br>
|
|
Subject: vi trick<br>
|
|
|
|
<P>
|
|
This is how you comment in a block of code using vi:
|
|
<pre>
|
|
:START,ENDs/^/# /
|
|
</PRE>
|
|
where START is the starting line number and END is the ending line number.
|
|
<PRE>
|
|
i.e. :10,30s/^/# /
|
|
</PRE>
|
|
comments in line 10 through line 30 of the current buffer (file).
|
|
<P>
|
|
same idea can be used for indentation and/or commenting out.
|
|
<P>
|
|
d. at Nortel (dane@cci.com)
|
|
<P>
|
|
|
|
<hr>
|
|
<!-- ===================================================================== -->
|
|
<H3><IMG ALIGN=MIDDLE ALT="" SRC="../gx/lil2cent.gif"><a name="find">
|
|
Newbie Tip on Find</a></H3>
|
|
<P>
|
|
Date: Tue, 20 Aug 1996 12:38:12 -0600 (MDT)<br>
|
|
From: murphyc@cadvision.com(Jim Murphy)<br>
|
|
To: gazette@ssc.com<br>
|
|
Subject: Article submission: Newbie Tip on Finding<br>
|
|
<P>
|
|
Hi,
|
|
<P>
|
|
As a new linuxer, I had a hard time finding my way
|
|
around the filesystem, and discovered that I often had to find
|
|
a file for some reason or other. I knew the find command was
|
|
out there, but remembering all the options required to make it
|
|
search the right places, find the right files, and print the
|
|
right answers was something I couldn't do, at first. So I made
|
|
up my own command, using a shell script, and called it "fnd".
|
|
<P>
|
|
"fnd" takes one argument, the name of the file you want
|
|
to locate, complete with any wildcards you may wish to include,
|
|
and pipes its output to "less", which then allows you to view a
|
|
large list of results. What you get, on each line of output, is
|
|
the complete path to anything which you're looking for! I
|
|
find it amazingly useful (as is a rough familiarity with the
|
|
"less" command.) Here's my script:
|
|
<PRE>
|
|
#!/bin/bash
|
|
find / -iname $1 -mount -print |less
|
|
</PRE>
|
|
<P>
|
|
That's it! The -iname option tells find to be case insensitive,
|
|
the $1 is a variable which subs in your commandline argument,
|
|
-mount tells find not to descend directories on other file systems
|
|
like your cd-ROM (because mine is wonky and locks up the machine if
|
|
it is accessed;). The -print option is required or you don't get
|
|
any output! (Get used to it, it's *nix...) The | symbol tells
|
|
find to direct its output to the "less" command so you can see
|
|
your results in style! Don't forget the / right after the find
|
|
command, or it won't know where to look. - Enjoy! You won't
|
|
regret the time you spend keying in this little shortcut, and
|
|
don't forget to put it in a "bin" or "sbin" directory after
|
|
chmod'ing it to be executable.
|
|
<P>
|
|
Jim Murphy<br>
|
|
murphyc@cadvision.com<br>
|
|
<P>
|
|
|
|
<hr>
|
|
<!-- ===================================================================== -->
|
|
<H3><IMG ALIGN=MIDDLE ALT="" SRC="../gx/lil2cent.gif"><a name="sendmail">
|
|
Masquerading with SendMail</a></H3>
|
|
|
|
<P>
|
|
Date: Tue, 27 Aug 1996 21:49:27 +0100 (GMT+0100)<br>
|
|
From: "Robert S. Wolfram" <0wolfram01@Lelystad.Flnet.nl><br>
|
|
To: gazette@ssc.com<br>
|
|
Subject: Masquerading with sendmail<br>
|
|
<P>
|
|
Hi Marjorie,
|
|
<P>
|
|
First of all, I think it is wonderful that John devoted that much of
|
|
his spare time to start and maintain the Linux Gazette. I am happy to
|
|
see that it is being continued. Keep up this beautiful project!
|
|
<P>
|
|
I was very pleased with Leifs Queue-R-Mail Howto, published in issue 6
|
|
of the Gazette, but I was still left with one drawback. I have a PPP
|
|
dialup account at a local provider, and when sending remote mail, the
|
|
"From" address and "Return Path" should be masqueraded to match my address
|
|
at the provider. If I would fill the $M macro in my 'sendmail.cf' (as
|
|
installed by Slackware 3.0), it would only change my domain, so it needed
|
|
some adjustment. I made some direct changes to 'sendmail.cf', but I did
|
|
make a backup before trying anything! Here are the changes I made:
|
|
<PRE>
|
|
> # Before the edits
|
|
< # After the edits
|
|
</PRE>
|
|
<P>
|
|
First of all, I filled the $M macro for masquerading my domain and added
|
|
a $N macro for masquerading my username:
|
|
<PRE>
|
|
> DM
|
|
< DMlelystad.flnet.nl
|
|
< DN0wolfram01
|
|
</PRE>
|
|
<P>
|
|
Disable masquerading for the local mailer in ruleset 40:
|
|
<PRE>
|
|
> R$* $: $1 @ $M add local qualification
|
|
< #R$* $: $1 @ $M add local qualification
|
|
</PRE>
|
|
<P>
|
|
Include username in remote mail masquerading (rulesets 31 and 61):
|
|
<PRE>
|
|
> R$* < @ $+ @ $+ > $@ $1 < @ $3 > $M is defined -- use it
|
|
< R$* < @ $+ @ $+ > $@ $N < @ $3 > $M is defined -- use it
|
|
> R$+ $: $1 < @ $M > user w/o host
|
|
< R$+ $: $N < @ $M > user w/o host
|
|
</PRE>
|
|
<P>
|
|
If you send your mail as root, you might want to remove its special
|
|
treatment:
|
|
<PRE>
|
|
> #CLroot
|
|
> CEroot
|
|
< #CLroot
|
|
< #CEroot
|
|
</PRE>
|
|
<P>
|
|
After sending 'sendmail' a HUP signal, my mail got masqueraded so that
|
|
the receiver could just reply to the correct mailbox.<br>
|
|
Two remarks:<br>
|
|
First, to find ruleset xx, just search for Sxx in the beginning of a line.
|
|
Secondly, tab characters between the fields in the rewriting rules
|
|
are REQUIRED!!! Make sure you do not change those into spaces!
|
|
<P>
|
|
Well, those were my $0.02. I hope it was still readable.
|
|
<P>
|
|
Cheers,<br>
|
|
Rob.
|
|
<br>
|
|
<PRE>
|
|
Rob S. Wolfram 0wolfram01@lelystad.flnet.nl rwolfram@wi.leidenuniv.nl
|
|
W3: http://www.flnet.nl/~0wolfram01
|
|
=========================================================================
|
|
L I N U X : T H E C H O I C E O F A G N U G E N E R A T I O N
|
|
=========================================================================
|
|
</PRE>
|
|
<P>
|
|
<hr>
|
|
<!-- ===================================================================== -->
|
|
<H3><IMG ALIGN=MIDDLE ALT="" SRC="../gx/lil2cent.gif"><a name="upgrade">Linux Upgrade</a></H3>
|
|
|
|
<P>
|
|
<hr>
|
|
Date: Tue, 20 Aug 1996 11:02:03 -0400<br>
|
|
From: David Bourgin dbourgin@wsc.com<br>
|
|
Organization: WSC Technologies, Inc.<br>
|
|
To: linux@ssc.com<br>
|
|
Subject: Linux upgrade<br>
|
|
<P>
|
|
Hello,
|
|
<P>
|
|
Since this FAQ is comes up a very often in comp.os.linux.*,
|
|
and since it's already mentioned in kernels 2.0.12+ in
|
|
/linux/Documentation/Changes and in some News papers
|
|
(still one contacting me today: The editor of the german magazine
|
|
UNIXopen.) without any request from us.
|
|
So I'm going to ask for you to put something in your interesting
|
|
magazine. It's is how to avoid a lot of problem when upgrading
|
|
a Linux box. There's a easy way, and some scripts to run.
|
|
All the stuff is free, and is available by ftp, located at:
|
|
ftp://ftp.wsc.com/pub/freeware/linux/update.linux/
|
|
<P>
|
|
The upgrade is full, it means it will upgrade any system
|
|
from 1.2.x (sorry I didn't test any earlier setup).
|
|
It will be right for anyone from new Linux users to experts
|
|
(no knowledge is required, no questions are done: all
|
|
is detected and worked fine for all people who tested,
|
|
except non-Lilo users since I force Lilo v19 to install.
|
|
This will change next.)
|
|
<P>
|
|
All the upgrade is always up to date, and only fully tested
|
|
packages are included (!). For example, I didn't install
|
|
kernel 2.0.5 when it comes out since I've found out a bug
|
|
in the code (reported to Linus who did 2.0.6 as a patch).
|
|
Current upgrade contains:
|
|
<ul>
|
|
<li> New kernel: 2.0.x
|
|
<li> New gcc: 2.7.2
|
|
<li> New libc: 5.4.2
|
|
<li> New libg: 2.7.1.4
|
|
<li> New ld.so: 1.8.1
|
|
<li> New bin utils 86: 0.3
|
|
<li> New modules: 2.0.0
|
|
<li> New make: 3.74
|
|
<li> New lilo: 19
|
|
<li> New autoconf 2.10
|
|
<li> New binary utilities 2.6.0.15 (2.7 only works with kernel
|
|
2.0.8+)
|
|
<li> New dip 3.3.7o
|
|
<li> New fdisk 3.04
|
|
<li> New fdutils 4.2
|
|
<li> New fsck 1.04
|
|
<li> New ftape 2.08
|
|
<li> New gawk 3.0.0
|
|
<li> New getty_ps 2.0.7i
|
|
<li> New gpm 1.09
|
|
<li> New hd param 3.0
|
|
<li> New iBCS 2.0 960610
|
|
<li> New man 1.4h
|
|
<li> New man pages 1.12
|
|
<li> New mount 2.5k
|
|
<li> New mtools 3.0
|
|
<li> New ncurses 1.9.9e
|
|
<li> New net tools 1.32alpha
|
|
<li> New pcmcia modules 2.8.18
|
|
<li> New ppp 2.2.0f
|
|
<li> New ps,top,who,w 1.01
|
|
<li> New sendmail 8.7.5a
|
|
<li> New SysVinit 2.64
|
|
<li> New TermCap 2.0.8a
|
|
<li> New apache (HTML server) 1.1.1
|
|
<li> New boot sys 0.4a
|
|
<li> New DosEmu: 960807
|
|
<li> New ghostscript 3.33
|
|
<li> New IP masquerading ipfwadm 2.2
|
|
<li> New lclint 2.1b
|
|
<li> New loadlin 16
|
|
<li> New ntfs 951231a
|
|
<li> New quotas 1.51
|
|
<li> New samba
|
|
<li> New snd-util 3.5
|
|
<li> New socks 5b 0.16.4
|
|
<li> New Linux utilities: 2.5
|
|
<li> New WINE: 960717
|
|
<li> New Netscape: 3.0 (not a freeware!)
|
|
</ul><P>
|
|
All is NOT installed when requested. For more details,
|
|
see README file at<br>
|
|
ftp://ftp.wsc.com/pub/freeware/linux/update.linux/
|
|
<P>
|
|
I know some mirrors exist in Europe as:<br>
|
|
ftp://ftp.ibp.fr/pub/linux/update.linux/
|
|
<P>
|
|
Note: I'm French, and I've moved two months ago from France.
|
|
So sorry if my American is not yet plain ;-)
|
|
<P>
|
|
Bye, David<br>
|
|
-- <br>
|
|
Web: http://www.accescyb.fr/~rezo1/homepage.html <br>
|
|
E-mail: dbourgin@wsc.com<br>
|
|
David Bourgin - Netware/Unix administration/security.<br>
|
|
I'm a netsurfer, and as such, a citizen of the worlda.<br>
|
|
|
|
<P> <hr> <P>
|
|
<A HREF="./index.html"><IMG SRC="../gx/indexnew.gif" ALT="[ TABLE OF
|
|
CONTENTS ]"></A> <A HREF="../index.html"><IMG SRC="../gx/homenew.gif"
|
|
ALT="[ FRONT PAGE ]"></A> <A HREF="lg_mail09.html"><IMG
|
|
SRC="../gx/back2.gif" ALT=" Back "></A> <A HREF="lg_bytes09.html"><IMG SRC="../gx/fwd.gif" ALT=" Next "></A>
|
|
|
|
<P> <hr> <P>
|
|
This page written and maintained by the Editor of <I>Linux Gazette</I>,
|
|
<A HREF="mailto: gazette@ssc.com"> gazette@ssc.com</A>
|
|
<P>
|
|
</body> </html>
|