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

1403 lines
57 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.c">
<LINK REV="made" href="mailto:%20linux-questions-only@ssc.com%20"><TITLE>More 2 Cent Tips &amp; Tricks LG #87</TITLE></HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#0000AF"
ALINK="#FF0000">
<!-- *** END HTML header *** -->
<!--endcut ==============================================-->
<!-- *** BEGIN navbar *** -->
<IMG ALT="" SRC="../gx/navbar/left.jpg" WIDTH="14" HEIGHT="45" BORDER="0" ALIGN="bottom"><A HREF="lg_mail.html"><IMG ALT="[ Prev ]" SRC="../gx/navbar/prev.jpg" WIDTH="16" HEIGHT="45" BORDER="0" ALIGN="bottom"></A><A HREF="index.html"><IMG ALT="[ Table of Contents ]" SRC="../gx/navbar/toc.jpg" WIDTH="220" HEIGHT="45" BORDER="0" ALIGN="bottom" ></A><A HREF="../index.html"><IMG ALT="[ Front Page ]" SRC="../gx/navbar/frontpage.jpg" WIDTH="137" HEIGHT="45" BORDER="0" ALIGN="bottom"></A><A HREF="http://www.linuxgazette.com/cgi-bin/talkback/all.py?site=LG&article=http://www.linuxgazette.com/issue87/lg_tips.html"><IMG ALT="[ Talkback ]" SRC="../gx/navbar/talkback.jpg" WIDTH="121" HEIGHT="45" BORDER="0" ALIGN="bottom" ></A><A HREF="../lg_faq.html"><IMG ALT="[ FAQ ]" SRC="./../gx/navbar/faq.jpg"WIDTH="62" HEIGHT="45" BORDER="0" ALIGN="bottom"></A><A HREF="lg_answer.html"><IMG ALT="[ Next ]" SRC="../gx/navbar/next.jpg" WIDTH="15" HEIGHT="45" BORDER="0" ALIGN="bottom" ></A><IMG ALT="" SRC="../gx/navbar/right.jpg" WIDTH="15" HEIGHT="45" ALIGN="bottom">
<!-- *** 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>Two Sound Cards Under Linux</strong></a>
<li><A HREF="#tips.2"
><strong>rpm in debian ?</strong></a>
<li><A HREF="#tips.3"
><strong>propagating ownership and permissions</strong></a>
<li><A HREF="#tips.4"
><strong>boot to windows by default</strong></a>
<li><A HREF="#tips.5"
><strong>network programming - accepting data</strong></a>
<li><A HREF="#tips.6"
><strong>Key bindings in X</strong></a>
<li><A HREF="#tips.7"
><strong>alsa in debian</strong></a>
<li><A HREF="#tips.8"
><strong>pppd</strong></a>
<li><A HREF="#tips.9"
></a>telnet processes not disappearing when user closes session incorrectly --or--
<br><A HREF="#tips.9"
><strong>Is that your FIN_WAIT Answer?</strong></a>
<li><A HREF="#tips.10"
><strong>direct rendering for nvidia RIVA 128</strong></a>
<li><A HREF="#tips.11"
><strong>xcdroast post cdrom mount problem</strong></a>
<li><A HREF="#tips.12"
><strong>iptables: What They Are and What They Do</strong></a>
<li><A HREF="#tips.13"
><strong>Code folding in Vim</strong></a>
<li><A HREF="#tips.14"
><strong>Debian "Woody" boot error</strong></a>
<li><A HREF="#tips.15"
><strong>Proxying with MAC address</strong></a>
<li><A HREF="#tips.16"
><strong>fwd: Re: [TAG] wrestling with postfix...</strong></a>
<!-- 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">Two Sound Cards Under Linux</FONT></H3>
Tue, 14 Jan 2003 03:02:07 -0500
<BR>N4FWD - Tom Kocourek (<a href="mailto:linux-questions-only@ssc.com?cc=tko@atempest.net&subject=%20Re%3A%20%5BLG%2087%5D%202c%20Tips%20%231">tko from atempest.net</a>)
<h4 align="center"><br> The Need
</h4>
<P>
As an Amateur Radio Operator, I wanted to use "QSSTV" under Linux. This program uses the DSP in a sound card to decode pictures being transmitted on Amateur Radio. However, I did not wish to give up the basic sound ability available under <A HREF="http://www.kde.org/">KDE</A>. Thus I started reading about dual sound cards.
</P>
<h4 align="center"><br>Research
</h4>
<P>
Searches via Google did not turn up much information on dual sound cards, just the usual "HOW TO" references on getting one sound card running. But, one key piece of information did turn up, that multiple sound drivers can coexist!
</P>
<h4 align="center"><br>Some experimentation and...
</h4>
<P>
Multiple sound cards can work together provided:
</P>
<blockQuote><ol>
<LI>Each additional sound card must be a different chip set (ie. different drivers)
<LI>Each sound card must have its own IRQ and distinct control register address space
</ol></blockQuote>
<h4 align="center"><br>Installation checkup
</h4>
<P>
At this point, you have physically installed the additional sound card and have verified that the BIOS has assigned different IRQs to the cards.
</P>
<P>
Now you have booted Linux and have logged in. In Mandrake Linux there is an integrated program called the MCC (or Mandrake Control Center). You can either use MCC or you can execute in a term window:
</P>
<blockquote><pre> $ /sbin/lsmod | less
</pre></blockquote>
<P>
You are verifying that different drivers have been assigned to each Sound Card. If you are not using one of the more recent distributions of Linux (such as <A HREF="http://www.redhat.com/">Red Hat</A>, Mandrake, or <A HREF="http://www.suse.com/">SuSE</A>), you may have to alter the configuration files by hand to achieve the necessary loading of the proper Sound Card drivers.
</P>
<P>
Next, you run a mixer setting program, like KMIX. If all is ok, the program should display 2 distinct mixers. If not, then you need to recheck the configuration files.
</P>
<h4 align="center"><br>Now for the tough part...
</h4>
<P>
Many sound programs are not well written. That is to say that the program assumes that only one sound card exist in your system. These types of sloppy programs will lock up Linux and require using the reset button
</P>
<P>
Well written programs allow you to set which sound card is to be used. XMMS is a well written program. While it assumes that sound card 0 is the only sound card in the system, It does not lock down Linux. QSSTV is an even better written program in that it allows you to configure which sound card is to be accessed.
</P>
<P>
"ARTSD" is a poorly written program and MUST be disabled when you run dual sound cards in your system. Otherwise, you will be reaching for the reset button!
</P>
<h4 align="center"><br>Lastly...
</h4>
<P>
I am able to play my music via XMMS and Sound Card 0; while QSSTV decodes pictures using Sound Card 1 simultaneously under Linux!
</P>
<!-- 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">rpm in debian ?</FONT></H3>
Tue, 7 Jan 2003 14:17:47 +0530
<BR>Kapil Hari Paranjape (<a href="mailto:linux-questions-only@ssc.com?cc=joy12@vsnl.net&cc=kapil@imsc.res.in&subject=%20Re%3A%20%5BLG%2087%5D%202c%20Tips%20%232%20%20rpm in debian">kapil from imsc.res.in</a>)
<BR>Question by Joydeep Bakshi (joy12 from vsnl.net)
<P><STRONG>
Hi,
I am a <A HREF="http://www.debian.org/">Debian</A> user and interested to install the rpm packages ( from RH or
MDK cds ) in Debian. but is it possible to do so ? if yse , how ?
</STRONG></P>
<BLOCKQUOTE>
[Kapil]
A debian package:
</BLOCKQUOTE>
<blockquote><pre>Package: alien
Section: admin
Architecture: all
Description: install non-native packages with dpkg
Alien allows you to convert LSB, Red Hat, Stampede and Slackware Packages
into Debian packages, which can be installed with dpkg.
.
It can also generate packages of any of the other formats.
.
This is a tool only suitable for binary packages.
</pre></blockquote>
<BLOCKQUOTE>
This suggests that "apt install alien" would do the trick for you.
</BLOCKQUOTE>
<BLOCKQUOTE>
This works as follows. You run
</BLOCKQUOTE>
<blockquote><pre> fakeroot alien -r &lt;RPM&gt;
</pre></blockquote>
<BLOCKQUOTE>
This produces a .deb which can be installed.
</BLOCKQUOTE>
<BLOCKQUOTE>
It is a good idea to read the documentation first. In particular,
please heed the warning about <EM>not</EM> installing any critical packages
this way. IF (and this is a big if) some mission critical package you
absolutely must have is <EM>not</EM> in Debian (stable or testing or
unstable), then it is generally better to run "debmake" on the
unpacked source tree to build the relevant debian package.
(of course to do this you should generally have installed
"build-essential").
</BLOCKQUOTE>
<BLOCKQUOTE>
[JimD]
</BLOCKQUOTE>
<BLOCKQUOTE><BLOCKQUOTE><CODE>
... and created a debian/rules file (a makefile starting with
<BR>#!/usr/bin/make -f).
</CODE></BLOCKQUOTE></BLOCKQUOTE>
<BLOCKQUOTE>
[Kapil]
The "alien" package is largely for (boo-hiss) non-free stuff that is
only available as binaries packaged as RPMs.
</BLOCKQUOTE>
<BLOCKQUOTE>
[JimD]
It is also possible to install the debian rpm package. You can
then directly use RPM commands. However, there won't be any
dependency database (dbm files) so all dependency checks will fail.
</BLOCKQUOTE>
<BLOCKQUOTE>
At some point someone may come with with a very clever (and probably
difficult to maintain) adapter that will generate a reasonable RPM/DBM
database set from a Debian <TT>/var/lib/dpkg/info</TT> tree. Alas that is not
in the cards for now.
</BLOCKQUOTE>
<BLOCKQUOTE>
'alien' is probably the best way to go in most cases.
</BLOCKQUOTE>
<HR width="10%" align="center"><P><STRONG>
Thanks a lot for ur valuable hints. alien is excellent. but *alien -i*
command didn't check any dependency when I installed open office (making .deb
from Mandrake cd ), hence it could not be started due to missing libraries.
</STRONG></P>
<BLOCKQUOTE>
[Kapil]
Dependencies are certainly a problem for alien. The way I understand
it, <EM>if</EM> you have the correct libraries installed then the
dependencies are included in the .deb package produced by
"alien". Otherwise "alien" only produces error messages about unmet
dependencies...
</BLOCKQUOTE>
<BLOCKQUOTE>
... a bit of a catch 22 alright!
</BLOCKQUOTE>
<BLOCKQUOTE>
But if you create the .deb files and install them in the "correct"
order (and assuming that there are no cross dependencies!) the
<EM>binary</EM> dependencies should work out correctly. What "alien" does (I'm
guessing here) is it runs "ldd" on the executables and looks for the
package that supplied the relevant library. This is how it is often done
during .deb creation.
</BLOCKQUOTE>
<BLOCKQUOTE>
Non-binary dependencies are probably unresolvable unless you can lay
your hands on an LSB package---whatever that is.
</BLOCKQUOTE>
<blockquote><font color="#000066">The Linux Standards Base is an industry-wide effort to make life easier
for companies that want to produce commercial shrinkwrap products. If
they adhere to the filesystem layout and principles described there,
then the package should be able to be installed on any Linux distro
which also claims to be LSB compliant.
</font></blockquote>
<blockquote><font color="#000066">The installers haven't quite perfected this as far as to handle
everybody's slight differences in initscript setup, but other than that
it's not too bad. At the very least a knowledgeable system admin has no
problem grafting such applications into the company-wide server.
-- Heather</font></blockquote>
<P><STRONG>
1) is it possible to let the kpackage to handle this type of converted .deb
packages and their dependency ?
</STRONG></P>
<BLOCKQUOTE>
[Kapil]
I don't know anything about kpackage but I would guess that if the
information is not in the .deb file there is not much kpackage can do.
</BLOCKQUOTE>
<P><STRONG>
2) if I have a particular directory to store all these converted .deb
packages then how to modify kpackage to display those packages in its tree
view ? ( if it is possible at all )
</STRONG></P>
<BLOCKQUOTE>
[Kapil]
There <EM>are</EM> some debian packages that allow you to create your private
repositories - there is a sledge-hammer called "apt-move" but there may
be something simpler for your requirement.
</BLOCKQUOTE>
<blockquote><font color="#000066">When the deb file is installed, if it has no section it will be placed
in the "Obsolete and Locally Created Packages" section under aptitude.
I assume kpackage has a similar feature, although I've been a bit shy of
the X-windows based apt front-ends, since I prefer to have a minimum of
processes running when updating my systems.
-- Heather</font></blockquote>
<P><STRONG>
once again thanks 4 ur solution.
</STRONG></P>
<BLOCKQUOTE>
[Kapil]
As far as openoffice and other such packages are concerned your best
bet is the "unofficial apt repositories" (which I forgot to mention in
my list of stable/testing/unstable). You can find these unofficial
repositories at:
</BLOCKQUOTE>
<BLOCKQUOTE><BLOCKQuote>
<A HREF="http://www.apt-get.org"
>http://www.apt-get.org</A>
</BLOCKQuote></BLOCKQUOTE>
<BLOCKQUOTE>
I seem to remember that this site lists a site for openoffice.
You can add that site to the list in <TT>/etc/apt/sources.list</TT>
and you should be able to then use apt-get (or probably kpackage) to
install openoffice with dependencies resolved.
</BLOCKQUOTE>
<BLOCKQUOTE>
Be warned that the unofficial repositories are un-signed packages and
could contain trojans and other such!
</BLOCKQUOTE>
<P><STRONG>
Thanks 4 all ur technical info.
</STRONG></P>
<P><STRONG>
best regards
</STRONG></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">propagating ownership and permissions</FONT></H3>
Mon, 30 Dec 2002 08:30:09 -0500
<BR>Ben Okopnik (<a href="mailto:linux-questions-only@ssc.com?cc=ben@callahans.org&subject=%20Re%3A%20%5BLG%2087%5D%202c%20Tips%20%233%20%20ownership">the <em>LG</em> Answer Gang</a>)
<P>
A while back, I wrote a utility that propagates ownership and
permissions from a sample file to a group of files. Imagine a situation
where you have, say, several dozen documents with a scattershot list of
permissions and owners/groups (since they were created by different
people.) The way to "bring them into line" would be to pick a file that
already has The Right Stuff - it doesn't even have to be in the same
directory - and say:
</P>
<blockquote><pre>cpmod /path/to/example/file *
</pre></blockquote>
<P>
Note that this utility is self-documenting. Its internal "man page" can
be read (as long as "cpmod" is somewhere in your path) with
</P>
<blockquote><pre>perldoc cpmod
</pre></blockquote>
<P>
If you want an actual man page, one can be easily created with
</P>
<blockquote><pre>pod2man cpmod|gzip -c&gt;cpmod.1.gz
</pre></blockquote>
<P>
Put the resulting file somewhere in your man directory structure
(<TT>/usr/share/man/man1</TT>, perhaps).
</P>
<p align="center">See attached <tt><a href="misc/tips/cpmod.pl.txt">cpmod.pl.txt</a></tt></p>
<BLOCKQUOTE>
[JimD]
In newer GNU utils you can use something like:
</BLOCKQUOTE>
<blockquote><pre> #!/bin/sh
reference="$1"; shift
for i in "$@"; do
chown --reference="$reference" "$i"
chmod --reference="$reference" "$i"
done
</pre></blockquote>
<P><STRONG>
[Ben]
Very cool, Jim! I hadn't seen that one before; I was only familiar with
the older versions.
</STRONG></P>
<BLOCKQUOTE>
[JimD]
(Technically I think you can just make that for i; do ...
since I think that for loops default to being in "$@" if you
don't specify an explicit list. I know they default, but I'm
not sure if they default to $* or "$@" --- if you care about the
distinction; as usual the subtleties of soft-quoting are there to
protect degenerate filenames containin whitespace!).
</BLOCKQUOTE>
<BLOCKQUOTE>
In other GNU utils you can use a little trickery like:
</BLOCKQUOTE>
<blockquote><pre> #!/bin/sh
reference="$1"; shift
UID=$(find "$1" -maxdepth 0 -printf "%U" )
MODE=$(find "$1" -maxdepth 0 -printf "%m" )
for i in "$@"; do
chown "$UID" "$i"
chmod "$MODE" "$i"
done
</pre></blockquote>
<BLOCKQUOTE>
Ben, am I missing some subtleties here? (Other than the obviously
argument counting, error checking and messages, and some getopts to
provide --help, --owner-only, --mode-only etc.)
</BLOCKQUOTE>
<P><STRONG>
[Ben]
Not so far as I can see. However, the Perl version is shorter (if you
ignore the included man page.)
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle">
</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">boot to windows by default</FONT></H3>
9 Jan 2003 05:16:50 -0000
<BR>David Mandala, Jim Dennis (<a href="mailto:linux-questions-only@ssc.com?cc=anuragsahay@rediffmail.com&subject=%20Re%3A%20%5BLG%2087%5D%202c%20Tips%20%234">the <em>LG</em> Answer Gang</a>)
<BR>Question by anurag sahay (anuragsahay from rediffmail.com)
<P><STRONG>
Hi Answer guy,
I ahve two questions
</STRONG></P>
<P><STRONG>
1.
I have linux and Windows both loaded on my system.i wanted to
boot to windows by default.how can i chang the lilo.conf
file.what are the changes to be made there.
</STRONG></P>
<BLOCKQUOTE>
[David]
The answer to your question about lilo is to edit the <TT>/etc/lilo.conf</TT>
file.
</BLOCKQUOTE>
<BLOCKQUOTE>
Your file might look something like this:
</BLOCKQUOTE>
<p align="center">See attached <tt><a href="misc/tips/linux-and-dos.lilo-conf.txt">linux-and-dos.lilo-conf.txt</a></tt></p>
<BLOCKQUOTE>
Cheers,
Davidm
</BLOCKQUOTE>
<BLOCKQUOTE>
[JimD]
Essentially, add a default= directive to your <TT>/etc/lilo.conf</TT>
(or edit your <TT>/boot/menu.lst</TT> file if you're using GRUB).
Read the lilo.conf man (and/or GRUB info) pages for more detail on
that.
</BLOCKQUOTE>
<BLOCKQUOTE>
The Linux Documentation Project (<A HREF="http://www.tldp.org"
>http://www.tldp.org</A> ) has an
entire section of HOWTOs on boot loaders and related topics (about
a dozen of them):
</BLOCKQUOTE>
<BLOCKQUOTE><BLOCKQuote>
<A HREF="http://www.tldp.org/HOWTO/HOWTO-INDEX/os.html#OSBOOT"
>http://www.tldp.org/HOWTO/HOWTO-INDEX/os.html#OSBOOT</A>
</BLOCKQuote></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">network programming - accepting data</FONT></H3>
9 Jan 2003 05:16:50 -0000
<BR>Kapil Hari Paranjape, Jim Dennis (<a href="mailto:linux-questions-only@ssc.com?cc=anuragsahay@rediffmail.com&subject=%20Re%3A%20%5BLG%2087%5D%202c%20Tips%20%235">the <em>LG</em> Answer Gang</a>)
<BR>Question by anurag sahay (anuragsahay from rediffmail.com)
<P><STRONG>
Hi Answer guy,
I ahve two questions
</STRONG></P>
<P><STRONG>
2.
This about unix network programming: How to accept any data
from any given port.
</STRONG></P>
<P><STRONG>
thanking you
<BR>yours anurag
</STRONG></P>
<BLOCKQUOTE>
[Kapil]
Have a look at the utlities "netcat" and "socat".
</BLOCKQUOTE>
<BLOCKQUOTE>
[JimD]
You could use netcat (often named <TT>/usr/bin/nc</TT>) or socat
directly (from shell scripts, etc) to listen on arbitrary TCP or UDP
ports. Note: the process has to have 'root' privileges to listen on
"privileged" ports -- those from 1 to 1023 inclusive (or maybe it's
1024 inclusive --- I never remember that one).
</BLOCKQUOTE>
<BLOCKQUOTE>
More to the point, you can read the source code to netcat or socat
(included with most distributions on the "Source Code" disc or
readily downloadable from many archive sites on the net. As a <A HREF="http://www.debian.org/">Debian</A>
user I find it most convenient to get most sources with a simple
'apt-get source' command. Debian tracks, index, and automatically
fetches, unpacks and patches the sources for me. With an 'apt-get
build-dep' command I can also have Debian fetch and install all of
the packages that are required to build almost any other package from
its sources (they're still working on that feature).
</BLOCKQUOTE>
<BLOCKQUOTE>
It makes me reluctant to hunt down the upstream sources, suitable
for other distros and other forms of UNIX.
</BLOCKQUOTE>
<BLOCKQUOTE>
These things change far too frequently, but Google is our friend.
It appears that the current canonical location for finding Hobbit's
netcat sources is at:
</BLOCKQUOTE>
<BLOCKQUOTE><BLOCKQuote>
<A HREF="http://www.atstake.com/research/tools/network_utilities"
>http://www.atstake.com/research/tools/network_utilities</A>
</BLOCKQuote></BLOCKQUOTE>
<BLOCKQUOTE>
... where he (Hobbit) seems to have an e-mail address. Perhaps he
works at @Stake.
</BLOCKQUOTE>
<BLOCKQUOTE>
As for socat its author, Gerhard Rieger, conveniently list the package's
home page in the man page that comes with the package (at least with the
Debian package): <A HREF="http://www.dest-unreach.org/socat"
>http://www.dest-unreach.org/socat</A>
</BLOCKQUOTE>
<BLOCKQUOTE>
Reading the sources to these will teach you alot about UNIX network
programming. In particular netcat has been around for a very long
time and has had VERY FEW bugs reported against it. It's been
scrutinized by thousands, probably tens of thousands of programmers.
</BLOCKQUOTE>
<BLOCKQUOTE>
You should also buy Richard Stevens' seminal textbook on
<EM>UNIX</EM> <EM>Network</EM> <EM>Programming</EM> (Prentice Hall). Read more about that at:
</BLOCKQUOTE>
<BLOCKQUOTE><BLOCKQuote>
<A HREF="http://www.kohala.com/start"
>http://www.kohala.com/start</A>
</BLOCKQuote></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">Key bindings in X</FONT></H3>
Wed, 22 Jan 2003 07:51:49 +0800
<BR>jamie sims (<a href="mailto:linux-questions-only@ssc.com?cc=jaymz@operamail.com&subject=%20Re%3A%20%5BLG%2087%5D%202c%20Tips%20%236">jaymz from operamail.com</a>)
<P>
Here's the fix I finally hit upon to get those F keys working
in xterm. I edited a copy of <TT>/usr/X11R6/lib/X11/app-defaults/XTerm</TT> and added the
following:
</P>
<P><BLOCKQuote>
See attached
<a href="misc/tips/XTerm.app-defaults.txt">XTerm.app-defaults.txt</a>
</BLOCKQuote></P>
<P>
I then saved it as .Xdefaults and it works very well.
</P>
<blockquote><font color="#000066">You can use the .Xdefaults file in your home directory to add or
override X internal resources for any application - so make sure that
if you already have some features stored there, that you add this
into it, instead of replacing it.
-- Heather</font></blockquote>
<!-- end 6 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.7"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">alsa in debian</FONT></H3>
Sun, 19 Jan 2003 12:52:21 +0530
<BR>Kapil Hari Paranjape (<a href="mailto:linux-questions-only@ssc.com?cc=joy12@vsnl.net&cc=kapil@imsc.res.in&subject=%20Re%3A%20%5BLG%2087%5D%202c%20Tips%20%237">kapil from imsc.res.in</a>)
<BR>Question by Joydeep Bakshi (joy12 from vsnl.net)
<P><STRONG>
Hi there,
u know alsa in not built in debian 3.0 by default. but alsa utils... &amp; driver
&amp; header files are present in the 7cd set. could any one please tell me how
to build the alsa modules in debian &amp; the required packages 4 this ?
</STRONG></P>
<P><STRONG>
Note: there are some alsa-modules ( in the cds ) based on 2.4.16 kernel, but
mine is 2.4.18
</STRONG></P>
<P>
Where you got the kernel-image-2.4.18 you should also find the
relevant alsa-modules-2.4.18. Anyway here is the procedure to build
alsa modules for debian.
</P>
<P>
1. Use apt-get to install the relevant alsa-source package. You could
also download the sources from the alsa ftp site --- I haven't tried
that but it should work.
</P>
<P>
2. Install the relevant kernel source package, and the package
kernel-package.
</P>
<P>
3. Unpack the kernel source and alsa-modules in <TT>/usr/src.</TT>
</P>
<P>
4. Run "make-kpkg --config=menuconfig" configure in the kernel source
directory.
</P>
<P>
5. Run make-kpkg kernel-image and make-kpkg modules-image.
</P>
<P>
6. This should build a pair of compatible kernel-image and
alsa-modules package files which you can install with dpkg.
</P>
<P>
7. Of course you need to edit your grub menu or lilo conf file and so
on to run this kernel.
</P>
<P>
8. You can then configure alsa with alsa-conf alsa-base and so on.
</P>
<P>
Remember to set and save the mixer settings so that
<TT>/etc/init.d/alsa</TT> script (which is part of alsa-base) can restore
these settings.
</P>
<!-- end 7 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.8"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">pppd</FONT></H3>
Fri, 3 Jan 2003 11:24:26 -0800
<BR>Mike Iron Orr, Ben Okopnik (<a href="mailto:linux-questions-only@ssc.com?cc=joy12@vsnl.net&subject=%20Re%3A%20%5BLG%2087%5D%202c%20Tips%20%238">the <em>LG</em> Answer Gang</a>)
<BR>Question by Joydeep Bakshi (joy12 from vsnl.net)
<P><STRONG>
pppd command shows a few strings character in RH, but in debian it shows
error
</STRONG></P>
<P><STRONG>
" remote system needs to authenticate itself" &amp; discontinue
</STRONG></P>
<BLOCKQUOTE>
[Ben]
Ah, I'd missed this part. Neil is right - you don't have the "noauth"
option defined in your "<TT>/etc/ppp/peers/provider</TT>" or whatever options
file you're using.
</BLOCKQUOTE>
<BLOCKQUOTE>
[Iron]
I haven't used ppp for years (but I will soon, when I set up my mom's computer),
but yes, if you're dialing into an ISP you want "noauth". Otherwise your Linux
box will require authentication from the server, which it won't do. The server
thinks *it's* trusted and *you're* the one who has to authenticate yourself.
And even if it was willing to authenticate itself, how could it? It doesn't
have a password to authenticate itself <EM>with</EM>. The (nonexistent) password the
servers would authenticate themselves with is different than the user password
you authenticate yourself with.
</BLOCKQUOTE>
<BLOCKQUOTE>
If people are dialing <EM>into</EM> your Linux system, then you want authorization
<EM>for those calls</EM>.
</BLOCKQUOTE>
<P><STRONG>
Thanks 4 the solution,
it is working now.
</STRONG></P>
<!-- end 8 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.9"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">Is that your FIN_WAIT Answer?</FONT></H3>
Mon, 13 Jan 2003 19:00:25 -0800
<BR>Jim Dennis (<a href="mailto:linux-questions-only@ssc.com?cc=linux-questions-only@ssc.com,&cc=jimd@starshine.org&subject=%20Re%3A%20%5BLG%2087%5D%202c%20Tips%20%239">the <em>LG</em> Answer Guy</a>)
<!-- ::
Is that your FIN_WAIT Answer?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:: -->
<P><STRONG>
I am using RedHat Advanced Server 2.1, Kernel 2.4.9 and am having the
following problem:
</STRONG></P>
<P><STRONG><BLOCKQuote>
If I log on as userA via a telnet session and run Test_pgm and then
disconnect the telnet session by closing the window instead of properly
logging out, this is what is shown from the ps command:
</BLOCKQuote></STRONG></P>
<pre><strong>UID PID PPID C STIME TTY TIME CMD
userA 8505 1 0 14:00 ? 00:00:00 login -- userA
userA 8506 8505 0 14:00 ? 00:00:00 -bash
userA 8540 8506 87 14:00 ? 00:00:42 Test_pgm
</strong></pre>
<P><STRONG>
Notice that there is no longer a TTY associated with the running program or
the original login and the PPID of the login has been inherited by process
ID#1. Furthermore, if I do a top command, the results show that the CPU Idle
% is zero, with the Test_pgm using up all of the CPU %. The load average
goes through the roof. I've seen it up close to 30.0. However, the system's
performance does not seem to be effected by me or by any of the users. These
processes are not listed as zombies and are never cleaned up by the system
unless I kill the login process or restart the server.
</STRONG></P>
<BLOCKQUOTE>
Most of this seems normal (for a program that's ignoring SIGHUP). The
loadavg number seems odd.
</BLOCKQUOTE>
<P><STRONG>
This scenario happens whether the user is running an in-house 'C' program or
an operating system utility such as Redhat's setup. Within our own 'C'
programs, I have tried to capture a terminating signal, using the <TT> signal()</TT>
command, but I am not seeing any of the signals
that I would expect to see, such a SIGTERM or SIGHUP.
</STRONG></P>
<P><STRONG>
Does anyone have any ideas as to how to tell RedHat to take down the
processes associated with a telnet when a tty disappears?
</STRONG></P>
<P><STRONG>
Thanks in advance.
<BR>DP
</STRONG></P>
<BLOCKQUOTE>
in.telnetd should be sending a SIGHUP to the process when the TCP
connection is closed (including when the keepalive fails?).
</BLOCKQUOTE>
<BLOCKQUOTE>
Run 'netstat -na' and see if the TCP connection is lingering in
FIN_WAIT state. This could be a case where your (probably MS-Windows)
telnet client is failing to properly perform the three-way
disconnection handshaking that's required of TCP. (I recall problems
with some MS Windows FTP clients resulting in similar symptoms on
high volume public FTP servers).
</BLOCKQUOTE>
<BLOCKQUOTE>
Try it with a UNIX telnet client.
</BLOCKQUOTE>
<BLOCKQUOTE>
Try it with ssh.
</BLOCKQUOTE>
<BLOCKQUOTE>
If it works with ssh, perhaps you can use that as leverage with your
users and management to abandon this insecure and deprecated protocol!
(PUTTY is a very good, and free, ssh client for MS Windows operating
systems. There are many others).
</BLOCKQUOTE>
<BLOCKQUOTE>
Other than that, I would try upgrading the kernel (2.4.9 was pretty
miserable under memory load) and watch one of these sessions with tcpdump
and strace (so you can correlate what's happening on the wire with
what's happening in the process). Upgrading to RH 7.3 might also be
good since the compilers and libraries in 7.1 and 7.2 had ... issues.
</BLOCKQUOTE>
<BLOCKQUOTE>
Without knowing more about what Test_pgm is supposed to do, I can't
immediately suggest any other workarounds.
</BLOCKQUOTE>
<!-- end 9 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.10"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">direct rendering for nvidia RIVA 128</FONT></H3>
Sun, 19 Jan 2003 00:13:51 +0100
<BR>Yann Vernier (<a href="mailto:linux-questions-only@ssc.com?cc=rscottf@ieee.org&cc=yann@algonet.se&subject=%20Re%3A%20%5BLG%2087%5D%202c%20Tips%20%2310">yann from algonet.se</a>)
<BR>Question by linux-questions-only@ssc.com, Scott Frazier (rscottf from ieee.org)
<P><STRONG>
I have a nvidia velocity 128 video card, which uses the RIVA 128
accelerator chip. I'm running Mandrake 9.0, which sets it up with
glx (3D capability), but with no direct rendering (uses software
rendering). Needless to say this REALLY slows it down for games.
Does anyone know how I might resolve this?
I've tried changing an entry in the XF86Config file, in the
MODULES section. I added the line Load "dri", to no avail.
I'm pretty sure the card is dri capable, as it is able to do bus
mastering, which is a must for this.
</STRONG></P>
<P>
Sorry to disappoint you, but last time I checked there was no DRI driver
for the Riva 128. It's among the earliest nVidia chips, and nVidia's own
binary-only driver only supports TNT or later (two models newer). There
was a partly accelerated Mesa-based GLX implementation for XFree86 3
that supported it, however, called Utah-GLX. You may be able to run
that, but you'd obviously lose out on all other new features of XFree86
4.
</P>
<!-- end 10 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.11"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">xcdroast post cdrom mount problem</FONT></H3>
Fri, 10 Jan 2003 17:32:51 -0500
<BR> (<a href="mailto:linux-questions-only@ssc.com?cc=bbertsch@surfside.net&cc=&subject=%20Re%3A%20%5BLG%2087%5D%202c%20Tips%20%2311"></a>)
<BR>Question by Brian (bbertsch from surfside.net)
<P><STRONG>
hello,
i'm a recovering os/2 user. i used it today, and i may have to
tomorrow... but i can stop any time i want to.. but my modem....
</STRONG></P>
<P><STRONG>
Anyway, after i use xcdroast, (which i am getting used to, under RH8-<A HREF="http://www.kde.org/">KDE</A>)
i am unable to check the cdrom just made because the cdrom will not
mount. (ide double cheapo brand 48x, works great). i have to use the
newly-made cd on my os/2 machine to check it. my friends laugh at me.
</STRONG></P>
<P><STRONG>
thanks, brian
</STRONG></P>
<BLOCKQUOTE>
[JimD]
You probably need to change <TT>/dev/cdrom</TT> to be a symlink to <TT>/dev/scd0</TT> or
something like that.
</BLOCKQUOTE>
<BLOCKQUOTE>
Linux normally handles your ATAPI CD-R drive via a SCSI emulation
layer. Once this layer is active (possibly via a loadable module)
then all access to the CD has to go through the SCSI device nodes
(<TT>/dev/sg*</TT> for writing, and <TT>/dev/scd0</TT> for mounting CDs).
</BLOCKQUOTE>
<BLOCKQUOTE>
Try that. Try this command first:
</BLOCKQUOTE>
<BLOCKQUOTE><BLOCKQUOTE><CODE>
mount -t iso9660 -o ro /dev/scd0 /mnt/cdrom
</CODE></BLOCKQUOTE></BLOCKQUOTE>
<BLOCKQUOTE>
... from a root shell prompt.
</BLOCKQUOTE>
<BLOCKQUOTE>
[John]
Greetings from another former OS/2 user - although I used it for about 2
yrs or so, and switched to Linux.
</BLOCKQUOTE>
<BLOCKQUOTE>
Anyway, have you read CD's made from that cooker before? Could be a
hardware issue. Some of those really cheap devices lack some features.
But chances of that would seem a bit slim if it's a 48X drive, cuz those
compatibility problems are usually more common with the older drives. But
I wouldn't rule it out as a possibility.
</BLOCKQUOTE>
<!-- end 11 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.12"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">iptables: What They Are and What They Do</FONT></H3>
Tue, 7 Jan 2003 04:18:33 -0800
<BR>Jim Dennis (<a href="mailto:linux-questions-only@ssc.com?cc=collin_sq2003@yahoo.com&cc=jimd@starshine.org&subject=%20Re%3A%20%5BLG%2087%5D%202c%20Tips%20%2312">the <em>LG</em> Answer Guy</a>)
<BR>Question by peter collins (collin_sq2003 from yahoo.com)
<P><STRONG>
could you please explain to me what iptables are and what they do
</STRONG></P>
<P>
IPTables are tables (lists) of packet filtering rules in the Linux
kernel. They are added (passed into the kernel's address space)
and manipulated using a command named: 'iptables' and they are
interpreted by various kernel modules written to the "netfilter"
APIs (primarily by Paul "Rusty" Russell).
</P>
<P>
Each rule is a pattern matching some sorts of network traffic
based on many criteria (IP source or destination addresses,
TCP or UDP source and destination ports, ICMP type, IP or other
options (flags), connection status (correlated from other, previous
packets), even MAC addresses, which interface and direction they're
coming from or destined to, which local processes are generating
them, etc.). Part of each rule is a "disposition" like: DROP, REJECT,
ACCEPT, "jump" to another ruleset (table) etc.
</P>
<P>
The ability to conditionally process different packets in various ways,
and even to conditionally "call" on some rulesets, makes iptables into
a very specialized programming language. IPChains was somewhat
different, simpler packet filtering language (also by Rusty), and
ipfwadm was a much simpler packet filtering system back in the 2.0
kernel days.
</P>
<P>
It looks like the 2.6 kernel, probably due out sometime this year, will
be the first one since 1.3 that hasn't had a major overhaul in the
packet filtering language. IP Tables was released with 2.4 and has
only undergone minor bug fixes and refinement since then.
</P>
<P>
Note that most of the packet filtering rules relate to whether to
allow a packet through the system, to DROP it (with no notice)
or REJECT it (providing an ICMP or error back to its sender, as
appropriate), MASQUERADE or TRANSLATE it (change its apparent source
address and port (usually setting up some local state to dynamically
capture and re-write any response traffic related to it), REDIRECT it
(change its destination address and/or port), change its "ToS" (type
of service) bits. It's also possible to attach an FWMARK to a packet
which can be used by some other parts of the Linux TCP/IP subsystem.
</P>
<P>
What IPTables is NOT:
</P>
<P><BLOCKQuote>
There is another subsystem, similarly complex and seemingly related
--- but distinct from netfilter (the kernel code that support IP
Tables). This is the "policy routing" code --- which is controlled
with the tersely named 'ip' command (the core of the iproute2 package).
</BLOCKQuote></P>
<P>
Policy routing is different that packet filtering. Where packet
filters is about whether the packets go through, and whether some parts
of a packet are re-written, policy routing is purely about <EM>how</EM> they
are sent towards their destination. Under normal routing every
outbound and forwarded packet is sent to its next hop based exclusively
on its destination address. Under policy routing it's possible to send
some traffic through one router based on its source address, port or
protocol characteristic, etc. This is different than the IP tables
"REDIRECT" because this doesn't change the packet --- it just sends it
to a different router based on the policy rules.
</P>
<P>
The two subsystems can interact, however. For example policy routing
does include options to match on the ToS or FWMARK that might be attached
to a packet by the iptables rules. (These FWMARKs are just identifiers
that are kept in the kernel's internal data structure about the packet
--- they never leave the system and can't go over the wire with the
packet. ToS are only a couple of bits in the header, hints that
traditionally distinguish between "expedited" (telnet) and "buld" (ftp)
traffic).
</P>
<P>
The iproute2 package and the 'ip' command replace the ifconfig command
and provide considerable control over interfaces. It also allows one
to set "queueing disciplines" to interfaces which determine which
packets get to "go first" when there are more than one of them waiting
to be sent over given interface.
</P>
<P>
There is alot more I could tell you about Linux routing and network
support. For example none of this relates to dynamic routing table
management. There are user space programs like routed, gated, and
various GNU Zebra modules, that can listening to various dynamic
routing protocols such as RIP, RIPv2, OSPF, BGP, etc. to automatically
add and remove entries to the kernel's routing tables. Some of these
might be able to also dynamically set <EM>policies</EM> as they do so.
There is also a Linux compile time option called "Equal Cost
Multi-path" which is not part of policy routing. Normally if you added
two static routes of "equal cost" than the first one (of the lowest
cost) would always be used, unless the system was getting "router
unavailable" ICMP messages from somewhere on the LAN. However, with
Equal Cost Multipath the system will distribute the load among
such routes. This can be used to balance the outbound traffic from a
very busy system (such as a popular web server or busy mail gateway) among
multiple routers (connected to multiple ISPs over multiple T1s or whatever).
</P>
<P>
(This is similar to a trick with policy routing --- assigning a couple
of IP "aliases" --- different IP addresses --- to one interface; one
from one ISP, another from a different one, and using policy routing
to ensure that all response/outbound packets <EM>from</EM> one of these sources
go through the appropriate router. DNS round robin will balance the
incoming load, and policy routing will balance the response load.
Equal Cost Multipath will balance traffic <EM>initiated</EM> from that host).
</P>
<P>
Again, all of these last paragraphs are NOT IP tables. I'm just trying
to give you a flavor of other networking stuff in Linux apart from it,
and to let you know that it, if you don't find what you need in the
iptables documentation, it might be somewhere else.
</P>
<P>
To learn more about Netfilter and IP Tables, please read though the
appropriate HOWTOs:
</P>
<P><BLOCKQuote>
<A HREF="http://www.tldp.org/LDP/nag2/x-087-2-firewall.future.html"
>http://www.tldp.org/LDP/nag2/x-087-2-firewall.future.html</A>
<A HREF="http://www.netfilter.org"
>http://www.netfilter.org</A>
</BLOCKQuote></P>
<!-- sig -->
<!-- sig -->
<!-- end 12 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.13"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">Code folding in Vim</FONT></H3>
12 Jan 2003 23:53:53 +0530
<BR>Ashwin N (<a href="mailto:linux-questions-only@ssc.com?cc=ashwin_n@gmx.net&subject=%20Re%3A%20%5BLG%2087%5D%202c%20Tips%20%2313">ashwin_n from gmx.net</a>)
<P>
Vim versions 6.0 and later support a new feature called Code Folding.
Using code folding a block of code can be "folded" up into a single
line, thus making the overall code easier to grasp.
</P>
<P>
The Vim commands to use code folding are quite simple.
</P>
<P>
To create a fold just position the cursor at the start of the block of
code and type :
zfap
</P>
<P>
To open a fold :
zo
</P>
<P>
To close a fold :
zc
</P>
<P>
To open all the folds :
zr
</P>
<P>
To close all the folds :
zm
</P>
<P>
For more commands and information on code folding in Vim query the
inbuilt help feature of Vim :
:help folding
</P>
<BLOCKQUOTE>
[John Karns]
You're quite right. Folding is particularly useful for
long sections of code that contain loops, etc. I use
it extensively in this context.
</BLOCKQUOTE>
<BLOCKQUOTE>
Other uses include long paragraphs of prose.
</BLOCKQUOTE>
<BLOCKQUOTE>
But make sure you are in command mode! If you are in text
entry mode, just typing in "zfap" would literally embed that
string into your text!
</BLOCKQUOTE>
<blockquote><font color="#000066">If you're in text entry mode, press Escape to get back into
command mode.
</font></blockquote>
<blockquote><font color="#000066">Vi has two command modes and a text entry mode. When you come
in you are at ordinary command mode. When you type a colon
(such as what precedes the word "help" above) then you end up
with a small colon prompt. The above commands are NOT colon
mode commands, except for help. But you do need your cursor
at the right location.
</font></blockquote>
<blockquote><font color="#000066">The colon prompt is also called "ex mode" by old hands at vi,
but I'm not entirely sure that all the commands that use it
are really old commands at all. Some are surely long words
allowing you to access some enhanced features, too, because
there are only so many letters in the alphabet.
</font></blockquote>
<blockquote><font color="#000066">To get out of the help mode you may need to type :q to quit
the extra window it created. Your original textfile is still
around, don't worry.
-- Heather</font></blockquote>
<!-- end 13 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.14"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">Debian "Woody" boot error</FONT></H3>
Tue, 21 Jan 2003 16:30:32 -0600
<BR>Robos (<a href="mailto:linux-questions-only@ssc.com?cc=rich@gandalf.ws&subject=%20Re%3A%20%5BLG%2087%5D%202c%20Tips%20%2314">the <em>LG</em> Answer Gang</a>)
<BR>Question by Rich Price (rich from gandalf.ws)
<P><STRONG>
After installing the Woody release of <A HREF="http://www.debian.org/">Debian</A> using the idepci kernel I
noticed the following boot message
</STRONG></P>
<pre><strong>modprobe: Can't locate module char-major-10-135
</strong></pre>
<P><STRONG>
Some Google searching led me to the following factoid:
</STRONG></P>
<P><STRONG><BLOCKQuote>
"char-major-10-135" refers to the character device, major 10, minor 135,
</BLOCKQuote></STRONG></P>
<P><STRONG>
which is <TT>/dev/rtc.</TT>
It provides access to the BIOS clock, or RTC, the Real Time Clock.
</STRONG></P>
<BLOCKQUOTE>
[Robos]
OH MY GOSH! REINSTALL!
(Just kidding)
</BLOCKQUOTE>
<blockquote><font color="#000066">This doesn't actually mean that your computer has no sense of time at
all; it just means you won't be able to access the additional precision
it has available, without extra code in the kernel. If you have SMP,
the kernel docs warn that it's important to compile this in. Otherwise,
very few things actually care.
</font></blockquote>
<blockquote><font color="#000066">But in a new enough kernel, with devfs support, any app which is
curious about it (that is, would use the extra support if you have it,
but ignore it if you don't) will provoke a complaint when the userland
devfsd attempts to autoload the module. You can tell it to ignore that
stuff, detailed in devfsd's man page.
-- Heather</font></blockquote>
<P><STRONG>
So, fine, I want it.
</STRONG></P>
<BLOCKQUOTE>
[Robos]
Hmm, ok
</BLOCKQUOTE>
<P><STRONG>
I looked around in the distro CDs, but I couldn't find the char-major-10-135
module.
No luck at the Debian site either. Where can I find a copy of this module
compiled for the
Debian Woody idepci kernel?
</STRONG></P>
<BLOCKQUOTE>
[Robos]
Actually it has to be compiled in the kernel to be either hard integrated or
to be loadable as a module. It <EM>seems</EM> as if they (the debian kernel package
maintainer) did neither. So, either you bake your own kernel and tick the
appropriate field in make xconfig or you need to look (grep) through some
configs of kernels (packaged ones) to find one which has rtc true oder m.
BTW, I have this message too on all my machines with hand made kernels and
it didn't bother me a thing till now...
</BLOCKQUOTE>
<BLOCKQUOTE>
[Iron]
char-major-10-135 is a generic name; the module itself won't be called that.
Take a look in <TT>/etc/modules.conf</TT> . The "alias" lines map the generic name to
a specific module that provides it, for instance:
</BLOCKQUOTE>
<blockquote><pre>alias char-major-10-175 agpgart
</pre></blockquote>
<BLOCKQUOTE>
In this case, some program or daemon is trying to access the real time clock.
You can also create your own aliases; e.g., I name my Ethernet cards according
to their interfaces:
</BLOCKQUOTE>
<blockquote><pre>alias eth0 3c59x
alias eth1 eepro100
</pre></blockquote>
<BLOCKQUOTE>
So when my network initialization script does:
</BLOCKQUOTE>
<blockquote><pre>modprobe eth0
modprobe eth1
</pre></blockquote>
<BLOCKQUOTE>
I know eth0 will connect to the 3C905 card (DSL) and eth1 will connect to the
EE PRO card (LAN). And if I have to change cards later, I can just change the
alias lines and leave everything else along. (The only thing I can't do is
use two cards of the same brand, because then I would have no control over their
initialization order except by seeing which PCI slot has the lowest base
address: "cat <TT>/proc/ioports</TT>". If eth0 and eth1 get reversed, the network
won't work because packets will get routed to the wrong network.)
</BLOCKQUOTE>
<BLOCKQUOTE>
Anyway, the easiest way to "fix" your problem is to add an alias:
</BLOCKQUOTE>
<blockquote><pre>alias char-major-10-175 off
</pre></blockquote>
<BLOCKQUOTE>
That tells modprobe to shut up because there is no module for that service.
So whatever is asking for that module will abort or do without. Whether that's
a problem or not depends on what the program is trying to do and whether you
need it. I have never run into problems aliasing char-major-*-* modules off.
</BLOCKQUOTE>
<BLOCKQUOTE>
Of course, the "correct" solution is to find out what's using the module and
disable it if you don't need it.
</BLOCKQUOTE>
<BLOCKQUOTE>
In my Linux 2.4.17 source, "make menuconfig", "character devices",
"Enhanced Real Time Clock support", "Help" (press Help while the cursor is
on the RTC line) says the module file is "rtc.o". You can also guess that from
the config option name at the top: CONFIG_RTC. That's the file you want from
your distribution disk. On Debian it would be in a kernel modules package.
</BLOCKQUOTE>
<BLOCKQUOTE>
Note that Debian has a configurator for <TT>/etc/modules.conf.</TT> Instead of editing
that file directly, edit <TT>/etc/modutils/aliases</TT> and then run "update-modules".
See "man 8 update-modules".
</BLOCKQUOTE>
<!-- end 14 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.15"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">Proxying with MAC address</FONT></H3>
Sun, 12 Jan 2003 05:00:20 -0800
<BR>Jim Dennis (<a href="mailto:linux-questions-only@ssc.com?cc=gansh@rediffmail.com&cc=jimd@starshine.org&subject=%20Re%3A%20%5BLG%2087%5D%202c%20Tips%20%2315">the <em>LG</em> Answer Guy</a>)
<BR>Question by Ganesh M (gansh from rediffmail.com)
<P><STRONG>
Thanks to Karl-Heinz Herrmann for bearing with me, just one little
<BR>question please.
</STRONG></P>
<P><STRONG>
Is it possible to restrict internet access by private LAN PCs
taking into account their MAC address instead of the IP address
by any means, i.e., Masquerading/Proxying etc. Can masquerading
and proxying co-exist, and if so, what is the advantage?
</STRONG></P>
<P><STRONG>
Thanks
<BR>M Ganesh
</STRONG></P>
<P>
It should be possible (though <EM>very</EM> cumbersome) to configure your
networks so that only registered MAC addresses are routed from one
internal network to another (including via the border router to the
Internet).
</P>
<P>
Under Linux you could write scripts to do this using the MAC Address
Match option/module in the Linux kernel configuration (*) (named:
CONFIG_IP_NF_MATCH_MAC in the .config file).
</P>
<blockquote><em><font color="#000033"><br> *(Networking Options --&gt; Netfilter Configuration --&gt; IP Tables)
</font></em></blockquote>
<P>
However, it's probably an ill-advised strategy. Many people try
to limit this by setting up their DHCP servers with known MAC addresses
and refusing to give out IP addresses to unknown systems. They then
might couple this with monitoring using the 'arpwatch' package to
detect new ARP (MAC/IP address combinations) and with 'snort' to
warn them of other suspicious network activity.
</P>
<P>
As for co-existence of IP Masquerading and applications layer proxying.
Yes they can co-exist --- and are even sensible in some cases. In fact
it's common to use something <EM>like</EM> IP Masquerading with the Squid caching
web proxy --- in its "transparent proxy" configuration.
</P>
<P>
In general you might use proxies for those protocols that support it,
and for inbound connections; while letting systems fall back on IP
masquerading other work (subject to your packet filtering, of course).
</P>
<P>
The advantages of application proxy systems are largely in three
dimensions: They can be quite simple, and run in user space often as a
non-privileged process (security and simplicity); they can reflect
higher level policies because they have access to the applications and
sessions layers of the protocol that is being proxied (flexibility and
control), they may be able to provide better performance (performance,
especially via caching).
</P>
<P>
However, any particular proxy might not provide real advantages in all
(nor even ANY) of these areas. In particular the Delegate proxy system
seems to be riddled with buffer overflows, for example. Squid is a
nice caching proxy for web and some other services --- and it has some
security and policy management features and optional modules. However,
Squid configuration and administration can be quite complicated. It's
far too easy to inadvertantly make your Squid system into a free
anonymizing proxy for the whole Internet, or to make it into an
unintentional <EM>inbound</EM> proxy to your own intranet systems.
</P>
<P>
While a proxy <EM>might</EM> have access to the application/session layer data
(in the payloads of the IP packets) --- it might not have a reasonable
means for expressing your policies regarding acceptable use of these
protocols.
</P>
<P>
Also there are always those new protocols for which no proxies have
been written. There will frequently be considerable demand by your
users and their management to provide access to the latest and greatest
new toys on the Internet (Pointcast was an historic example, Internet
radio is, perhaps, a more recent one).
</P>
<P>
These issues are very complex, and I can't do them justice at 5am after
staying up all night
<IMG SRC="../gx/dennis/smily.gif" ALT=";)"
height="24" width="20" align="middle">
</P>
<!-- end 15 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.16"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">fwd: Re: [TAG] wrestling with postfix...</FONT></H3>
Sun, 19 Jan 2003 09:01:44 -0800
<BR>Dan Wilder (<a href="mailto:linux-questions-only@ssc.com?cc=rnegut@yahoo.com&subject=%20Re%3A%20%5BLG%2087%5D%202c%20Tips%20%2316">the <em>LG</em> Answer Gang</a>)
<BR>Question by Radu Negut (rnegut from yahoo.com)
<P><STRONG>
Hi!
After going twice through the postfix documentation, I
still couldn't figure it out if it is possible to
configure mail for groups (e.g.
<A HREF="mailto:sales_managers@domain.com"
>sales_managers@domain.com</A>) otherwise besides aliasing
all group members to that address in
<TT>/etc/postfix/aliases.</TT> Does postfix reread the aliases
as well if 'postfix reload' is issued or only the .cf
file? Does 'service postfix restart' reset all
mailques, resulting in dropped/lost mail? I've looked
</STRONG></P>
<P>
For alias lists, add stuff to <TT>/etc/aliases</TT> then run
</P>
<P><CODE>
postalias /etc/aliases
</CODE></P>
<P>
If you don't care whether the new aliases are effective instantly,
you're done. Very shortly Postfix will notice
the aliases file is updated and will reload it.
</P>
<P>
You may keep aliases in additional files. See the
</P>
<P>
alias_maps =
</P>
<P>
parameter in main.cf. You can add as many alias files as you
like.
</P>
<P>
For bigger lists, or frequently changing ones, investigate
mailing list software. I use Mailman or majordomo myself.
See the URL below.
</P>
<P><STRONG>
around but couldn't find if postfix can be configured
to use accounts other than from <TT>/etc/passwd</TT> (and I'm
not talking about aliases). What I mean is normal mail
spools, but for users that get specified in a separate
file and who do not have any permissions on the system
whatsoever.
</STRONG></P>
<P>
Briefly, you can't do normal UNIX mail delivery except to users
from <TT>/etc/passwd.</TT> However you <EM>can</EM> do POP3/IMAP delivery
to a software that maintains its own list of users. You're looking
for something like Cyrus. You'll find it under the POP3/IMAP servers
section of
</P>
<P>
<A HREF="http://www.postfix.org/addon.html"
>http://www.postfix.org/addon.html</A>
</P>
<P>
Take the time to browse the other pages of the postfix.org site.
</P>
<P>
--
Dan Wilder
</P>
<!-- sig -->
<!-- end 16 -->
<!-- *** 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 87 of <i>Linux Gazette</i>, February 2003</H5>
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>
<!--startcut ==========================================================-->
<CENTER>
<!-- *** BEGIN navbar *** -->
<IMG ALT="" SRC="../gx/navbar/left.jpg" WIDTH="14" HEIGHT="45" BORDER="0" ALIGN="bottom"><A HREF="lg_mail.html"><IMG ALT="[ Prev ]" SRC="../gx/navbar/prev.jpg" WIDTH="16" HEIGHT="45" BORDER="0" ALIGN="bottom"></A><A HREF="index.html"><IMG ALT="[ Table of Contents ]" SRC="../gx/navbar/toc.jpg" WIDTH="220" HEIGHT="45" BORDER="0" ALIGN="bottom" ></A><A HREF="../index.html"><IMG ALT="[ Front Page ]" SRC="../gx/navbar/frontpage.jpg" WIDTH="137" HEIGHT="45" BORDER="0" ALIGN="bottom"></A><A HREF="http://www.linuxgazette.com/cgi-bin/talkback/all.py?site=LG&article=http://www.linuxgazette.com/issue87/lg_tips.html"><IMG ALT="[ Talkback ]" SRC="../gx/navbar/talkback.jpg" WIDTH="121" HEIGHT="45" BORDER="0" ALIGN="bottom" ></A><A HREF="../lg_faq.html"><IMG ALT="[ FAQ ]" SRC="./../gx/navbar/faq.jpg"WIDTH="62" HEIGHT="45" BORDER="0" ALIGN="bottom"></A><A HREF="lg_answer.html"><IMG ALT="[ Next ]" SRC="../gx/navbar/next.jpg" WIDTH="15" HEIGHT="45" BORDER="0" ALIGN="bottom" ></A><IMG ALT="" SRC="../gx/navbar/right.jpg" WIDTH="15" HEIGHT="45" ALIGN="bottom">
<!-- *** END navbar *** -->
</CENTER>
</BODY></HTML>
<!--endcut ============================================================-->