old-www/LDP/LG/issue86/TWDT.html

8829 lines
338 KiB
HTML
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML><HEAD><TITLE> Linux Gazette Table of Contents LG #86</TITLE></HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#0000AF"
ALINK="#FF0000" >
<center>
<!-- A HREF="http://www.linuxgazette.com/">
<H1><IMG SRC="../gx/newlogo.jpg" ALT="LINUX GAZETTE" border="0"></H1></A> -->
<A HREF="http://www.linuxgazette.com/">
<H1><IMG ALT="LINUX GAZETTE" SRC="../gx/lglogo.png"
WIDTH="600" HEIGHT="124" border="0"></H1></A>
<H2>January 2003, Issue 86 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Published by <I>Linux Journal</I></H2>
<A HREF="../index.html">Front Page</A> &nbsp;|&nbsp;
<A HREF="../index.html">Back Issues</A> &nbsp;|&nbsp;
<A HREF="../lg_faq.html">FAQ</A> &nbsp;|&nbsp;
<A HREF="../mirrors.html">Mirrors</A> <!-- &nbsp;|&nbsp; --><BR>
<A HREF="../tag/kb.html">The Answer Gang knowledge base</A> (your Linux questions here!) <!-- &nbsp;|&nbsp; --><BR>
<A HREF="http://www.linuxgazette.com/search.html">Search (www.linuxgazette.com)</A>
<!-- *** BEGIN mirror site search link *** -->
<!-- &nbsp; <A HREF="http://www.linuxgazette.com/search.html">(SITE.COM
mirror)</A> -->
<!-- *** END mirror site search link *** -->
</CENTER>
<HR NOSHADE>
<!--=================================================================-->
<!-- H1><font color="#BB0000">Table of Contents:</font></H1 -->
<!-- *** BEGIN toc *** -->
<UL>
<LI> <A HREF="lg_mail.html">The MailBag</A>
<LI> <A HREF="lg_tips.html">More 2-Cent Tips</A>
<LI> <A HREF="lg_answer.html">The Answer Gang</A>
<LI> <A HREF="lg_bytes.html">News Bytes</A>, <EM>by Michael Conry</EM>
<LI> <A HREF="artime.html">An Undeletion Experience</A>, <EM>by C.E.C. Artime and J.A. Baro</EM>
<LI> <A HREF="bint.html">I Broke the Console Barrier</A>, <EM>by Stephen Bint</EM>
<LI> <A HREF="collinge.html">HelpDex</A>, <EM>by Shane Collinge</EM>
<LI> <A HREF="ecol.html">Ecol</A>, <EM>by Javier Malonda</EM>
<LI> <A HREF="ecol2.html">EcolNet and the escomposLinux.org project</A>, <EM>by Javier Malonda</EM>
<LI> <A HREF="foolish.html">The Foolish Things We Do With Our Computers</A>, <EM>by Mike ("Iron") Orr</EM>
<LI> <A HREF="jenkins.html">How to E-mail an Encyclopedia</A>, <EM>by Graham Jenkins</EM>
<LI> <A HREF="lechnyr.html">Security with PHP Superglobals</A>, <EM>by David Lechnyr</EM>
<LI> <A HREF="okopnik.html">Perl One-Liner of the Month: The Case of the Evil Spambots</A>, <EM>by Ben Okopnik</EM>
<LI> <A HREF="qubism.html">Qubism</A>, <EM>by Jon "Sir Flakey" Harsem</EM>
<LI> <A HREF="ramankutty.html">Programming in Ruby - Part 3</A>, <EM>by Hiran Ramankutty</EM>
<LI> <A HREF="tougher.html">Debian APT Part 2: Installing Unreleased Software</A>, <EM>by Rob Tougher</EM>
<LI> <A HREF="vinayak.html">Exploring TCP/IP with TCPdump and Tethereal</A>, <EM>by Vinayak Hegde</EM>
<LI> <A HREF="ward.html">Is vmWare good for Linux users?</A>, <EM>by Alan Ward</EM>
<LI> <A HREF="lg_backpage.html">The Back Page</A>
</UL>
<!-- *** END toc *** -->
<HR NOSHADE>
<!--=================================================================-->
<H3 ALIGN="center"><EM>Linux Gazette</EM> Staff and The Answer Gang</H3>
<BLOCKQUOTE>
<STRONG>Editor:</STRONG> Michael Orr<BR>
<STRONG>Technical Editor:</STRONG> Heather Stern<BR>
<STRONG>Senior Contributing Editor:</STRONG> Jim Dennis<BR>
<STRONG>Contributing Editors:</STRONG>
Ben Okopnik, Dan Wilder, Don Marti
</BLOCKQUOTE>
<HR NOSHADE>
<!--=================================================================-->
<A HREF="TWDT.txt.gz">TWDT 1 (gzipped text file)</A><BR>
<A HREF="TWDT.html">TWDT 2 (HTML file)</A><BR>
are files containing the entire issue: one in text format, one in HTML.
They are provided
strictly as a way to save the contents as one file for later printing in
the format of your choice;
there is no guarantee of working links in the HTML version.
<HR NOSHADE>
<!--=================================================================-->
<center>
<I>Linux Gazette</I><img alt="[tm]" src="../gx/tm.gif">,
<A HREF="http://www.linuxgazette.com/">http://www.linuxgazette.com/</A><BR>
This page maintained by the Editor of <I>Linux Gazette</I>,
<A HREF="mailto: gazette@ssc.com"> gazette@ssc.com</A>
<P>
<H5>Copyright &copy; 1996-2003 Specialized Systems Consultants, Inc.</H5>
</center>
<HR NOSHADE>
<!--=================================================================-->
<!-- *** BEGIN navbar *** -->
<IMG ALT="" SRC="../gx/navbar/left.jpg" WIDTH="14" HEIGHT="45" BORDER="0" ALIGN="bottom"><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/issue86/lg_mail.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_tips.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">The Mailbag</FONT></STRONG></BIG></BIG><BR>
<!-- BEGIN wanted -->
<STRONG>From <A HREF="mailto:gazette@ssc.com">The Readers of <i>Linux Gazette</I></A></STRONG></BIG>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
<HR>
<center>
<BIG><STRONG><FONT COLOR="maroon">HELP WANTED : Article Ideas</FONT></STRONG></BIG>
<BR>
<STRONG>Submit comments about articles, or articles themselves (after reading <a href="../faq/author.html">our guidelines</a>) to <A HREF="mailto:gazette@ssc.com">The Editors of <i>Linux Gazette</I></A>, and technical answers and tips about Linux to <A HREF="mailto:linux-questions-only@ssc.com">The Answer Gang</A>.
</STRONG>
</center><HR>
<UL>
<!-- index_text begins -->
<li><A HREF="#wanted.1"
><strong>FvwmCommand (FvwmCommandS)</strong></a>
<li><A HREF="#wanted.2"
><strong>Installing Redhat on Dell X200 laptop (via 1394 CD)</strong></a>
<!-- index_text ends -->
</UL>
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="wanted.1"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">FvwmCommand (FvwmCommandS)</FONT></H3>
Fri, 15 Nov 2002 17:17:20 -0100
<BR>Hans Borg (<a href="mailto:linux-questions-only@ssc.com?cc=Hans.Borg@Physics.umu.se&subject=%20Re%3A%20%5BLG%2086%5D%20help%20wanted%20%231%20fvwmcommand">Hans.Borg from Physics.umu.se</a>)
<br>with comments by Heather Stern (<em>LG</em> Technical Editor) and
Thomas Adam (The <em>LG</em> Weekend Mechanic)
<P><STRONG>
Hi all,
</STRONG></P>
<P><STRONG>
Have tried to find a help forum for Fvwm* stuff, but can't find any.
My be just tipping me of one is enough.
</STRONG></P>
<P><STRONG>
The problem:
Have made an application using FvwmCommand that works fine when
running under <TT>/root</TT> (super user, SU). However, when running under a "normal"
user it fails by the FvwmCommand fifos.
</STRONG></P>
<BLOCKQUOTE>
[Thomas]
I use nothing but fvwm
<IMG SRC="../gx/dennis/smily.gif" ALT=":-)"
height="24" width="20" align="middle"> I love it. It would be
useful to know which version of fvwm you're running.
</BLOCKQUOTE>
<P><STRONG>
My understanding:
The FvwmCommandS sets up 2 fifos (C,M) in <TT>/var/tmp</TT> and always get
the permission prw-------. Those fifos doesn't seem to be accessible
from none SU.
</STRONG></P>
<BLOCKQUOTE>
[Thomas]
Yeah -- I checked the Changelog file for fvwm version &gt;=2.3.0, and
there was a bug within the FvwmCommand
module. However, as of version 2.3.6, it was fixed.
I'd upgrade to the latest stable release.
</BLOCKQUOTE>
<P><STRONG>
When trying not SU, always get the report:
</STRONG></P>
<P><STRONG><BLOCKQuote>
No such file or directory FvwmCommand error in opening message fifo:
Permission denied.
</BLOCKQuote></STRONG></P>
<P><STRONG>
May be this is deliberately from some security point of view, but on the
other hand FvwmCommand is "x for all" in my default installation.
</STRONG></P>
<P><STRONG>
Best regards
</STRONG></P>
<BLOCKQUOTE>
[Thomas]
As Heather goes on to explain, it is most likely a
umask problem.
</BLOCKQUOTE>
<blockquote><font color="#000066">I'm a fvwm fan myself, but I've not used the FvwmCommand module.
Generally I just put things on the menus as Exec calls.
</font></blockquote>
<blockquote><font color="#000066">However, it sounds like a umask problem; and possibly a permissions
problem in the filesystem. /var/tmp, rather like /tmp, should be
permissions 1777 (sticky-bit, everybody can see and write and stat
things in the directory). The permissions your file got would be
sufficient to defend it from other accounts reading it, but should
allow the creating account to work with it. Also note that it's not
executable; you weren't trying to create a script and then run it,
were you?
-- Heather</font></blockquote>
<BLOCKQUOTE>
[Thomas]
But that's what FvwmCommand can do heather! It's
supposed to do that
<IMG SRC="../gx/dennis/smily.gif" ALT=":-)"
height="24" width="20" align="middle">
</BLOCKQUOTE>
<blockquote><font color="#000066">Is it also supposed to refuse to do it if the result is
not marked executable?
</font></blockquote>
<blockquote><font color="#000066">For doing, um, dynamic things I like to have a tmp under
my homedir, which belongs only to <EM>me</EM> (mode 0700) so I
can do strange things but I don't subject myself to
possible nosy other users. Mind you, I don't usually
have other users to worry about, but what the heck; I plan
some things here that may get put in production elsewhere.
-- Heather</font></blockquote>
<P><STRONG>
Thanks for your answers and appologies for my late
<BR>response. Have been away we no net capabilities.
</STRONG></P>
<P><STRONG>
I agree that it looks like a permission problem as is
actually reported. There should be no problem with
the <TT>/var/tmp</TT> directory permissions. They are both
"rwx" (7) for all.
</STRONG></P>
<blockquote><font color="#000066">You don't mention if it's sticky (shows drwxrwxrwt with ls)
-- Heather</font></blockquote>
<P><STRONG>
The problem seems to be related
to FvwmCommandS that sets up (I guess) the two Fifos
and also sets the permission to prw-------. By the way,
what does "P" stand for.
</STRONG></P>
<blockquote><font color="#000066">p stands for named pipe. Stdout (standard out) of one
process may be set to feed into a pipe, and the program
attached to pick up stdin (standard input) from that pipe
can use that to do whatever it needs to do next.
</font></blockquote>
<blockquote><font color="#000066">Both the programs should have the permission to reach the pipe
that has been created; the umask of the fvwmcommand process
is probably restricted to prevent nasty side effects.
-- Heather</font></blockquote>
<P><STRONG>
Have tried after FvwmCommandS
is spawned to (as SU) change the fifo permissions by all
sorts of combinations with no luck. Typically I can get
to prwSrwSrw-. In chmod I used "s" but comes out as "S".
</STRONG></P>
<blockquote><font color="#000066">That's because it had no execute permission; since the "Suid"
shares a space with the "eXecute" bit, a way was needed to show
that both are set, or only one of them,
</font></blockquote>
<blockquote><font color="#000066">execute but not suid:
for owner and group, the first two triplets: rwx
</font></blockquote>
<blockquote><font color="#000066">execute AND suid:
for owner and group: rws
</font></blockquote>
<blockquote><font color="#000066">not execute, but suid. This doesn't make sense for most purposes:
for owner and group: rwS
</font></blockquote>
<blockquote><font color="#000066">execute but not sticky:
for "other", the third triplet: rwx
</font></blockquote>
<blockquote><font color="#000066">execute and sticky:
for other: rwt
</font></blockquote>
<blockquote><font color="#000066">not execute, but sticky. again it's rare for this to be reasonable:
for other: rwT
</font></blockquote>
<blockquote><font color="#000066">Now, since the suid, exec, and sticky bits don't affect the read or
write, those "rw" could really be any of "r-" "-w" "--" or "rw".
-- Heather</font></blockquote>
<P><STRONG>
My version of FvwmCommand is 2.4.7. I do not know what,
or how to find out the version of FvwmCommandS.
</STRONG></P>
<blockquote><font color="#000066">I do not know that either. Perhaps Thomas Adams or one of the other
Answer Gang members can help further.
-- Heather</font></blockquote>
<P><STRONG>
Thanks a lot for the information on permissions. Some of them were new
<BR>to me.
</STRONG></P>
<P><STRONG>
Honestly, I have to tell that I have rewritten the application in order not to
use FvwmCommand, but it is still interesting to know where the problem
sits. It may be useful in the future.
</STRONG></P>
<P><STRONG>
Just for testing I have done the following (may be someone can do the same ?).
</STRONG></P>
<p><Strong><ol type="a"><li> I have set the permissions as (a lot shouldn't be needed, but just for test):
FvwmCommand: -rwsr-sr-x
/var: drwsrwsrwx
/var/tmp: drwsrwsrwt
<li> FvwmCommandS is spawned by fvwm95 (using that).
When spawned I changed (as root) the two fifos permissions
to: prwsrwsrwx
<li> From an xterm I run: FvwmCommand Restart fvwm95.
Works when logged in as root but not as !root user.
</ol></Strong></p>
<P><STRONG>
Well, as having rewritten the application it is no longer of utmost importance.
</STRONG></P>
<P><STRONG>
The Answer Gang has been of a lot of help in the past. Thank you all.
</STRONG></P>
<P><STRONG>
Best regards
<BR>Hans.
</STRONG></P>
<blockquote><font color="#000066">During this thread I cc'd the Answer Gang back in so
the entire Gang can help you out here. Any one of us could
go underwater with complicated questions, so we do not "assign
techs" to help anybody all alone. Good thing too - nice to have
Thomas confirm what I was groping around in the dark about...
</font></blockquote>
<blockquote><font color="#000066">... and that's where it comes to you, dear readers. Hans solved
<EM>his</EM> problem, by avoiding it. But if anyone happens to know what
it's really up to - was it really a bug in that version, does it
really work now? If anyone else out there is using fvwmcommand
actively, drop us a line and let us know what you're doing with
it. I presume, making FVWM a little more fun
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle">
</font></blockquote>
<blockquote><font color="#000066">Other articles or replies about making your favorite window manager
do cool and weird things are also welcome. If we get enough maybe
it could be the month of "The Truly Cool Things We Did To Our Computers"
-- Heather</font></blockquote>
<!-- end 1 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="wanted.2"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">Installing Redhat on Dell X200 laptop (via 1394 CD)</FONT></H3>
Thu, 19 Dec 2002 14:58:35 -0700
<BR>Montgomery, Jim (<a href="mailto:linux-questions-only@ssc.com?cc=jmontgomery@peakdatallc.com&subject=%20Re%3A%20%5BLG%2086%5D%20help%20wanted%20%232%20firewire%20install">jmontgomery from peakdatallc.com</a>)
<P><STRONG>
Please help me install Redhat 7.3 on my Dell X200 laptop.
This machine has a firewire CD from which I am able to start the install
process.
However, the install process soon asks for the device from which to do
the install (NFS, FTP, Hard disk, etc.).
</STRONG></P>
<P><STRONG>
No option is given for CD.
It looks my BIOS can see the 1394 CD but Redhat cannot.
I've looked in all the obvious places for 1394 firewire drivers (Redhat,
Dell, Linux documentation and discussion sites).
Please help. NFS/FTP boot is not an option.
</STRONG></P>
<P><STRONG>
Thanx,
Jim Montgomery
</STRONG></P>
<BLOCKQUOTE>
[Heather]
For that matter, if our readers know any distro that would cleanly
install from a firewire CD, let us know. Distro vendors - look forward
to more questions like this!
</BLOCKQUOTE>
<!-- end 2 -->
<HR>
<center>
<BIG><STRONG><FONT COLOR="maroon">GENERAL MAIL</FONT></STRONG></BIG>
<BR>
</center><HR>
<UL>
<!-- index_text begins -->
<li><A HREF="#mailbag.1"
><strong>Thanks for the viewer hints</strong></a>
<li><A HREF="#mailbag.2"
><strong>The last word on "daemon"</strong></a>
<li><A HREF="#mailbag.3"
><strong>Booting multiple OS's</strong></a>
<!-- index_text ends -->
</UL>
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="mailbag.1"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">Thanks for the viewer hints</FONT></H3>
Wed, 27 Nov 2002 19:23:09 EST
<BR>Jack (<a href="mailto:gazette@ssc.com?subject=%20Re%3A%20%5BLG%2086%5D%20mailbag%20%231%20max%20viewer">JRook78123 from aol.com</a>)
<P>
I forgot to tell the lads and lassies at Linux.......I got the .max viewer
online and downloaded it.......Now I can view my nieces scans without having
to fiddle with them......
</P>
<P>
Again and again, THANKS!
</P>
<P>
Jack - Chicago
</P>
<!-- end 1 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="mailbag.2"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">The last word on "daemon"</FONT></H3>
Wed, 4 Dec 2002 09:56:00 +0100 (CET)
<BR>Maurizio Loreti (<a href="mailto:gazette@ssc.com?subject=%20Re%3A%20%5BLG%2086%5D%20mailbag%20%232%20daemon">loreti from pd.infn.it</a>)
<P>
I have read on the December Linux Gazette (mailbag) another letter about
the etimology of "daemon". Usually for this kind of things the <EM>ultimate</EM>
source of knowledge is "The Jargon File" by Eric S. Raymond, aka ESR
(aveilable at the URL <A HREF="http://www.tuxedo.org/~esr/jargon"
>http://www.tuxedo.org/~esr/jargon</A>) .
</P>
<blockquote><font color="#000066">At this point he repeats the entry, but you can find it online at:
<A HREF="http://tuxedo.org/~esr/jargon/html/entry/daemon.html"
>http://tuxedo.org/~esr/jargon/html/entry/daemon.html</A>
</font></blockquote>
<blockquote><font color="#000066">The jargon file entry was mentioned in the starter to this thread,
which began in the October issue when someone confused about Kylix
made a wildly incorrect guess about the origin of "daemon" and was
immediately fed all sorts of tasty bits by The Answer Gang. I thought
the timing was quite excellent as it arrived perfectly for Halloween.
<A HREF="../issue83/tag/1.html"
>http://www.linuxgazette.com/issue83/tag/1.html</A>
</font></blockquote>
<blockquote><font color="#000066">It has since seen replies in November's and December's mailbag
<A HREF="../issue84/lg_mail.html"
>http://www.linuxgazette.com/issue84/lg_mail.html</A>
<A HREF="../issue85/lg_mail.html"
>http://www.linuxgazette.com/issue85/lg_mail.html</A>
which remove the haze of years that a glossary entry generally
summarizes out of existence, to describe current usage only. The
Jargon File doesn't always do this, but the information lost by not
being quite common enough "common knoqledge" before this began to be
set down as bits (and eventually paper) sadly does the glazing over
quite well enough.
</font></blockquote>
<blockquote><font color="#000066">"ultimate" is a strong word and frankly I rarely use it for anything.
Anyone who's been in this business long enough knows that to depend upon
only one source for your research isn't really "ultimate" at all, and
I'm pleased to have drawn some historians out of the woodwork with more
complete info than the Gang pulled out of our wizard hats at the end of
September.
</font></blockquote>
<blockquote><font color="#000066">In fact, I think the Jargon File maintainers may well like to add details
from the etymology-of-daemon thread updates to their entry. To make it
more likely, I've cc'd their maintainer list.
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle"> Hi Eric, and everybody
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle">
</font></blockquote>
<blockquote><font color="#000066">As of press time, I haven't seen an update to this entry in the Jargon File
as a result. No worries. It's probably because I didn't follow their
posting guidelines more closely...
-- Heather</font></blockquote>
<TABLE WIDTH="95%" BORDER="1" BGCOLOR="#FFFFCC"><TR><TD>
<p align="center">...............</p>
<P>
You can mail submissions for the Jargon File to
<A HREF="mailto:jargon@snark.thyrsus.com"
>jargon@snark.thyrsus.com</A>.
</P>
<P>
We welcome new jargon, and corrections to or amplifications of
existing entries. You can improve your submission's chances of being
included by adding background information on user population and years
of currency. References to actual usage via URLs and/or Google
pointers are particularly welcomed.
</P><p align="center">...............</p>
</TD></TR></TABLE>
<!-- end 2 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="mailbag.2"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">Booting multiple OS's</FONT></H3>
<h4 align="center">moral: pay attention during hardware upgrades.</h4>
Mon, 23 Dec 2002 18:06:41 -0500
<BR>Bob (<a href="mailto:gazette@ssc.com?subject=%20Re%3A%20%5BLG%2086%5D%20mailbag%20%233%20multi%20OS%20warning">x.generalx from verizon.net</a>)
<P>
Your answer gang column in issue 85 had an article
"<a href="../issue85/tag/1.html">Triple Booting</a>" and
had 1 segment of a triple boot as Windows 98.
</P>
<P>
Recently, I decided to upgrade my P3 MB to a P4 at 2.4gz. There was a
combo of an Soyo P4vda MB and the P4 2.4gz that I couldn't resist. I did
a lot of reading and the installed the MB. I also have a <A HREF="http://www.slackware.org/">Slackware</A> and
Mandrake Linux installation.
</P>
<P>
On boot up, I got an error message from W98 that initialization of the
NDIS had failed and the system had to be rebooted. It turned out that
the only way it would boot from that point was in the safe mode.
Needless to say, that's like being on a dead end street with no place to
go. My 2 Linux installations were not accessible because the Promise
card had been removed and they were now on hda and hdb and I couldn't
get them to boot.
</P>
<P>
It seems that W95 &amp; 98 at this speed of a P4 processor can only be
made to work by getting a fix from Bill's os. Since my Pc was dead in
the water, there was no way this could be done and the alternative was
to install WXP. My true instincts said install Linux and to hell with
windows.
</P>
<P>
Anyhow, its all said and done and WXP as far a I am concerned is a piece
of crap. I sooner setup a graphics card in Slackware Linux than deal
with what XP has to offer.
</P>
<P>
My reason for this litany of misery is to ward of some poor soul who
might have the temptation to use this combo of a P4 2.4gz or higher
processor with W95 or W98. You would think that somewhere there would be
a flag to warn us but it was only after a call to Soyo, the MB
manufacturer, that I learned of this pitfall. People tell us hard Linux
is, if I had chosen this combo to install on Linux life would have been
a bed or roses.
</P>
<P><DL><DT>
Bob Lee
<DD><A HREF="mailto:x.generalx@verizon.net"
>x.generalx@verizon.net</A>
</DL></P>
<!-- sig -->
<!-- end 3 -->
<HR>
<center>
<BIG><STRONG><FONT COLOR="maroon">GAZETTE MATTERS</FONT></STRONG></BIG>
<BR>
</center><HR>
<UL>
<!-- index_text begins -->
<li><A HREF="#gaz.1"
><strong>answerguy and tag addresses gone</strong></a>
<li><A HREF="#gaz.2"
><strong>Thanks</strong></a>
<li><A HREF="#gaz.3"
><strong>Re: virtual beer and feature request</strong></a>
<!-- index_text ends -->
</UL>
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="gaz.1"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">answerguy and tag addresses gone</FONT></H3>
Wed, 4 Dec 2002 09:55:22 -0800
<BR>Mike Orr (<a href="mailto:gazette@ssc.com?subject=%20Re%3A%20%5BLG%2086%5D%20gazette%20matters%20%231%20dead%20addresses"><em>Linux Gazette</em> Editor</a>)
<P>
The answerguy and tag addresses are now gone, "user unknown", bye bye, see ya.
Answer Gang, expect a significant decrease in spam. -- Mike
</P>
<blockquote><font color="#000066">And I suspect a significant amount of rejoicing from our sysadmin, Dan,
who has to clean out the spamtrap occasionally...
-- Heather</font></blockquote>
<!-- end 1 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="gaz.2"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">Thanks</FONT></H3>
Thu, 12 Dec 2002 21:56:25 -0500
<BR>naylor (<a href="mailto:gazette@ssc.com?subject=%20Re%3A%20%5BLG%2086%5D%20gazette%20matters%20%232%20worth%20buying">rnaylor from nhvt.net</a>)
<P><STRONG>
I found the back issues of the Gazette included in the <A HREF="http://www.debian.org/">Debian</A> CDs. Another
hidden gem. This alone was worth the purchase price. I enjoy the format of
multiple answers to questions (eg: the answer gang) and I am suprised that
other publications have not tried to copy the format. It kind of has the
feel of being subscribed to a news list I subscribed to 'Linux Journal' a
couple of years ago because of 'linux Gazette'.
</STRONG></P>
<P><STRONG>
I agree, Linux is more fun.
</STRONG></P>
<P><STRONG>
Why don't you advertise your magazine archives?
~ Buy Our Linux Gazette Archives And Get a FREE Debian 3 Disto.~
</STRONG></P>
<P>
Heather specifically wanted The Answer Gang to read like an informal
conversation, so that's how she edits it. I don't know why nobody else
has copied the style. For LJ, it may be because of tradition and space.
The Answer Gang takes up a lot of space when printed, and print magazines
have only a limited number of pages, so you'd have to drop a couple articles.
But people buy LJ for the articles. -- Mike
</P>
<blockquote><font color="#000066">(curtsy) thanks for the compliment, guys. I figure, a thick enough
thread feels a little like an installfest... all these clues flying
around at high speed... bonking people occasionally, but all in good
fun.
-- Heather</font></blockquote>
<P>
As for the Debian CDs, those are handled by the Debian Project and the CD
vendors, so it's their job to promote them. We do have LG on the Linux
Journal Archive CD (store.linuxjournal.com, under "LJ Archives").
-- Mike
</P>
<!-- end 2 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="gaz.3"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/envelope.gif">
<FONT COLOR="navy">Re: virtual beer and feature request</FONT></H3>
Mon, 30 Dec 2002 16:57:24 -0800
<BR>Mike Orr (<a href="mailto:gazette@ssc.com?subject=%20Re%3A%20%5BLG%2086%5D%20gazette%20matters%20%233%20bios%20in%20TWDT"><em>Linux Gazette</em> Editor</a>)
<BR>Request by Raj Shekhar (lunatech3007 from yahoo.com)
<P><STRONG><FONT COLOR="#006633"><EM><BLOCKQuote>
Can it be possible to append the author bio to the
TWDT file. Or maybe make a TWDT for the author bio
itself for each issue.
I really enjoyed reading the bios
<IMG SRC="../gx/dennis/smily.gif" ALT=":-)"
height="24" width="20" align="middle">.
</BLOCKQuote></EM></FONT></STRONG></P>
<P><STRONG><FONT COLOR="#000066"><EM>
We'll think about this. One of the purposes of the
Author pages is
to have the latest contact information and bio; the
articles and TWDT
would not be changed after publication.
</EM></FONT></STRONG></P>
<P><STRONG><FONT COLOR="#000066"><EM>
Pehaps I can put the entire bio page (minus the
links to previous articles,
and minus the large type in the header) at the
bottom of the TWDT article,
with a note that this information may be old and
another link to the
Author page.
</EM></FONT></STRONG></P>
<P><STRONG>
Thanks for looking into my feature request about the
author's bio. What you suggested is exactly what I
wanted.
</STRONG></P>
<P>
Done, starting in January's issue. -- Mike
</P>
<!-- end 3 -->
<!-- *** 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 86 of <i>Linux Gazette</i>, January 2003</H5>
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>
<!-- *** 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/issue86/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"
></a>Re: [LG 84] 2c Tips #2 --or--
<br><A HREF="#tips.1"
><strong>When LILO lies low and you see LI</strong></a>
<li><A HREF="#tips.2"
></a>Learning Red Hat 8.0 --or--
<br><A HREF="#tips.2"
><strong>Learning about mail</strong></a>
<li><A HREF="#tips.3"
><strong>a new language</strong></a>
<li><A HREF="#tips.4"
><strong>Linux Router ISP Network Ip pool Details</strong></a>
<li><A HREF="#tips.5"
></a>Why is my connection breaking? --or--
<br><A HREF="#tips.5"
><strong>security = obscurity, in this case</strong></a>
<li><A HREF="#tips.6"
><strong>Headless Linux</strong></a>
<li><A HREF="#tips.7"
></a>Re: [LG 85] help wanted #2 --or--
<br><A HREF="#tips.7"
><strong>Crashing mystery? Try no DRI</strong></a>
<li><A HREF="#tips.8"
><strong>imac_X-problems</strong></a>
<li><A HREF="#tips.9"
><strong>Compiling Kernel and Installing on a new machine</strong></a>
<li><A HREF="#tips.10"
><strong>Partitioning without setup</strong></a>
<li><A HREF="#tips.11"
><strong>Red Hat 7.3 Installation</strong></a>
<li><A HREF="#tips.12"
><strong>is this the right place?</strong></a>
<li><A HREF="#tips.13"
><strong>Switchboard</strong></a>
<li><A HREF="#tips.14"
><strong>ThumbDrive</strong></a>
<li><A HREF="#tips.15"
><strong>ip address from c program</strong></a>
<li><A HREF="#tips.16"
><strong>Tricky Linux</strong></a>
<li><A HREF="#tips.17"
><strong>Teething problems with a dual boot system</strong></a>
<li><A HREF="#tips.18"
><strong>ISO file?</strong></a>
<li><A HREF="#tips.19"
><strong>Remote X over SSH</strong></a>
<li><A HREF="#tips.20"
><strong>Debian User Worldmap</strong></a>
<li><A HREF="#tips.21"
><strong>Remote control of Linux from Windows</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">When LILO lies low and you see LI</FONT></H3>
Thu, 28 Nov 2002 09:38:15 -0700
<BR>Neil Koozer (<a href="mailto:linux-questions-only@ssc.com?cc=neilkoozer@adelphia.net&subject=%20Re%3A%20%5BLG%2086%5D%202c%20Tips%20%231">neilkoozer from adelphia.net</a>)
<!-- sig -->
<!-- sig -->
<!-- ::
When LILO lies low and you see LI
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:: -->
<P>
Adding to the
<a href="../issue84/lg_tips.html#tips/2">Issue 84 2 cent tip #2</a>
...
</P>
<P>
I wish to clarify what the LI result from lilo means.
</P>
<P>
The often quoted segment from the lilo readme is sort of backwards in both
halves of the sentence. When you get LI and nothing else, the second stage
loader was NOT loaded. A block of bytes was loaded, but from the wrong
location. This wrong block of bytes WAS executed, but since it is garbage
nothing is printed.
</P>
<P>
Neil.
</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">Learning about mail</FONT></H3>
Tue, 26 Nov 2002 23:09:30 -0800
<BR>Heather Stern (<a href="mailto:linux-questions-only@ssc.com?cc=jhavilan@attbi.com&cc=star@starshine.org&subject=%20Re%3A%20%5BLG%2086%5D%202c%20Tips%20%232"><em>Linux Gazette</em> Technical Editor</a>)
<BR>Question by James M. Haviland, RN (jhavilan from attbi.com)
<!-- sig -->
<!-- sig -->
<!-- ::
Learning about mail
~~~~~~~~~~~~~~~~~~~
:: -->
<P>
A continuation of
<a href="../issue85/lg_tips.html#tips/10"">Issue 85, 2 cent tip #10</a>
...
</P>
<P><STRONG>
I have installed RH's 8.0. I'll have to admit I'm in Windows at the moment.
</STRONG></P>
<P>
'sokay, that's fixable :&gt; Or if you get really tricky you can convince
a good copy of <A HREF="http://www.winehq.com/">WINE</A> to use the Windows setup, and run mswin apps even
when you are in Linux.
</P>
<P><STRONG>
Also the e-mail program that came with 8.0 that isn't connected to a
browser retrieved my mail, but wouldn't, couldn't send my mail.
</STRONG></P>
<P>
That's probably:
</P>
<P><BLOCKQuote>
Fetching mail from another serv explicitly (via POP3) works. (This is
common. Your ISP did all the work setting up and keeping that POP
server, your mailer just visits it once in a while.)
</BLOCKQuote></P>
<P>
Sending mail outbound, no SMTP server is found to talk to. (There are
a few browsers which will "speak SMTP" on their own, but they are not
very good mailers on the average, for other reasons.)
</P>
<P>
Adding an SMTP server to your setup is usually quite easy; look for an
RPM package named any one of sendmail, qmail, or postfix. (but you only
want one of them.)
</P>
<blockquote><font color="#000066">and I forgot to mention that if your ISP actually gives you the explicit
address of an SMTP server to use, say, mail.isp.example.com, then you
could try telling that to your mailer, rather than worrying about
setting up your own.
-- Heather</font></blockquote>
<P><STRONG>
Thank you for your time.
</STRONG></P>
<P>
You're welcome
<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">a new language</FONT></H3>
Wed, 27 Nov 2002 15:55:29 -0800
<BR>Rick Moen (<a href="mailto:linux-questions-only@ssc.com?cc=jackdrook@hotmail.com&cc=rick@linuxmafia.com&subject=%20Re%3A%20%5BLG%2086%5D%202c%20Tips%20%233">the <em>LG</em> Answer Gang</a>)
<BR>Question by Jack (jackdrook from hotmail.com)
<!-- sig -->
<!-- sig -->
<blockquote><font color="#000066">Jack asked us a question that was so general Rick answered it with the
applicable Linux answer...
-- Heather</font></blockquote>
<P><STRONG>
You lost me on the KPPP Tool and Linux. Linux is an OS, right?
</STRONG></P>
<P>
Indeed. Thus the term "Linux Answer Gang", you see.
</P>
<P><STRONG>
Now, where did I get your address? I asked some friends about how to
get my telephone to operate through the PC. One person sent me a
forward with "The Answer Guy" and the address. I believe it to have
been a page from an old site that contained pertinent information, but
not the site itself. Does this help?
</STRONG></P>
<P>
Not nearly as much as it would if you inquired with that person and
tracked down the "old site" for us. That would be much appreciated, as
we continue to be deluged with misdirected non-Linux queries.
</P>
<P><STRONG>
I am self-taught, so do not confuse me with high-altitude techtalk,
just the facts.
</STRONG></P>
<P>
Self-taught was at one time the only way to learn Linux, back when many
of us got started with it, so we sympathise, and now attempt to assist
others while, as we say, "Making Linux just a little more fun".
</P>
<P><STRONG>
What is my best approach for learning a program language?
</STRONG></P>
<P>
Well, first you'd have to install a Linux distribution, of course.
</P>
<blockquote><font color="#000066">Strictly speaking, most of these languages are available for Windows
too, but some of the mswin implementations may be less than perfectly
portable, or the documentation may suggest non-portable over portable
coding strategies. Go for dual booting, perhaps.
-- Heather</font></blockquote>
<P>
You'll find that it comes with an amazing variety of programming
language development kits, from C, C++, and Python through tk/tcl,
Java, Lisp, and heavens knows what else. I personally maintain a list
of Integrated Development Environment software for Linux, here:
<A HREF="http://linuxmafia.com/~rick/faq/#idedev"
>http://linuxmafia.com/~rick/faq/#idedev</A> . As you'll see, the list has
grown to pass 100 entries.
</P>
<P>
How you would proceed from there would depend on which type of
programming language you'd like to use, and what you want to do with it.
</P>
<P>
Cheers,
Rick Moen
</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 Router ISP Network Ip pool Details</FONT></H3>
Fri, 6 Dec 2002 14:24:43 +0530
<BR>Jim Dennis and the Gang (<a href="mailto:linux-questions-only@ssc.com?cc=jeevan@asthatech.com&subject=%20Re%3A%20%5BLG%2086%5D%202c%20Tips%20%234">the <em>LG</em> Answer Gang</a>)
<BR>Question by jeevan (jeevan from asthatech.com)
<!-- sig -->
<!-- sig -->
<P><STRONG>
Is it possible for me to run Routing Protocols(ospf,BGP,rip) on my
Linux Box connected to an ISP (through cable modem) and obtain all the
network (including subnetwork ip pool)ip pool range of my ISP.
</STRONG></P>
<BLOCKQUOTE>
[JimD]
Look for GNU Zebra: <A HREF="http://www.zebra.org"
>http://www.zebra.org</A>
It's considered to be the best available package for Linux, and
has (I'm told) syntax that's reasonably similar to Cisco's IOS.
</BLOCKQUOTE>
<BLOCKQUOTE>
[someone else in the Gang expands]
Of course you can! This is not your grandpa's operating system, here.
OSPF v. 2 and BGP4/4+ are both supported by either the gated daemon or
the GNU zebra daemon, both of which should be standard on your Linux
distribution. Zebra can also do pretty much every variety of RIP (v.1,
v.2, and RIPng). The standard old routed (prounounced "route-dee")
daemon can do RIPv1, and gated can do RIPv2. (gated will also do EGP,
thrown into the bargain.)
</BLOCKQUOTE>
<P><STRONG>
Thanks for replying. But what I wanted exactly to know is that
should I need any kind of details from the ISP (like Router ip,ASN...)
or any permission from the ISP for my LINUX Router to have a OSPF
session with
the ISP Router.
</STRONG></P>
<P><STRONG>
With Regards
<BR>Jeevan
</STRONG></P>
<!-- 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">security = obscurity, in this case</FONT></H3>
Mon, 2 Dec 2002 23:10:33 -0500
<BR>Faber Fedor (<a href="mailto:linux-questions-only@ssc.com?cc=bmike1@vei.net&cc=faber@linuxnj.com&subject=%20Re%3A%20%5BLG%2086%5D%202c%20Tips%20%235">faber from linuxnj.com</a>)
<BR>Question by Michael Havens (bmike1 from vei.net)
<!-- sig -->
<!-- ::
security = obscurity, in this case
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:: -->
<P><STRONG>
When I go to login with my online stockbroker
</STRONG></P>
<P><STRONG>
I get this:
</STRONG></P>
<P><STRONG><BLOCKQuote>
"Connection to host www15.scottsave.com is broken"
</BLOCKQuote></STRONG></P>
<P><STRONG>
Why do you think that is and what do you think can be done about it?
</STRONG></P>
<BLOCKQUOTE>
Let me guess, you're using the Konqueor 3.0 web browser, right? Konq is
broken with respect to SSL sites. I have the same problem and I need to
find an updated Konq to use or switch to another browser.
</BLOCKQUOTE>
<blockquote><font color="#000066">I'm not able to verify this; it could just be the same problem as in
Konqueror 2.x, where the SSL support is a seperate package
(kdebase-crypto under Debian; your distro may vary), and Konqueror only
visits non-encrypted URLs if you don't have that package installed.
Of course it doesn't bother to <EM>say</EM> so... an error message like
"https: protocol not supported" would have been a little more useful.
-- Heather</font></blockquote>
<BLOCKQUOTE>
Galeon and Mozilla will work, but you need to d/l the Personal Security
Manager (PSM). I've looked at installing it and it looks like a PITA.
</BLOCKQUOTE>
<BLOCKQUOTE>
Until I find an updated Konq or install PSM, I use an old version of
Netscape (4.x) which works fine.
</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">Headless Linux</FONT></H3>
Sun, 22 Dec 2002 22:54:45 -0800
<BR>Dan Wilder (<a href="mailto:linux-questions-only@ssc.com?cc=admin@bsdfan.cncdsl.com&cc=dan@ssc.com&subject=%20Re%3A%20%5BLG%2086%5D%202c%20Tips%20%236">SSC sysadmin</a>)
<BR>Question by Steve B. (admin from bsdfan.cncdsl.com)
<!-- sig -->
<!-- sig -->
<P><STRONG>
I've been looking around and can't find the info I need. How do I
configure Linux to run headless with a terminal connected to a serial
port?
</STRONG></P>
<P>
Not quite headless, with a serial terminal connected. I choose to
call the condition "nearly headless", after the phantom named
"Nearly Headless Nick" in the Harry Potter series.
</P>
<P>
Take a look at:
</P>
<P><BLOCKQuote>
Documentation/serial-console.txt
</BLOCKQuote></P>
<P>
in the kernel source. This won't get you quite everything you'd
get from a console connected. In particular, you don't have access
to the BIOS. But if you can get past that, you're pretty much
there. You can even tell LILO to use the serial port, as described
in the documentation file. No doubt there's also a GRUB option
for serial console, if that's the boot loader you're using.
</P>
<P>
As I understand it, there's at least one card which will even
make the BIOS available via a serial port.
</P>
<!-- 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">Crashing mystery? Try no DRI</FONT></H3>
Wed, 11 Dec 2002 08:19:37 -0500
<BR>Drew S (<a href="mailto:linux-questions-only@ssc.com?cc=linux_man_us@hotmail.com&subject=%20Re%3A%20%5BLG%2086%5D%202c%20Tips%20%237">linux_man_us from hotmail.com</a>)
<!-- sig -->
<!-- sig -->
<!-- ::
Crashing mystery? Try no DRI
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:: -->
<P>
Something for rajachemist of
<a href="../issue85/lg_mail/#wanted/2">Issue 85 Help wanted #2</a>
to try.
</P>
<P>
Though you never mentioned what your video card was, I will respond since I
was having a similar problem with Mandrake Linux 9.0 on my home-built
machine. I was getting lockups all the time and yet I could ssh into the box
from another machine and see that everything behind the scenes was still
running fine. Just X froze, but it also meant that I could not kill it with
CTRL-ALT-BACKSPACE. I happened to have an ATI Xpert 2000 video card (Rage
128 chipset). The ONE item that fixed it was that the card does not seem to
handle DRI properly. I commented out the line in my XF86Config file that
said: load "dri", restarted X and I never saw the problem again. Perhaps
your problem is similar.
</P>
<P>
Drew
</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">imac_X-problems</FONT></H3>
Thu, 28 Nov 2002 10:24:46 -0800
<BR>Rick Moen (<a href="mailto:linux-questions-only@ssc.com?cc=kuettner@tuebingen.mpg.de&cc=rick@linuxmafia.com&subject=%20Re%3A%20%5BLG%2086%5D%202c%20Tips%20%238">the <em>LG</em> Answer Gang</a>)
<BR>Question by kuettner (kuettner from tuebingen.mpg.de)
<!-- sig -->
<!-- sig -->
<P><STRONG>
after using linux for several years now on i-586 I tried to install it
on my imac-g4. the problem: I do not get X to run, because of my
NVIDIA GeForce4 MX. I am using debian woody for ppc and don't find
any hints in the net. can anybody send me a working XF86Config for
XFree 4.1.0 or any other help.
</STRONG></P>
<P>
It looks like you'll need XFree86 4.2.0 or later, and will have to use
the "vesa" driver (not the "nv" driver) in 16-bit mode, which is the
only one supported thus far.
</P>
<P>
As you may know, these things do tend to happen with newly introduced
video chipsets, and Nvidia have unfortunately been notably uncooperative
with the XFree86 Project.
</P>
<blockquote><font color="#000066">That they didn't buy into the XFCom release sequence (compatible
binaries, source eventually committed to the open source X code tree) and
want to roll their own we can understand; but they have to keep up with
the Xfree86 codebase or it makes them look slow. And act slow, if one has
to back down to the generic servers in order to work...
-- Heather</font></blockquote>
<!-- 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">Compiling Kernel and Installing on a new machine</FONT></H3>
Sat, 7 Dec 2002 13:11:07 -0800
<BR>Jim Dennis (<a href="mailto:linux-questions-only@ssc.com?cc=Sunil.Kayiti@fmr.com&cc=jimd@starshine.org&subject=%20Re%3A%20%5BLG%2086%5D%202c%20Tips%20%239">the <em>LG</em> Answer Guy</a>)
<BR>Question by Sunil Kayili (Sunil.Kayiti from fmr.com)
<!-- sig -->
<!-- sig -->
<P><STRONG>
I am in a catch-22 situation. There might be an easy answer for this but I
am not able to work around this problem. Sending this problem here.
</STRONG></P>
<P><STRONG>
Server Configuration:
</STRONG></P>
<blockquote><code><font color="#000033"><br> Chipset 440GX
<br> Micron NetFrame 3400
<br> Adaptec 7680 SCSI Adapter (aic7xxx - HBA 6.2.8)
<br> Mylex Raid - DAC960
</font></code></blockquote>
<P><STRONG>
Software:
</STRONG></P>
<blockquote><code><font color="#000033"><br> RedHat 8.0 - Linux Kernel 2.4.18-14
</font></code></blockquote>
<P><STRONG>
Problem:
</STRONG></P>
<P><STRONG><BLOCKQuote>
With 2.4.18-14 there is a problem in the kernel which loops on aic7xxx
during boot up, hence it does not boot.
</BLOCKQuote></STRONG></P>
<P><STRONG>
Solution:
</STRONG></P>
<P><STRONG><BLOCKQuote>
Compile the latest kernel 2.4.18-20rc4
</BLOCKQuote></STRONG></P>
<P><STRONG>
Catch-22:
</STRONG></P>
<P><STRONG><BLOCKQuote>
I built the latest kernel on my other linux machine and wrote it into a
CD ROM. Now how do I transfer it into my NetFrame Server.
</BLOCKQuote></STRONG></P>
<P><STRONG>
I boot into the rescue mode using the installation CD but once in the
rescue mode, I am unable to eject the CD. I have tried all possible
mount points to eject the cd but to no avail.
</STRONG></P>
<p><Strong><ol>
<LI>Is there a any way to transfer the new kernel image into my NetFrame
PC? I exhausted all options, i,e network (since it is in rescue mode)
<LI>Is there a way to disable linux to take control of the CDROM ejection
mechanism?
</ol></Strong></p>
<P><STRONG>
Your help greatly appreciated.
</STRONG></P>
<P><STRONG>
Thanks
<BR>Sunil
</STRONG></P>
<BLOCKQUOTE>
Suggestions:
</BLOCKQUOTE>
<blockQuote><ul>
<LI>Use a Tom's Root/Boot floppy.
<LI>Burn a bootable CD with the Tom's Root/Boot "El Torito" boot image
(and your new kernel, etc. in all that other CD-R space)
<LI>Use the ifconfig and route commands (on just about any rescue
CD or floppy) to manually configure your network, then fetch
a tarball of the kernel and modules (etc) from any other machine
on your network (using mount -t nfs, or wget or an FTP client).
<LI>Install an extra CD-ROM drive
<IMG SRC="../gx/dennis/smily.gif" ALT=";)"
height="24" width="20" align="middle">.
<LI>Configure a system on your network as a bootp/dhcpd server, install
PXELinux, configure it to transfer a custom network rescue kernel
and initrd system to your server, then configure the NetFrame to
boot using PXE, etc).
</ul></blockQuote>
<BLOCKQUOTE>
(Okay, that last one is way too much effort for way too little gain
and the one before that is just plain silly).
</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">Partitioning without setup</FONT></H3>
Wed, 25 Dec 2002 22:46:15 GMT
<BR>Dan WIlder and Pradeep Padala (<a href="mailto:linux-questions-only@ssc.com?cc=bmdean@socket.net&subject=%20Re%3A%20%5BLG%2086%5D%202c%20Tips%20%2310">the <em>LG</em> Answer Gang</a>)
<BR>Question by Brandon Dean (bmdean from socket.net)
<!-- sig -->
<!-- sig -->
<P><STRONG>
Hello,
</STRONG></P>
<P><STRONG>
I would like to know what linux program to get that I could use to repartition
a hard drive without going through setup.
</STRONG></P>
<P><STRONG>
Thank You,
<BR>Brandon Dean
</STRONG></P>
<BLOCKQUOTE>
[Dan]
fdisk
</BLOCKQUOTE>
<BLOCKQUOTE>
See "man fdisk"
</BLOCKQUOTE>
<BLOCKQUOTE>
[Pradeep]
If you want to repartition without losing data, GNU Parted is a great
tool. Details at:
</BLOCKQUOTE>
<BLOCKQUOTE><BLOCKQuote>
<A HREF="http://www.gnu.org/software/parted"
>http://www.gnu.org/software/parted</A>
</BLOCKQuote></BLOCKQUOTE>
<BLOCKQUOTE>
You can also use fdisk or diskdruid but both will destroy the data after
repartitioning. These two should be installed by default in most of the
distributions.
</BLOCKQUOTE>
<blockquote><font color="#000066">Don't forget to make good backups first
-- Heather</font></blockquote>
<!-- 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">Red Hat 7.3 Installation</FONT></H3>
Tue, 24 Dec 2002 13:19:39 -0500
<BR>Pete Keller (<a href="mailto:linux-questions-only@ssc.com?cc=dhar_mca@jntu.net&cc=pkeller01@snet.net&subject=%20Re%3A%20%5BLG%2086%5D%202c%20Tips%20%2311">pkeller01 from snet.net</a>)
<BR>Question by (dhar_mca from jntu.net)
<P><STRONG>
Friends,
Last week I posed a question for booting with 3 OSes. Thank U.
</STRONG></P>
<P><STRONG>
Here I again partitioned ... [lots of stuff about prepared system]
I am trying boot from boot
disk. It is coming upto "localhost login:" after which GUI screen be
displayed. It displays the localhost login: prompt for a second or a half
and then hangs. I thought its a problem with monitor sync values. Mine was
samsung's samtron 56V model. But in the list specified - no exact match
for it. So I opted for the default given (unprobed type)and modified the
sync values with the ones given in my monitor manual. (My friends who have
already loaded windows, have not even changed the sync values). One of my
friend got the same problem. But his system didn't hang but it flashes
between blank screen and the text based localhost prompt.
</STRONG></P>
<blockquote><font color="#000066">His "chooser" - the GUI login, keeps crashing but the system keeps
trying to put it back up. kdm, gdm, xdm, one of those dm thingies.
-- Heather</font></blockquote>
<P><STRONG>
He was able to
login. He logged into it with root and modified the Xconfigurator and now
works fine.
</STRONG></P>
<P><STRONG>
Plz assist me.
</STRONG></P>
<BLOCKQUOTE>
[Pete]
</BLOCKQUOTE>
<blockQuote><ol>
<LI>press control alt and F1 to get a text login.
<LI>login as root and run Xconfigurator
</ol></blockQuote>
<blockquote><font color="#000066">If you're hung too hard for that to work, use the boot loader to put
yourself in sincgle user mode, then fix the boot runlevel (/etc/inittab
default entry) to stay in text mode. For Red Hat flavors that's
runlevel 3. Set it back when you'r sure it's fixed, use startx as a
user to run X explicitly while experimenting.
-- Heather</font></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">is this the right place?</FONT></H3>
Wed, 27 Nov 2002 11:41:44 -0800
<BR>Mike Orr (<a href="mailto:linux-questions-only@ssc.com?cc=jhavilan@attbi.com&subject=%20Re%3A%20%5BLG%2086%5D%202c%20Tips%20%2312"><em>Linux Gazette</em> Editor</a>)
<BR>Question by James M. Haviland, RN (jhavilan from attbi.com)
<!-- sig -->
<!-- sig -->
<P><STRONG>
If I may. Is this the news group of ssc.com?
</STRONG></P>
<blockquote><font color="#000066">I'm the Technical Editor; I'm cc'ing the Gang, so everyone can chime in
if they like.
-- Heather</font></blockquote>
<P><STRONG>
Is it better in the future to write <A HREF="mailto:linux-questions-only@ssc.com"
>linux-questions-only@ssc.com</A>? Will the
server accept my e-mail
</STRONG></P>
<P><STRONG>
TIA
Jim
</STRONG></P>
<blockquote><font color="#000066">Yes. Linux-questions-only accepts queries from anybody; members of the
list see all such messages and are expected to answer a few here and there.
-- Heather</font></blockquote>
<BLOCKQUOTE>
Just to be clear, this mailing list (<A HREF="mailto:linux-questions-only@ssc.com"
>linux-questions-only@ssc.com</A>) is
owned by Linux Gazette (www.linuxgazette.com), which is published by SSC.
However, most of LG's contributors and Answer Gang members are independent
volunteers not related to SSC.
</BLOCKQUOTE>
<BLOCKQUOTE>
There is no single ssc.com mailing list or news group. SSC hosts many
mailing lists, some related to our business and others we host as part of our
general commitment to Linux and to free software.
</BLOCKQUOTE>
<BLOCKQUOTE>
Questions about Linux should go to <A HREF="mailto:linux-questions-only@ssc.com"
>linux-questions-only@ssc.com</A>. Questions
about SSC should go to... well, it depends on the question. Send it to
<A HREF="mailto:info@ssc.com"
>info@ssc.com</A> if you're unsure where to direct it.
</BLOCKQUOTE>
<BLOCKQUOTE>
There is also linux-list, a discussion list about everything Linux (except
advocacy or flame wars). linux-list is hosted by SSC and has a strong Pacific
Northwest emphasis, but we do have people from other regions and people who
have moved away but still want to keep in touch. To subscribe to linux-list or
to any of SSC's other public lists, go to <A HREF="http://www.ssc.com/mailman/listinfo"
>http://www.ssc.com/mailman/listinfo</A> .
</BLOCKQUOTE>
<!-- 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">Switchboard</FONT></H3>
Wed, 27 Nov 2002 11:49:35 -0800
<BR>Ashwin N and Heather Stern (<a href="mailto:linux-questions-only@ssc.com?cc=JRook78123@aol.com&subject=%20Re%3A%20%5BLG%2086%5D%202c%20Tips%20%2313">the <em>LG</em> Answer Gang</a>)
<BR>Question by JRook78123 (JRook78123 from aol.com)
<!-- sig -->
<!-- sig -->
<P><STRONG>
Dear Answerguy,
</STRONG></P>
<BLOCKQUOTE>
[Ashwin]
Hi Jack,
</BLOCKQUOTE>
<BLOCKQUOTE>
There is no longer an answer guy here, but a gang of Linux enthusiasts!
We answer queries on Linux in our free time.
</BLOCKQUOTE>
<P><STRONG>
I used to have an IBM Aptiva system that had in the bundle a switchboard
supplied by Phoenix.
I now have an hp pavilion 7850. It has a modem and phone dialer, but I
cannot use the telephone through my computer as before.
Is there some way to connect to my telephone line for normal surface
telephone lines? What would I need to do?
</STRONG></P>
<BLOCKQUOTE>
[Ashwin]
If you're using Linux, have you tried connecting using the KPPP tool?
</BLOCKQUOTE>
<BLOCKQUOTE>
[Heather]
I'm not sure, but if he means that his computer used to handle the voice
lines in his office (and yes, there are such things, which have some
cute GUI app to configure them) ... then he may want to play with the
program Asterisk, and maybe the hardware "LineJack" or "PhoneJack" by
Quicknet, which are telephony cards you add to a computer.
</BLOCKQUOTE>
<BLOCKQUOTE>
If he just means that his computer needs to reach the internet, then
it's true we have a bunch of dialer-helpers (KPPP is one of the better
ones; xisp and a few others are out there) ... but he will still need
to know some basic things like his ISP's phone number, the username
he was assigned, and maybe some connection features like whether they
use PAP or CHAP to identify him.
</BLOCKQUOTE>
<BLOCKQUOTE>
These are all things which his ISP can tell him better than we could.
</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">ThumbDrive</FONT></H3>
Mon, 2 Dec 2002 01:57:17 +0100
<BR>Robos (<a href="mailto:linux-questions-only@ssc.com?cc=linux_lover2003@yahoo.co.in&cc=robos@muon.de&subject=%20Re%3A%20%5BLG%2086%5D%202c%20Tips%20%2314">the <em>LG</em> Answer Gang</a>)
<BR>Question by Syborg (linux_lover2003 from yahoo.co.in)
<!-- sig -->
<P><STRONG>
Is it possible to install Linux on
a thumb drive(size 120 MB).
Or Can I copy selected files from my normal
linux installation(RH 7.2 on a 40 GB hard disk)
and make the thumb drive bootable independently.
What is the best way to do this?
I thought of copying files from my
normal linux installation.But i am in doubt whether
i can boot this drive in this way.
Looking forward to your suggestions.
</STRONG></P>
<P><DL><DT>
Short answer -- try this:
<DD><A HREF="http://freshmeat.net/projects/runt"
>http://freshmeat.net/projects/runt</A>
</DL></P>
<blockquote><font color="#000066">A Linux distro optimized for a USB gadget. I like it. So, as
long as your BIOS supports booting from USB devices, you should be
golden
-- Heather</font></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">ip address from c program</FONT></H3>
Fri, 06 Dec 2002 17:25:28 -0800
<BR>George Victor Tereshko (<a href="mailto:linux-questions-only@ssc.com?cc=daven@web-wise.com&cc=georget@genesyslab.com&cc=mion@neocom.fr&subject=%20Re%3A%20%5BLG%2086%5D%202c%20Tips%20%2315">georget from genesyslab.com</a>)
<BR>Question by Dave N. (daven from web-wise.com)
<!-- sig -->
<!-- sig -->
<br>Answered By Jim Dennis (The <em>LG</em> Answer Guy), Marian ION
<P>
In reply to
<a href="../issue85/lg_mail.html#wanted/3">LG 85, help wanted #3</a>
</P>
<blockquote><em><font color="#000033"><br>I need to identify the ip address of the client fron within a c program
</font></em></blockquote>
<P><STRONG>
On Solaris
</STRONG></P>
<BLOCKQUOTE>
[JimD]
Grump. This is a Linux magazine.
</BLOCKQUOTE>
<P><STRONG>
trace the incoming connections and:
</STRONG></P>
<p align="center">See attached <tt><a href="misc/tips/solaris.getting-ip-address.c.txt">solaris.getting-ip-address.c.txt</a></tt></p>
<BLOCKQUOTE>
[JimD]
If I'm reading it correctly this translates roughly to:
</BLOCKQUOTE>
<blockquote><pre>dmesg | tail -1 | grep " from " | sed -e 's/^.* from //' | cut -c '0-6'
</pre></blockquote>
<BLOCKQUOTE>
... which could be simplified somewhat in PERL, awk, or Python,
and could probably be munged to perform most of the string handling
just using bash/Korn parameter substitution magic with something
vaguely like:
</BLOCKQUOTE>
<blockquote><pre>... | grep " from " | while read line; do
line=${line//#* from /}; ipaddr=${line:0:6}; ...
</pre></blockquote>
<BLOCKQUOTE>
Note: I'm just using shell syntax here because I consider it the
easiest way to express the concept of what you're doing ---
a psuedo-code to people like me who use shell extensively.
</BLOCKQUOTE>
<BLOCKQUOTE>
Unfortunately this code is not close to what the querent was after.
He actually wants to have his program do something like:
</BLOCKQUOTE>
<blockquote><code><font color="#000033"><br> if my input/output is a tty then:
<br> if my tty is an inet domain socket then:
<br> ask the socket for the remote (source) ip address
</font></code></blockquote>
<BLOCKQUOTE>
... which will involve the isatty(3) library function and the
getsockname(2) system call (and some other structs and munging).
</BLOCKQUOTE>
<BLOCKQUOTE>
There's an example of the code for this in Wietse Venema's
TCP Wrappers sources for tcpd. That code is quite portable, well
testing (running on almost all mainstream Linux boxes for about a
decade, as well as most BSD systems, and many others.
</BLOCKQUOTE>
<BLOCKQUOTE>
Your code relies on details about how a given system might be
logging connections via syslog/klog or similar externalities, and
it's inherently a race (other connections may be logged between the
time the message gets put in the dmesg ring buffer and the time when
his code is scheduled to run).
</BLOCKQUOTE>
<BLOCKQUOTE>
I'm not much of a C programmer. I've done a little, even having written
a simple kernel device driver that's in production use. However, I
rely very heavily on reading examples of similar code.
</BLOCKQUOTE>
<BLOCKQUOTE>
In general when looking for how to do something like this (figure out
the remote system's IP address from one of your file descriptors) I
try to think about which programs on my system must be doing something
similar. Sometimes I run the similar program under strace, even ltrace
for some hints. Then I grab their sources and read up on it. (Usually I
can use a man -k or two to make a pretty good guess at which library
functions or system calls are involved, even without an strace).
</BLOCKQUOTE>
<BLOCKQUOTE>
George, I hope you don't think I'm being hard on you. I realize that
tech support, particularly trying to help people with programming
questions, is difficult.
</BLOCKQUOTE>
<BLOCKQUOTE>
Dave, I hope this helps. I'm assuming you can figure out the actual
code on your own. One reason I display my ignorance by telling
people <EM>how</EM> I discovered whatever I'm suggesting is to "teach the
world how to fish." I've never written code to use <TT> sockname()</TT> and
hadn't ever noticed it until I did a man -k socket while writing this
message.
</BLOCKQUOTE>
<BLOCKQUOTE>
[Marian]
</BLOCKQUOTE>
<blockquote><pre>struct sockaddr_in from;
socklen_t fromlen;
fromlen = sizeof (struct sockaddr_in);
getpeername (fdi, (struct sockaddr *)&amp;from, &amp;fromlen);
printf ("You are %s:%u\n",inet_ntoa (from.sin_addr), (unsigned)ntohs
(from.sin_port));
</pre></blockquote>
<!-- 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">Tricky Linux</FONT></H3>
Mon, 23 Dec 2002 14:12:15 -0400
<BR>Kapil Hari Paranjape, Huibert Alblas (<a href="mailto:linux-questions-only@ssc.com?cc=Hritesh.Moorjani@zenitel.biz&subject=%20Re%3A%20%5BLG%2086%5D%202c%20Tips%20%2316">the <em>LG</em> Answer Gang</a>)
<BR>Question by Hritesh Moorjani (Hritesh.Moorjani from zenitel.biz)
<!-- sig -->
<!-- sig -->
<P><STRONG>
Dear Sir,
</STRONG></P>
<P><STRONG>
After soo many years have I waited to use Linux as my principle OS as we
both know how much problems we have to go through with Microsoft. I've
waited for years for Linux to be user friendly and finally our prayers have
been answered. I have over twenty machines in my department and soon if I'm
able to resolve some of the problems with software compatibility and
substitutes. I would probably migrate everyone of us to Linux from Windows.
</STRONG></P>
<BLOCKQUOTE>
[Kapil]
Welcome to the Brave GNU World! But be warned that if you want to
administer a network of machines in any world you can't depend on
user-friendly parts but only on the sysadmin-friendly parts!
</BLOCKQUOTE>
<P><STRONG>
My only problem is right now, I have an NT Server running Exchange 5.0 and
our principle desktop was supposed to be NT workstation with Outlook 97.
Obviously, as an administrator, I never follow protocols.
</STRONG></P>
<BLOCKQUOTE>
[Kapil]
Quite a big confession that. Would other sysadmins be as honest and
own up?!
</BLOCKQUOTE>
<P><STRONG>
I had Windows 2000
with Outlook 2000 and it worked perfectly. Now that I have installed <A HREF="http://www.redhat.com/">Red Hat</A>
Linux workstation, I successfully connected to the server via DHCP and I can
easily surf. But what I can't do is check my email through Ximian Evolution
Email Service. My domain is MARS and the server name is MAIN. In exchange,
we have IMAP4 and POP3. In Linux, I tried to configure the Ximian Evolution
as <TT>IMAP.MAIN.COM</TT> and <TT>POP3.MAIN.COM.</TT> Ofcourse we don't have extranet so we
can't browse through the Browser. It doesn't work. I even tried my login
name with the hostname and it still doesn't work. Can you help me ?
</STRONG></P>
<P><STRONG>
Thanks.
</STRONG></P>
<P><STRONG>
Hritesh
</STRONG></P>
<BLOCKQUOTE>
[Kapil]
Obviously you have confused Win NT domains with DNS domains. To have a
DNS domain (which you don't seem to need since you have no extranet)
you need to have an authoritative DNS name server.
</BLOCKQUOTE>
<BLOCKQUOTE>
If your entire network is only served through Win NS you should check
up the documentation on Samba to configure your machine as a Win NS
client. You can stick with localhost.localdomain for your DNS name
unless you want to be more imaginative!
</BLOCKQUOTE>
<BLOCKQUOTE>
[Halb]
Maybe you should look into Ximian Connector, it will enable to use
Evolution as a complete Exchange client. Ximian will be happy to sell
you these at $69.00 a piece, but this sholud not be a real problem for a
company....... if this is the solution to your problem. Maybe Kapil Hari
Paranjape's answer is more the direction you should be looking at.
</BLOCKQUOTE>
<!-- end 16 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.17"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">Teething problems with a dual boot system</FONT></H3>
Tue, 24 Dec 2002 10:21:22 +0000
<BR>Huibert Alblas, John Karns (<a href="mailto:linux-questions-only@ssc.com?cc=toddncl@hotmail.com&subject=%20Re%3A%20%5BLG%2086%5D%202c%20Tips%20%2317">the <em>LG</em> Answer Gang</a>)
<BR>Question by john todd (toddncl from hotmail.com)
<!-- sig -->
<!-- sig -->
<P><STRONG>
Hi there, I was wondering if you could help me out here. I have a dual boot
system running XP and red hat 8.0. I have just recently installed red hat
and am finding a few problems whilst setting up the system. My computer has
2 physical hard disks (primary master, and secondary master) the first
(hda1) has that nasty windows thingy on it (I left the file system as fat32
so I could go back to 98se if need b). Hda2 has red hat on. I can mount and
access hda1 when in Linux, but I cannot access my second (fat32) hard drive
at all. I have all my operating systems and software on the first hard drive
and all my work on the second, so this is starting to wind me up a bit now!
</STRONG></P>
<blockquote><font color="#000066">It's not entirely clear if he can still see that work drive from
Windows; if he can, Halb's probably right. John K's hints are good
before someone starts setting up, so people can have better results.
It may also be worth noting that hda2 is the second partition on the
first drive; a second drive on the same IDE chain would be hdb, and
its partitions also numbered, so maybe he just needs to mount /dev/hdb1
as well.
</font></blockquote>
<blockquote><font color="#000066">NT filesystem support for Linux, claiming to read all versions:
<A HREF="http://linux-ntfs.sourceforge.net"
>http://linux-ntfs.sourceforge.net</A>
-- Heather</font></blockquote>
<BLOCKQUOTE>
[Halb]
By the look of things I would say you have NTFS on your second
Harddrive. This is common behaviour on M$ machines becouse FAT23
partition sizes are artificialy restricted to 32 Gigs ( not that big for
nowaday harddrives) M$ will automagicly change to NTFS, this might be
the reason why you are not able to mount it. This presumes that you have
made all the correct entries in your <TT>/etc/fstab.</TT>
</BLOCKQUOTE>
<BLOCKQUOTE>
[John]
My guess is that perhaps you lost your fat32 partition on the 2nd hd. How
did you set up your partition(s) on hda2 when installing RH8? The
recommended method would be something like:
</BLOCKQUOTE>
<blockQuote><ul>
<LI>back up the existing partition if it contained anything of interest
<LI>use a non-destructive method of dividing the 2nd hd into multiple
partitions (e.g., GNU parted, fips, Partition Magic - there are several
to choose from).
<LI>install Linux on a newly-created partition on hd2
</ul></blockQuote>
<P><STRONG>
also when I re-start my computer I need to mount the hda1 each time. Any
help would be greatly appreciated.
</STRONG></P>
<BLOCKQUOTE>
[Halb]
here you can make an
entry for <TT>/dev/hda1</TT> like this or whatever your liking is:
</BLOCKQUOTE>
<blockquote><pre>/dev/hda1 /WIN2K vfat defaults,noatime 0 0
</pre></blockquote>
<!-- end 17 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.18"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">ISO file?</FONT></H3>
Thu, 28 Nov 2002 16:10:57 +0000 (GMT)
<BR>Dan Clark, Faber Fedor, Mike Orr (<a href="mailto:linux-questions-only@ssc.com?cc=lil_p84@yahoo.co.uk&subject=%20Re%3A%20%5BLG%2086%5D%202c%20Tips%20%2318">the <em>LG</em> Answer Gang</a>)
<BR>Question by Paul Bailey (lil_p84 from yahoo.co.uk)
<P>
What exactly is an ISO file? I downloaded what i thought was a game and
it is an ISO file. Can you convert this into an EXE file? and do ISO
files only work on LINUX. Your help will be greatly appreciated thank you.
</P>
<P>
Lil_P
</P>
<BLOCKQUOTE>
[Iron]
This gets the award for the most frequently-asked question of the month.
I think it's the third time somebody has asked how to play .iso games.
</BLOCKQUOTE>
<BLOCKQUOTE>
ISO9660 is the file format used for CD-ROMs, named after the International
Standards Organization's standard that defines it. "ISO" is sometimes
used as an abbreviation. Whether that's the format <EM>your</EM> file is in is
a different matter; it could be anything. The .iso extension isn't
universal like .txt, .html, .jpg, etc. What does the "file" command
say about your file?
</BLOCKQUOTE>
<BLOCKQUOTE>
Assuming the file <EM>is</EM> really an ISO9660 filesystem image, you can write
it directly to a CD and then either read the CD or boot from it.
You'd write the image using "cdrecord" on Linux
or one of its GUI front-ends like KOnCD in <A HREF="http://www.kde.org/">KDE</A>. Skip the first step
(making an image file from a directory hierarchy) because you already
have the image.
</BLOCKQUOTE>
<BLOCKQUOTE>
[Faber]
ISO files are binary versions of CDs. If you were to copy a CD byte for
byte (NOT file for file), you would have an ISO file.
</BLOCKQUOTE>
<P><STRONG>
[Dreamgazer]
and how can I open them without copying to cd
</STRONG></P>
<BLOCKQUOTE>
When I found out how to do this in Linux I was <EM>so</EM> impressed with Linux!
Let's say you have a directory called <TT>/mnt/my_iso</TT> and your ISO is called
<TT>/home/Dreamgazer/my_iso_file.</TT> You can mount the ISO
with the command:
</BLOCKQUOTE>
<blockquote><pre>mount -t iso9660 -o ro,loop=/dev/loop1 /mnt/my_iso /home/Dreamgazer/my_iso_file
</pre></blockquote>
<BLOCKQUOTE>
and then you can access any of the files in the ISO by going to the
<TT>/mnt/my_iso</TT> directory! Cool, eh?!
</BLOCKQUOTE>
<BLOCKQUOTE>
Let's see Windows do <EM>that</EM> !
</BLOCKQUOTE>
<blockquote><font color="#000066">Actually, just saying -o loop is enough; iso9660 defaults to read-only,
and you don't have to tell it which loop device comes next, it can
figure it out all alone. I loopback mount CD images a <EM>lot</EM> myself.
I have to make sure not to run out of loops available.
-- Heather</font></blockquote>
<BLOCKQUOTE>
[Iron]
It may fail for many reasons such as loop device busy (choose another
loop device <TT>/dev/loop*</TT>), your kernel not having loop device support, the
<TT>/dev/loop*</TT> files not existing, etc. When you've finished inspecting the
files under <TT>/mnt</TT>, do:
</BLOCKQUOTE>
<blockquote><pre>umount /mnt
</pre></blockquote>
<BLOCKQUOTE>
to unmount the image (note the command name has one "n" instead of two).
See "man mount". A couple details:
</BLOCKQUOTE>
<blockQuote><ol>
<LI>You may be able to just use "-o ro,loop" instead and let it choose an
unused loopback device, see the manpage for details.
<LI>The manual says it's more convenient to mount and unmount loopback
devices if /etc/mtab is a regular file and not a symbolic link to
/proc/mounts. That answers another question The Answer Gang was unsure
about a couple months ago, whether you lose anything by symlinking the
two together. (What you gain by symlinking them together is that
/etc/mtab -- and thus what "mount" without options reports -- will
always be up to date.)
</ol></blockQuote>
<BLOCKQUOTE>
[Dan]
A free trial of mswin software that will let you open, create, and extract
(we guess this means "view the filesystem inside of") ISO files.
</BLOCKQUOTE>
<BLOCKQUOTE>
<A HREF="http://www.undisker.com/download.html"
>http://www.undisker.com/download.html</A>
</BLOCKQUOTE>
<!-- end 18 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.19"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">Remote X over SSH</FONT></H3>
Mon, 25 Nov 2002 21:11:17 +0100
<br>G&uuml;rkan Seng&uuml;n
(<a href="mailto:linux-questions-only@ssc.com?cc=gurkan@linuks.mine.nu&subject=%20Re%3A%20%5BLG%2086%5D%202c%20Tips%20%2319">gurkan from linuks.mine.nu</a>)
<!-- sig -->
<!-- sig -->
<P>
You need a user account for the host you want to login to.
The server should be accessible over SSH (normally TCP/22), and should have
X11 forwarding configured.
</P>
<blockquote><pre>$ netstat -a |grep ssh
tcp 0 0 *:ssh *:* LISTEN
$ grep orwarding /etc/ssh/sshd_config
X11Forwarding yes
</pre></blockquote>
<h4 align="center"><br>X server and SSH client for Windows(r)
</h4>
<blockQuote><ul>
<LI>Putty, SSH client suite
<A HREF="http://www.chiark.greenend.org.uk/~sgtatham/putty"
>http://www.chiark.greenend.org.uk/~sgtatham/putty</A>
<LI>StarNet's X-Win32 (commercial)
<A HREF="http://www.starnet.com"
>http://www.starnet.com</A>
<LI>MicroImages MI/X for Windows (commercial, but very cheap; free demo.)
<A HREF="http://www.microimages.com/freestuf/mix"
>http://www.microimages.com/freestuf/mix</A>
<LI>X server: Cygwin's XFree port to win32 (open source)
<A HREF="http://www.cygwin.com/xfree"
>http://www.cygwin.com/xfree</A>
<LI>Xserver: fwx (a much smaller, dustier project)
<A HREF="http://sourceforge.net/projects/fwx"
>http://sourceforge.net/projects/fwx</A>
%+%
%-
<LI>start your Xserver. We'll assume it's called xs.exe
<LI>start Putty
<LI>activate X11 forwarding in Putty
<LI>activate SSH 2 protokoll
<LI>configure SSH port, normally 22
<LI>connect to server user@1.2.3.4
<LI>enter password
</ul></blockQuote>
<P>
On UNIX, BSD or Linux you can use any X server and SSH client you want.
</P>
<blockquote><pre>$ ssh -X user@1.2.3.4
user@1.2.3.4's password:
</pre></blockquote>
<h4 align="center"><br>Starting the window manager
</h4>
<P>
This will start the amiwm window manager in the background and display it
on your X server window (xs.exe).
</P>
<blockquote><pre>$ amiwm &amp;
</pre></blockquote>
<h4 align="center"><br>Screen in five minutes
</h4>
<P>
We become super-user.
</P>
<blockquote><pre>$ su
Password:
</pre></blockquote>
<P>
We start iptraf as daemon (screen session in detached mode).
</P>
<blockquote><pre># screen -dmS iptraf iptraf
</pre></blockquote>
<P>
We list our SockDir.
</P>
<blockquote><pre># screen -ls
There are screens on:
604.iptraf (Detached)
1 Socket in /var/run/screen/S-root.
</pre></blockquote>
<P>
We reattach to our detached screen process and detach from it.
</P>
<blockquote><pre># screen -r
&amp;lt;ctrl-a-d&amp;gt;
[detached]
</pre></blockquote>
<blockquote>G&uuml;rkan Seng&uuml;n
<br><em><font color="#000033"><br>http://www.linuks.mine.nu
<br>Windoze not found: (C)heer, (P)arty or (D)ance?
</font></em></blockquote>
<!-- end 19 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.20"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">Debian User Worldmap</FONT></H3>
Mon, 25 Nov 2002 21:11:17 +0100
<br>G&uuml;rkan Seng&uuml;n
(<a href="mailto:linux-questions-only@ssc.com?cc=gurkan@linuks.mine.nu&subject=%20Re%3A%20%5BLG%2086%5D%202c%20Tips%20%2320">gurkan from linuks.mine.nu</a>)
<P>
A fun thing to do; see where fellow <A HREF="http://www.debian.org/">Debian</A> users are, check in.
I will try to make the page better with time:
Like click on a place and find friends (a list) nearby,
show how it's done etc...
</P>
<P>
<A HREF="http://www.linuks.mine.nu/debian-worldmap"
>http://www.linuks.mine.nu/debian-worldmap</A>
</P>
<blockquote>G&uuml;rkan Seng&uuml;n
<br><em><font color="#000033"><br>http://www.linuks.mine.nu
<br>Windoze not found: (C)heer, (P)arty or (D)ance?
</font></em></blockquote>
<!-- end 20 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="tips.21"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">Remote control of Linux from Windows</FONT></H3>
Mon, 2 Dec 2002 21:15:36 -0600
<BR>Thomas Adam (<a href="mailto:linux-questions-only@ssc.com?cc=bmdean@socket.net&cc=thomas_adam16@yahoo.com&subject=%20Re%3A%20%5BLG%2086%5D%202c%20Tips%20%2321">The <em>LG</em> Weekend Mechanic</a>)
<BR>Question by Brandon M. Dean (bmdean from socket.net)
<!-- sig -->
<!-- sig -->
<P><STRONG>
Hello,
</STRONG></P>
<P><STRONG>
I live in LaGrange, Missouri. I have downloaded the iso's for
</STRONG></P>
<P><STRONG>
Mandrake 9.0. I have installed it once. I then took it off to have
Windows again.
</STRONG></P>
<BLOCKQUOTE>
[Thomas]
Oh, dear. You do know that, Tux doesn't bite <EM>that</EM>
hard.
</BLOCKQUOTE>
<P><STRONG>
My brother had a Linux Router, and I wanted it to act as
a server, but he said it wouldn't.
</STRONG></P>
<BLOCKQUOTE>
[Thomas]
Your brother is deluded
<IMG SRC="../gx/dennis/smily.gif" ALT=":-)"
height="24" width="20" align="middle">
</BLOCKQUOTE>
<P><STRONG>
But I have a second computer in my
room. I want to add this behind my dad's desk with a 5' network cable,
instead some more 100' cable to run to my room. I wanted to know a good
app to run a remote desktop connection on it. I have downloaded one
program called X-Win 32.
</STRONG></P>
<BLOCKQUOTE>
[Thomas]
"A good app" -- well that depends on what you want the
server to do. Your server, once it is up and running
can support (amongst others): file serving, print
serving, webserver, phpserver, mysql server, mail
serving, etc...................
</BLOCKQUOTE>
<blockquote><font color="#000066">If you find you don't like that one, there arre a few other X servers
mentioned in
"(#tips.19)Remote X over ssh"
above.
-- Heather</font></blockquote>
<P><STRONG>
I have Windows XP on my main computer. It has a
remote desktop built in.
</STRONG></P>
<blockquote><font color="#000066">The open source client for that protocol is called rdesktop:
<A HREF="http://www.rdesktop.org"
>http://www.rdesktop.org</A>
</font></blockquote>
<blockquote><font color="#000066">But I don't know if anything on Linux serves that protocol so the
windows remote-desktop client can view it.
</font></blockquote>
<blockquote><font color="#000066">VNC is another possibility, and may be needed if you want to share
the desktop with more than one person - here's a KDE remote sharing
project that uses it:
<A HREF="http://www.tjansen.de/krfb"
>http://www.tjansen.de/krfb</A>
-- Heather</font></blockquote>
<P><STRONG>
I also wanted to know if it had to have a
keyboard, mouse, and monitor hooked up to it at all times, even though I
will have some sort of remote desktop app.
</STRONG></P>
<P><STRONG>
Thank You,
<BR>Brandon Dean
</STRONG></P>
<BLOCKQUOTE>
[Thomas]
Nope, my 486 Server has no monitor, keyboard or mouse,
since during the odd occassion that I have to log into
the server, it is done via SSH which I can run from
the command-line.
</BLOCKQUOTE>
<BLOCKQUOTE>
Although if your using Windows, then I suggest the use
of "putty.exe".
</BLOCKQUOTE>
<blockquote><font color="#000066">This is also mentioned in the
"(#tips.19)remote X over ssh"
tip.
For occasional access over a serial cable, see the
"(#tips.6)headless server"
tip.
</font></blockquote>
<blockquote><font color="#000066">As long as your BIOS is happy when you don't have these things,
Linux doesn't mind at all.
-- Heather</font></blockquote>
<!-- end 21 -->
<!-- *** 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 86 of <i>Linux Gazette</i>, January 2003</H5>
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>
<H3>Contents:</H3>
<dl>
<dt><a href="#tag.greeting"
><strong>&para;: Greetings From Heather Stern</strong></A></dl>
<DL>
<!-- index_text begins -->
<dt><A HREF="#tag.1"
><img src="../gx/dennis/qbub.gif" height="28" width="50"
alt="(?)" border="0"
><strong>Troubleshooting boot-time video mode problems</strong></a>
<dt><A HREF="#tag.2"
><img src="../gx/dennis/qbub.gif" height="28" width="50"
alt="(?)" border="0"
><strong>NameVirtualHost in Apache</strong></a>
<dt><A HREF="#tag.3"
><img src="../gx/dennis/qbub.gif" height="28" width="50"
alt="(?)" border="0"
></a>shutdown down the system using power switch --or--
<dd><A HREF="#tag.3"
><strong>alternatives for the Big Red Switch</strong></a>
<br>consider journaling...
<dt><A HREF="#tag.4"
><img src="../gx/dennis/qbub.gif" height="28" width="50"
alt="(?)" border="0"
><strong>Question on writing Server program for multiple client connections.</strong></a>
<!-- index_text ends -->
</DL>
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<A NAME="tag.greeting"><HR WIDTH="75%" ALIGN="center"></A>
<H3 align="left"><img src="../gx/dennis/hbubble.gif"
height="50" width="60" alt="(&para;) " border="0"
>Greetings from Heather Stern</H3>
<!-- begin hgreeting -->
<blockQuote>
Hello everyone, and welcome not only to the world of the Answer Gang,
but a very Happy New Year!
</blockQuote>
<blockQuote>
Considering how terrible the economy is these days, Linux didn't do too
badly for itself. The question is increasingly not "is that linux
thingy safe enough to use in our enterprise" but "where can it serve us"
... with the advent of stabler desktop software has come some legitimacy,
even among sites that really don't care as much about their desktops.
Also as our installers have been improving, near as I can tell from the
messages, Windows' has been getting worse, and the number of mswin
distrss is increasing the chance that formerly innocent end-users will
someday soon have to endure installing a new OS. And there are a fair
number of free-OS hardware vendors now; the preload advantage is no
longer entirely in Redmond's court, either.
</blockQuote>
<blockQuote>
Heck,
<a href="http://www.commweb.com/article/IWK20021217S0007">Red Hat's in the black</a>
too. Not a bad year for the penguin.
</blockQuote>
<blockQuote>
Statistics, statistics. That brings me to the Gang's message queue.
It was <EM>really</EM> light tthis month, about half the usual volume. I'm
not even counting the spam, which we hardly see anymore. (Thanks Dan!
Bunches!) And if we had ignored everything that had come as HTML or
text+HTML rather than plaintext, we darn near could have gone on vacation,
leaving me to gather threads from past months.
</blockQuote>
<blockQuote>
Fear not, however. We do have some good stuff here. There
were plenty of good tips as well.
</blockQuote>
<blockQuote>
Of course it's time for some new years' resolutions. Being a rather
techie soul -- gosh! who could have guessed??
<IMG SRC="../../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle"> -- I'm for 600x600
full color. dpi, that is. A pal of mine gave me a scanner as a
winter-gift. Now all I have to do is find desk space and some time
to drop
<a href="http://www.mustang.com/sane">SANE</a>
(Scanner Access Now Easy) into place. My dream last year of LCD
prices coming down decently hasn't really settled in yet.
</blockQuote>
<blockQuote>
For a more serious resolution, regular backups. The day your computer
decides to go on a magnetic starvation diet and lose a few pounds ...
approximately the weight of one hard disk ... will be really annoying
if you don't have 'em. Too bad DVD writing devices are still such a
pain in the butt to use. They seem to be where video cards were a year
or two ago - if it works then it's just beautiful right out of the box.
And if it doesn't... well, have a lot of fun digging through docs
and scratching your head in puzzlement. I've barely met anyone who's
actually done it yet... and DVD-RAM doesn't count, since it's a different
media entirely from the DVD-R and DVD+R. For that matter a mere 9Gb at
a time is chicken feed to some modern drive setups. I think most folk
will be backing up their medium size hard disks to even larger hard disks
this year.
</blockQuote>
<blockQuote>
Have a great month, folks.
</blockQuote>
<!-- end hgreeting -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<A NAME="tag.1"><HR WIDTH="75%" ALIGN="center"></A>
<!-- begin 1 -->
<H3 align="left"><img src="../gx/dennis/qbubble.gif"
height="50" width="60" alt="(?) " border="0"
>Troubleshooting boot-time video mode problems</H3>
<p><strong>From Scott Rafferty
</strong></p>
<p></strong></p>
<p align="right"><strong>Answered By Joshua Jeffrey Wingstrom, Karl-Heinz Herrman, Matthias Posseldt
</strong></p>
<blockQuote>
In reply to
<a href="../issue77/tag/2.html">TAG #2, Issue 77</a>
</blockQuote>
<P><STRONG>
Josh,
</STRONG></P>
<P><STRONG>
Sorry for the intrusion. Came across your name in a linux archive.
Your brother had a similar problem to the one I'm having right now and I
was wondering if he managed to resolve the issue. The problem is the
blank screen on bootup (no boot messages, no logon prompt etc)...I kinda
agree with your hardware/card theory as I too am using a GEFORCE 2 card.
</STRONG></P>
<P><STRONG>
I can get the console text/logon prompt to appear by logging in
(although I can't see what I'm typing) and starting X and then quitting
X. This seems to "restore the correct mode" and the text logon prompt
appears fine.
</STRONG></P>
<P><STRONG>
Booting up rescue mode or doing a text install from the CD seems to show
the console text no problem though so why would my newly installed
kernel just blank the screen.
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [K.-H.]
just an idea:
</blockQuote>
<blockQuote><ul>
<!-- *) text-install uses a plain text console -->
<LI>text-install uses a plain text console
<!-- *) rescue CD's/floopy use a plain text console -->
<LI>rescue CD's/floopy use a plain text console
</ul></blockQuote>
<blockQuote>
but: At least <A HREF="http://www.suse.com/">SuSE</A>'s regular boot process shows a penguin or something and
therefore must have switched to some non-text console (VGA mode). Maybe your
card doesn't like that?
</blockQuote>
<blockQuote>
boot messages are of course always readable later on via dmesg, but I agree
that if something goes wrong and boot hangs it would be nice to see the
messages....
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Very little information on this problem in general. It's extremely
frustrating. I'd like to see my boot messages. Interestingly enough
I've encountered the same problem with Mandrake and Redhat on the same
system. I could buy a new card of course but I'm determined to get to
the bottom of this.
</STRONG></P>
<P><STRONG>
If I've intruded, please accept my apologies in advance.
</STRONG></P>
<P><STRONG>
Scott Rafferty
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Joshua]
</blockQuote>
<blockQuote>
Scott,
Thanks for contacting me. I would like to resolve this too.
</blockQuote>
<blockQuote>
I have since switched to Gentoo and the problem does not occur there.
</blockQuote>
<blockQuote>
I think that the problem is related to the bootsplash screens that
Mandrake and Redhat use. The GEFORCE 2 does not seem to want to be
switch into... I'm guessing VESA mode?... in the manner in which these
applications are switching it. I think that this can be fixed by using
the bootsplash utility from Mandrake. The CVS code for this is
available at:
</blockQuote>
<blockQuote><BLOCKQuote>
<A HREF="http://cvs.mandrakesoft.com/cgi-bin/cvsweb.cgi/soft/bootsplash"
>http://cvs.mandrakesoft.com/cgi-bin/cvsweb.cgi/soft/bootsplash</A>
</BLOCKQuote></blockQuote>
<blockQuote>
I would look at the documenatation and try to turn off the bootscreen.
If this fixes the problem, try changing boot screen resolutions.
Otherwise, I'm guessing we'll have to start looking at kernel
configurations.
</blockQuote>
<blockQuote>
Happy hunting,
Josh
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
After scouring google yesterday for an answer to my NO BOOT MESSAGES problem
there was one interesting comment I came across about settings in the BIOS.
So late last night I made 2 changes to my BIOS settings. Now I can see all
my boot messages. A simple but no less important solution to a frustrating
problem.
</STRONG></P>
<P><STRONG>
The changes I made to the BIOS were these (screenshot links included) --
</STRONG></P>
<P><STRONG><DL><DT>
Enabled the memory hole from 15-16 M
<DD><A HREF="http://www.motherboards.org/images/15/2002/1204_p2_11.jpg"
>http://www.motherboards.org/images/15/2002/1204_p2_11.jpg</A>
</DL></STRONG></P>
<P><STRONG><DL><DT>
Changed Primary VGA BIOS to [AGP VGA Card] - Was set to [PCI VGA Card].
<DD><A HREF="http://www.motherboards.org/images/15/2002/1204_p2_9.jpg"
>http://www.motherboards.org/images/15/2002/1204_p2_9.jpg</A>
</DL></STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Matthias]
I'm pretty sure it is only the second BIOS setting which has to do with the
VGA problem.
You better disable the first option again, because it's more trouble than
it's worth. And it is a "legacy" option, for systems which use VGA cards
older then 1994 or so. Almost any system is newer to when this setting was
important. In your PC timeline, order it in before "MS Windows 3.0 finally
arrived. Bad OS/2 clone, btw."
<IMG SRC="../gx/dennis/smily.gif" ALT=";-)"
height="24" width="20" align="middle">
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Different BIOS's will have different settings of course but I think these
two are pretty standard across the board.
</STRONG></P>
<P><STRONG>
One thing to note - I had to actually switch the power off after making the
changes (rather than just rebooting) for the changes to take complete
effect. I also could have narrowed it down a little further to just the one
BIOS change but it was late and I was so elated that I just forgot. If
anyone wants me to delve further then just ask.
</STRONG></P>
<P><STRONG>
I really hope this helps other people with the same problem. I'm sure
anyone in the know will understand exactly why these 2 settings would effect
the linux bootup in such a way with some of the NVIDIA cards. I don't
though.
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle">
</STRONG></P>
<P><STRONG>
Cheers,
Scott
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Matthias]
It has to do with the AGP way of life
<IMG SRC="../gx/dennis/smily.gif" ALT=";-)"
height="24" width="20" align="middle">. AGP cards have two modes. The
"PCI equivalent" simple mode where they can display character mode
terminals etc, and the "AGP full featured mode" where they run full power.
The second mode has to be supported by the Operating System with some
driver and AGP layer.
</blockQuote>
<blockQuote>
And it seems that -- while the BIOS can display characters -- Linux cannot
display them for some reason. Maybe because it sends PCI only commands or
tries to detect the VGA card on the PCI bus and fails correctly handling
</blockQuote>
<!-- end 1 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<A NAME="tag.2"><HR WIDTH="75%" ALIGN="center"></A>
<!-- begin 2 -->
<H3 align="left"><img src="../gx/dennis/qbubble.gif"
height="50" width="60" alt="(?) " border="0"
>NameVirtualHost in Apache</H3>
<p><strong>From Rich Price
</strong></p>
<p></strong></p>
<!-- sig -->
<!-- sig -->
<p align="right"><strong>Answered By Huibert Alblas, Faber Fedor, Mike "Iron" Orr, Heather Stern
</strong></p>
<blockQuote>
I am running <A HREF="http://www.slackware.org/">Slackware</A> 7.1.0 and <A HREF="http://www.apache.org/">Apache</A>/1.3.12 on my web server which I have
been running for many years. Recently, I acquired a second domain name and
I attempted to use name based virtual hosting to support both domains on
this server.
</blockQuote>
<blockQuote>
I have been unable to configure apache to do this. I have been using the
second edition of "Apache The Definitive Guide" by Ben and Peter Laurie as
a guide. But repeated attempts to come up with a httpd.conf file have
resulted in either both web sites showing the same [primary site] pages or
in both sites showing an error page.
</blockQuote>
<blockQuote>
I have a number of questions that the Laurie's book has not been able to
answer:
</blockQuote>
<blockQuote><ol>
<LI>Can you have both a primary site and a "NameVirtualHost" site that use
<LI>Can you have both a primary site and a "NameVirtualHost" site that use
the same IP address?
<LI>Should I make both sites be "NameVirtualHost" sites?
<LI>Should I make both sites be "NameVirtualHost" sites?
<LI>Is there anything obviously wrong with these httpd.conf statements?
<LI>Is there anything obviously wrong with these httpd.conf statements?
</ol></blockQuote>
<blockquote><pre>#
NameVirtualHost aaa.bbb.ccc.ddd
&lt;VirtualHost virt-host-name&gt;
ServerAdmin relevant-email-address
DocumentRoot /websites/virthost/htdocs
ErrorLog /var/log/error_log
CustomLog /var/log/access_log common
&lt;/VirtualHost&gt;
#
</pre></blockquote>
<blockQuote>
Any advice would be appreciated!
</blockQuote>
<blockQuote>
Rich Price
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Halb]
Yes, as far as I can see you're missing the ServerName entry:
</blockQuote>
<blockquote><pre> &lt;VirtualHost virt-host-name&gt;
ServerName virt-host-name
ServerAdmin relevant-email-address
DocumentRoot /websites/virthost/htdocs
ErrorLog /var/log/error_log
CustomLog /var/log/access_log common
&lt;/VirtualHost&gt;
</pre></blockquote>
<blockQuote>
Hope it helps
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
Thanks for your reply. But my problem remains.
</STRONG></P>
<P><STRONG>
When I add the NameVirtualHost and &lt;VirtualHost &gt; commands
[with the ServerName statement] to the end of the httpd.conf file, I
get the "HTTP 404 - File not found" error message when trying to
access either website.
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Faber]
Hang on. From what I've seen in this thread, you need to do this:
</blockQuote>
<blockquote><pre>NameVirtualHost aaa.bbb.ccc.ddd
&lt;VirtualHost aaa.bbb.ccc.ddd&gt; &lt;-- note this nibbly bit
ServerName virt-host-name
&lt;...snip...&gt;
&lt;/VirtualHost&gt;
</pre></blockquote>
<blockQuote>
NOT
</blockQuote>
<blockquote><pre>NameVirtualHost aaa.bbb.ccc.ddd
&lt;VirtualHost virt-host-name&gt; &lt;-- this line is the problem
ServerName virt-host-name
&lt;...snip...&gt;
&lt;/VirtualHost&gt;
</pre></blockquote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Iron]
That's how our sites are set up, those that do name virtual host.
However, the Apache docs (version 1.3) say you can use either the IP
or domain name, although they recommend the IP for the NameVirtualHost
line. I would thus use the IP on both the NameVirtualHost and
VirtualHost lines so it's easier for the person to match up which
VirtualHost stanzas go with which NameVirtualHost.
</blockQuote>
<blockQuote>
Note that you can also use ServerAlias to define multiple names for
one virtual host:
</blockQuote>
<blockquote><pre>NameVirtualHost 10.0.0.1:8080
&lt;VirtualHost 10.0.0.1:8080&gt;
ServerName buffy.vampire.slayer
ServerAlias www.buffy.vampire.slayer
...
&lt;/VirtualHost&gt;
</pre></blockquote>
<blockQuote>
This can be called the "Rick Moen can't get his users trained not to
type the 'www'" approach.
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
I figgured it out!!!!
</STRONG></P>
<P><STRONG>
The Apache online documentation says:
</STRONG></P>
<TABLE WIDTH="95%" BORDER="1" BGCOLOR="#FFFFCC"><TR><TD>
<p align="center">...............</p>
<P><STRONG><BLOCKQuote>
Note: the "main server" and any <em> _default</em> servers will never be served for
a request to a NameVirtualHost IP Address . . .
</BLOCKQuote></STRONG></P><p align="center">...............</p>
</TD></TR></TABLE>
<P><STRONG>
So I added the origional "main server" as another virtual host like this:
</STRONG></P>
<p align="center">See attached <tt><a href="misc/tag/named-host.httpd.conf">named-host.httpd.conf</a></tt></p>
<P><STRONG>
And the original host continued to work with the new httpd.conf file.
</STRONG></P>
<P><STRONG>
The problem with the new host turned out to be a misspelled directory path.
[I blush with shame].
</STRONG></P>
<P><STRONG>
Thanks for all the help.
</STRONG></P>
<P><STRONG>
Rich Price
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Iron]
Oh, OK. Often you think the problem is one thing but it turns out to be
something else.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Heather]
So, I didn't join this thread when it was active during the month, and
here I am adding this as I edit the thread. But I figured it would be
valuable to complete the example.
</blockQuote>
<blockQuote>
You need to have permissions for the directory set up in your
httpd.conf too, since the very default permissions usually explicitly
describe that anywhere in the web tree should be inaccessible unless
opened up (or possibly, only open to localhost). The defaults may work
pretty well until you start moving your web directories to a place
unplanned for by your installation of Apache. (For example, having a
websites directory off of the root directory, not exactly
<a href="http://www.linuxbase.org/">LSB compliant</a>
, but heck, it's <EM>your</EM> server.) That Rich misspelled this little tidbit,
then realized and spelled it right, is what fixed him. So here's that
part, presuming that these are pages for access by a world of visitors,
not just a limited number of friends.
</blockQuote>
<blockQuote>
AllowOverride suggests what things .htaccess control files can affect.
</blockQuote>
<p align="center">See attached <tt><a href="misc/tag/host-directories.httpd.conf">host-directories.httpd.conf</a></tt></p>
<blockQuote>
Now, the fact that he mentions "htdocs" suggests that he probably
also has a dedicated cgi directory and maybe even a dedicated icons
directory (so fancy indexing gets a touch of local flavor). So here's
an expanded and slightly fancier example that covers the lot, and
puts things in a slightly more reasonable place in the directory tree.
Also I seperate the logs.
</blockQuote>
<p align="center">See attached <tt><a href="misc/tag/completist.httpd.conf">completist.httpd.conf</a></tt></p>
<blockQuote>
Of course, to use my example you should also touch and set
permissions for the logfiles you'll be keeping, and give them group
permission that allows the webmasters to see their own stuff.
</blockQuote>
<blockQuote>
You'll want to change that "lettered" IP address to a real one.
You can use 127.0.0.2 and a bunch of entries in your <TT>/etc/hosts</TT>
file to test things out if you need to.
DNS "A records" should exist pointing these sites to your IP
addrress; it might be good if the less preferred names (the
ServerAlias values) are all CNAMEs to their primaries, so that at
least a few browsers will get the hint when bookmarking.
</blockQuote>
<p align="center">See attached <tt><a href="misc/tag/test-fragment.etc-hosts.txt">test-fragment.etc-hosts.txt</a></tt></p>
<blockQuote>
Create <TT>/home/websites/virthost1</TT> and its subdirectory <TT>/errors</TT> with 2 files
in it, likewise for virthost2, and copy their sets of icons in.
</blockQuote>
<blockQuote>
Make sure that the webfiles and grpahics for the web are world readable
in your filesystem too, so the webdaemon (which usually runs as an
unprivileged user, either 'nobody' or one dedicated to run only apache)
can access the files. They can be group writable by the webmaster for
the given site.
</blockQuote>
<blockQuote>
Keeping the custom error pages in the directory "errors" under the web
tree and numbered like that is compatible with thttpd; so is the attitude
that everything under the htdocs directories iw world-readable at the
filesystem. To really go whole hog with that, your virthostX directories
would be named the same as the preferred name of the site instead, and your
thttpd.conf would contain the lines:
</blockQuote>
<blockquote><code><font color="#000033"><br>dir=/home/websites
<br>vhost
</font></code></blockquote>
<blockQuote>
Useful to know if you're switching over in a hurry if there is some nasty
apache hole that's been discovered and you can't afford to have the websites
down while the patch is being prepared. Set symlinks for the
ServerAliased names and it should just work, though your cgi scripts will be
dead without additional setup, thttpd doesn't do fancy indices, and the
logs will be somewhere new.
</blockQuote>
<blockQuote>
Add norobots.txt files for spice if you like to keep your sites
from being web-indexed until they are ready.
</blockQuote>
<p align="center">See attached <tt><a href="misc/tag/simple.norobots.txt">simple.norobots.txt</a></tt></p>
<blockQuote>
When things are good you can take out the second Disallow and replace
it with lines for specific places that shouldn't be traversed.
</blockQuote>
<blockQuote>
After you've finished mixing all these ingredients in a big mixing
bowl labelled "disk space", season to taste, stuff in the oven, bake
at 450 for 10 seconds, frost. Serves thousands.
</blockQuote>
<!-- end 2 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<A NAME="tag.3"><HR WIDTH="75%" ALIGN="center"></A>
<!-- begin 3 -->
<H3 align="left"><img src="../gx/dennis/qbubble.gif"
height="50" width="60" alt="(?) " border="0"
>alternatives for the Big Red Switch</H3>
<H4 ALIGN="center">consider journaling...</H4>
<p><strong>From Mark Morshedi
</strong></p>
<p></strong></p>
<!-- sig -->
<!-- sig -->
<!-- ::
alternatives for the Big Red Switch
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
consider journaling...
:: -->
<p align="right"><strong>Answered By Thomas Adams, David Mandala, John Karns, Rick Moen, Mike "Iron" Orr, Didier Heyden, Heather Stern
</strong></p>
<P><STRONG>
What if the only option is to use the power switch to turn off the system.
there are times that mouse doesn't work and keyboard is dead. how does one
manages that without destorying the file system.
</STRONG></P>
<P><STRONG>
thanks
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Thomas]
My first indication is that this is VERY much hardware
specific. You should check that your motherboard can
handle processes like the one that you wish to
implement under linux.
</blockQuote>
<blockQuote>
Typically the programs that you would want to use are:
"apm" which is most likely, the program that will
control the "power-down" feature via the power button
anyway, and also "lm_sensors" so that you can get the
current state of your system.
</blockQuote>
<blockQuote>
As far as not allowing the filesystem to get mangled,
you can set the maximum mount check point to an
arbitrary value (I have it set at 100), using the
"tune2fs" program. Thus you can specify:
</blockQuote>
<blockQuote><CODE>
tune2fs -c 100
</CODE></blockQuote>
<blockQuote>
means that your filesystem WONT be checked until it
has been mounted 100 times. You can extend this
further to say that:
</blockQuote>
<blockQuote><CODE>
tune2fs -i [d/m] whereby you can set the next check to
<BR>be in either days or months. Have a look at "man
<BR>tune2fs" for more details.
</CODE></blockQuote>
<blockquote><IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Heather] Note that lm_sensors is specifically <EM>not</EM> recommended for some
hardware; some thinkpad models crash hard and in fact the hardware
suffers wickedly (see <A HREF="http://www.linux-thinkpad.org"
>http://www.linux-thinkpad.org</A> for details).
Do check the internet for comments about lm_sensors and your motherboard
before just brazenly invoking it.
</blockquote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [David]
One can try the three finger salute Control Alt Delete which sometimes
will cause a orderly shutdown and restart. Or one can use the ext3
filesystem option on newer versions of Linux which are safer to data
loss.
</blockQuote>
<blockQuote>
If the machine is networked you could try sshing or telnetting into the
locked machine, sometimes the console is locked but the machine is still
active on the network and you can gain control that way.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [John]
Re: journaling filesystems (ext3 mentioned below) I've been very happy
with reiserfs over the past 18 months. Then there is the SGI (?)
contributed XFS. See the LG issue 68
<a href="http://www.linuxgazette.com/issue68/dellomodarme.html">article about journaling filesystems</a>
for more info about them.
</blockQuote>
<blockQuote>
The magic SysRQ can also help, unless the kernel is locked up hard. It's
worked for me on a number of occasions. For a system lock-up, the key
sequence that I most often use is Alt-SysRq-S, Alt-SysRq-U, and
Alt-SysRq-B which syncs buffers, unmounts fs's, and reboots, respectively.
You may need to recompile your kernel to enable the feature though. For
moe info, see <TT>/usr/src/linux/Documentation/sysrq.txt</TT>
</blockQuote>
<P><STRONG>
<IMG SRC="../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [David]
I remember reading somewhere how to hook up the power switch on an ATX
power supply to do an orderly shutdown but I don't remember where.
Anybody else remember?
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Rick]
You might be thinking of Joris van Rantwijk's Linux PowerSwitch Driver.
Description: "The powerswitch driver makes it possible to use the ATX
power button on your computer to shutdown Linux. You simply press the
power button, and the driver shuts down Linux and powers off the
machine, just like the shutdown command does."
</blockQuote>
<blockQuote>
<A HREF="http://deadlock.et.tudelft.nl/~joris/powerswitch"
>http://deadlock.et.tudelft.nl/~joris/powerswitch</A>
</blockQuote>
<blockQuote><DL><DT>
A different approach:
<DD><A HREF="http://www.geocrawler.com/archives/3/38/1999/9/50/2611153"
>http://www.geocrawler.com/archives/3/38/1999/9/50/2611153</A>
</DL></blockQuote>
<blockQuote><DL><DT>
Or a kernel patch for the ACPI code:
<DD><A HREF="http://www.cs.helsinki.fi/linux/linux-kernel/2001-31/0968.html"
>http://www.cs.helsinki.fi/linux/linux-kernel/2001-31/0968.html</A>
</DL></blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Iron]
Since this is a different driver than the keyboard driver, it may work
even when the keyboard doesn't respond. However, if not losing data is
your primary concern, the first step to do is to switch to a journalled
filesystem. It's easy to switch from ext2 to ext3.
</blockQuote>
<blockQuote><ol>
<LI>Make sure your kernel has ext3 support compiled in. (Not a module,
because you don't want it to fail if something happens to the module
files.)
<LI>Boot to single-user mode (or use "telinit s").
<LI>For each filesystem:
<OL>
<LI> Verify it's unmounted or mounted read-only.
<LI> Run "tune2fs -j /dev/THE_PARTITION".
</OL>
<LI>Change "ext2" to "ext3" in /etc/fstab for the affected filesystems.
<LI>Switch back to multi-user mode.
</ol></blockQuote>
<blockQuote>
You can also place <TT>/usr</TT> on a separate partition and mount it read-only
except when installing software, to prevent those files from being
corrupted in an unclean shutdown.
</blockQuote>
<blockQuote>
Make sure your rescue floppy (from your distribution, www.toms.net/rb/,
etc) has support for the journalled filesystem you're using, or you won't be
able to repair it from the floppy. Last I saw, Tom's supported ext3 out of
the box, but for ReiserFS you had to put a custom kernel on the floppy.
You may also want to leave <TT>/boot</TT> as ext2 (mounted read-only of course) to
ensure it's repairable from the widest variety of rescue floppies, should
the need ever arise.
</blockQuote>
<blockQuote>
Of course, you'll also want to determine why the keyboard is not responding
and how to fix it. However, if you're stuck with unreliable hardware,
immature drivers for your gee-whiz must-have peripherals, or you occasionally run
out of both memory and swap, there's not much you can do except press the reset
button or the power switch.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Didier]
I'm being rather off-topic here, but this summarizes perfectly the
problem I had with my old graphics board -- a hardware issue ...
seemingly solved by replacing the defective (or MVP3-incompatible) thing
with another video card.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Iron]
But your first line of defense when the console hangs is to try to ssh or telnet
in from another computer, because usually those services are unaffected. It may
take a long time if the system is "thrashing" (meaning free memory is so low it's
constantly swapping to disk), but you may be able to do a clean "halt" or "reboot"
command that way.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Didier]
Regarding 'ext3' however, it may be worth mentioning the following
discussion about a data corruption bug recently found in the 2.4.20
kernel:
</blockQuote>
<blockQuote><BLOCKQuote>
<A HREF="http://kerneltrap.org/node.php?id=515"
>http://kerneltrap.org/node.php?id=515</A>
</BLOCKQuote></blockQuote>
<blockQuote>
The funny thing is, ever since I started using 2.4.x kernels, and
regardless of the actual 'ext' filesystem subtype, I've had to 'sync'
<em>multiple times</em> and introduce artificial delays right before powering
off the beast, otherwise the filesystems are almost invariably found
to "have not been unmounted cleanly" on the next boot.
</blockQuote>
<blockquote><IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Heather] The nature of the problem, and a workaround, is summarized nicely on this kernel-traffic entry:
<A HREF="http://kt.zork.net/kernel-traffic/kt20021209_195.html#16"
>http://kt.zork.net/kernel-traffic/kt20021209_195.html#16</A>
</blockquote>
<blockquote>This bug has been caught and the patch is now available; to be safe
you need to be either using an early enough kernel (the nasty bug
was introduced in 2.4.20-pre5, but I think I saw discussion about
interaction with a more subtle bug that lurked in the 2.4.19 series)
or a late enough one (this one was nailed in 2.4.20-pre1, and two more
notable ext3 bugs were nailed in -pre2).
</blockquote>
<blockquote>When I realized that some of my dev work was going to heavily crash my
development workstation, I decided I needed journals; saving
<EM>everything</EM> aside for a thorough reiserfs makeover looked like no fun,
so ext3 was my first try. That was when 2.4.19-pre10 was current and
I've not encountered any sync problems; I'd certainly know, because
a lot of my testing involves swapping drives around, so I'm up and
down all the time deliberately as well. Also, It's not at all clear
whether this ever affected the backported-to-2.2.x ext3 support, since
the main flaw was in an optimization trick.
</blockquote>
<blockquote>There was apparently some benchmark comparing reiserfs and ext3
mid-year 2002; it generated an awful lot of mailing list traffic at the
time, easy to find in Google/linux when looking for both keywords together.
</blockquote>
<!-- end 3 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<A NAME="tag.4"><HR WIDTH="75%" ALIGN="center"></A>
<!-- begin 4 -->
<H3 align="left"><img src="../gx/dennis/qbubble.gif"
height="50" width="60" alt="(?) " border="0"
>Question on writing Server program for multiple client connections.</H3>
<p><strong>From vidya srinivasan
</strong></p>
<p></strong></p>
<!-- sig -->
<!-- sig -->
<p align="right"><strong>Answered By Faber Fedor, Kapil Hari Paranjape, Jim Dennis
</strong></p>
<P><STRONG>
Hi,
</STRONG></P>
<P><STRONG>
I had a question regarding servers. I want to know what happens when a server listening for multiple connections at a single port receives packets from two clients at the same time on the same port? Will the server discard one packet or accept both? Is there an order with which it accepts/discards them?
</STRONG></P>
<P><STRONG>
Thanks for replying in advance.
</STRONG></P>
<P><STRONG>
Sincerely,
Vidya.
</STRONG></P>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Faber]
Two packets will never arrive at the port at the same time. For LAN
technologies that I know of (Ethernet, Token Ring, ATM), there is only
one packet on the wire at a time. Look into "Carrier Sense, Multiple
Access/Collision Detection" to see how Ethernet does it.
</blockQuote>
<blockQuote>
I have no idea what happens on the really big pipes.
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Kapil]
I don't think the question is well phrased. Do you mean this from the
kernel programmer's point of view or the socket programmer's point of
view. I only understand something of the latter, which is explained
below.
</blockQuote>
<blockQuote>
The man pages for socket(2), bind(2), listen(2), accept(2) and
select(2) explain things quite well. The "info" pages for glibc are
also a good source.
</blockQuote>
<blockQuote>
The final (presumably desirable) outcome of socket programming is to
create a "socket connection" of the form (LOCALIP:PORT::REMOTEIP:PORT)
which each of the processes (the local one and the remote one) can
<EM>treat</EM> like a file descriptor for reading from and writing to.
</blockQuote>
<blockQuote>
If a program wishes to handle multiple connections of this type, then
it must do this exactly in the way it would handle many files at the
same time---by forking, threading or running on thousands of
processors if possible
<IMG SRC="../gx/dennis/smily.gif" ALT=":-)"
height="24" width="20" align="middle">
</blockQuote>
<blockQuote>
The actual creation of the socket is handled by the kernel (in Linux)
or the network daemon (in the Hurd). What the socket programmer does
is to tell the kernel that
</blockQuote>
<blockQuote><ol>
<LI>a socket is needed via "socket"
<LI>is to be bound to LOCALIP:PORT via "bind"
<LI>to listen for (and queue) incoming connections via "listen"
<LI>to accept a queued incoming (completed with REMOTEIP:PORT
connection via "accept"
</ol></blockQuote>
<blockQuote>
A file handle/descriptor is created in step (d). At this point the
programmer must decide whether the program will handle multiple calls
or not; in case the program(mer) feels energetic enough
<IMG SRC="../gx/dennis/smily.gif" ALT=":-)"
height="24" width="20" align="middle"> the process
forks or creates a new thread which then interacts with this
particular file descriptor.
</blockQuote>
<blockQuote>
The "select" call is a mechanism by which the program notifies the
kernel that it is waiting to "accept" and the kernel notifies the
program when there is something to "accept".
</blockQuote>
<blockQuote>
<IMG SRC="../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [JimD]
I think the gist of his question was: How does the system disambiguate
among multiple connection <EM>to</EM> the same TCP port?
</blockQuote>
<blockQuote>
The (short) answer is: All sockets (at any given point in time) are a
unique combination of the following: source IP address, source port,
destination IP address and destination port (and protocol, UDP or TCP).
Thus the kernel internally routes data to the correct socket by looking
at the source port as well as the the destination port.
</blockQuote>
<blockQuote>
I hope that's sufficient.
</blockQuote>
<!-- end 4 -->
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
<h5>
<br>Copyright &copy; 2003
<br>Copying license <A HREF="">http://www.linuxgazette.com/copying.html</A>
<BR>Published in Issue 86 of <i>Linux Gazette</i>, January 2003</H5>
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<SMALL><CENTER><H6 ALIGN="center">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>
</H6></SMALL></CENTER>
<HR>
<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 WIDTH="380">
<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">News Bytes</FONT></STRONG></BIG></BIG>
<BR>
<STRONG>By <A HREF="../authors/conry.html">Michael Conry</A></STRONG>
</CENTER>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
</p><center>
<table cellpadding="7"><tbody><tr><td>
<img src="../gx/bytes.gif" border="1" alt="News Bytes">
</td><td>
<h3>Contents:</h3>
<ul>
<li><a href="#leg">Legislation and More Legislation</a>
</li><li><a href="#links">Linux Links</a>
</li><li><a href="#conferences">Conferences and Events</a>
</li><li><a href="#general">News in General</a>
</li><li><a href="#distro">Distro News</a>
</li><li><a href="#commercial">Software and Product News</a>
</li></ul>
</td></tr></tbody></table>
<strong>Selected and formatted by <a href="mailto:michael.conry@softhome.net">Michael Conry</a></strong>
</center>
<p> Submitters, send your News Bytes items in
<font size="+2"><strong>PLAIN TEXT</strong></font>
format. Other formats may be rejected without reading. You have been
warned! A one- or two-paragraph summary plus URL gets you a better
announcement than an entire press release. Submit items to
<a href="mailto:gazette@ssc.com">gazette@ssc.com</a>
</p><hr> <p>
<!-- =================================================================== -->
</p><h3><img alt=" " src="../gx/bolt.gif">
<font color="green">
January 2003 <i>Linux Journal</i>
</font>
</h3>
<img alt="[issue 105 cover image]" src="misc/bytes/lj-cover105.png" width="200" height="268" align="left" hspace="20">
The January issue of <a href="http://www.linuxjournal.com/"><i>Linux
Journal</i></a> is on newsstands now.
This issue focuses on Networking/Telecom. Click
<a href="http://www.linuxjournal.com/modules.php?op=modload&amp;name=NS-lj-issues/issue105&amp;file=index">here</a>
to view the table of contents, or
<a href="http://www.linuxjournal.com/subscribe/">here</a>
to subscribe.
<p>
<font color="green">All articles older than three months are available for
public reading at
<a href="http://www.linuxjournal.com/magazine.php">http://www.linuxjournal.com/magazine.php</a></font>.
Recent articles are available on-line for subscribers only at
<a href="http://interactive.linuxjournal.com/">http://interactive.linuxjournal.com/</a>.
<BR CLEAR="all">
<!-- =================================================================== -->
<a name="leg"></a>
<p><hr><p>
<!-- =================================================================== -->
<center><H3><font color="green">Legislation and More Legislation</font></H3></center>
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">ElcomSoft Innocent
</FONT>
</H3>
The first criminal trial under the
<a
href="http://www.eff.org/IP/DMCA/hr2281_dmca_law_19981020_pl105-304.html">
Digital Millennium Copyright Act</a>
(DMCA) has resulted in a
<a href="http://www.theregister.co.uk/content/55/28612.html">
not-guilty verdict</a>. The history of this case goes
back to July 2001, when a soon to be famous Russian programmer by the name
of Dmitry Sklyarov was arrested while attending Defcon in Las Vegas. He
had come to the attention of the authorities through his work for software
company ElcomSoft on a computer
program capable of removing copy protection on documents created
using the Adobe ebook format. Sklyarov's presentation at Defcon was on the
subject of the weak protections offered by this ebook format
<P>
Dmitry's incarceration was to last 3 weeks, subsequent to which he was
required to remain in the United States for a further 6 months while
various legal details were hammered out. The result was that Dmitry would
not have to face prosecution.
Instead his employer, <a href="http://www.elcomsoft.com/">ElcomSoft</a>,
would have to face the charges, and Dmitry would be obliged to return to
the US to testify in the trial.
In the course of these events, widespread public opinion was sympathetic to
Dmitry's plight, and this was likely a factor in Adobe's distancing itself
from the case. Notwithstanding this, Adobe is still (as reported by The
Register) a
<a href="http://www.theregister.co.uk/content/6/28654.html">
strong supporter</a>
of the DMCA, and advocates further criminal prosecutions.
<P>
In the intervening period leading up to the current trial, unsuccessful
attempts were made to pre-emptively stop the prosecution based on
challenges to the constitutionality of the DMCA law. These arguments were
based on assertions of the right to free speech (including the rights of
third parties to fair use of copyright materials), and also on a
claim that the law was so vague as to be unconstitutional.
Judge Ronald Whyte
<a href="http://www.eff.org/sc/sklyarov/20020508_dismiss_deny_order.html">
dismissed these motions</a> in May 2002. Although the Judge accepted that
computer code was free speech, he asserted that the DMCA was content
neutral and thus dealt with computer programs on the basis of its
<em>purpose</em>, rather than its <em>content</em>. He also decided that
no fair use was prohibited by the DMCA, while acknowledging that many uses
may be made substantially more difficult. Whyte also ruled that the law
was sufficiently precise to be constitutional.
This decision is a significant victory for the DMCA supporters, as was
noted by Lewis Clayton in his
<a href="http://www.law.com/servlet/ContentServer?pagename=OpenMarket/Xcelerate/View&c=LawArticle&cid=1039054489470&t=LawArticleIP">
review of IP cases in 2002</a>, and strengthens the legitimacy of the law.
<P>
Following some difficulties with visas and the US State Department, Dmitry
and Alex Katalov (chief executive of ElcomSoft)
<a href="http://www.theregister.co.uk/content/6/28352.html">
finally travelled to California</a>
in December 2002 for the trial. Some transcripts from the trial have been
made <a href="http://cryptome.org/usa-v-elcom-dt.htm"> available
online</a>. Additionally, Lisa Rein has done a good job of
<a href="http://www.onlisareinsradar.com/archives/us_vs_elcomsoft_my_trial_coverage/">
reporting on the court proceedings</a>. A significant point on which the
trial hinged was whether ElcomSoft <em>wilfully</em> broke the law. It
was the jury's opinion that while ElcomSoft's product may have violated the
DMCA, they did not distribute it while aware of this infringement. The
open manner in which the product was distributed contributed to this image.
The jury is also reported as
<a href="http://www.onlisareinsradar.com/archives/us_vs_elcomsoft_others_trial_coverage/">
having difficulties</a>
with the severe curtailment of users' rights inherent in the application of
the DMCA to the ebook format.
<P>
The consequences of the verdict are unclear. Don Marti believes it is a
<a href="http://www.ssc.com/pipermail/atc/2002-December/000029.html">
hugely positive development</a>, and that Federal prosecutors will be slow
to attempt another DMCA criminal case given the failure of the ElcomSoft
prosecution. Linux Weekly News is
<a href="http://lwn.net/Articles/18304/">
less upbeat</a>, and sees this primarily as a victory for ElcomSoft. The
point is made that it has now been shown that the DMCA can lead to
"expensive criminal trials and arrests, even if they win in the end". This
is only partly true, since as Don points out, the Federal authorities will
only prosecute cases they believe can be won, and the ElcomSoft verdict
raises the standard of evidence required to justify such an opinion.
However, the civil-law provisions of the DMCA can also be used to cripple
smaller companies with the burden of an expensive DMCA defence, and it is
at the discretion of the complainant if and when to bring such cases.
<P>
Below is a quasi-random selection of the recent media reporting on the
case, arranged in approximately chronological order.
<ul>
<li>
<a href="http://zdnet.com.com/2100-1106-976821.html">
Gov't tightens its case in hacking trial</a> [ZDNet]
</li>
<li>
<a href="http://www.wired.com/news/business/0,1367,56703,00.html">
Opening Salvos in ElcomSoft Trial</a> [Wired]
</li>
<li>
<a href="http://www.siliconvalley.com/mld/siliconvalley/business/special_packages/security/4703904.html">
ElcomSoft programmer takes stand</a> [SiliconValley.com]
</li>
<li>
<a href="http://www.theregister.co.uk/content/55/28510.html">
'I'm no hacker', Sklyarov tells US court</a> [The Register]
</li>
<li>
<a href="http://www.reuters.co.uk/newsArticle.jhtml?type=internetNews&storyID=1855398">
Trial told no proof of ebook piracy</a> [Reuters]
</li>
<li>
<a href="http://www.siliconvalley.com/mld/siliconvalley/business/special_packages/security/4711138.htm%5BDec">
Defense rests in ElcomSoft copyright trial</a> [SiliconValley.com]
</li>
<li>
<a href="http://news.com.com/2100-1023-976821.html">
Testimony ends in Adobe hacking trial</a> [News.com]
</li>
<li>
<a href="http://www.theregister.co.uk/content/6/28587.html">
Jury scrutinises DMCA in ElcomSoft case</a> [The Register]
</li>
<li>
<a href="http://www.wired.com/news/business/0,1367,56853,00.html">
ElcomSoft Jury Asks for Law Text </a> [Wired]
</li>
<li>
<a href="http://news.com.com/2100-1023-978176.html">
ElcomSoft verdict: Not guilty</a> [News.com]
</li>
<li>
<a href="http://www.freep.com/money/business/bnews18_20021218.htm">
Firm beats digital copyright charge</a> [Detroit Free Press]
</li>
<li>
<a href="http://www.2600.com/news/display/display.shtml?id=1468">
ElcomSoft found innocent in DMCA case</a> [2600]
</li>
<li>
<a href="http://www.tomshardware.com/technews/20021219_044623.html">
Software Hackers 1, DMCA 0</a> [Tom's Hardware]
</li>
<li>
<a href="http://www.wired.com/news/business/0,1367,56898,00.html">
Verdict Seen As Blow to DMCA</a> [Wired]
</li>
</ul>
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">DVD Jon
</FONT>
</H3>
<P>
Jon Johansen is another young man who
<a href="http://www.eff.org/IP/Video/DeCSS_prosecutions/Johansen_DeCSS_case/20021206_eff_pr.html">
has found himself in court</a>
in the past month as a consequence of his involvement in software
development. Jon's case began three years ago, when the young Norwegian
participated in the development of the DeCSS program. The purpose of DeCSS
was to allow playback of DVD movies on systems, such as Linux, which lacked
DVD playback software. Though Johansen has been strongly associated with
the DeCSS software,
<a href="http://www.linuxworld.com/linuxworld/lw-2000-01/lw-01-dvd-interview.html">he is keen to point out</a>
that he was only a
<a href="http://www.free-dvd.org.lu/css-chain-of-events.txt">minor collaborator</a>
in its development. However, the other collaborators in the project have
remained anonymous, leaving Johansen
<a href="http://www.aftenposten.no/english/local/article.jhtml?articleID=451580">facing criminal charges</a>
in a Norwegian court.
<P>
Though Jon could have faced up to 2 years in jail, the prosecution has
sought a sentence of
<a href="http://www.aftenposten.no/english/local/article.jhtml?articleID=456698">3 months probation</a>
along with
<a href="http://www.afterdawn.com/news/archive/3658.cfm">
payment of US$1400 court fees and confiscation of his computers</a>
should he be found guilty. Jon has strongly
<a href="http://www.aftenposten.no/english/local/article.jhtml?articleID=452751">defended his innocence</a>.
<a href="http://www.aftenposten.no/english/local/article.jhtml?articleID=452976">Prosecution questioning</a> appears to have
<a href="http://www.aftenposten.no/english/local/article.jhtml?articleID=453595">focused</a> on the possible use of DeCSS for DVD piracy. Johansen has
argued that although DeCSS could possibly be used in some forms of piracy,
piracy is entirely possible and quite easy even without DeCSS. The primary
purpose of DeCSS is the playback of DVDs that customers have legally
purchased. A verdict is expected early in January 2003.
<P>
It is worth putting this case in the context of other cases which have been
taken in the US to suppress DeCSS. Cryptome has a
<a href="http://cryptome.org/mpaa-v-decss.htm">
large number</a> of documents relating to these cases,
<a href="http://www.eff.org/IP/Video/DeCSS_prosecutions/">
as does the EFF</a>. Of particular interest is
Jon Johansen's
<a href="http://www.eff.org/IP/DMCA/MPAA_DVD_cases/20000720_ny_trial_transcript.html">
testimony</a>
in the New York DeCSS trial, where he gives much of the background to these
cases. Though Jon's trial relates to the actual development of the
software and breaking protection on a DVD, in the case of the NY trial the
issue concerned the legality of simply linking to DeCSS on the internet.
Many have objected strongly to these draconian prosecutions, and have
ridiculed the law by finding novel, clever or humorous ways to
<a href="http://www-2.cs.cmu.edu/~dst/DeCSS/Gallery/index.html">
distribute DeCSS</a>. An example is Phil Carmody's
<a href="http://www.theregister.co.uk/content/6/21591.html">
publication of a prime number</a>
which is also, neatly, a valid DeCSS executable. This follows from his
<a href="http://asdf.org/~fatphil/maths/illegal1.html">
first "illegal" prime</a> which contains the DeCSS source code.
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">The Yes Men
</FONT>
</H3>
<P>
<a href="http://www.theregister.co.uk/content/6/28573.html">
The DMCA has also found use</a>
in efforts to silence
a group of satirical impostors, known as
<a href="http://theyesmen.org/">
The Yes Men</a>.
A parody website, which was located at www.dow-chemical.com, was
constructed to draw attention to the 18 year legacy of the Union Carbide
chemical disaster in Bhopal, India which killed 20,000 people.
Union Carbide is now a part of the larger Dow company.
On the 18th anniversary of the tragedy, a hoax press release was issued,
purporting to be from Dow and addressing why Dow was unable to accept
responsibility for the injuries and deaths.
<blockquote>
"We understand the anger and hurt," said Dow Spokesperson Bob Questra.
"But Dow does not and cannot acknowledge responsibility. If we did, not
only would we be required to expend many billions of dollars on cleanup
and compensation--much worse, the public could then point to Dow as a
precedent in other big cases."
</blockquote>
<P>
Dow's reaction was one of anger, and
<a href="http://theyesmen.org/dow/Dow-Chemical_DMCAnotice.pdf">a letter</a>
was sent to the site's upstream provider verio.com requiring the removal of
the website. This communication served notice of a violation of the DMCA
(the parody used logos and designs from the original Dow website),
and this effectively obliged Verio to take immediate action. Verio withdrew
service to Thing.net, the New York activist oriented ISP hosting The Yes
Men's site. This action simultaneously took down a range of unrelated arts
based websites. Subsequently, Verio has served notice that Thing.net must
relocate to another provider
<a href="http://rtmark.com/thingpr.html">within 60 days</a>, after which
point service will be terminated.
<P>
As well as intimidating the service providers, Dow succeeded in taking
control of the www.dow-chemical.com domain name (which it turns out they
owned, as it was registered by the pranksters in the name of James Parker,
son of the Dow CEO). Nevertheless, the website can be viewed at numerous
mirrors.
A list of current mirrors can be found in
<a href="http://theyesmen.org/dow/">
The Yes Men's account of events</a>. The original press release is also
included.
<a name="links"></a>
<p><hr><p>
<!-- =================================================================== -->
<center><H3><font color="green">Linux Links</font></H3></center>
<P>
Australian newspaper, The Age, has published
<a href="http://www.theage.com.au/articles/2002/12/26/1040511127721.html">
an interview</a>
with Rick Moen (yes, <EM>the</EM> <A HREF="../authors/moen.html">Rick
Moen</A> of The Answer Gang).
<P>
LinuxDevices.com has published
<a href="http://www.linuxdevices.com/articles/AT6476691775.html">
the proceedings from the Fourth Real-Time Linux Workshop</a>
held December 6-7, 2002 in Boston.
<P>
Some links of particular interest from
<a href="http://www.lwn.net/">Linux Weekly News</a>:
<ul>
<li>
Dave Jones
<a href="http://www.codemonkey.org.uk/post-halloween-2.5.txt">
explains</a> what's new in the 2.5 kernel and what problems 2.4 users
might encounter if they upgrade.
</li>
<li>
<a href="http://lwn.net/Articles/17930/">
Germany sees security in Linux</a>
</li>
<li>
<a href="http://lwn.net/Articles/18662/">
klisa security update</a>
</li>
<li>
KDE 2.x and KDE 3.x <a href="http://lwn.net/Articles/18709/"> fails to
quote arguments to shell commands properly</a>. No exploits are known,
but updates have been released.
</li>
<li>
<a href="http://www.theregister.co.uk/content/6/28684.html">
EU copyright deadline</a>.
</li>
<li>
Nvidia
<a href="http://www.prnewswire.com/cgi-bin/stories.pl?ACCT4&STORY=/www/story/12-12-2002/0001856658&EDATENvidia">
releases faster Linux drivers for its graphics cards</a>.
They are freely distributable, but the source is closed.
</li>
</ul>
<P>
An encouraging
<a href="http://www.siliconvalley.com/mld/siliconvalley/business/technology/personal_technology/4746642.htm">
Siliconvalley.com report</a> on the accessibility of Linux to new users.
<P>
<a href="http://linux.oreillynet.com/pub/a/linux/2002/12/12/vanishing.html">
Vanishing Features of the 2.6 Kernel</a>.
<P>
Dustin Puryear
<a href="http://linux.oreillynet.com/pub/a/linux/2002/12/05/samba.html">
explores recent enhancements</a>
to <a href="http://www.samba.org/">Samba</a>.
(Dustin</A> is also an LG author.)
<P>
The
<a href="http://www.bbc.co.uk/">BBC</a>
<a href="http://newsvote.bbc.co.uk/1/hi/technology/2540179.stm">
reports</a> on free software, as explained by Richard Stallman.
<P>
Fitting a
<a href="http://www.oreillynet.com/pub/a/oreilly/cprog/news/albatross_1202.html">
computer to an albatross</a>.
<P>
Some interesting stories from
<a href="http://www.theregister.co.uk/">The Register</a>:
<ul>
<li>
Amnesty criticises tech giants for
<a href="http://www.theregister.co.uk/content/6/28349.html">
'aiding' Chinese human rights abuse</a>.
</li>
<li>
Open Source
<a href="http://www.theregister.co.uk/content/4/28461.html">
makes inroads in the EU</a>.
</li>
<li>
<a href="http://www.theregister.co.uk/content/55/28628.html">
SSH flaws sighted</a>. OpenSSH appears to be safe though.
</li>
</ul>
<P>
<a href="http://newsforge.com/article.pl?sid=02/12/21/1536254&mode=thread&tid=19">
Newsforge commentary on teaching GNU/Linux to new users</a>.
<P>
<a href="http://www.pcworld.com/news/article/0,aid,108163,00.asp">
PC World article</a> reporting a study which says that the appeal of Linux
is emotional rather than technical.
<P>
Tinyminds.org have
<a href="http://www.tinyminds.org/modules.php?op=modload&name=News&file=article&sid=845">
interviewed kernel developer Robert Love</a>. He discusses some issues
relating to the current development kernel series, and how new features
will manifest themselves for desktop users.
<P>
Some links highlighted by Linux Today:
<ul>
<li>
NewsFactor article
<a href="http://www.newsfactor.com/perl/story/20238.html">
on alternative web browsers</a>, focus is on Konqueror and Opera.
</li>
<li>
<a href="http://www.petitiononline.com/gnu2003/">
Brazilian petition</a> (Portuguese) of President-elect Lula, urging him
to favour free software over proprietary alternatives.
</li>
<li>
Linux Productivity Magazine
<a href="http://www.troubleshooters.com/lpm/200212/200212.htm">
has run an issue focusing on VI and Vim</a>.
</li>
<li>
The Samaritans
decides
<a href="http://news.bbc.co.uk/1/hi/technology/2543173.stm">
to use Linux</a>.
</li>
</ul>
<P>
Linux and Main,
<a href="http://www.linuxandmain.com/modules.php?name=News&file=article&sid=300">
rewindable desktops</a>. Summarises
<a href="http://mail.gnome.org/archives/desktop-devel-list/2002-December/msg00251.html">
a paper</a>
by <a href="http://www.xach.com/bjp/">Bowie J. Poag</a>.
<P>
Some links of interest from
<a href="http://www.linuxjournal.com/"><em>Linux Journal</em></a>.
<ul>
<li>
<a href="http://www.linuxjournal.com/article.php?sidd87">
The Real Battle at Comdex:</a> Intellectual Property vs. Internet Protocol
</li>
<li>
<a href="http://www.linuxjournal.com/article.php?sidd53">
E-mail as a System Console, Part I</a>
explains how you can use procmail and fetchmail to build a
program that will let you remotely control when a system makes a
dial-up connection, how long it stays connected and when it
disconnects. Part I explains the project and links to Part II.
</li>
<li>
<a href="http://www.linuxjournal.com/article.php?sid=6514&mode=thread&order=0">
Book review</a> of The Business and Economics of Linux and Open Source.
</li>
<li>
An introduction to the
<a href="http://www.linuxjournal.com/article.php?sid=6463">
concepts of linking and loading in Linux</a>
and why shared libraries are so useful.
</li>
<li>
A <a href="http://www.linuxjournal.com/article.php?sid=6476">
discussion of Bluecurve</a>.
</li>
<li>
Phil Hughes, publisher of Linux Journal, has
<a href="http://www.linuxjournal.com/article.php?sid=6486">
announced a new mailing list</a>
for people involved in moving government offices to open source,
providing a forum for the questions, problems and solutions they all
face in their work.
</li>
</ul>
<P>
<a href="http://www.bbspot.com/News/2002/12/santa_linux.html">
Santa considers switch to Linux</a>, Red Hat is frontrunner.
<P>
LinuxSecurity.com
has reported that despite the availability of fixes
<a href="http://www.linuxsecurity.com/feature_stories/feature_story-132.html">
attackers are still compromising servers with well known attacks</a>. The
article has tips on improving security and security awareness.
Some interesting links from
<a href="http://slashdot.org/">Slashdot</a>:
<ul>
<LI>
<A HREF="http://www.linuxlookup.com/modules.php?op=modload&name=News&file=article&sid=381">Using Your iPod Under Linux</A>
<li>
<a href="http://slashdot.org/articles/02/11/28/2237218.shtml?tid2">
ATI cards on Linux</a>.
</li>
<li>
Rivals Sony and Matsushita agree to
<a href="http://slashdot.org/articles/02/12/18/1948257.shtml?tid3">
jointly develop a version of Linux</a>
for their consumer electronics products.
</li>
<li>
Lawrence Lessig
<a href="http://www.cioinsight.com/article2/0,3959,762935,00.asp">
explains the different effects of copyright</a>
on books and e-books.
</li>
</ul>
<a name="conferences"></a>
<p><hr><p>
<!-- =================================================================== -->
<center><H3><font color="green">Upcoming conferences and events</font></H3></center>
<P> Listings courtesy <EM>Linux Journal</EM>. See <EM>LJ</EM>'s
<A HREF="http://www.linuxjournal.com/events.php">Events</A> page for the
latest goings-on.
<P>
<table cellpadding=5 border=0 width=100%>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>Consumer Electronics Show</b><BR>
<td valign=top>January 9-12, 2003<BR>Las Vegas, NV<BR>
<a href="http://www.cesweb.org/" target="_blank">
http://www.cesweb.org/</A><BR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>LinuxWorld Conference & Expo</b><BR>
<td valign=top>January 21-24, 2003<BR>New York, NY<BR>
<a href=""http://www.linuxworldexpo.com/linuxworldny03/V33/index.cvn target="_blank">
http://www.linuxworldexpo.com/</A><BR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>O'Reilly Bioinformatics Technology Conference</b><BR>
<td valign=top>February 3-6, 2003<BR>San Diego, CA<BR>
<a href="http://conferences.oreilly.com/" target="_blank">
http://conferences.oreilly.com/</A><BR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>Game Developers Conference</b><BR>
<td valign=top>March 4-8, 2003<BR>San Jose, CA<BR>
<a href="http://www.gdconf.com/" target="_blank">
http://www.gdconf.com/</A><BR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>SXSW</b><BR>
<td valign=top>March 7-11, 2003<BR>Austin, TX<BR>
<a href="http://www.sxsw.com/interactive" target="_blank">
http://www.sxsw.com/interactive</A><BR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>CeBIT</b><BR>
<td valign=top>March 12-19, 2003<BR>Hannover, Germany<BR>
<a href="http://www.cebit.de/" target="_blank">
http://www.cebit.de/</A><BR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>4th USENIX Symposium on Internet Technologies and Systems</b><BR>
<td valign=top>March 26-28, 2003<BR>Seattle, WA<BR>
<a href="http://www.usenix.org/events/" target="_blank">
http://www.usenix.org/events/</A><BR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>PyCon DC 2003</b><BR>
<td valign=top>March 26-28, 2003<BR>Washington, DC<BR>
<a href="http://www.python.org/pycon/" target="_blank">
http://www.python.org/pycon/</A><BR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>AIIM</b><BR>
<td valign=top>April 7-9, 2003<BR>New York, NY<BR>
<a href="http://www.advanstar.com/" target="_blank">
http://www.advanstar.com/</A><BR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>SD West</b><BR>
<td valign=top>April 8-10, 2003<BR>Santa Clara, CA<BR>
<a href="http://www.sdexpo.com/" target="_blank">
http://www.sdexpo.com/</A><BR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>COMDEX Chicago</b><BR>
<td valign=top>April 15-17, 2003<BR>Chicago, IL<BR>
<a href="http://www.comdex.com/chicago/" target="_blank">
http://www.comdex.com/chicago/</A><BR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>Real World Linux Conference and Expo</b><BR>
<td valign=top>April 29-30, 2003<BR>Toronto, Ontario<BR>
<a href="http://www.realworldlinux.com/" target="_blank">
http://www.realworldlinux.com</A><BR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>USENIX First International Conference on Mobile Systems,
Applications, and Services (MobiSys)</b><BR>
<td valign=top>May 5-8, 2003<BR>San Francisco, CA<BR>
<a href="http://www.usenix.org/events/" target="_blank">
http://www.usenix.org/events/</A><BR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>USENIX Annual Technical Conference</b><BR>
<td valign=top>June 9-14, 2003<BR>San Antonio, TX<BR>
<a href="http://www.usenix.org/events/" target="_blank">
http://www.usenix.org/events/</A><BR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>CeBIT America</b><BR>
<td valign=top>June 18-20, 2003<BR>New York, NY<BR>
<a href="http://www.cebit-america.com/" target="_blank">
http://www.cebit-america.com/</A><BR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>The Fourth International Conference on Linux Clusters:
the Linux HPC Revolution 2003</b><BR>
<td valign=top>June 18-20, 2003<BR>Las Vegas, NV<BR>
<a href="http://www.linuxclustersinstitute.org/Linux-HPC-Revolution"
target="_blank">
http://www.linuxclustersinstitute.org/Linux-HPC-Revolution</A><BR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>O'Reilly Open Source Convention</b><BR>
<td valign=top>July 7-11, 2003<BR>Portland, OR<BR>
<a href="http://conferences.oreilly.com/" target="_blank">
http://conferences.oreilly.com/</A><BR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>12th USENIX Security Symposium</b><BR>
<td valign=top>August 4-8, 2003<BR>Washington, DC<BR>
<a href="http://www.usenix.org/events/" target="_blank">
http://www.usenix.org/events/</A><BR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
<tr><td valign=top>
<b>LinuxWorld Conference & Expo</b><BR>
<td valign=top>August 5-7, 2003<BR>San Francisco, CA<BR>
<a href="http://www.linuxworldexpo.com" target="_blank">
http://www.linuxworldexpo.com</A><BR>
<tr><td colspan=2><HR size=5 width=100% noshade align=center></td></tr>
</table>
<a name="general"></a>
<p><hr><p>
<!-- =================================================================== -->
<center><H3><font color="green">News in General</font></H3></center>
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">iCanProgram
</FONT>
</H3>
<P>
Spaces are
<a href="http://newsvac.newsforge.com/article.pl?sid=3D02/12/17/1445213">still available</a>
for the
<a href="http://www.icanprogram.com">iCanProgram course</a>.
iCanProgram began a year ago, offering online programmer training courses
with a "no fee in return for a Cancer Research donation" format. Over the
course of 2002 more than 1500 students have participated.
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">GFDD
</FONT>
</H3>
<P>
Debian Weekly News
<a href="http://www.debian.org/News/weekly/2002/50/">reported on the
'stable' launch</a> of
<a href="http://www.gfdd.org/">GNUtemberg!
Free Documentation Database</a>, or GFDD. The GFDD is a free database for
free documentation, providing services such as indexing, translation
management, information on official publishing, document ratings,
statistics and search.
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">Galuna S.R.L.
</FONT>
</H3>
<P>
<a href="http://www.galuna.ro">Galuna S.R.L.</a> aims at supporting and
improving Linux for Romanian users. The company translated major parts of
GNOME desktop environment and helps new users migrate from Microsoft
products to Linux, increasing productivity while reducing costs and
software piracy rate which is very high in Romania.
<P>
To help clients benefit from open-source software advantages at high
quality standards, Galuna offers both standard and custom solutions. Visit
<a href="http://www.galuna.ro">www.galuna.ro</a>
for presentations of Linux advantages and available desktop applications.
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">IBM Ships New Linux Ready eServer Systems
</FONT>
</H3>
<P>
<a href="http://www.ibm.com">IBM</a>
has announced that it is shipping Linux ready IBM eServer pSeries systems.
Equipped with POWER4 processors, IBM claims the new eServer system costs
substantially less than a comparably configured Itanium 2 based system
<a href="http://www.e-solutions.hp.com">from Hewlett-Packard</a>.
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green"> rpmseek.com - New rpm search engine
</FONT>
</H3>
<P>
The new Linux portal
<a href="http://www.rpmseek.com">www.rpmseek.com</a> claims to offer users
of the Linux operating system a convenient search engine for rpm packages.
The packages can be searched by various criterions, such as package name,
file name, distribution, keywords, dependencies or files that a package
contains. Dependecies between packages are resolved by cross references.
<P>
For every rpm package there are numerous detailed informations collected,
links to different mirror servers are listed for the download in
geographically arranged order. Another highlight is the classification of
all rpm packages into categories. This way, a special software type or
functionality can be found by browsing the tree structure of the
categories. The site also aims to offer a range of documentation and
discussion groups.
<a name="distro"></a>
<p><hr><p>
<!-- =================================================================== -->
<center><H3><font color="green">Distro News</font></H3></center>
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">Debian
</FONT>
</H3>
<P>
<a href="http://www.debian.org/">
The Debian Project</a> has
<a href="http://www.debian.org/News/2002/20021216">
updated</a> the current stable release (Woody) to
Debian GNU/Linux 3.0 updated (r1).
This update has involved the
<a href="http://people.debian.org/~joey/3.0r1/">
acceptance and rejection</a> of some packages. The total list of changes
for both the
<a href="http://http.us.debian.org/debian/dists/Debian3.0r1/ChangeLog">
regular</a>
and
<a href="http://non-us.debian.org/debian-non-US/dists/Debian3.0r1/non-US/ChangeLog">
non-US</a>
branches can be viewed online
<P>
<hr width="20%" noshade>
<P>
Debian Weekly News
<a href="http://www.debian.org/News/weekly/2002/47/">
reported</a>
that
<a href="http://www.apt-get.org/">
apt-get.org</a>
is now up and running. It maintains a list of unofficial APT repositories.
<P>
<hr width="20%" noshade>
<P>
Debian Weekly News
<a href="http://www.debian.org/News/weekly/2002/48/">
also highlighted</a>
two resources which would be of some use to those customising Debian.
Martin Sj&#246;gren
<a href="http://lists.debian.org/debian-boot-0212/msg00153.html">
has made available</a>
<a href="http://people.debian.org/~sjogren/d-i/">
scripts</a>
for building CD images based on the new debian-installer. This is of use
in
<a href="http://people.debian.org/~sjogren/d-i/_README">
putting together</a>
small CD images. Also of interest is Create your first Debian Package.
Clemens Lee's new Mini-HOWTO entitled
"<a href="http://www.kclee.com/clemens/unix/HowToCreateYourOwnDebianPackage.html">
How to Create Your First Debian Package</a>", which describes how to create
a Debian package for installation on one's own computer, rather than for
<a href="http://www.debian.org/doc/maint-guide/">
inclusion into the official Debian archives</a>.
<P>
<hr width="20%" noshade>
<P>
<a href="http://www.desktoplinux.com/">
DesktopLinux</a>
has published an
<a href="http://www.desktoplinux.com/articles/AT2559097045.html">
interview</a>
Colin Walters of the Debian Desktop subproject
<P>
<hr width="20%" noshade>
<P>
DebianPlanet have published an article describing the process of
<a href="http://www.debianplanet.org/node.php?id=880">
downgrading from Sarge to Woody with Debian</a>.
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">Mandrake
</FONT>
</H3>
<P>
In the past month,
<a href="http://www.mandrakelinux.com/en/">
MandrakeSoft</a>
has
<a href="http://www.mandrakelinux.com/en/future.php3">
publicised financial difficulties</a>
that could threaten the future of the business. The company has appealed
for more users to contribute financially through the purchase of Mandrake
products, or by investing directly in the company.
It is also hoped that the
<a href="http://www.theregister.co.uk/content/4/28618.html">
introduction of commercial licences</a> will help generate larger revenue
streams, though Mandrakesoft is at pains to emphasise that this does not
represent a retreat from Free Software.
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">Rock
</FONT>
</H3>
<P>
ROCK Linux 1.5.20 has been
<a href="http://newsvac.newsforge.com/article.pl?sid=3D02/12/03/127243">
released</a>.
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">Slackware
</FONT>
</H3>
<P>
<a href="http://www.slackware.org/">Slackware</a> 8.1
has recently been reviewed
<a href="http://www.unixreview.com/documents/s=7459/uni1038933601489/">
by Unix Review</a> and
<a href="http://www.distrowatch.com/review-slackware.php">
by Distrowatch</a>.
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">SuSE
</FONT>
</H3>
<P>
<a href="http://www.suse.de/en/">
SuSE Linux</a>
has announced that the German city of Schw&#228;bisch Hall (population
36,000) will build its IT infrastructure entirely on SuSE Linux - replacing
a more costly Windows installation. The town will deploy SuSE Linux on IBM
Intel-based servers as well as up to 400 PCs - saving the city an estimated
amount of more than one hundred thousand Euro over the Windows
installation.
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">Xandros Desktop
</FONT>
</H3>
<P>
DistroWatch has published a
<a href="http://www.distrowatch.com/review-xandros.php">
review of Xandros Desktop 1.0</a>.
<a name="commercial"></a>
<p><hr><p>
<!-- =================================================================== -->
<center><H3><font color="green">Software and Product News</font></H3></center>
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">ActiveState PureMessage: email protection
</FONT>
</H3>
<P>
<a href="http://www.ActiveState.com">
ActiveState Corp.</a>,
a producer of email gateway filtering systems, has released PureMessage 3.0
(formerly PerlMx), an update of its anti-spam, anti-virus, and policy
compliance solution. PureMessage 3.0 provides IT administrators with new
features including a web-based administration console, enhanced spam
identification and management flexibility, optional end user quarantine
management, next generation anti-spam heuristics, and the McAfee anti-virus
engine. The product is aimed at mid to large sized organisations.
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">SCO Update and UnixWare 7.1.3
</FONT>
</H3>
<P>
<a href="http://www.sco.com">
The SCO Group</a>
has announced the launch of
<a href="http://www.sco.com/services/upgrade/scoupdate/">
SCO Update Service</a>,
a new program that is claimed to make the upgrade process for SCO operating
systems more efficient and less costly. The service is available for SCO
Linux 4.0, UnixWare 7.1.3 and will be available for SCO OpenServer 5.0.7
when it ships early next year.
<P>
The Update Service simplifies and streamlines the process of deploying
new technology and keeping deployed systems up-to-date. This
service provides electronic notification and delivery of operating system
changes, gives the system administrator control of the upgrade process and
helps customers accurately budget for the cost of system upgrades.
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">Farpointer
</FONT>
</H3>
<P>
<a href="http://www.farpointer.com">
Farpointer Technologies</a>
has announced a new automated session management tool for the Apache
server. The company's <a href="http://www.i-conductor.com">iConductor server module</a>
interacts with HTML files to automatically implement session tracking via
any URL. In addition, iConductor manages simple key/values as well as
complex documents such as Web Services requests and replies. These
features save a significant amount of developer time in building
Internet-based applications. A free trial version of iConductor and
an online demonstration are available online.
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">CylantSecure free for personal use
</FONT>
</H3>
<P>
<a href="http://www.cylant.com">
Cylant</a>, a provider of host-based intrusion prevention systems for the
Linux server platform, has announced that it is offering the newest version
of CylantSecure (2.0.2) free for personal use.
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">ProjectForum
</FONT>
</H3>
<P>
<a href="http://www.courseforum.com/projectforum/">
ProjectForum</a>
provides a solution for flexible workgroup collaboration and coordination
of projects over the web. It can be used for project planning, todo lists,
design notes, task assignments, meeting notes, problem reports, team
discussions, collecting feedback, research, brainstorming and more.
Version 1.1 (the first public release) is now available, with versions for
Linux, as well as Windows, MacOS X, and FreeBSD.
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">ActiveState Updates Perl Development Portfolio
</FONT>
</H3>
<P>
<a href="http://www.ActiveState.com">
ActiveState</a> has announced new releases of its Perl
tools and language distribution: Perl Dev Kit (PDK) 5.0, Visual Perl 1.7,
and ActivePerl 5.8. The Perl Dev Kit features tools for building and
deploying Perl applications. Visual Perl is the Perl plug-in for Visual
Studio .NET. ActivePerl is ActiveState's quality-assured distribution of
Perl, available for Linux, Solaris, and Windows.
<P> <hr> <P>
<!-- =================================================================== -->
<H3><IMG ALT=" " SRC="../gx/bolt.gif">
<FONT COLOR="green">Fast Hardware Backup of Big IDE Drives
</FONT>
</H3>
<P>
<a href="http://www.duplidisk.com">
Arco Data Protection Systems</a>, a provider of low cost IDE disk
mirroring (RAID 1) hardware, has announced the release of
<a href="http://www.arcoide.com/duplidisk3">
The DupliDisk3</a>.
DupliDisk3 facilitates maintenance up-to-the-minute backups of data and
software. The DupliDisk3 supports the Windows, LINUX , Macintosh and DOS
operating systems and works by creating an exact bootable replica of your
hard drive. The software is designed to handle drives as large as 131
Petabytes (131,072 Terabytes) and can provide copy speeds up to 48
Gigabytes per hour (800 Mbytes per minute).
<!-- =================================================================== -->
<!-- =================================================================== -->
<!-- *** BEGIN author bio *** -->
<P>&nbsp;
<P>
<P> Mick is LG's News Bytes Editor.
<!-- *** BEGIN bio *** -->
<P>
<IMG ALIGN="LEFT" VALIGN="top" ALT="[Picture]" SRC="../gx/2002/tagbio/conry.jpg"
WIDTH="128" HEIGHT="158">
<em>Born some time ago in Ireland, Michael is currently working on
a PhD thesis in the Department of Mechanical Engineering, University
College Dublin. The topic of this work is the use of Lamb waves in
nondestructive testing. GNU/Linux has been very useful in this work, and
Michael has a strong interest in applying free software solutions to
other problems in engineering. When his thesis is completed, Michael
plans to take a long walk.
</em>
<br CLEAR="all">
<!-- *** END bio *** -->
<!-- *** END author bio *** -->
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright &copy; 2003, Michael Conry.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 86 of <i>Linux Gazette</i>, January 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>
<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 WIDTH="380">
<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">An Undeletion Experience</FONT></STRONG></BIG></BIG>
<BR>
<STRONG>By <A HREF="../authors/artime.html">C.E.C. Artime</A> and <A HREF="../authors/baro.html">J.A. Baro</A></STRONG>
</CENTER>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
<EM>We describe an attempt of recovering data unadvertedly deleted on a ext2
filesystem. Aware that the course of events was far from desirable, we are
committed that our readers will not make the same mistakes and, in order
to illustrate the bunch of things that one can learn during a crisis, we
detail the whole story.</EM>
</p>
<h2>Prelude: the disaster spells</h2>
<h3>The arena</h3>
<h4>Hardware</h4>
<p>
Two boxes, called Fish and Bell. Fish is a Sun E250. Bell is a Pentium 3
(450 MHz). They are in the same Ethernet subnetwork.
</p>
<h4>Software</h4>
<p>
Bell runs Debian GNU/Linux 3.0r0 after a painless upgrade from 2.2r7. Kernel
is Linux 2.4.18.
</p>
<p>
Fish also runs a Debian 3.0r0, port Sparc64. A recent upgrade from 2.2r7
led to a unique problem: XFree does not work for normal users (it does for
<code>root</code>). Kernel is Linux 2.4.18-SMP.
</p>
<p>
All filesystems are <code>ext2</code>.
</p>
<h3>How we buggered it up</h3>
<p>
On Fish, Xfree works for <code>root</code>, but not for normal
users. <br /> Rationale: either a problem with permissions or user
configuration files. <br /> Solution: let us add a user and copy
<code>root</code>'s dot-files to its home directory:
<pre>
root@fish# adduser judas
Enter new UNIX password:
Retype new UNIX password:
root@fish# cp --recursive /root/.[a-zA-Z]* /home/judas
root@fish# chown --recursive judas:judas /home/judas/.*
</pre>
<p>
[Did you spot the difference between regexp arguments for
<code>cp</code> and <code>chown</code>?]
</p>
<p>
After enough trail &amp; error, the X problem is finally solved; it is
about time to remove the user. <br /> While trying to speed up the
procedure a bit, thorough study of a terse man page reveals an
appealing option:
</p>
<pre>
root@fish# deluser --remove-all-files judas
</pre>
<p>
Cha-ching! Enters disaster! The unfortunate option makes
<code>deluser</code> search the entire disk looking for files owned by
<code>judas</code> and erasing them!
</p>
<p>
Contents of <code>/home</code> disappeared. <br /> Two minutes later,
we unmounted its corresponding device (<code>/dev/sda8</code>).
</p>
<h2>Back-up</h2>
<h3>First attempt</h3>
<p>
First cares involve taking a copy of the raw bytes inside the doomed
device. <br /> There is no room in Fish, so let us make a copy onto
Bell's hard drive:
</p>
<pre>
root@fish# ftp bell
ftp&gt; put '|dd if=/dev/sda8' fishbackup
</pre>
<p>
In fact, this step was not so easy due to a problem with the net:
transmission of big files is interrupted after a while. The file must
be split. Partition <code>/dev/sda8</code> is size 10142 MiB. <br />
Resorting to the <code>factor</code> tool of GNU
<code>shellutils</code>:
</p>
<pre>
root@fish# factor 10142
10142: 2 11 461
</pre>
<p>
This led us to an appropriate size for each chunk of device.
</p>
<h3>Secure tunnelling</h3>
<p>
Instead FTP, we used the OpenSSL suite for the next step. <br />
First we interchange passwords in order to use batch mode:
</p>
<pre>
root@fish# ssh-keygen
artime@bell$ ssh-keygen
root@fish# scp /root/.ssh/identity.pub artime@bell:/home/artime/.ssh/authorized.keys
root@fish# scp artime@bell:~/.ssh/identity.pub ~/.ssh/authorized.keys
</pre>
<p>
Let us execute this script in Fish:
</p>
<pre>
#!/bin/sh
for i in $(seq 0 460)
do
dd if=/dev/sda8 bs=$((2*11*1024)) skip=$i of=fula
scp --batch fula artime@bell:~/fiback.$i
done
</pre>
<p>
Just join the pieces in Bell:
</p>
<pre>
for i in $(seq 0 460)
do cat fiback.$i &gt;&gt; fiback.raw
done
</pre>
<p>
Equivalently we could do the same in one step by executing in Fish:
</p>
<pre>
#!/bin/sh
for i in $(seq 0 460)
do
dd if=/dev/sda8 bs=$((2*11*1024)) skip=$i | ssh artime@bell "cat &gt;&gt; fiback.raw"
done
</pre>
<h2>Seeking lost data</h2>
<p>
We can resort to the <a
href="http://www.tldp.org/HOWTO/mini/Ext2fs-Undeletion.html">Linux
Ext2fs undeletion mini-HOWTO</a>, by Aaron Crane; the <a
href="http://www.tldp.org/HOWTO/mini/Ext2fs-Undeletion.html">Ext2fs
undeletion of directory structures mini-HOWTO</a>, by Tomas Ericsson;
the <a
href="http://recover.sourceforge.net/linux/recover">recover</a>
program by Tom Pycke; <a href="http://twerner.debian.net">Torsten
Werner</a>'s patch for debugfs working on i386.
</p>
<h3>Lazy attempt</h3>
<p>
<code>Recover</code> is a tool for recovering individual files. As in
our case we have suddenly lost hundreds of files, it seems this is not
the best choice to begin with. The most direct way is using Werner's
<code>debugfs</code> patch; we already have a copy of the damaged
filesystem stored in a i386 box, so we can use the binary found at
<code>twerner.debian.org</code>:
</p>
<pre>
artime@bell$ ./debugfs fishback.raw
debugfs&gt; restore
debugfs&gt; quit
artime@bell$ mkdir mnt
artime@bell$ mount -t ext2 -o loop fishback.raw mnt
artime@bell$ ls -l mnt
</pre>
<p>
We find no files there! It seems we unmounted <code>/dev/sda8</code> a little
too late. As T. Werner indicates on his page, his tool can only recover files
that still <i>have a name</i>.
</p>
<h3>It pays reading</h3>
<h4>Crane's undeletion howto</h4>
<p>
This tool we pick in <a href="http://www.tldp.org">The Linux
Documentation Project</a> taught us how to find the inodes (more or
less, the locations) of lost files and how to recover them with the
<code>dump</code> command of <code>debugfs</code>. We finish with a
lot of assorted files in the same directory, but they are just a small
subset of the deleted ones. As mentioned before, a thorough, file by
file recovery scheme as indicated in this HOWTO is unfeasible in our
case.
</p>
<h4>Ericsson's directory undeletion howto</h4>
<p>
Here we learnt how to tell between deleted files from directories. We
followed the indications. <br /> The script in section 7 was in need for
some further adaptation to our version of <code>debugfs</code>
</p>
<pre>
#!/bin/sh
awk '{ print "mi &lt;" $1 "&gt;\n"\
"\n\n\n\n\n\n\n"\
"0\n"\
"1\n"\
"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" }'
</pre>
<p>
Anyway, we fail to find the directory names and proceed to section 8. So
we must look elsewhere.
</p>
<h4>Man pages</h4>
<p>
A last chance was
</p>
<pre>
$ man debugfs
</pre>
<p>
where we found the command <code>rdump</code>, unmentioned in the
howtos. Applying the following script to the directory inodes located
in <code>lsdel.out</code> of section 6 of Ext2fs Undeletion of
Directory Structures mini-HOWTO:
</p>
<pre>
#!/bin/sh
awk '{ print "rdump &lt;" $1 "&gt; folders\n" }'
</pre>
<p>
most directories are recovered into the directory <code>folders</code>.
But unnamed! So finally we have to individually assign two hundred folders
to users by looking their contents! Even after that, we miss some files,
notably an e-mail box. Let us try a quest by hand:
</p>
<pre>
$ strings fishback.raw | grep -B1 -A99 "To: lisistrata" &gt; lisistrata.mbox
</pre>
<h2>Epilogue</h2>
<p>
Further things we would like to outline.
</p>
<h3>RTFM</h3>
And never use a new option as <code>root</code> for the first time.
<h3>Magnetic tapes</h3>
Fish has a magnetic tape unit. GNU <code>mt</code> and <code>tar</code> are
useful tools for a backup schedule. Aaron Crane's howto includes interesting
links regarding this issue.
<h3>Regexps</h3>
<p>
The use of regular expressions in shell commands is very dangerous, especially
when dealing with dot-files. Perhaps the superuser <code>root</code> should
use a shell with limited (rather than "extended") regular expression support.
We are considering
<a href="http://olympus.het.brown.edu/doc/esh/esh.html">esh</a>.
</p>
<h3>PDA</h3>
<p>
This article was mostly written with an <a
href="http://www.agendawiki.com">Agenda</a> <a
href="http://www.softfield.com">VR3</a>, a rather unique free software
PDA, in a beach of Gran Canaria.
</p>
<!-- *** BEGIN author bio *** -->
<P>&nbsp;
<P>
<!-- *** BEGIN bio *** -->
<P>
<img ALIGN="LEFT" ALT="[BIO]" SRC="../gx/2002/note.png">
<em>
C.E.C. Artime is a GNU fan and a free software advocator since 2000.
</em>
<br CLEAR="all">
<!-- *** END bio *** -->
<P> <!-- *** BEGIN bio *** -->
<P>
<img ALIGN="LEFT" ALT="[BIO]" SRC="../gx/2002/note.png">
<em>
J.A. Baro is a Linux user and a Perl hacker since 1996.
</em>
<br CLEAR="all">
<!-- *** END bio *** -->
<!-- *** END author bio *** -->
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright &copy; 2003, C.E.C. Artime and J.A. Baro.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 86 of <i>Linux Gazette</i>, January 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>
<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 WIDTH="380">
<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">I Broke the Console Barrier</FONT></STRONG></BIG></BIG>
<BR>
<STRONG>By <A HREF="../authors/bint.html">Stephen Bint</A></STRONG>
</CENTER>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
<P><B><CENTER><U>Colour text, keyboard and mouse under DOS and the Linux
console</U></CENTER></B>
<P>When I began using Linux I noticed that most Linux text editors are
rubbish, having little or no mouse support, no shift-selection and no
menus or file open dialogs. So I thought I could make a contribution, by
writing an editor which had all the features we have come to associate
with DOS editors, for the Linux console. Why shouldn't the better OS
have editors which are at least as good?
<P>So I searched for a library that would give me a colour text-mode
interface to both platforms and I found Slang and curses. Neither were
satisfactory. In order to provide an interface to a huge list of
platforms, many features possible at the Linux console were disabled.
Also, they were so big there was no prospect of customising them for my
own needs and bundling the modified versions with my own sources. Out of
frustration I set out to write my own.
<P>I set myself the target of producing an interface with the widest
possible range of ctrl- and alt- key combinations, a function to report
the state of shift, ctrl and alt keys, full mouse reporting (including
movement) and direct access to a screen array of EGA-style
character-colour pairs. I hoped to produce something small and simple
enough for programmers to bundle with their own source, so they could
modify it if they wish and distribute with confidence.
<H2>The Mouse</H2>
<P>Programming for the mouse was relatively easy. Under DOS, I just used
int86 and Ralf Brown's Interrupt List. Under Linux, I struggled for a
while and eventually mastered the gpm mouse driver, which has pretty
good docs and demo programs.
<H2>The Screen</H2>
<P>Finding out how to output colour text to the Linux screen was more of
a struggle. I was saved by an article at Linux Gazette called
<A HREF="../issue65/padala.html">"So You Like Color!!!"</A>.
I was shocked at what it said.
<P>Unlike DOS, under which characters and colours are written directly
to video memory as byte pairs, the Linux screen is refreshed by using
fwrite to write to stdout! Instead of a colour being written with each
character, the output colour must be changed whenever a character is a
different colour to the one written before it. Changing the output
colour involves writing an 11-byte string to stdout.
<P>Consequently, screen refresh is very slow under Linux. I did what I
could to speed it up. I keep a duplicate screen buffer which is updated
as the screen is refreshed. Comparing this to the screen buffer, I
refresh only parts of the screen which have changed. Even so, screen
refresh takes twenty times as long under Linux as it does under DOS.
<P>It is possible to access video memory in recent versions of Linux, by
opening /dev/vcsa as a file. (see man vcs for details) There are two
reasons not to do this. One is that only programs run by the superuser
are allowed to do it. The second is that only the US ASCII character set
is supported. At least with fwrite, the local character set is
respected, which is important because Linux is an international thing,
from its friendly welcome screen to its big, warm heart.
<P>I found out how to show, hide and position the text cursor by
examining the Slang sources and by using an excellent program bundled
with Slang, called untic. Untic reads the terminfo database and
translates it into human-readable form. (The terminfo database contains
the command strings to write to stdout to perform control operations on
any terminal.)
<P>There was one little niggle. Under Linux, box-drawing characters are
not part of the default character set. ASCII values which produce boxes
under DOS produce funny foreign letters under Linux unless you send a
string to stdout to switch to the alt character set. Switching to that
charset permanently was not an option. I wanted the library to be
international like Linux, supporting international character sets, so
what to do?
<P>I decided to use the high bit of the colour byte as a box bit.
Programmers wishing to draw boxes would have to set the box bit in the
colour for any characters they wish to be shown as box characters. This
meant that blinking text would not be available, because the high bit is
otherwise used for that, but I was happy. I never liked blinking text
anyway.
<H2>The Keyboard</H2>
<P>Interpreting keyboard events on either platform is a giant screaming
nightmare on stilts. Under DOS, the BIOS scancodes are so illogically
allocated, they might as well be random numbers. Under Linux, the
terminal has to be specially prepared and then, the function keys
generate strings of bytes which need to be converted to scancodes
through a lookup table.
<P>It was almost inconceivable to convert Linux key events to DOS, or
vice versa. I decided instead, to produce a pure key function, which
would report a key value which is unaffected by control or alt, but will
be shifted if shift is pressed. Programmers wishing to use a ctrl- or
alt-key combination for a hot key could examine the keyboard status word
seperately.
<H3>The DOS Keyboard</H3>
<P>You might hope that a two-byte BIOS scancode would use the high byte
as a key ID which never varies and the low byte for an ASCII value which
depends on whether shift, control or alt are pressed. Unfortunately,
because of a need to maintain compatability with the old XT keyboard,
the high byte varies as much much as the low byte. What is worse,
different keys react differently to control and alt. To avoid a
time-consuming switch block, I produced a tangle of "if" tests to sieve
the identities out of ctrl'd and alt'd scancodes.
<P>Then I found that holding down shift reverses the sense of the
numlock under DOS, but not Linux. I had to complicate my key purifier
still further to undo that stupidity, so numlock means numbers, no
matter what. So DOS was conquered and I faced the horror of the Linux
keyboard.
<H3>The Linux Keyboard</H3>
<P>In its default state, the Linux keyboard is far from suitable for an
interactive program. The <TT>fgetc()</TT> function does not return until
return is pressed, then it returns a whole string at once, so moving the
cursor with arrows can't work. It echoes characters to the screen and
ctrl-z, ctrl-q and ctrl-s all generate interrupts. It's a nightmare.
<P>I had hoped I could avoid using <TT>fgetc()</TT> and slip the
keyboard into raw mode (pure scancodes), but the gpm mouse driver
offered me no choice. It provides a single function to read events from
both keyboard and mouse, and the keyboard part uses
<TT>fgetc(stdin)</TT>. There is a mouse-only polling function, but I
couldn't make it work.
<P>I am glad of that now, because I have realised since that
<TT>fgetc()</TT> receives high-level keycodes which are likely to be the
same on foreign keyboards, where the layout and probably the scancodes
would be different. I resigned myself to translating strings of bytes
into scancodes as a necessity and it turned out to be easier than
dealing with BIOS scancodes under DOS had been.
<P>I found out how to set up the terminal by examining the Slang
sources. You use a function called <TT>tcsetattr()</TT> to set flags and
values in a terminal control structure. So I fixed the keyboard to
return characters immediately without echo and to treat ctrl-z, ctrl-q
and ctrl-s as ordinary keys.
<P>I still had no <TT>kbhit()</TT> function, nor any way to read the
shift state (whether ctrl, alt or shift are pressed). Google turned up
an article at Linux Gazette called
<A HREF="../issue76/marinov.html">"Taming the Linux Keyboard"</A>, which
gave me both those functions, full source code.
<H2>The Final Trial</H2>
<P>Still one bugbear remained. It may seem trivial to you but it was
everything to me. It seemed insurmountable and I don't mind admitting,
it nearly broke me.
<P>You know how on DOS editors you can select text by holding down shift
while using cursor-movement keys, including page up and page down? Well
under Linux, shift-PageUp and shift-PageDown are reserved for a
pointless function called scrollback. That means applications receive
nothing from <TT>fgetc()</TT> when shift-PageUp/Down are pressed. The
kernel spirits these keys away and your program never sees them.
<P>But that is not the worst of it by a long chalk. After weeks of
brain-busting work I found out at the final furlong, that if a user
tries to select text with shift-PageUp, half my lovely colour text
screen disappears - scrolled back!
<P>There was no way I could release my library now. I felt like I had
read a thousand-page novel and found the last page missing. I went round
and round in circles of man pages and info files and searched the net to
no avail. Then I noticed that the <TT>shift_state()</TT> function I got
from that article I mentioned earlier, used a function called
<TT><b>ioctl()</b></TT> to work its magic.
<P>I used <TT><b>"apropos ioctl"</b></TT> to search the man pages and
found one called <TT><b>"console_ioctls"</b></TT>. There I discovered
that <TT><b>ioctl()</b></TT> is the Linux equivalent of a DOS interrupt
call. The same page gave a full list of low-level system calls and a
warning from a kernel programmer, never to use these because they are
<U>not guaranteed</U> and are <U>subject to change</U> in future
versions of the kernel.
<P><EM>But we all know we can ignore kernel programmers when they say
things like that. They are just denying responsibility, like when Scotty
tells Captain Kirk it's going to take twice as long as it really
will.</EM>
<P>In the list I found one to change the functions associated with keys
- including PageUp and PageDown. It involved filling a struct with three
integers, to indicate which table, which key and which command to
assign. The problem was, there were no docs telling me what these
numbers should be, to disable scrollback for shift-PageUp.
<P>Further research turned up the kbd package, which contains great docs
and a bunch of utilities for changing the key mapping. You can dump the
current mapping to stdout by running dumpkeys. Here is an excerpt from
my dumpkeys output. Notice that it only gives me one of the three
numbers I need - the keycode.
<PRE>
keycode 103 = Up
alt keycode 103 = KeyboardSignal
<STRONG>keycode 104 = Prior
shift keycode 104 = Scroll_Backward</STRONG>
keycode 105 = Left
alt keycode 105 = Decr_Console
keycode 106 = Right
alt keycode 106 = Incr_Console
keycode 107 = Select
keycode 108 = Down
<STRONG>keycode 109 = Next
shift keycode 109 = Scroll_Forward</STRONG>
keycode 110 = Insert
</PRE>
<P>If you redirect the output into a text file, you can edit it and pass
it to loadkeys to alter the mapping. Experiments revealed that you can
delete most of the file - only leaving the keys you want to change. So I
reduced it to two lines:
<PRE>
<STRONG>shift keycode 104 = Scroll_Backward
shift keycode 109 = Scroll_Forward</STRONG>
</PRE>
<P>and changed the current functions to the ones for those keys without
shift pressed:
<PRE><STRONG>shift keycode 104 = Prior
shift keycode 109 = Next</STRONG>
</PRE>
<P>I called the file kmap and ran "loadkeys kmap". Then I tried my test
program and found that scrollback had been disabled - exactly the result
I was looking for. I knew now that it was possible. A peek at the source
for loadkeys revealed that it used the ioctl I had found, to change the
key functions, but I still did not know what numbers to use.
<P>I had no choice but to use cunning. I found out that loadkeys has a
-m option, to produce a source file, which contains tables of 256
values. I ran "loadkeys -m kmap" and found it produced one table with
254 null values and two non-null. Counting elements I found that the
non-null elements were numbered 104 and 109 - the key codes in my kmap
file. The values in the table had to be the values of the "Prior" and
"Next" commands.
<P>I also saw that this table had a number. I tried changing "shift" to
"control" in one of the lines in kmap and got two tables, one for shift
and one for control. In both cases the shift table was table number 1.
Along with the actual values in the table, I had my three numbers.
<P>To disable scrollback and scroll forward and make shift-PageUp/Down
into ordinary keys, you must save the existing values, then change them
and install an exit routine to restore them to normal function
afterwards.
<P>If you want to disable any key, such as the console switching keys
for example, you will need to mess about like I did with "loadkeys -m"
to find the numbers you are looking for.
<P><b>This function changes a key's action and saves the old one in an
integer you pass in by reference (written for gcc):</b>
<P><A HREF=misc/bint/kbe.c.txt>(text version of all listings)</A>
<PRE>
#include &lt;sys/ioctl.h&gt;
#include &lt;linux/kd.h&gt;
#include &lt;linux/keyboard.h&gt;
#include &lt;stdio.h&gt;
int set_kb_entry( unsigned short table, unsigned short keycode,
unsigned short value, unsigned short *oldvalue ) {
struct kbentry ke;
ke.kb_table = table;
ke.kb_index = keycode;
/* Get old value, return error if table or keycode are duff */
if( ioctl( fileno(stdin), KDGKBENT, &amp;ke ) )
return -1;
/* Unless oldvalue ptr is NULL, save old value to restore later */
if( oldvalue ) *oldvalue = ke.kb_value;
/* The new action for this key */
ke.kb_value = value;
/* Do the business, return error if value is duff */
if( ioctl( fileno(stdin), KDSKBENT, &amp;ke ) )
return -1;
return 0;
}
</PRE>
<P><b>To use the above function to disable scrollback and restore it on
exit:</b>
<PRE>
#include &lt;stdlib.h&gt;
/* Old key action values will be stored in these */
unsigned short scroll_forward = 0;
unsigned short scroll_backward = 0;
/* The magic numbers gleaned from dumpkeys and loadkeys -m */
#define SHIFT_TABLE 1
#define PAGE_UP_KEYCODE 104
#define PAGE_DOWN_KEYCODE 109
#define PAGE_UP_ACTION 0x0118 /* Prior */
#define PAGE_DOWN_ACTION 0x0119 /* Next */
/* Restore default funcs for shift-PageUp and shift-PageDown */
static void restore_scrollback() {
if( scroll_backward )
set_kb_entry( SHIFT_TABLE, PAGE_UP_KEYCODE,
scroll_backward, 0 );
if( scroll_forward )
set_kb_entry( SHIFT_TABLE, PAGE_DOWN_KEYCODE,
scroll_forward, 0 );
}
/* Liberate shift-PageUp and shift-PageDown for normal use */
int disable_scrollback() {
if( set_kb_entry( SHIFT_TABLE, PAGE_UP_KEYCODE,
PAGE_UP_ACTION, &amp;scroll_backward ) )
return -1;
if( set_kb_entry( SHIFT_TABLE, PAGE_DOWN_KEYCODE,
PAGE_DOWN_ACTION, &amp;scroll_forward ) )
return -1;
atexit( restore_scrollback );
return 0;
}
</PRE>
<H2>Return of the Jedi</H2>
<P>So I emerged from the dark underworld of the Linux console, prizes in
hand, triumphant. I have made it possible for programmers to write
console apps which behave exactly the same under DOS and Linux and (I
think) secured my place in legend.
<P>And you know what? I never did write that text editor. I can't
because I am homeless and I was lucky to get access to a computer long
enough to do this little thing. Perhaps that is where you come in.
<P>Linux is a virgin territory, about to be colonized by the people of
India and Africa. They can't afford flash computers that can run X, so
they need console apps. Now even those of you who don't have Linux
installed can help them.
<P>Linux needs pioneers to carve out the infrastructure before the first
big wave of settlers can move in. Those settlers will need configuration
dialogs for common apps like Apache and for common filters like grep.
They will need a good text editor, with a right-click cut-copy-paste
menu.
<P>Programmers who mean to produce these tools will need a widget
library and especially, a file Open/Save dialog. They would benefit from
a well-written string array class with cut-copy-paste functions,
provided separately to be used in various, competing text editors.
<P>The perfect editor wouldn't have many features, but would have a
simple facility for adding functions to its menus. It would be set up so
that any fool could write a C++ function which takes a pointer to an
editor as an argument and add that function to the editor's menu, just
by adding a single line to <TT>main()</TT>. Programmers could swap C++
editor functions with eachother and we would be on course to the
ultimate editor.
<P>Will you be a pioneer? If no-one bothers, I fear that Linux may fall
and we may all end up the helpless playthings of the evil Darth Gates.
So I am hoping you will pick up my fallen standard. You may be our last,
our only hope. Good luck.
<P>May the Source be with you.
<STRONG>
<P><A HREF=http://members.lycos.co.uk/ctio/ctio.zip>ctio.zip</A> (41.7kb)
<BR><A HREF=http://members.lycos.co.uk/ctio/ctio.tar>ctio.tar</A> (150kb)
</STRONG>
<H2>Credits</H2>
<P><STRONG><A HREF=http://www.s-lang.org/>
Slang</A></STRONG>, by John E. Davis.
Slang is easy to rob because it is well-written. I learned how to init
the keyboard and got most of the command strings for the screen from the
Slang sources. I got other command strings by using the untic program
that comes with it. But the best thing about Slang is what enables
Midnight Commander to run in a telnet window. Anyone who has ever had to
fix a web server remotely will know, it's a beautiful thing.
<P><STRONG><A HREF=../issue65/padala.html>
So You Like Color !!!</A></STRONG> By Pradeep Padala (LG #65).
This article got me started on the Linux console screen.
<P><STRONG><A HREF=../issue76/marinov.html>
Taming The Linux Keyboard</A></STRONG> By Petar Marinov (LG #76).
My <TT>shift_status()</TT> and <TT>key_awaits()</TT> functions are
modified versions of <TT>shift_state()</TT> and <TT>kbhit()</TT> given
away with this article.
<P><STRONG><A HREF=http://www-2.cs.cmu.edu/afs/cs/user/ralf/pub/WWW/files.html>
Ralf Brown</A></STRONG>, Patron Saint of DOS programmers
<!-- *** BEGIN author bio *** -->
<P>&nbsp;
<P>
<!-- *** BEGIN bio *** -->
<P>
<img ALIGN="LEFT" ALT="[BIO]" SRC="../gx/2002/note.png">
<em>
Stephen is a homeless Englishman who lives in a tent in the woods. He eats out
of bins and smokes cigarette butts he finds on the road. Though he once worked
for a short time as a C programmer, he prefers to describe himself as a "keen
amateur".
</em>
<br CLEAR="all">
<!-- *** END bio *** -->
<!-- *** END author bio *** -->
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright &copy; 2003, Stephen Bint.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 86 of <i>Linux Gazette</i>, January 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>
<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 WIDTH="380">
<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">HelpDex</FONT></STRONG></BIG></BIG>
<BR>
<STRONG>By <A HREF="../authors/collinge.html">Shane Collinge</A></STRONG>
</CENTER>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
<EM>These cartoons are scaled down to minimize horizontal scrolling.
To see a panel in all its clarity, click on it.</EM>
<P>
<A HREF="misc/collinge/racingstripes.jpg">
<IMG ALT="[cartoon]" SRC="misc/collinge/racingstripes.jpg"
WIDTH="640" HEIGHT="240"></A>
<BR CLEAR="all">
<P> Recent HelpDex cartoons are at Shane's web site,
<A HREF="http://www.shanecollinge.com/">www.shanecollinge.com</A>, on
the <A HREF="http://www.shanecollinge.com/Linux/">Linux</A> page.
<!-- *** BEGIN author bio *** -->
<P>&nbsp;
<P>
<!-- *** BEGIN bio *** -->
<P>
<img ALIGN="LEFT" ALT="[BIO]" SRC="../gx/2002/note.png">
<em>
Part computer programmer, part cartoonist, part Mars Bar. At night, he runs
around in a pair of colorful tights fighting criminals. During the day... well,
he just runs around. He eats when he's hungry and sleeps when he's sleepy.
</em>
<br CLEAR="all">
<!-- *** END bio *** -->
<!-- *** END author bio *** -->
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright &copy; 2003, Shane Collinge.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 86 of <i>Linux Gazette</i>, January 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>
<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 WIDTH="380">
<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">Ecol</FONT></STRONG></BIG></BIG>
<BR>
<STRONG>By <A HREF="../authors/malonda.html">Javier Malonda</A></STRONG>
</CENTER>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
These cartoons were made for es.comp.os.linux (ECOL), the Spanish USENET
newsgroup for Linux. The strips are drawn in Spanish and then translated to
English by the author. Text commentary on this page is by LG Editor Iron.
Your browser has shrunk the images to conform to the horizontal size limit for
LG articles. For better picture quality, click on each cartoon to see it full
size.
<P>
<A HREF="misc/ecol/ecol-88-e.png"><IMG SRC="misc/ecol/ecol-88-e.png" WIDTH="600" HEIGHT="240"></A>
<P>
<A HREF="misc/ecol/ecol-88.png"><IMG SRC="misc/ecol/ecol-88.png" WIDTH="600" HEIGHT="240"></A>
<HR NOSHADE> <!-- ****************************************************** -->
<P>
<A HREF="misc/ecol/ecol-90-e.png"><IMG SRC="misc/ecol/ecol-90-e.png" WIDTH="600" HEIGHT="240"></A>
<P>
<A HREF="misc/ecol/ecol-90.png"><IMG SRC="misc/ecol/ecol-90.png" WIDTH="600" HEIGHT="240"></A>
<HR NOSHADE> <!-- ****************************************************** -->
<P>
<A HREF="misc/ecol/ecol-91-e.png"><IMG SRC="misc/ecol/ecol-91-e.png" WIDTH="600" HEIGHT="240"></A>
<P>
<A HREF="misc/ecol/ecol-91.png"><IMG SRC="misc/ecol/ecol-91.png" WIDTH="600" HEIGHT="240"></A>
<HR NOSHADE> <!-- ****************************************************** -->
<P>
<A HREF="misc/ecol/ecol-92-e.png"><IMG SRC="misc/ecol/ecol-92-e.png" WIDTH="600" HEIGHT="240"></A>
<P>
<A HREF="misc/ecol/ecol-92.png"><IMG SRC="misc/ecol/ecol-92.png" WIDTH="600" HEIGHT="240"></A>
<HR NOSHADE> <!-- ****************************************************** -->
All Ecol cartoons are at
<A HREF="http://tira.escomposlinux.org/">tira.escomposlinux.org</A> (Spanish) and
<A HREF="http://comic.escomposlinux.org/">comic.escomposlinux.org</A> (English).
<P> <SMALL>These cartoons are copyright Javier Malonda. They may be copied, linked
or distributed by any means. However, you may not distribute modifications. If
you link to a cartoon, please <A
HREF="mailto:jmr@escomposlinux.org">notify</A> Javier.
</SMALL>
<!-- *** BEGIN author bio *** -->
<!-- *** BEGIN bio *** -->
<!-- P>
<img ALIGN="LEFT" ALT="[BIO]" SRC="../gx/2002/note.png">
<em>
</em>
<br CLEAR="all" -->
<!-- *** END bio *** -->
<!-- *** END author bio *** -->
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright &copy; 2003, Javier Malonda.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 86 of <i>Linux Gazette</i>, January 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>
<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 WIDTH="380">
<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">EcolNet and the escomposLinux.org project</FONT></STRONG></BIG></BIG>
<BR>
<STRONG>By <A HREF="../authors/malonda.html">Javier Malonda</A></STRONG>
</CENTER>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
<h5>The (not so) brief story.</h5>
<h3>Why should I be interested in this article?</b></big><br></h3>
<p>This is an article about the birth, growth
and everyday life of an Internet community. Why is this Internet community
so special? See it for yourself.
<ul>
<li>It has its <b>very own network</b>. This translates into an independent community,
only dependent on bandwidth providers (our ISPs). Everything else is maintained by
its members. </li>
<li>It's quite <b>big</b>, involving people all around a country, Spain in
this case. It's interesting to see how people can coordinate, even while
live far away from each other.</li>
<li>It's a <b>non profit</b> member-defrayed organization. Each member pays for his own box,
his Internet connection, and is responsible for the services he has chosen to offer.</li>
<li>It's a<b> pro-Open Source</b> organization, basically a Linux thing.
The group hosts many Open-Source projects, providing the needed infrastructure to its
members.</li>
<li>It's <b>open to everyone</b> who has something to offer to help spread the Open Source
gospel. The infrastucture is run by just a bunch of volunteers who pay costs out of their
pockets, but everyone is invited to contribute in any way: writing code,
writing documentation, promoting Open Source in any way, etc...</li>
</ul>
<p>We're using cable and DSL Internet connections. Most likely
this community model could be run on more modest bandwidth connections. Of course it can
be run on better connections, thus offering new possibilities. It's all a matter of
imagination and motivation. As for the boxes, some of them are pretty old
for today's standards, but they deal very well with their everyday duties, showing the
true power of Open Source and being a remarkable example of what can be done with Linux and
hardware that someone else would consider a piece of junk.
<p>Following EcolNet's example, bigger or smaller communities
could be built on the same basis. Keep on reading and see what we have come up with.
Maybe it will fire your imagination. I hope it does <tt>:)</tt>
<h3>Some history</h3>
<p>escomposLinux stands for a "short" name of the
newsgroups hierarchy es.comp.os.Linux. As you can easily note, this is the root of all
Linux newsgroups in Spanish and the other languages spoken in Spain. "es" refers to Spain,
in contrast with "esp" which hosts all the Spanish speaking groups in general.
<p>The es.comp.os.Linux newsgroup was founded in
1996, promoted by Pablo Saratxaga. In those days, there was no newsgroup to discuss
about Linux in Spanish, not even in the esp.* top-level domain noted before. Later, in 1999,
and due to the incredible increase of traffic, a split of the original es.comp.os.Linux
was proposed, voted and approved, so four more specific groups were created:
<ul>
<li><b>es.comp.os.Linux.instalacion</b>: Installation and
configuration</font></li>
<li><b>es.comp.os.Linux.programacion</b>: Programming in
Linux</font></li>
<li><b>es.comp.os.Linux.redes</b>: Networking under
Linux</font></li>
<li><b>es.comp.os.Linux.misc</b>: Stuff that didn't fit in
any other place</li>
</ul>
<p>This current year saw the birth of <b>es.comp.os.Linux.anuncios</b>
(announcements) , though it doesn't hold much traffic as of now.
<p>In the year 2000, some active es.comp.os.Linux users created a
first version of the escomposLinux web page, hosted at <a
href="http://www.Linux-es.com/">Linux-es.com</a>. Not long after that, a group of
five ecol users, bought the escomposLinux.org domain and the web page got moved to its actual
location, at <a href="http://www.escomposLinux.org">www.escomposLinux.org</a>. Those Linux
users who were especially active at the newsgroups, received web hosting space and FTP access,
so they could have a place to display all their Linux documentation and personal projects.
Everyone interested, can access to a @escomposLinux.org mail account. I'd like to note that,
in Spain, things were hard even in the year 2000, and having an email account was not as easy
as it is nowadays.
<p>These "Five Good Men" started the project writing a manifesto
about the guidelines to be followed. All initial the costs were assumed by those
volunteers, who never asked for financial help. Step by step, the escomposLinux.org
project gets bigger and bigger, as new services are added and more people gets involved.
Luckily, DSL become relatively affordable. On October 2001, all the services provided at
the time are moved to machines run and maintained by regular es.comp.os.Linux.* users.
This is when the escomposLinux.org project becomes EcolNet.
<h3>What's EcolNet?</h3>
<p>Technically, EcolNet is the escomposLinux.org network, a bunch
of computers spread all over the country. EcolNet is run, administered and defrayed by
volunteers who have in common their passion for Linux and the regular use of the
es.comp.os.Linux.* groups. We are not "37337 gurus". We enjoy learning how Linux works.
Plus we are happy to help the Linux community.
<p><b>What was the motivation behind EcolNet?</b> Basically, the
terrible management by the Spanish ISPs of the newsgroups, including es.comp.os.Linux.*.
Slow services, lost messages... We thought we could do better. Also, the first place
that hosted escomposLinux.org was very resctrictive, data storage was expensive and FTP was
limited. As soon as we thought we could take care of the services we needed, we moved
escomposLinux.org to our home servers.
<p><b>What's EcolNet current goal?</b> When someone wants to start
a project (say a little program, a big one, a documentation project, a game) he doesn't
have at hand all the tools he might need. Usually, you'd have your code at
sourceforge, maybe freshmeat, an IRC channel at openprojects.org, an FTP in some
university lost in some lost place of the planet, and so on. With EcolNet, s/he who
starts a project has all the support he may need, and everything centralized: www space,
FTP, IRC channel, etc. That's basically what EcolNet offers. But of course, EcolNet is
much more than that. EcolNet is a bunch of people who have become good friends enjoying Linux
and its philosophy.
<p><b>Where are the servers located?</b> A map showing these EcolNet
machines' location is shown here. You can see the machine's name, its IP, the volunteer's
name, their email address and what kind of Internet connection the box has:
<A HREF="misc/ecol2/1-ecolnet.png">[Click for image]</A>.
<p>This is a nice example of what can be done with <a
href="http://www.lysator.liu.se/%7Ealla/dia/">Dia</a>. You can find more
details about this diagram in the end of the article if you are interested.
<p>So the idea is easy: we take a few computers with a relatively
decent Internet connection and create a network providing services. Adding resources
and allocating necesities and responsabilities, we have achieved a network which works
on small computers and basic DSL Internet connections, depending just on ourselves and
our capability to keep the boxes working. EcolNet also allows us to experiment the
management of a Linux server, having fun with it, and puts on our shoulders the
responsability to keep things working, which is sometimes a bit stressing. But that's
what the root life is like, isn't it? <tt> ;) </tt>
<h3>What services do you run at EcolNet?</h3>
<p>The list is quite long. EcolNet offers to the Linux
community in Spain (completely non profit) the following services:
<ul>
<li><b>Electronic mail:</b> POP3 and Webmail access.</li>
<li><b>Webpage hosting: </b>Actualized via rsync. Anyone who has something
to offer involving Linux has a place at the ecol project.</li>
<li><b>Anonymous FTP: </b>To handle large stuff.</li>
<li><b>Mailing lists:</b> Several mailing lists are run at ecol, the most important ones being the users' list and the admins' list.</li>
<li><b>News:</b> We offer access to all the es.comp.os.Linux.* newsgroups
to anyone who wants to read them. That's one of the services we wanted EcolNet
for, to make sure whoever wanted to read the groups had the chance to have
a decent service.</li>
<li><b>IRC:</b> This is one of our favorites. Great fun at IRC.escomposLinux.org
#escomposLinux, where we meet and chat about our stuff. Always nice to drop
by.</li>
<li><b>PGP keys:</b> Here we keep our PGP and GnuPG keys.</li>
<li><b>Time:</b> At ntp.escomposLinux.org we keep a big clock to know what
time it is.
<IMG ALT=":)" SRC="../gx/dennis/smily.gif" WIDTH="20" HEIGHT="24">
</li>
<li><b>CVS:</b> Some of our users work on different projects, so CVS is
a great tool for them.</li>
<li><b>Wiki: </b>We have a little wiki that we use for different things,
mainly for writing documentation when you just made someting work and you're
still feel on fire &nbsp;:)</li>
</ul>
<p>Besides those services, www.escomposLinux.org holds a lot of
information, like Linux related links, book reviews and helpful documentation. And
constantly growing.
<p>The services distribution varies from time to time, either
when some machines join the EcolNet or when someone experiences problems, like too
much bandwidth consumption or some real tragedy. One of our primary servers had a
terrible crash featured by the electrical company not long ago. We learnt a few things
from that.
<p>We are specially proud of these "Star" features:
<ul>
<li><a href="http://libertonia.escomposLinux.org"><b>Libertonia</b></a>: A Linux weblog
based on K5's Scoop. It started a few months ago and we have over 300 registered
users today. Libertonia is Spanish for Freedonia, the imaginary country Groucho Marx
ruled in "Duck Soup". Hence the penguin with a Groucho disguise as the logo. It's quite
different from all other weblogs around, and this is why:</li>
<ul>
<li>Users <b>must</b> be registered to be able to post.</li>
<li>As in K5, users vote on what gets published.</li>
<li>We can censor news and comments we consider off-topic or impolite. Censoring
has very bad connotations and everybody is against it, so maybe you'd prefer to
call it moderation. We provide the service with our money and sweat. We don't want
any trolls having fun at our cost. As of today, we've only had nice and dialogant
participants around, and they like the way things are managed. We don't host banners,
we don't need money, we don't need hits. Thus, we do choose to have just a group of
selected people taking part in Libertonia. Althogh articles usually don't have many
comments (so far) compared to other weblogs, the quality of comments is good enough
to compensate this, and competition makes the quality of the articles grow. As of today,
we never had a troll and everybody lives happily and cordially in Libertonia.</li>
</ul>
<li><a href="http://comic.escomposLinux.org"><b>The ecol comic strip</b>:</a> One of the
most famous EcolNet services, Humor :) Originally in <a
href="http://tira.escomposLinux.org">Spanish</a>, now they are translated into
English. They have become incredibly successful among the Spanish geeks, getting
around 1000 visits daily, even though it's a weekly publication. Some popular weblogs
link them, as well as scores of personal pages. As for the English version, over 100
people have subscribed to a mailing list, run by a guy called Simon, neither Spanish
nor EcolNet-related, but still very nice :) Besides, the English version receives well
over 100 visits/day. You might have already read some of them, if you're a regular Linux
Gazette reader. <EM>[Like the <A HREF="ecol.html">one</A> in this issue. --Editor]</EM>
To deal with all that traffic, we have put up ten mirrors, which was kind
of an interesting challenge. We still hope to be slashdotted someday and see how well we do.
At EcolNet we like challenges. The comic strip is also EcolNet's "Poster Child", at least
in Spain. By the way, I must disclose that I'm the proud father of the thing.</li>
<li><b>Our news servers:</b> We are especially proud of our news servers. They are
difficult to put up and maintain (hey, we find it difficult!) Neverteless, they are
the base of the escomposLinux proyect. We go the extra mile to take care of the news servers.
Here you can see a scheme of the servers we have now running, and who is feeding us
externally. Kudos go to those feeders:
<A HREF="misc/ecol2/3-ecolnet.png">[Click for image]</A>.
</li>
</ul>
<h3>Who takes care of the whole thing? Is there something like a president? Do you
have an EcolNet king?</h3>
<p>There's a lot of people involved in EcolNet, which makes things
"interesting". Fortunately, EcolNet volunteers are always talkative and very nice, and it's
more a pleasure than a hasle to deal with them. Nevertheless, whenever there's people
involved, there's a need for some kind of structure. At EcolNet there's a core of people,
basically the "Five Good Men", who take care of the baby. They hold the experience and
the know-how. If you want, you can see them as Primus intern Pares, First among Equals.
<p>I've already talked about censoring in Libertonia, and I'll
keep on reviewing "nasty" words. Next one is "dictatorship". Let me tell a story I
especially like. Plato the philosopher said in <EM>The Republic</EM> that the perfect form
of government is the dictatorship of a wise man. Unluckily, that's not possible in
real life, or is it? Well, I think we do have that: we have a few people that have never
been elected, that usually say what's to be done or they just do it, and everybody's happy with
it. And it's been like that for many years and we keep rolling on, better and better each
day. The rest of the volunteers of course have an opinion, and it's taken into account.
Everything is pretty democratic, or at least it looks like it. It's hard to fight when
everybody is nice and has the same goals. We all know we ride the same boat. We want
to keep the boat afloat and we know who is the most capable, so everybody works together,
rowing in the same direction.
<p>How does EcolNet's decision-making process work? We have the admin
mailing list, the users mailing list, an internal weblog and an online poll. Usually,
infrastructure stuff gets discussed in the admin mailing list, because users don't need to
know or be bothered with technical details. The users mailing list is for when things affect
all the EcolNet population, both those running machines and users who have projects or documentation
hosted. For minor discussions, we tend to use the internal weblog and its poll.
<h3>In Memoriam</h3>
<p>The EcolNet project is dedicated to <tt>Tas</tt>,
one of the original "Five Good Men", now staying with $DEITY.
<hr width="100%" size="1" noshade="noshade">
<p><div align="left">Written by Javier Malonda.
<p>There's a lot of people who should be listed in the
credits, but they want to be anonymous. Just read
<A HREF="http://www.escomposLinux.org/">http://www.escomposLinux.org</A>.
<p>If you're curious, you can find the Dia source XML
code of the diagrams, as well as the diagrams themselves, at <a
href="http://helvete.escomposLinux.org/ecolnet/">http://helvete.escomposLinux.org/ecolnet/
</a>.
<!-- *** BEGIN author bio *** -->
<P>&nbsp;
<P>
<!-- *** BEGIN bio *** -->
<!-- P>
<img ALIGN="LEFT" ALT="[BIO]" SRC="../gx/2002/note.png">
<em>
</em>
<br CLEAR="all" -->
<!-- *** END bio *** -->
<!-- *** END author bio *** -->
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright &copy; 2003, Javier Malonda.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 86 of <i>Linux Gazette</i>, January 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>
<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 WIDTH="380">
<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">The Foolish Things We Do With Our Computers</FONT></STRONG></BIG></BIG>
<BR>
<STRONG>By <A HREF="../authors/orr.html">Mike ("Iron") Orr</A></STRONG>
</CENTER>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
<H2>Floppy story</H2>
By <A HREF="mailto:L.Mongey@Liberty-IT.co.uk">Lorcan Mongey</A>
<P> Back in the days when we used 5.25" floppies, somebody spilled a mug of
coffee over their floppy disc. Not unnaturally, it became unreadable. The
problem here is not that the data has been destroyed, but the fabric lining
of the floppy envelope becomes saturated and constantly re-applies a thin
layer of coffee to the disc surface, preventing the data from being read.
They brought it to me, so I cut open the envelope with scissors, removed the
actual disc, rinsed it under a tap and dried it with paper towels. Then I
cut open a spare floppy envelope (removing the unwanted disc), inserted the
problem disc and put the whole lot in the drive. It worked perfectly, and we
were able to copy the entire contents to safety before abandoning the
floppy.
<HR NOSHADE WIDTH="80%"> <!--*********************** -->
<H2>More luck than skill</H2>
By <A HREF="mailto:Morten.Sickel@newmedia.no">Morten Sickel</A>
<P> There's a Norwegian saying that goes, "Sometimes you may
have more luck than skill." With a couple of exceptions, that has been my
experience when doing stupid things with the computers.
<P> I have studied chemistry, and as I studied, I had for a while a job as a
kind of sysadmin for the computers the (other) students could use. Most of
the machines were some great 386s with a whooping 4MB of RAM. At that time,
we also got the first 486 PCs. In one of those, the floppy ceased working,
but I knew what to do, as I had a couple of dead 386s in a storage.
After a bit of
Frankesteinification, I again had a 486 equipped with a floppy. I turned
the power
on and, oops, there went the blue smoke. It turned out that I had put on
the power connection one pin too far to the left. Later, floppy power
connectors have been altered so it is virtually impossible to repeat that
stunt. Obiously, I have not been the only one...
<P> At about the same time, a friend of mine (yes it is true, it is not me!) got
hold of a 386sx that should replace his old 286. I was working together with
him to get it all together, and in the end, it turned out that one of the
screws had disappeared. We looked for it for a while, gave up, turned on the
power and found it immediately, just by looking at the spot where the
motherboard started to burn... After that, I have always been very careful
collecting all screws and never turning on the power if any are still
missing. Well, my friend shortly after got hold of a 486 motherboard and
managed to collect 20MB of RAM from old PC at his job, so I don't think he
was too unhappy with it at the end. I still remember the thrill of seeing
that machine counting RAM during boot... At that time, my own 8088 never
came pass 640k... :-)
<P> On the other hand, what really has impressed me is the quality of
IDE connectors. I don't know how many times I have connected them the wrong
way around, without damaging anything. My last stunt connected two ingenious
connections of pieces of hardware was just a few weeks ago. I got a few old
SCSI disks from my friend with the burningly fast 386SX (no he does not have
any more left now...). On one of them, there was a label on the top telling
how to set the jumpers for master, slave or CS, so I thought 'OK, then this
one is really an IDE drive, then I'll put it in another PC'. After a bit of
fiddling I managed to get it in, but the PC did not recognice it and
refused to boot from the other (known working) disk. I took it out again,
and had a closer look at the jumpers, after a while I could see that even
though the label on the top were mentioning master and slave, the jumpers
themselves were labeled A0,A1,A2..... Then a closer examination revealed
that the connector was broader than IDE and that some of the pins were
slightly bent... I carefully bent the pins back, attached it to a SCSI
chain, and saw it came up just beautifully. Occationally, luck is better
than skill.
<P> Morten Sickel, Dr<44>bak Norway
<HR NOSHADE WIDTH="80%"> <!--*********************** -->
<H2>The whirlybird CPU</H2>
By Raul Marusca
<P> A decade ago I was working as a technician at a computer store. One day a
customer bought a 387 mathematical coprocesator for his computer.
He insisted on installing it himself.
Two days after he come back and returned the chip (without the protective case),
saying, "You sold me a broken device".
<P> I responded,
"But now is out of the protective cover, How we know it not was affected by
an electostatic discharge?"
<P> "I plugged it on the socket in all four possible ways and it was never detected
by the BIOS nor by the software at all."
<P> We were shocked. We hadn't imagined it was even possible to plug the copro
in another way besides to matching the pin 1 mark on the chip with the mark
on the motherboard!
<P>
It took us a long week to explain he that he broke the chip when he plug
it in the wrong way for the first time, and that's not covered by the warranty.
<BLOCKQUOTE><EM>
[If you have a story about something foolish or ingenious you
did to your computer, send it to
<A HREF="mailto:gazette@ssc.com">gazette@ssc.com</A>. -Iron.]
</EM></BLOCKQUOTE>
<!-- *** BEGIN author bio *** -->
<P>&nbsp;
<P>
<!-- *** BEGIN bio *** -->
<P>
<IMG ALT="picture" SRC="../../gx/2002/tagbio/iron.jpg" WIDTH="161" HEIGHT="200"
ALIGN="left" HSPACE="10" VSPACE="10">
<em>
Mike is the Editor of <I>Linux Gazette</I>. You can read what he has
to say on the Back Page of each issue. He has been a Linux enthusiast
since 1991 and a Debian user since 1995. He is SSC's web technical
coordinator, which means he gets to write a lot of Python scripts.
Non-computer interests include Ska and Oi! music and the international
language Esperanto. The nickname Iron was given to him in college--short for
Iron Orr, hahaha.
</em>
<br CLEAR="all">
<!-- *** END bio *** -->
<!-- *** END author bio *** -->
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright &copy; 2003, Mike ("Iron") Orr.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 86 of <i>Linux Gazette</i>, January 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>
<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 WIDTH="380">
<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">How to E-mail an Encyclopedia</FONT></STRONG></BIG></BIG>
<BR>
<STRONG>By <A HREF="../authors/jenkins.graham.html">Graham Jenkins</A></STRONG>
</CENTER>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
<h2>Why Would You E-mail an Encyclopedia?</h2>
<p>OK, so it doesn't have to be an encylopedia.
It might be a movie. Or a large directory you have tarred and compressed.
And you could of course transfer it using FTP. Or perhaps you couldn't.
Your machine might live within a corporate LAN environment with no FTP
access to the outside world. Or the destination machine may have FTP
disabled for security purposes. An alternative is to encode the object
to be transferred into a string of ASCII characters, and send it via e-mail.
You can use the 'uuencode' utility to perform this encoding, or you can
use Base64 Content Transfer Encoding as described
in <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045
"Multipurpose Internet Mail Extensions (MIME) Part One"</a>.</p>
<h2>How Would You Package an Encyclopedia?</h2>
<p>If you were physically mailing an encyclopedia, you might package it
entirely within one carton. That would be a good solution, provided all
mail handlers along the way would accept a carton of that size and weight. If
that were not the case, then you would have to split the encyclopedia into
multiple cartons of acceptable size and weight.</p>
<p>In a like manner, when we are e-mailing an encyclopedia, we need to
ensure that the size of the e-mail message which contains it doesn't
exceed any limits which might be encountered along the way. If that is not
the case, then we need to split the message into multiple parts of
acceptable size. This can be done in accordance
with <a href="http://www.ietf.org/rfc/rfc2046.txt">RFC 2046
"Multipurpose Internet Mail Extensions (MIME) Part Two"</a>.</p>
<p>In summary, if we follow the recommendations of RFC 2045 and RFC 2046, we
should perform Base64 encoding on our entire encyclopedia, then split the
result into as many parts as necessary. The parts to be mailed will then
look something like this:</p>
<pre>
From grahjenk@au1.ibm.com Tue Dec 31 13:14:34 2002
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
Content-Type: message/partial; id="300870"; number="1"
Subject: Graham's Encylopedia
owF1Vb+P3EQUPhLRrBSFlHQjRYCQsthe/1q7CNrbREjocnvK3hHREM3ac7fWeWfM
zPh2L38ASomEIro0SNBBg2hBSDTwR0BBEwqQaFJF8J499tob0EjW7rzv+96b772x
...
szJb9DUMvKdRUIV+RY5Xu3UkRQqvJCzdzHtHoQL36Ke6elnYLgwH8MfxCU9ymq1Y
--
From grahjenk@au1.ibm.com Tue Dec 31 13:14:34 2002
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
Content-Type: message/partial; id="300870"; number="9"; total="9"
Subject: Graham's Encyclopedia
dc45xuruv3m3e8z/OGRD6lxz13GC5m0XbXvcWlyFW4vxbSSK5KEoTOIIuxTFs2JK
UnZKy1wTAV9TWr2dev7WrLbXkeOHUVQnjuyXEptwm3hBgfT43auvVh/v5mt+48pb
n+09Hf7+5Nvyx5tf/fP4o+PJ398Xf958cW3v6ejzL17/9YPfPs4unv08efvr68O/
njz/Fw==
--
</pre>
<h2>Another Way of Packaging an Encyclopedia</h2>
<p>It's not always easy for a message recipient to assemble parts like those
shown above in correct order, then strip out header lines and feed the
parts into a Base64 decoding program. If he is using an old Unix machine, he
may not actually have a Base64 decoder. If he is using a Microsoft machine,
he might not be able to appropriately edit the message parts.</p>
<p>So an alternative mechanism is to break the encyclopedia into numbered
parts, then separately uuencode each part for sending. Most versions
of 'uudecode' are smart enough to strip out header lines. It even works with
Microsoft Outlook.</p>
<p>The secret here is to number the component parts in such a fashion that
they can easily be selected (e.g. by using 'cat') in the correct sequence,
and fed to a pipe (e.g. for uncompress and untar operations) or output file.
The output parts now look like:</p>
<pre>
From grahjenk@au1.ibm.com Tue Dec 31 13:49:07 2002
Subject: encyclo part 1/ size/sum 1024/16571
begin 644 001_encyclo
M&lt;F]O=#IX.C`Z,3I3=7!E&lt;BU5&lt;V5R.B\Z+W-B:6XO&lt;V@*9&amp;%E;6]N.G@Z,3HQ
M.CHO.@IB:6XZ&gt;#HR.C(Z.B]U&lt;W(O8FEN.@IS&gt;7,Z&gt;#HS.C,Z.B\Z"F%D;3IX
...
M8W)E&lt;',Z+V)I;B]K&lt;V@*=V-O8F%T8V@Z&gt;#HU,#(X.#HQ.D%L97@@=&amp;AE(%=A
B;FME&lt;CHO97AP;W)T+VAO;64O=V-O8F%T8V@Z+V)I;B]K&lt;P``
`
end
--
From grahjenk@au1.ibm.com Tue Dec 31 13:49:07 2002
Subject: encyclo part 2/2 size/sum 945/12218
begin 644 002_encyclo
M:`IC-S0S-#0P.G@Z-38T-C,Z-3`P-#I!;F1R97&lt;@3'5O;F&lt;Z+VAO;64O861M
M;W!E&lt;F%T;W(Z+V5X&lt;&amp;]R="]H;VUE+V]P8U]O&lt;#HO8FEN+W-H"F,Y,34W.3DZ
M&gt;#HU,#(Y,#HQ.CHO:&amp;]M92]A9&amp;UI;B]C.3$U-SDY.B]U&lt;W(O8FEN+V)A&lt;V@*
`
end
--
</pre>
<p>You'll notice that we are now using just an upper-case character-set,
and that it contains a number of bracket and other symbols. Some of the
symbols don't map in an equivalent fashion into other character-set
representations. That's why RFC 2045 recommends the use of Base64 instead
of 'uuencode'.</p>
<h2>The Encylopedia Packer</h2>
<p>Here's the
<a href="misc/jenkins/filemail.pl.txt">packaging program</a>.
For simplicity and generality, we use the alternative packaging scheme
outlined above. Programs which do this have been around for a long time. They
are usually written in 'C', although Bourne-Shell versions are available. And
they usually write temporary files.</p>
<p>It is possible to write an elegant implementation of the packaging
scheme using the Perl language, without using any temporary files. The
resulting program is both simple and portable. So that's what we've done.</p>
<pre>
#!/usr/local/bin/perl -w
# @(#) filemail.pl Breaks incoming stream into parts, then encodes
# each part and e-mails it to designated recipient.
# Vers. 2.05; Graham Jenkins, IBM GSA, December 2002.
use strict; # Parts are encoded and sent via a double-buffer scheme.
use File::Basename; # Uuencoding is used to reduce module dependence.
my $PSize = 700; # Default (input) part-size.
my ($Count,$Sum,$Size,$Total,$InpBuf,$InpLen,$OutBuf,$j);
if ($#ARGV eq 2) { if ($ARGV[0] =~ m/^-\d+$/ ) { $PSize=0-$ARGV[0]; shift } }
die "Usage: cat file |".basename($0)." [-KbPerPart] destination filename\n".
" e.g.: tar cf - .|".basename($0)." -64 smith\@popser.acme.com mydir.tar\n".
"(Note: default un-encoded part size = $PSize","kb)\n" if ($#ARGV ne 1);
open(INFILE,"-") || die "Can't read input!\n";
$Count = 0; $Total = "";# Loop until no further input available.
do { $InpLen = read(INFILE, $InpBuf, 1024 * $PSize);
$Total = $Count if $InpLen lt 1;
do { $Size = length($OutBuf);
print STDERR "$ARGV[1] part $Count/$Total =&gt; $ARGV[0] $Size bytes\n";
$Sum = unpack("%32C*", $OutBuf);
foreach $j (1,2) {$Sum = ($Sum &amp; 0xffff) + int($Sum/0x10000)}
open(PIPE, "| Mail -s" .
"'$ARGV[1] part $Count/$Total size/sum $Size/$Sum' $ARGV[0]");
$j = $Count ; while (length($j) &lt; 3 ) { $j = "0" . $j }
$j = dirname($ARGV[1])."/".$j if dirname($ARGV[1]) ne ".";
print PIPE "begin 644 ",$j,"_", basename($ARGV[1]),"\n",
pack("u",$OutBuf),"\`\nend\n";
close(PIPE) } if $Count gt 0;
$Count++; $OutBuf = $InpBuf } until $InpLen lt 1;
</pre>
<p>Perl lends itself to this application through the form of its 'read'
statement, which allows us to specify the number of bytes which it should
try to acquire into a designated string. As can be seen, we just keep reading
from standard input until an empty string is returned in '$InpBuf'. Each
time we get a non-empty string, we uuencode whatever content is currently
in '$OutBuf' and push it into a mail program. We then store the contents
of '$InpBuf' in '$OutBuf' ready for our next iteration.</p>
<p>Perl is able to perform a uuencode operation on a string by using
its 'pack' statement as shown
with a 'u' parameter; no additional modules are required. It's not really
necessary - but we also take advantage of the 'unpack' statement's
characteristics to compute a checksum on each part as it is sent.</p>
<p>You may observe that we actually open a pipe into the Unix/Linux 'Mail'
program to handle our outgoing mail. For greater portability, we could
install and use the Net::SMTP module.</p>
<p>The program can be invoked with an optional part-size parameter to adjust
its default un-encoded part-size limit of 700kb.</p>
<h2>Programs Which Do Similar Things</h2>
<p>Some of you may recognize that this sort of message-splitting is
exactly the sort of thing we did in
<a href="../issue75/jenkins.html">
"Secure Printing with PGP"</a>. For those of you who are interested, there are
updated versions of the programs presented therein at:
<a href="http://www.cpan.org/scripts/">"CPAN Scripts Repository"</a>. Those
programs use the RFC-recommended "Base64-encode then split" methodology.</p>
<p>An earlier article
<a href="../issue68/jenkins.html">
"A Linux Client for the Brother Internet Print Protocol"</a> included a
shell script which used a "split then send parts" methodology; this also
used Base64 encoding.</p>
<!-- *** BEGIN author bio *** -->
<P>&nbsp;
<P>
<!-- *** BEGIN bio *** -->
<P>
<img ALIGN="LEFT" ALT="[BIO]" SRC="../gx/2002/note.png">
<em>
Graham is a Unix Specialist at IBM Global Services, Australia. He lives
in Melbourne and has
built and managed many flavors of proprietary and open systems on several
hardware platforms.
</em>
<br CLEAR="all">
<!-- *** END bio *** -->
<!-- *** END author bio *** -->
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright &copy; 2003, Graham Jenkins.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 86 of <i>Linux Gazette</i>, January 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>
<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 WIDTH="380">
<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">Security with PHP Superglobals</FONT></STRONG></BIG></BIG>
<BR>
<STRONG>By <A HREF="../authors/lechnyr.html">David Lechnyr</A></STRONG>
</CENTER>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
<p align="center"><em>"Avoid strange women and temporary variables."</em> -- Anonymous</p>
<p>A few years ago, my wife and I decided to go on a skiing trip up north. To reserve skiing equipment, you had to give 24 hours advance notice using the ski lodge's on-line website. The
catch was that my wife had asked me to make the reservations 23 hours before the deadline.</p>
<p>So I got to thinking, and examined the online website, which would not let you make any reservations within the 24 hour timeframe. However, once you selected an appropriate date, I noticed
that the URL was:</p>
<blockquote><code>https://www.somewhere.com/reservations.php?date=01-23-01</code></blockquote>
<p>It occurred to me that, while they had locked down security on what dates I could choose from, the final value was placed into a <strong>GET</strong> statement at the end of the web
address. I modified the web address to use "date=01-22-01" and indeed, our skies were waiting for us first thing the next morning (we paid for them, of course).</p>
<p>This innocent yet practical example is just one of the dangers we have to be aware of when using any programming language that can be used in ways that we did not intend, which leads us
into our discussion on PHP Superglobals.</p>
<h2>Forms</h2>
<p>To understand Superglobals, it is <em>critical</em> that you understand how data is passed from one web page to another (e.g., forms). Specifically, you must be aware of two methods known
as GET and POST. You should also probably be familiar with the HTML &lt;FORM&gt; statement (a good reference is
<a href="http://www.w3.org/TR/html401/interact/forms.html">http://www.w3.org/TR/html401/interact/forms.html</a>).</p>
<p>You've probably seen something like this before:</p>
<blockquote>
<p><code>&lt;form name="form1" method="post" action="process.php"&gt;<br />
&nbsp;&nbsp;&nbsp;&lt;p&gt;Please enter your name:&lt;/p&gt;<br />
&nbsp;&nbsp;&nbsp;&lt;p&gt;&lt;input type="text" name="yourname" /&gt;&lt;/p&gt;<br />
&nbsp;&nbsp;&nbsp;&lt;p&gt;&lt;input type="button" name="Submit" value="Submit" /&gt;&lt;/p&gt;<br />
&lt;/form&gt;</code></p></blockquote>
<p>This is standard, nothing-fancy HTML form code that asks for some information and then submits the data to the file "process.php" . &nbsp;The critical bit here is the
<strong>method</strong> declaration, which tells the form <strong>how</strong> to submit the data, for which we need to digress for a moment or two (hold your breath):</p>
<p>For those that recall the early days of HTML, forms were provided by means of the &lt;ISINDEX&gt; HTML tag. By inserting this tag into the HEAD of your HTML documents, a text field appeaed
where you could fill out input. As the new HTML+ standard evolved, a &lt;FORM&gt; tag was designed and could be used with a METHOD attribute of GET, POST, or PUT. &nbsp;So, this leaves us
with a few different ways to send our data.</p>
<h2>GET</h2>
<p>With GET, variables and their values are sent in the header of the URL request appended as part of the URL itself. &nbsp;The limitation is that web addresses (URLs) are limited to 8,192
characters; if the amount of data is too long, it will be truncated. Also, even with an SSL connection, the data is not encrypted since it is part of the web address.</p>
<p>For example, a web page might have a form statement like this:</p>
<blockquote>
<p><code>&lt;form name="form1" <strong><font color="#0000FF">method="get"</font></strong> action="process.php"&gt;<br />
&nbsp;&nbsp;&nbsp;&lt;p&gt;Please enter your name, e-mail address, and a comment:&lt;/p&gt;<br />
&nbsp;&nbsp;&nbsp;&lt;p&gt;&lt;input type="text" name="yourname" /&gt;&lt;/p&gt;<br />
&nbsp;&nbsp;&nbsp;&lt;p&gt;&lt;input type="text" name="email" /&gt;&lt;/p&gt;<br />
&nbsp;&nbsp;&nbsp;&lt;p&gt;&lt;input type="text" name="comment" /&gt;&lt;/p&gt;<br />
&nbsp;&nbsp;&nbsp;&lt;p&gt;&lt;input type="button" name="Submit" value="Submit" /&gt;&lt;/p&gt;<br />
&lt;/form&gt;</code></p></blockquote>
<p>When you clicked <em>Submit</em>, your web browser would take the values you filled out in the form and redirect you to this web address:</p>
<blockquote><code>http://www.fluffygerbil.com/process.php?yourname=fred+smith&amp;email=fred@nowhere.com&amp;comment=I+have+no+comment</code></blockquote>
<p>Notice how the values of the form are part of the web address itself? That's the essence of GET.</p>
<p>For the curious, what is actually sent in the <em>raw</em> HTTP transmission to accomplish this transaction is:</p>
<blockquote>
<p><code>GET /process.php?yourname=fred+smith&amp;email=fred@nowhere.com&amp;comment=I+have+no+comment HTTP/1.0<br />
Accept: image/gif, image/x-xbitmap, image/jpeg, */*<br />
Accept-Language: en-us<br />
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Q312461)<br />
Host: www.fluffygerbils.com<br />
Connection: keep-alive</code></p></blockquote>
<h2>POST</h2>
<p>With <strong>POST,</strong> the variables and their values are sent in the body of the URL request, not the header. &nbsp;The advantages of this type of data transmission is that there is
no limit to the size of the data being sent since it is contained in the body of the HTTP request, not the header. &nbsp;Also, if you're using an SSL connection, the data will be encrypted
too, what a deal.
<IMG ALT=":)" SRC="../gx/dennis/smily.gif" WIDTH="20" HEIGHT="24">
&nbsp;For example, a web page that has a form statement like:</p>
<blockquote>
<p><code>&lt;form name="form1" <strong><font color="#0000FF">method="post"</font></strong> action="process.php"&gt;<br />
&nbsp;&nbsp;&nbsp;&lt;p&gt;Please enter your name, e-mail address, and a comment:&lt;/p&gt;<br />
&nbsp;&nbsp;&nbsp;&lt;p&gt;&lt;input type="text" name="yourname" /&gt;&lt;/p&gt;<br />
&nbsp;&nbsp;&nbsp;&lt;p&gt;&lt;input type="text" name="email" /&gt;&lt;/p&gt;<br />
&nbsp;&nbsp;&nbsp;&lt;p&gt;&lt;input type="text" name="comment" /&gt;&lt;/p&gt;<br />
&nbsp;&nbsp;&nbsp;&lt;p&gt;&lt;input type="button" name="Submit" value="Submit" /&gt;&lt;/p&gt;<br />
&lt;/form&gt;</code></p></blockquote>
<p>When you clicked <em>Submit</em>, your web browser would take the values you filled out in the form and redirect you to this web address:</p>
<blockquote><code>http://www.fluffygerbil.com/process.php</code></blockquote>
<p>Notice how the values of the form are <em>not</em> part of the web address itself? That's the essence of PUT.</p>
<p>For the curious, what is actually sent in the <em>raw</em> HTTP transmission to accomplish this transaction is:</p>
<blockquote>
<p><code>POST /process.php HTTP/1.0<br />
Accept: image/gif, image/x-xbitmap, image/jpeg, */*<br />
Accept-Language: en-us<br />
Content-Type: application/x-www-form-urlencoded<br />
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Q312461)<br />
Host: www.fluffygerbils.com<br />
Content-Length: 94<br />
Pragma: no-cache<br />
Connection: keep-alive<br />
<br />
yourname=fred+smith<br />
email=fred@nowhere.com<br />
comment=I+have+no+comment</code></p></blockquote>
<h2>So What?</h2>
<p>So, why is all this background information useful? When you install PHP 4.2.2 or later, you might happen to notice that when compiling PHP, it states:</p>
<blockquote><code>+--------------------------------------------------------------------+<br />
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;***&nbsp;NOTE&nbsp;***&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;default&nbsp;for&nbsp;register_globals&nbsp;is&nbsp;now&nbsp;OFF!&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />
|&nbsp;If&nbsp;your&nbsp;application&nbsp;relies&nbsp;on&nbsp;register_globals&nbsp;being&nbsp;ON,&nbsp;you&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />
|&nbsp;should&nbsp;explicitly&nbsp;set&nbsp;it&nbsp;to&nbsp;on&nbsp;in&nbsp;your&nbsp;php.ini&nbsp;file.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />
|&nbsp;Note&nbsp;that&nbsp;you&nbsp;are&nbsp;strongly&nbsp;encouraged&nbsp;to&nbsp;read&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />
|&nbsp;http://www.php.net/manual/en/security.registerglobals.php&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />
|&nbsp;about&nbsp;the&nbsp;implications&nbsp;of&nbsp;having&nbsp;register_globals&nbsp;set&nbsp;to&nbsp;on,&nbsp;and&nbsp;&nbsp;&nbsp;|<br />
|&nbsp;avoid&nbsp;using&nbsp;it&nbsp;if&nbsp;possible.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />
+--------------------------------------------------------------------+</code></blockquote>
Which means that PHP will be <em>ultra-paranoid</em> about the data that is passed to it, and will <strong>require that you state which <em>method</em> the data should be coming
from</strong>. &nbsp;Also, you should be aware that there's more ways to send data to your PHP pages than just via GET and POST:<br />
<br />
<img src="misc/lechnyr/php-variables.png" alt="" width="600" height="399" /><br />
<h2>Superglobals</h2>
<p>Which brings us to <strong>Superglobals</strong>, a relatively new concept to PHP. For example, the above diagram presents a slight problem: If you're working with the variable $yourname,
how do you know that during your script it hasn't been redefined by one of these six other methods of variable assignment by someone attempting to hack into your script? For example, imagine
having someone who has managed to upload a PHP script to your webserver that performs the following (<a href="http://packetstormsecurity.nl/web/php.hidden-vars.txt">php exploit</a> by Daniel
Phoenix):</p>
<blockquote>
<p><code>&lt;?php<br />
setcookie("test","../../../../../../etc/passwd");<br />
echo "cookie inserted";<br />
?&gt;</code></p></blockquote>
<p>Wouldn't it be great to have a way to isolate variables based on how the data gets assigned to it in the first place? Superglobals allow you to specify which variables <strong>received by
a specific method</strong> should be used.</p>
<p>Superglobals are PHP's attempt at helping you determine where a particular value comes from. If you haven't heard of this new feature as of PHP 4.1.0, you'll want to start adapting to it.
Most PHP training books don't touch this subject, so you will need to be aware of how to transition to this new input method. Ultimately, you should re-visit your /usr/local/lib/php.ini file
and make the following change:</p>
<blockquote>
<p>register_globals = Off</p></blockquote>
<p>This will prevent the ability for any user-submitted variable to be injected into your PHP code and can reduce the amount of variable poisoning a potential attacker may inflict. They will
have to take the additional time to forge submissions, and your internal variables are effectively isolated from user submitted data. If a user then tried to fill out a form, the server
wouldn't assign any data to the global variables <code>$name</code>, <code>$email</code>, or <code>$comment</code>. Instead, it would divide up the data into the following hashed arrays:</p>
<blockquote><code>$_POST['name']<br />
$_POST['email']<br />
$_POST['comment']</code></blockquote>
<p>The main Superglobal arrays are:</p>
<ol>
<li>$_GET['<em>variable</em>'] - Variables provided to the script via HTTP GET. Analogous to the deprecated HTTP_GET_VARS array</li>
<li>$_POST['<em>variable</em>'] - Variables provided to the script via HTTP POST. Analogous to the deprecated $HTTP_POST_VARS array</li></ol>
<p>The other, less-common Superglobal arrays are:</p>
<ol>
<li>$_COOKIE['<em>variable</em>'] - Variables provided to the script via HTTP cookies. Analogous to the deprecated $HTTP_COOKIE_VARS array</li>
<li>$_REQUEST['<em>variable</em>'] - Variables provided to the script via any user input mechanism (GET, POST, COOKIE) and which therefore cannot be trusted.</li>
<li>$_GLOBALS['<em>variable</em>'] - Contains a reference to every variable which is currently available within the global scope of the script. The keys of this array are the names of the
global variables.</li>
<li>$_SERVER['<em>variable</em>'] - Variables set by the web server or otherwise directly related to the execution environment of the current script. Analogous to the deprecated
$HTTP_SERVER_VARS array</li>
<li>$_FILES['<em>variable</em>'] - Variables provided to the script via HTTP post file uploads. Analogous to the deprecated $HTTP_POST_FILES array</li>
<li>$_ENV['<em>variable</em>'] - Variables provided to the script via the environment. Analogous to the deprecated $HTTP_ENV_VARS array</li>
<li>$_SESSION['<em>variable</em>'] - Variables which are currently registered to a script's session. Analogous to the deprecated $HTTP_SESSION_VARS array</li></ol>
<p>For more details, see <a href="http://www.php.net/manual/en/reserved.variables.php">http://www.php.net/manual/en/reserved.variables.php</a>.</p>
<p>So instead of <code>$name</code> being set to "John", you would either have <code>$_GET['name'] = "John"</code> or possibly <code>$_POST['name'] = "John"</code> depending on how the form
data was submitted. The advantage is that you will know:</p>
<ol>
<li>$name can never be faked; if your script sets its value, that's the value!</li>
<li>The $_GET and $_POST arrays help you to determine if the user appended the data as part of the URL or as part of the request body; therefore you don't have to worry about having a form
accepting POST data and having the values change by someone sending a hacked URL with GET data appended to the URL. This will make sense shortly, so hang on...</li>
<li>These 'superglobals' allow you to 'compartmentalize' not only your variable's values, but how the values were provided to the server in the first place. Someone attempting to hack into
your server will have a very difficult time bypassing this.</li></ol>
<h2>Final Thoughts</h2>
<p>Programming with PHP can be a frustrating experience as of late. Security
measures prevent data from being easily assigned to variables, ISP's typically
implement PHP without consideration for their audience, and newcomers to PHP
tend to be taken aback by such terms as <em>GET</em>, <em>POST</em>,
<em>Superglobals</em>, and so forth. However, a little knowledge can go a long
way, and hopefully this article has helped you in your quest.</p>
<p>This document was prepared based on PHP 4.3.0.</p>
<h2>Additional Resources</h2>
<ul>
<li><a href="http://softwaredev.earthweb.com/script/article/0,,12063_918141,00.html">On the Security of PHP</a>, by Jordan Dimov</li>
<li><a href="http://www.cgisecurity.com/lib/studyinscarlet.txt">A Study In Scarlet: Exploiting Common Vulnerabilities in PHP Applications</a>, by Shaun Clowes</li>
</ul>
<p><em>This document was lovingly
handcrafted on a Dell Latitude C400 laptop running Slackware Linux 8.1.</em></p>
<!-- *** BEGIN author bio *** -->
<P>&nbsp;
<P>
<!-- *** BEGIN bio *** -->
<P>
<img ALIGN="LEFT" ALT="[BIO]" SRC="../gx/2002/note.png">
<em>
David is a Network Manager at the Human Resources department of the
University of Oregon. He holds a Master's Degree in Social Work along with his
MCSE+I, CNE, and CCNA certifications. He has been working with Linux for the
past six years, with an emphasis on systems security, network troubleshooting,
and PHP/MySQL integration.
</em>
<br CLEAR="all">
<!-- *** END bio *** -->
<!-- *** END author bio *** -->
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright &copy; 2003, David Lechnyr.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 86 of <i>Linux Gazette</i>, January 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>
<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 WIDTH="380">
<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">Perl One-Liner of the Month: The Case of the Evil Spambots</FONT></STRONG></BIG></BIG>
<BR>
<STRONG>By <A HREF="../authors/okopnik.html">Ben Okopnik</A></STRONG>
</CENTER>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
<p><i>A REPORTER'S NOTE</i>
<p><i>To forestall some sure-to-happen complaints, I'd like to underscore
the necessity of having the current version of Perl (at least 5.8.0, as
of this writing) in order to play with the scripts presented in these articles.
One-liners, to a far greater degree than proper scripts, rely on new and
unusual language features, and languages tend to "grow" new features and
drop old, outdated ones as version numbers rise. Perl, heading for its
17th year of growth and development, is no exception.</i>
<p><i>One of a number of possible problems with one-liners is fragility,
especially in those (many of them) which are dependent on cryptocontext,
side effects, and undocumented features, which are likely - in fact, are
</i>certain<i>
- to change without notice. One-liners are hacks which often demonstrate
some clever twist or feature, which encourages the use of all of the above.
Remember - these are fun toys which (hopefully) lead to a better understanding
of Perl; trying to use them as you would robust, solid code would be a
serious error. If you don't understand the </i><a href="../issue61/okopnik.html">basics</a><i>
of Perl, this is <b>not</b> the place to start.</i>
<br>&nbsp;
<pre>Debugging is twice as hard as writing the code in the first place.&nbsp;
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it.
&nbsp;-- Brian W. Kernighan</pre>
<p><br><i><b>Caveat Lector</b> (Let the reader beware).</i>
<p><b><i>Ben Okopnik</i></b>
<br><i>On board S/V "Ulysses", Saint Augustine, Florida</i>
<hr>
<p>Frink Ooblick had fallen asleep at the keyboard. He had been alternately
playing and trying to puzzle out the number-guessing game that Woomert
had written (the first had proven easy, but the second still eluded him);
in fact, his last unfinished game was still visible on the screen:
<pre>
<hr WIDTH="100%">perl -wlne'BEGIN{$b=rand$=}$a=qw/Up exit Down/[($_&lt;=&gt;int$b)+1];print eval$a'
50
Down
25
Up
37
Up
44
Up
<hr WIDTH="100%"></pre>
What was the secret? How did it work? <a href="#1">[1]</a> Frink's dreams
were full of floating bits of code which spiraled off into the distance
or mutated into monstrous shapes, threatening to consume the world. The
hand shaking his shoulder, waking him, was therefore a welcome relief.
Woomert stood at his side, looking impatient.
<p>&nbsp;- "Wake up, Frink, wake up! The game's afoot, you slug-a-bed;
let's go!"
<p>&nbsp;- "Uh... Erm... I'm, uh, awake. What's up?"
<p>&nbsp;- "In the living room. Come on, come on, there's not a moment
to lose!"
<p>Frink's first sight of their visitor brought him to a stop. Used to
dealing with the working crowd - sysadmins, techs, etc. - he had expected
the usual scruffy-and-competent look, perhaps complete with hiking boots;
what greeted his eyes was a fellow in a pinstripe suit, crisp white shirt,
a red "power" tie, and lacquered black shoes. He had been impatiently pacing
the floor, and brightened up considerably at the sight of Frink.
<p>&nbsp;- "Ah, this must be the second team member in your organizational
hierarchy! Excellent; now, we can get into actualizing the power strategies
that will reorganize this, erm, unpredicted opportunity into the profit
slot on the balance sheet. All right, here's how we wind-tunnel this: the
securitization of the computing resources is predicated on leveraging..."
<p>Keeping a cautious eye on their visitor, Frink prison-whispered to Woomert:
"What's he <i>saying?</i> And what language is it in?"
<p>&nbsp;- "It's Marketroid. You need to learn at least the basics of it;
not that it's spoken by the people who sign the checks - they don't have
much time for that sort of thing - but you're going to run into it in the
business world, and it's best to be prepared. Usually, though, most of
these people can still speak English; let's see if this fellow remembers
how. Oh, Mr. Wibbley!"
<p>Their visitor had just finished what he obviously considered an explanation
of the problem, had switched off the overhead LCD projector, put away his
laser pointer, and was looking at them in an expectant manner. Clearly,
he had heard of Woomert's reputation and was relying on the famous Hard-Nosed
Computer Detective to deal with... well, whatever it was.
<p>&nbsp;- "Mr. Wibbley - that was an excellent presentation, but I wonder
if you could restate the problem in more basic terms for my assistant here.
I'm afraid he's not up on proper business terminology, and has missed the
more subtle points."
<P>
<br>Their visitor heaved a sigh, and dropped into the nearby easy chair.
<p>&nbsp;- "Oh, sure. You know, they were going to send one of the system
administrators to talk to you, but of course I insisted on doing the presentation
myself as soon as I heard about it. After all, one of <i>them</i> wouldn't
have even thought of using that textured salmon-and-peach background on
the slides, and that's all the rage these days! Anyway, I <i>did</i> get
a note from him that explains it in his own words; it's crude and unsophisticated,
not at all proper marketing technique, but I suppose you fellows will understand
it..."
<p>The crumpled and coffee-stained napkin, most of which was covered with
calculations, reminders, and something that looked like firewall rules,
contained a short note framed with a red marker pen:
<br>&nbsp;
<center><table BORDER=4 COLS=1 WIDTH="100%" NOSAVE >
<tr>
<td>Woomert, spambots are harvesting the e-mail addresses on our website
(we've tagged them with the "plus hack", <a href="#2">[2]</a> so we know
where it's coming from); the amount of spam we're getting is growing by
leaps and bounds. We need to have the addresses out there - it's our contact
info, site problem reports, etc. - but we've got to stop the 'bots somehow!
I've already written the CGI to handle the hot links, but we need to have
the actual addresses displayed on the pages, and the 'bots are getting
those. Any ideas? The page is at <font color="#3333FF">http://xxxxxxxxxxxx.xxx</font>.
I've created an account for you; just go to <font color="#3333FF">ssh://xxxxxxxxx.xxx/xxx</font>,
password 'xxxxxxxxxx'. Thanks!&nbsp;
<br>&nbsp;- Int Main</td>
</tr>
</table></center>
<p>After Woomert had ushered out their visitor (and reassured him that,
indeed, the salmon-and-peach background was delightful), he returned to
the living room where Frink awaited him.
<p>&nbsp;- "What are you going to do, Woomert? Any plans?"
<p>&nbsp;- "Yes; let's take a peek at their website, then get out there and
look around. It's a mistake to make decisions ahead of your facts, and we
have few facts at hand."
<p>...
<p>Once again, Woomert and Frink found themselves surrounded by the familiar
sights and sounds of a working web site. They could see the Web server
easily spawning off threads without significantly affecting CPU load; clearly,
the local sysadmin had installed mod_perl <a href="#3">[3]</a>. Here and
there, data streams whisked by, and everything moved like a smoothly-oiled
machine.
<p>A sudden shadow made Frink look up. "What the..." Before he could go
any further, a horrifying creature, all tentacles, lenses, and evil intent
<a href="#4">[4]</a>
leaped upon the scene, sucked up a copy of every HTML file at once, and
was gone in a blink.
<p>&nbsp;- "What <i>was</i> that, Woomert - a spambot?"
<p>&nbsp;- "Yep. These things traverse the Net, collecting e-mail addresses
and reporting them to their scummy spammer masters. Given the nature of
the Net, you can't stop them - but you <i>can</i> make them much less effective.
Spammers are stupid, their bots even more so, and that's what we're going
to rely on. Mind you, whatever we do is only going to be a temporary solution;
eventually, spammers (or at least their hired techie help) will catch on
to this particular method - but by then, we'll implement other solutions."
<p>Walking up to a convenient terminal, Woomert slipped on his favorite
typing gloves and fired off a rapid volley.
<pre>
<hr WIDTH="100%">perl -MRFC::RFC822::Address=valid -wne'/[\w-]+@[\w.-]+/||next;print valid$&amp;' *html
<hr WIDTH="100%"></pre>
A line of '1's appeared on the screen; Woomert smiled and his fingers again
flew over the keyboard.
<pre>
<hr WIDTH="100%">perl -i -wlpe's=[\w-]+@[\w.-]+=join"",map{sprintf"&amp;#%s;",ord}split//,$&amp;=e' *html
<hr WIDTH="100%"></pre>
This time, there was no output; however, Woomert looked satisfied. He quickly
shot off an email to the local sysadmin that contained some instructions
and included a shorter version of the last one-liner -
<pre>
<hr WIDTH="100%">perl -we'map{printf"&amp;#%s;",ord}split//,pop' user@host.com
<hr WIDTH="100%"></pre>
- "All right-o, Frink; our work here is done. Home, here we come!"
<p>...
<p>The old-fashioned coal-fired samovar <a href="#6">[6]</a> was gently
perking; the <i>zavarka</i> (tea concentrate), made with excellent Georgian
tea, gave off a marvelous smell. A plate of canap&#233;s, ranging from the
best Russian butter and wild blackberry jam on freshly-baked fluffy white
bread to beluga caviar on a heavy, dark rye rubbed with just a touch of
garlic, was set close at hand, and both Woomert and Frink were merrily
foraging in the gourmet field thus presented. Eventually they settled back,
replete with good food, and Frink's curiosity could be contained no longer.
<p>&nbsp;- "Woomert, when I try to puzzle out your one-liners, I can only
get so far; then I run out of steam. Can you tell me about what you did?"
<p>Lying back in his favorite armchair, Woomert smiled.
<p>&nbsp;- "Instead, why don't you start by telling me what part you understood?
I like to see how far you've advanced, Frink; it's been a pleasure to me
to see you picking up some of the finer points. I'll take it from there."
<p>&nbsp;- "All right, then... Let's start with the first one:
<pre>
<hr WIDTH="100%">perl -MRFC::RFC822::Address=valid -wne'/[\w-]+@[\w.-]+/||next;print valid$&amp;' *html
<hr WIDTH="100%"></pre>
I recognized all the command-line switches:
<p><tt>-Mmodule Use the specified module</tt>
<br><tt>-w Enable warnings</tt>
<br><tt>-n Non-printing loop</tt>
<br><tt>-e Execute the following commands</tt>
<p>However, I couldn't quite puzzle out the '<tt>-MRFC::RFC822::Address=valid'</tt>syntax
- what was that?"
<p>&nbsp;- "Ah. As 'perldoc perlvar' tells us, in the entry for '-M', it's
a bit of syntactic sugar; '<tt>-MBar=foo</tt>' is a shortcut for '<tt>use
Bar qw/foo/</tt>', which imports the specified function 'foo' from module
'Bar'. Go on, you're doing well."
<p>Frink cleared his throat.
<p>&nbsp;- "In that case, I think I have it figured out... almost. Let
me take a quick look at 'perldoc perlvar' and 'perldoc RFC::RFC822::Address'...
Yes, that's what I thought - I've got it! The regex at the beginning -
<p><tt>/[\w-]+@[\w.-]+/</tt>
<p>tries to match e-mail addresses - it's not perfect, but should do reasonably
well. What it says is "match any character in <tt>[a-zA-Z0-9-]</tt> repeated
one or more times, followed by '<tt>@</tt>', followed by any character
in <tt>[a-zA-Z0-9.-]</tt> repeated one or more times". If the match does
not succeed - the '<tt>||</tt>' logical-or operator handles that - go to
the next line."
<p>&nbsp;- "Brilliant, Frink! What happens then?"
<p>&nbsp;- "If it does succeed, '<tt>next</tt>' is skipped over, and '<tt>print
valid$&amp;</tt>' is invoked. The module documentation tells me that the
'<tt>valid</tt>' function tests an e-mail address for RFC822 (e-mail specification)
conformance, and returns true or false based on validity. '<tt>$&amp;</tt>',
according to 'perldoc perlvar', is the last successful pattern match -
in other words, whatever was matched by the regex. Since you saw all '1's
and no errors - any matches that weren't RFC822-valid would have returned
something like "<tt>Use of uninitialized value in print at -e line 1</tt>"
- what you matched was all valid. What you were doing here is checking
to see that your regex only matched actual addresses. How did I do?"
<p>&nbsp;- "Excellent, my dear Frink; you're coming along well! As a side
note, it's generally best to avoid the use of&nbsp; <tt>$&amp;, $`,</tt>
and <tt>$'</tt> as well as '<tt>use English'</tt> in scripts; there's a
rather large performance penalty associated with them (see 'perldoc perlvar').
However, here we had a very small list of matches, and so I went ahead
with it. Go on, see what you can make of the next one."
<p>&nbsp;- "Um... the next one, right. Well, I've got part of it -
<pre>
<hr WIDTH="100%">perl -i -wpe's=[\w-]+@[\w.-]+=join"",map{sprintf"&amp;#%s;",ord}split//,$&amp;=e' *html
<hr WIDTH="100%"></pre>
<tt>-i In-place edit (modify the specified file[s])</tt>
<br><tt>-w Enable warnings</tt>
<br><tt>-p Printing loop</tt>
<br><tt>-e Execute the following commands</tt>
<p>Mmmm... I got sorta lost here, Woomert. I see that regex that you'd
used before, but what's that 's=' bit?"
<p>&nbsp;- "It's one of those convenient tweaks that Perl provides - although,
admittedly, the basic idea was stolen from 'sed'. It's simply an alternate
delimiter used with the 's' (substitute) operator; there are times when
using the default delimiter ("/") is highly inconvenient and leads to "toothpick
Hell" - as, for example, in matching a directory name:
<p><tt>s/\/path\/to\/my\/directory/my home directory/</tt>
<p>Far better to use an alternate delimiter, one that is not contained
in the text of either the pattern or the replacement:
<p><tt>s#/path/to/my/directory#my home directory#</tt>
<p>As long as it's non-alphanumeric and non-whitespace, it'll work fine.
There are some special cases, but they're all sensible ones; using a single
quote disables interpolation in both the pattern and the replacement (see
the rules in 'perldoc perlop'), and using braces or brackets as delimiters
requires rather obvious syntax:
<p><tt>s{a}{b}</tt>
<br><tt>s(a)(b)</tt>
<br><tt>s[a][b]</tt>
<p>Many people like '#' as a delimiter; I prefer '=', since '#' tends to
come up in HTML and comments. Can you make sense of any of the rest?"
<p>- "I'm afraid not. You're matching the email addresses as previously,
and replacing them with something, but I can't figure out what."
<p>- "All right; it <b>is</b> rather involved. The replacement part of
the substitution is actual Perl code; we can do that thanks to the 'e'
(evaluate) modifier on the end of the 's' operator. Let's parse the relevant
code from right to left:
<pre>join"",map{sprintf"&amp;#%s;",ord}split//,$&amp;</pre>
We know that '<tt>$&amp;</tt>' contains an email address; the next thing
we do is use the '<tt>split'</tt> function which converts a scalar to a
list, splitting it on whatever is specified between the delimiters. In
this case, however, the delimiter is empty, a null - so the returned list
has each character of the address as a separate element in the list. We
now pass this list to the '<tt>map</tt>' function, which will evaluate
the code specified in the <tt>{block}</tt> for each element of the supplied
list and return the result - as another list.
<p>Within the block itself, each character is used as an argument to the
'<tt>ord</tt>' function, which returns the ASCII value of that character;
this, in turn, is used as the argument for the '<tt>sprintf</tt>' function
which returns the following formatted string:
<p><tt>&amp;#&lt;ASCII_value&gt;;</tt>
<p>for each value so specified. After all the characters in the list have
been processed, we use the '<tt>join</tt>' function to convert the list
back to a scalar - which the substitute operator will now use as a replacement
string for the original email address. What used to be "<tt>foo@bar.com</tt>"
now looks like
<p><tt>&amp;#102;&amp;#111;&amp;#111;&amp;#64;&amp;#98;&amp;#97;&amp;#114;&amp;#46;&amp;#99;&amp;#111;&amp;#109;</tt>
<p>This, you must admit, looks nothing like an e-mail address - so spambots
will not be able to read it!"
<p>Frink looked troubled.
<p>&nbsp;- "Woomert, I hate to tell you... but human beings won't be able
to read it either!"
<p>Woomert took another sip of his tea and smiled.
<p>&nbsp;- "You're forgetting one thing, Frink. Humans aren't <i>going</i>
to be reading this; since it's part of the HTML files, it's going to be
read by
<i>browsers</i>. As it happens, the HTML specification for showing
ASCII characters by their value is
<p><tt>&amp;#&lt;ASCII_value&gt;;</tt>
<p>which is exactly what we've produced. Try this yourself: save the text
between the following lines as "text.html" and view it in a browser.
<pre>
<hr WIDTH="100%">&lt;html&gt;&lt;head&gt;&lt;title&gt;&lt;/title&gt;&lt;/head&gt;&lt;body&gt;
&amp;#87;&amp;#111;&amp;#111;&amp;#109;&amp;#101;&amp;#114;&amp;#116;&amp;#32;&amp;#70;&amp;#111;&amp;#111;&amp;#110;&amp;#108;&amp;#121;
&lt;/body&gt;&lt;/html&gt;
<hr WIDTH="100%"></pre>
Do you see what I mean?"
<p>A few moments later, Frink looked up from the keyboard.
<p>&nbsp;- "Woomert, what a great solution! Your client will be able to
display the addresses without them being harvested, and the Web page will
still look the same as it did before. I can tell by comparison that the
last bit of code:
<pre>
<hr WIDTH="100%">perl -we'map{printf"&amp;#%s;",ord}split//,pop' user@host.com
<hr WIDTH="100%"></pre>
simply enables the sysadmin to convert any new addresses before popping
them into the HTML. Wonderful!"
<p>&nbsp;- "A large part of the complete solution, of course, was the CGI
that the local admin had written - that takes a bit more than a one-liner,
although not very much more, given the power of the CGI module. Remember,
Frink: as your powers grow, make certain to align yourself with the side
of Good rather than Evil. Not only is it the right thing to do; the people
around you are far more likely to have brains!"
<br>&nbsp;
<br>&nbsp;
<p>
<hr WIDTH="100%">
<br><a NAME="1"></a>[1] Oddly enough, my mysterious correspondent did not
include the solution to this, perhaps deeming it simple enough (!) for
the public to figure out - or (and I suspect this to be the more likely
scenario) he has not yet figured it out himself. Readers are welcome to
write in with their ideas... but for now, the workings of Woomert's game
remain a puzzle.
<p><a NAME="2"></a>[2] A number of commonly-used Mail Transfer Agents will
ignore anything that follows a plus sign in the username part of the address,
e.g. &lt;smith+yahoo@joe.com&gt; will be routed exactly the same as &lt;smith@joe.com&gt;.
This can be a very useful mechanism for tracing and reducing spam: a "plus-hacked"
address that becomes too spam-loaded can be directed to "<tt>/dev/null</tt>"
and replaced by a newly generated one (say, &lt;smith+yahoo1@joe.com&gt; -
which would also go to &lt;smith@joe.com&gt;.)
<p><a NAME="3"></a>[3] A.K.A. "Apache On Steroids". From the mod_perl documentation:
<p><tt>The Apache/Perl integration project brings together the full power
of</tt>
<br><tt>the Perl programming language and the Apache HTTP server. This
is</tt>
<br><tt>achieved by linking the Perl runtime library into the server and</tt>
<br><tt>providing an object oriented Perl interface to the server's C language</tt>
<br><tt>API.</tt>
<p><tt>These pieces are seamlessly glued together by the `mod_perl' server</tt>
<br><tt>plugin, making it is possible to write Apache modules entirely
in</tt>
<br><tt>Perl. In addition, the persistent interpreter embedded in the server</tt>
<br><tt>avoids the overhead of starting an external interpreter program
and</tt>
<br><tt>the additional Perl start-up (compile) time.</tt>
<p>There are many major benefits to using mod_perl; if you use Apache in
any serious fashion without it, you're almost certainly throwing away some
of your time and effort.
<p><a NAME="4"></a>[4] If you've seen "The Matrix", just picture the Sentinels.
If you haven't seen it, hey, you've got only yourself to blame. :)
<p><a NAME="5"></a>[5] Gibberish is the written form of the Marketroid
language. It was formerly spoken by the Gibbers, who all died out as a
result of their complete inability to do anything (as opposed to talking
about it.) It is exactly as comprehensible as its spoken counterpart, although
many people confuse the two: "it's all marketroid gibberish!" is a highly
redundant statement.
<p><a NAME="6"></a>[6] See the "Russian Tea HOWTO", by D&aacute;niel Nagy,
for the proper way to make and serve Russian tea. The man <b><i>knows</i></b>
what he's talking about.
<!-- *** BEGIN author bio *** -->
<P>&nbsp;
<P>
<P> Ben is a Contributing Editor for Linux Gazette and a member of
The Answer Gang.
<!-- *** BEGIN bio *** -->
<P>
<IMG ALT="picture" SRC="../../gx/2002/tagbio/ben-okopnik.jpg" WIDTH="199"
HEIGHT="200" ALIGN="left" HSPACE="10" VSPACE="10">
<em>
Ben was born in Moscow, Russia in 1962. He became interested in
electricity at age six--promptly demonstrating it by sticking a fork into
a socket and starting a fire--and has been falling down technological mineshafts
ever since. He has been working with computers since the Elder Days, when
they had to be built by soldering parts onto printed circuit boards and
programs had to fit into 4k of memory. He would gladly pay good money to any
psychologist who can cure him of the resulting nightmares.
<p>Ben's subsequent experiences include creating software in nearly a dozen
languages, network and database maintenance during the approach of a hurricane,
and writing articles for publications ranging from sailing magazines to
technological journals. Having recently completed a seven-year
Atlantic/Caribbean cruise under sail, he is currently docked in Baltimore, MD,
where he works as a technical instructor for Sun Microsystems.
<p>Ben has been working with Linux since 1997, and credits it with his complete
loss of interest in waging nuclear warfare on parts of the Pacific Northwest.
</em>
<br CLEAR="all">
<!-- *** END bio *** -->
<!-- *** END author bio *** -->
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright &copy; 2003, Ben Okopnik.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 86 of <i>Linux Gazette</i>, January 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>
<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 WIDTH="380">
<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">Qubism</FONT></STRONG></BIG></BIG>
<BR>
<STRONG>By <A HREF="../authors/harsem.html">Jon "Sir Flakey" Harsem</A></STRONG>
</CENTER>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
<EM>These cartoons are scaled down to minimize horizontal scrolling.
To see a panel in all its clarity, click on it.</EM>
<P>
<A HREF="misc/qubism/qb-antim101.jpg">
<IMG ALT="[cartoon]" SRC="misc/qubism/qb-antim101.jpg"
WIDTH="640" HEIGHT="240"></A>
<BR CLEAR="all">
<A HREF="misc/qubism/qb-genviagra2.jpg">
<IMG ALT="[cartoon]" SRC="misc/qubism/qb-genviagra2.jpg"
WIDTH="640" HEIGHT="240"></A>
<BR CLEAR="all">
<P> All Qubism cartoons are
<A HREF="http://www.core.org.au/modules.php?name=Cartoons">here</A>
at the CORE web site.
<!-- *** BEGIN author bio *** -->
<P>&nbsp;
<P>
<!-- *** BEGIN bio *** -->
<P>
<img ALIGN="LEFT" ALT="[BIO]" SRC="../gx/2002/note.png">
<em>
Jon is the creator of the Qubism cartoon strip and current
Editor-in-Chief of the
<A HREF="http://www.core.org.au/">CORE</A> News Site.
Somewhere along the early stages of
his life he picked up a pencil and started drawing on the wallpaper. Now
his cartoons appear 5 days a week on-line, go figure. He confesses to
owning a Mac but swears it is for "personal use".
</em>
<br CLEAR="all">
<!-- *** END bio *** -->
<!-- *** END author bio *** -->
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright &copy; 2003, Jon "Sir Flakey" Harsem.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 86 of <i>Linux Gazette</i>, January 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>
<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 WIDTH="380">
<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">Programming in Ruby - Part 3</FONT></STRONG></BIG></BIG>
<BR>
<STRONG>By <A HREF="../authors/ramankutty.html">Hiran Ramankutty</A></STRONG>
</CENTER>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
<H2><B>Review</B></H2>
<P>In <A
href="../issue81/ramankutty.html">part 1</A>
we looked at the basic syntactic structure of Ruby. In <A
href="../issue83/ramankutty.html">part 2</A>
we discussed <B>iterators</B> and the fundamentals of <B>Object-Oriented
Programming</B>. Here in part 3 we explore object-orientedness in more detail.
</P>
<H2><B>Methods</B></H2>
<P>A <B><I>method</I></B> is an action the object knows how to perform on
request. Let's see an example of how a method is invoked for an object: </P>
<P></P><PRE>print "asdfgh".length
^D
6
</PRE>
<P>One can infer from this that a method named `length' of the <B>String
object</B> is called. </P>
<P>Now try this: </P>
<P></P><PRE>foo = "abc"
print foo.length,"\n"
foo = [1, 2]
print foo.length,"\n"
^D
3
2
</PRE>
<P>From the result it is clear that deciding which method to call is done at
execution time, and that the choice differs depending on the content of the
variable. </P>
<P>I suggest that readers not bother about how the object determines its length
because the process is different for strings and arrays. Fortunately, Ruby
automatically chooses the correct process, so we don't have to worry about it.
This feature in languages supporting object orientedness is called
<B><I>polymorphism</I></B>. </P>
<P>It is not necessary for the user to know how the methods are processed, but
one has to know what methods are acceptable to the object. When an object
receives an unknown method, an error is raised. For example: try calling the
"length" method for the object "foo" with value "5". </P>
<P>I had mentioned about a special variable <B><I>self</I></B> in Ruby. It is
the object which calls methods. Such callings are used very often and so an
abbreviation is available. That is; </P>
<P></P><PRE>self.method_name(arguments...)
</PRE>
<P>can be omitted then </P>
<P></P><PRE>method_name(arguments...)
</PRE>
<P>causes same effect. Called function is just an abbreviation for method
calling to self. </P>
<H2><B>Classes</B></H2>
<P>The real world consists of objects which can be classified. For example, a
one-year-old child may think `bowwow' on seeing a dog or even a fox. In terms of
object orientedness, `bowwow' can be termed <B><I>class</I></B>, and an object
belonging to a class is called <B><I>instance</I></B>. </P>
<P>In Ruby, as in other object oriented languages, we first define a class to
determine the behaviour of the object, and then make an instance of the class, a
specific object. So let's define a class in Ruby. </P>
<P></P>
<P></P><PRE>class Dog
def bark
print "Bow wow\n"
end
end
^D
</PRE>
<P>The definition of the <B>class</B> lies between the keywords `class' and
`end'. A `def' in class syntax defines a method of the class. </P>
<P>Now that we have a class named `Dog', let's make an object. </P>
<P></P><PRE>tommy = Dog.new
tommy.bark
^D
Bow wow
</PRE>
<P>This makes a new instance of the class Dog and substitutes it into the
variable tommy. The method `new' of any class makes a new instance. Now the
variable tommy has properties defined in the class Dog, and so he can `bark'.
</P>
<H2><B>Inheritence</B></H2>
<P>Ever wondered how others classify objects? One example is how people perceive
a dog. A mathematician may see a dog as an object made up of different numbers
and figures, a physicist may see it as the result of many natural and artificial
forces at work, and my sister (a zoologist) may interpret it as a representative
of the species <I>canine domesticus</I>. To her, a dog is a kind of canine, a
canine is a kind of mammal, and a mammal is always an animal. </P>
<P>Hence we see that the classification of objects takes the form of a
hierarchy, though not in all cases. Let's see what Ruby does with it. </P>
<P></P><PRE>class Animal
def breath
print "inhales and breaths out\n"
end
end
class Cat&lt;Animal
def bark
print "mew\n"
end
end
tama = Cat.new
tama.breath
tama.bark
^D
inhales and breaths out
mew
</PRE>
<P>Here the Cat class isn't given any definitions on how to breathe, but it will
inherit that property from the Animal class. In this case, the `bark' feature is
just appended. </P>
<P>It is notable that the properties of the parent class or the super class is
not always inherited. For example, birds fly, but penguins don't. Penguins do
have other properties of birds, though, like laying eggs. This kind of thing can
be represented in Ruby also, and I leave it to the reader as home work. </P>
<P>To make a new class using inheritence from a superclass that holds common
properties, we only need define the differences from the superclass. Some say
this `differential programming' is one of the merits of object oriented
programming. </P>
<H2><B>Redefining Methods</B></H2>
<P>We can observe difference in behaviour of the instances in subclasses when we
redefine the superclass methods. See below: </P<P></P><PRE>class Human
def print_id
print "I'm a human.\n"
end
def train_toll(age)
print "reduced-fare.\n" if age &lt; 12
end
end
Human.new.print_id
class Student1&lt;Human
def print_id
print "I'm a student.\n"
end
end
Student1.new.print_id
class Student2&lt;Human
def print_id
super
print "I'm a student too.\n"
end
end
Student2.new.print_id
^D
I'm a human.
I'm a student.
I'm a human.
I'm a student too.
</PRE>
<P>In the new classes that redefine the superclass methods, the original method
of superclass can be called using `super'. Along with the code above, try this:
</P>
<P></P><PRE>class Student3&lt;Human
def train_toll(age)
super(11) # unconditionally reduced
end
end
Student3.new.train_toll(25)
^D
reduced-fare.
</PRE>
<P>These are simple examples, but I hope they give you and idea of how
inheritance and redefinition works. </P>
<H2><B>More on Methods</B></H2>
<P>There are some methods which play the role of restricting the way a method is
called. For a function (defined at top level) given below: </P>
<P></P><PRE>def sqr(x)
x * x
end
print sqr(5)
^D
25
</PRE>When `def' appears outside of class definition, it has effect of adding
this method to the Object class. The Object class is the base class of all other
classes- all classes inherit from the class Object. The means that the method
`sqr' can be used in all other classes.
<P></P>
<P>Now that all classes must be able to call `sqr', let's try to call `sqr' to
`self': </P>
<P></P><PRE>print self.sqr(5)
^D
ERR: private method `sqr' called for (Object)
</PRE>
<P>Calling the function using `self' after the definition of the function gives
the error as shown above. The error message is not intuitive, so what does it
mean? </P>
<P>What is happening is that a method that is defined at the top levelcan can be
called using function style as opposed to method style. See what error message
you get when undefined methods are called. </P>
<P>Since methods are called in a function type style, it works in a fashion
similar to that of C++, while calls are within the class or its subclass. </P>
<P>We can restrict access to methods using `public' or `private' - public
methods can be called by users of the class, while private methods can only be
called by other methods inside this class. </P>
<P></P><PRE>class Test
def foo
print "foo\n"
end
private foo:
def bar
print "bar -&lt; "
foo
end
end
temp = Test.new
temp.foo
temp.bar
^D
ERR: private method `foo' called for (Test)
bar -&lt; foo
</PRE>
<P>The concept must be clear with the kind of output obtained. </P>
<H2><B>Singleton Method</B></H2>
<P>The behaviour of an instance is determined by the class, but we know that a
particular instance should have special behavior. In most languages, we must
make another class for the instance, while in Ruby we can append methods to a
paticular instance without much fuss. </P>
<P></P><PRE>class SingletonTest
def size
print "25\n"
end
end
t1=SingletonTest.new
t2=SingletonTest.new
def t2.size
print "10\n"
end
t1.size
t2.size
^D
25
10
</PRE>
<P>Here t1 and t2 belong to the same class, though, t2 redefines the `size'
method so it will behave differently. A method of a particular instance is
called <B><I>singleton method</I></B>. </P>
<P>One example where singleton methods are used is in the buttons of a GUI
program, where each button has a different action. We can redefine the action
suitably for each button object. </P>
<H2><B>Modules</B></H2>
<P>Modules in Ruby are very similar to classes, but are used to group related
classes together. There are three major differences between modules and classes:
</P>
<P></P>
<OL>
<LI>Modules have no instance.
<LI>Modules have no subclass.
<LI>Modules are defined by <TT>module ... end</TT>. </LI></OL>
<P>Roughly saying, there are two uses of modules. First, to collect
methods or constants. For example: </P>
<P></P><PRE>print Math::PI,"\n"
print Math.sqrt(2),"\n"
^D
3.141592654
1.414213562
</PRE>
<P>The operator `::' refers to a constants in a module or class. When
we refer directly to the methods or the constants of a method, we use the
`include' method. </P>
<P></P><PRE>include Math
print sqrt(2),"\n"
print PI,"\n"
^D
1.414213562
3.141592654
</PRE>
<P>Another use of modules is called `mixin'. This can be complex so should be
explained in detail. </P>
<P>In some Object-Oriented programming languages, a class can inherit from
more than one superclass; this feature is called multiple-inheritance. Ruby
purposely doesn't have this feature. Instead, we can make it by mixin with the
module. </P>
<P>As said above, the module works like the class; the methods or the constants
of a module cannot be inherited, but instead are appended to other modules or
classes by use of include. So, when one includes the definition of a module,
this adds the property (mixes the property) into the class. </P>
<P>mixin modules appear in the standard library, and by mixing in these modules
to a class whose the `each' method returns each element, the class get the
features: `sort', `find', etc. </P>
<P>The following differences exist between multiple-inheritance and mixin:
<UL>
<LI>The module don't generate instances; it is a guarantee for the abstract
class.
<LI>The module keeps the relationship of instance to be a tree. </LI></UL>
<P>These differences inhibit complex relationships between classes; simplicity
is a good thing. This is why Ruby doesn't have multiple inheritance. In
languages that have multiple inheritance, situations can occur where classes
have many superclasses and the relationship of instances form a tangled
network... Situations like this are too complex to understand for the brain of
the human being, or at least my brain... </P>
<P>On the other hand, mixins make it simple as just `the collection of
particular properties all we want to add'. </P>
<P>So, even in a language with multiple inheritance, it is recognized that it
is good to extend classes by using mixin rather than developing complicated
inheritance relationships. We advanced this idea in Ruby allowing mixins only
instead of
multiple inheritance. </P>
<H2><B>Procedure Objects</B></H2>
<P>Suppose you are writing a program that does something to process signals.
Those familiar with it will understand the simplicity in sending a procedure as
an argument to a method (here usually arrival of signals). </P>
<P>The built-in method <B><I>proc</I></B> generates a procedure object. The
procedure code goes between braces,
and to execute the procedure object
one uses the <B><I>call</I></B> method. See below: </P>
<P></P><PRE>obj = proc{print "Hello world\n"}
obj.call
^D
Hello world
</PRE>
<P>C programmers will find procedure objects similar to function pointers. </P>
<H2><B>Conclusion</B></H2>With this, we come to an end of the series of articles
<B>Part 1</B>, <B>Part 2</B> and <B>Part 3</B> with which I have intended to
give readers a basic introduction to programming in Ruby. I have not tried to
present hard core programming in Ruby: this is my final year of Engineering,
and I am busy with my final year project and have been unable to look deeply
into Ruby. But I know that as time permits, I will come up with much more in
Ruby.
<P></P>
<P><B>Happy Programming...</B></P>
<!-- *** BEGIN author bio *** -->
<P>&nbsp;
<P>
<!-- *** BEGIN bio *** -->
<P>
<img ALIGN="LEFT" ALT="[BIO]" SRC="../gx/2002/note.png">
<em>
I am a final year student of Computer Science at Government Engineering
College, Trichur, Kerala, India. Apart from Linux I enjoy learning Physics.
</em>
<br CLEAR="all">
<!-- *** END bio *** -->
<!-- *** END author bio *** -->
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright &copy; 2003, Hiran Ramankutty.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 86 of <i>Linux Gazette</i>, January 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>
<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 WIDTH="380">
<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">Debian APT Part 2: Installing Unreleased Software</FONT></STRONG></BIG></BIG>
<BR>
<STRONG>By <A HREF="../authors/tougher.html">Rob Tougher</A></STRONG>
</CENTER>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
<html>
<head><title>Debian APT Part 2 - Installing Unreleased Software</title></head>
<body>
<h3>Contents</h3>
<dl>
<dt><a href="#1">Introduction</a>
<dt><a href="#2">Overview</a>
<dt><a href="#3">Installing Unreleased Packages</a>
<dd><a href="#3.1">Initial Setup</a>
<dd><a href="#3.2">Installing An Unreleased Package</a>
<dd><a href="#3.3">Upgrading Unreleased Packages</a>
<dd><a href="#3.4">Downgrading From Unreleased To Released</a>
<dt><a href="#4">Conclusion</a>
<dt><a href="#5">References</a>
</dl>
<a name="1" />
<h3>Introduction</h3>
<p>
APT stands for the Advanced Packaging Tool - it is a package management system for Debian GNU/Linux. In
<a href="../issue84/tougher.html">Part 1</a> of this series,
I described how to use APT to install Debian software on your machine. If you are unfamiliar with APT,
you should read that first.
</p>
<p>
Part 1 focused on installing only released versions of Debian's software packages. Besides the released versions,
Debian provides unreleased packages for people who need the latest versions of software. This article describes
how to install these unreleased packages.
</p>
<a name="2" />
<h3>Overview</h3>
<p>In the last article I introduced two concepts: the package, and the package cache. Now I am introducing
a third: the <i>distribution</i>. A distribution is a collection of packages, installation scripts, user
documentation, and configuration applications unique to Debian.
<p>
There are three Debian distributions:
</p>
<ul>
<li><code><a href="http://www.debian.org/releases/stable">stable</a></code> - the released version.
<li><code><a href="http://www.debian.org/releases/testing">testing</a></code> - the candidate for the next release.
<li><code><a href="http://www.debian.org/releases/unstable">unstable</a></code> - the development version.
</ul>
<p>
The <code>stable</code> distribution is the released version of Debian. The packages in <code>stable</code>
have been tested thoroughly. Most of the packages installed on my machine come from the <code>stable</code> distribution.
</p>
<p>
The <code>testing</code> distribution is the candidate for the next release.
Packages in this distribution have undergone some testing, but require more testing before they can
be released.
When <code>testing</code> is ready, it becomes the <code>stable</code> distribution, and the
old <code>stable</code> distribution is moved to archives.
</p>
<p>
The <code>unstable</code> distribution is the development distribution. Debian volunteers update it continuously.
The packages in <code>unstable</code> may not have been tested at all, and may not work.
After a package has undergone some testing, it gets moved to the <code>testing</code> distribution.
</p>
<p>
A software package can exist in one or more of these distributions. For example, the <code>php4</code>
package is contained in all three. In <code>stable</code> its version is 4.1.2,
in <code>testing</code> its version is 4.1.2, and in <code>unstable</code> its version is 4.2.3.
I currently have version 4.1.2 installed on my machine - if I needed version 4.2.3, I could install it
from the <code>unstable</code> distribution.
</p>
<a name="3" />
<h3>Installing Unreleased Packages</h3>
<a name="3.1" />
<h4>Initial Setup</h4>
<p>
To get your machine ready to install software packages from <code>testing</code>
or <code>unstable</code>, you have to perform the following steps:
</p>
<ul>
<li>Add an entry to <code><a href="misc/tougher/sources.list.txt">/etc/apt/sources.list</a></code>
to include the distribution
<li>Modify <code><a href="misc/tougher/apt.conf.txt">/etc/apt/apt.conf</a></code> to make
the <code>stable</code> distribution the default
<li>Call <code>apt-get update</code>
</ul>
<p>
<code>sources.list</code> keeps a list of sources for Debian software.
In the last article we had 7 CDROM sources and 2
HTTP sources. Now let's add two more HTTP sources - one for the
<code>testing</code> distribution and one for the <code>unstable</code> distribution.
My <code>sources.list</code> file now looks like the following:
</p>
<pre>
# Two new sources
deb http://http.us.debian.org/debian unstable main contrib non-free
deb http://http.us.debian.org/debian testing main contrib non-free
# Sources from last article
deb http://security.debian.org/ stable/updates main
deb http://http.us.debian.org/debian stable main contrib non-free
deb cdrom:[Debian GNU/Linux 3.0 r0 _Woody_ - Official i386 Binary-6 (20020718)]/ unstable contrib main non-US/contrib non-US/main
deb cdrom:[Debian GNU/Linux 3.0 r0 _Woody_ - Official i386 Binary-7 (20020718)]/ unstable contrib main non-US/contrib non-US/main
deb cdrom:[Debian GNU/Linux 3.0 r0 _Woody_ - Official i386 Binary-5 (20020718)]/ unstable contrib main non-US/contrib non-US/main
deb cdrom:[Debian GNU/Linux 3.0 r0 _Woody_ - Official i386 Binary-4 (20020718)]/ unstable contrib main non-US/contrib non-US/main
deb cdrom:[Debian GNU/Linux 3.0 r0 _Woody_ - Official i386 Binary-3 (20020718)]/ unstable contrib main non-US/contrib non-US/main
deb cdrom:[Debian GNU/Linux 3.0 r0 _Woody_ - Official i386 Binary-2 (20020718)]/ unstable contrib main non-US/contrib non-US/main
deb cdrom:[Debian GNU/Linux 3.0 r0 _Woody_ - Official i386 Binary-1 (20020718)]/ unstable contrib main non-US/contrib non-US/main
</pre>
<p>
Next you modify <code>apt.conf</code> so that you still
use packages from <code>stable</code> by default. My
<code>apt.conf</code> file looks like the following:
</p>
<pre>
# Make 'stable' the default distribution
APT::Default-Release "stable";
</pre>
<p>
To finish the initial setup call <code>apt-get update</code>. This will download the
latest package information, and update your local package cache.
</p>
<a name="3.2" />
<h4>Installing An Unreleased Package</h4>
<p>
Let's continue our example from last section. The <code>stable</code> distribution contains version
4.1.2 of the <code>php4</code> package. Let's say you wanted version 4.2.3 - maybe
it contained some new feature you needed. You could install this package using the following command:
</p>
<pre>
prompt$ apt-get -t unstable install php4
</pre>
<p>
This would install version 4.2.3 of the <code>php4</code> package. Note the -t switch on the command line -
this is telling APT that it is allowed to use packages from the <code>unstable</code> distribution. If
you didn't include the -t switch, APT would be unable to install version 4.2.3 of the package, because the
<code>stable</code> distribution is your default.
</p>
<a name="3.3" />
<h4>Upgrading Unreleased Packages</h4>
<p>
You can upgrade your <code>testing</code> and <code>unstable</code> packages by
using the <code>apt-show-versions</code> command:
</p>
<pre>
prompt$ apt-get install `apt-show-versions -u -b | grep testing`
</pre>
<a name="3.4" />
<h4>Downgrading From Unreleased to Released</h4>
<p>
You can downgrade packages on your machine. This means that if you have a <code>testing</code> or
<code>unstable</code> package installed, and you don't want it any more, you can downgrade the package
to the latest <code>stable</code> version.
</p>
<p>
Before being able to downgrade, you must make an entry in your
<code><a href="misc/tougher/preferences.txt">/etc/apt/preferences</a></code> file. The entry
looks like the following:
</p>
<pre>
Package: php4
Pin: release a=stable
Priority: 1001
</pre>
<p>
Once you make this entry you can run the following command to downgrade a package:
</p>
<pre>
prompt$ apt-get update
</pre>
<a name="4" />
<h3>Conclusion</h3>
<p>
APT is a powerful package management system. It allows you to install, maintain, and remove
software applications from your Debian system. In this article I focused on installing software from
Debian's unreleased distributions, <code>testing</code> and <code>unstable</code>.
</p>
<a name="5" />
<h3>References</h3>
<ul>
<li><a href="http://www.debian.org/doc/">Debian documentation</a>
<li>man pages for apt-get, apt-cache, sources.list, apt.conf, and apt_preferences
</ul>
</body>
</html>
<!-- *** BEGIN author bio *** -->
<P>&nbsp;
<P>
<!-- *** BEGIN bio *** -->
<P>
<img ALIGN="LEFT" ALT="[BIO PEN]" SRC="../gx/2002/note.png">
<em>
Rob is a software developer in the New York City area.
</em>
<br CLEAR="all">
<!-- *** END bio *** -->
<!-- *** END author bio *** -->
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright &copy; 2003, Rob Tougher.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 86 of <i>Linux Gazette</i>, January 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>
<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 WIDTH="380">
<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">Exploring TCP/IP with TCPdump and Tethereal</FONT></STRONG></BIG></BIG>
<BR>
<STRONG>By <A HREF="../authors/vinayak.html">Vinayak Hegde</A></STRONG>
</CENTER>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
<h3> The shortest introduction to TCP/IP </h3>
<p align=justify>
TCP/IP has become the de facto standard protocol for communication between
computers. IP (Internet Protocol) provides functionality at the network layer
(addressing and routing) while TCP (Transmission Control Protocol) provides
(virtual) end-to-end connectivity. The <b> TCP/IP family </b>includes a host
of other useful protocols such as <b> ICMP </b> (Internet Control Message
Protocol), <b> IGMP </b> (Internet Group management protocol) and <b> UDP </b>
(User Datagram Protocol). An
overwhelming majority of today's networks use TCP/IP. Almost every other
application today incorporates some kind of a network functionality hence it
has become necessary for every programmer to have at least a working knowledge
of TCP/IP.
</p>
<p align=justify>
Communication between computers using TCP/IP takes place through the exchange of
packets. A packet is a PDU (Protocol Data Unit) at the IP layer. The PDU at the
TCP layer is called a segment while a PDU at the data-link layer (such as Ethernet)
is called a frame. However the term packet is generically used to describe the data
unit that is exchanged between TCP/IP layers as well as between two computers.
</p>
<p align=justify>
This is how an Ethernet frame looks:
<table bgcolor=#AAFFFF>
<td>
<pre>
+------------------------------------------------------------------+
| | | | | |
| Ethernet| IP | TCP | Encapsulated | Ethernet |
| Header | Header | Header | Data | Trailer |
| | | | | (FCS) |
+------------------------------------------------------------------+
<- 20 bytes -> <- 40 bytes ->
<---------- max length = 1500 bytes ---------->
FCS stands for Frame Check Sequence.
</pre>
</td>
</table>
</p>
<h3> TCPdump and Tethereal</h3>
<p align=justify>
TCPdump is a utility that allows a user to intercept and capture packets
passing through a network interface. This is an extremely nifty little utility
which can help a programmer to troubleshoot network applications. Because this
utility captures all the packets received by a network interface, it can be used
for used for unlawful purposes as well.
</p>
<p align=justify>
Normally only the packets which are addressed to a network interface are intercepted
and passed onto the upper layers of the TCP/IP protocol layer stack. Other packets
which are not addressed to the interface are ignored. In <b>Promiscuous</b> mode,
the packets which are not intended to be received by the interface are also
intercepted and passed onto the higher levels of the protocol stack. TCPdump works
by putting the network interface into promiscuous mode.
</p>
<p align=justify>
TCPdump uses the libpcap (packet capture library) which is freely available. The
libpcap library is versatile and works with BSD packet filter, the SVR4 Data-link
Provider Interface (DLPI) and the Linux SOCK_PACKET interface. Tethereal which is
the command line version of the popular network traffic analyser tool ethereal
also uses pcap packet capture library. Tethereal is a powerful tool for analysing
network traffic and also provides more facilities for decoding packets as compared
to TCPdump. Ethereal the GUI tool for analysing packets is extremely good and one can
see the different flags and options which have been used in a hierarchical way.
The best feature of ethereal is it can piece together the different fragments of the
the communication between two computers and show the whole ASCII text that was
exchanged during the conversation.
</p>
<h3> The TCP and IP packet format </h3>
<p align=justify>
ASCII representation from <a href="http://www.faqs.org/rfcs/rfc791.html"> RFC 791 </a>
<table>
<td bgcolor=#AAFFFF>
<pre>
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Version| IHL |Type of Service| Total Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Identification |Flags| Fragment Offset |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Time to Live | Protocol | Header Checksum |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Source Address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Destination Address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Options | Padding |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
IP Header Format
</pre>
</td>
</table>
</p>
<p align=justify>
ASCII representation from <a href="http://www.faqs.org/rfcs/rfc793.html"> RFC 793 </a>
<table>
<td bgcolor=#AAFFFF>
<pre>
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Source Port | Destination Port |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Sequence Number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Acknowledgment Number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Data | |U|A|P|R|S|F| |
| Offset| Reserved |R|C|S|S|Y|I| Window |
| | |G|K|H|T|N|N| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Checksum | Urgent Pointer |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Options | Padding |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| data |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
TCP Header Format
</pre>
</td>
</table>
</p>
<h3> Examples of Packet capture using TCPdump and Tethereal </h3>
<p align=justify>
You can experiment with TCPdump on any interface through which we can conduct
network transactions. To list the different interfaces connected to your
computer, you can give the command
<table>
<td bgcolor=#FFAADD>
<pre>
#ifconfig -a
</pre>
</td>
</table>
This will list out all the network interfaces connected to your system including
the loopback interface. If you are connected to the net using a dialup line, you
can also use the interface ppp0 for experimenting and debugging your applications
using TCPdump.
</p>
<p align=justify>
<b> Example #1 </b><br>
This is a snippet (from the file tcpdumpppp) of the captured packet using a dialup line (PPP).
The -vvv flag tells tcpdump to be very very verbose. The other switches for controlling
verbosity are -v and -vv.
<table>
<td bgcolor=#FFAADD>
<pre>
#tcpdump -vvv &gt; tcpdumpppp
tcpdump: listening on ppp0
</pre>
</td>
</table>
The capturing of packets is stopped by pressing CTRL-C.
<table>
<td bgcolor=#FFFF99>
<pre>
15:57:58.181078 207.219.33.101.http &gt; 203.94.236.47.33003: P 1:1399(1398) ack 736 win 31856 <nop,nop,timestamp 547724602 2802054> (DF) [tos 0x10] (ttl 38, id 28827, len 1450)
</pre>
</td>
</table>
Some of the information can be interpreted from the about packet dump
<ul>
<li> The protocol used is http (port 80 has been decoded as http).
<li> The local IP address assigned to me by my ISP after dialing up is 203.94.236.47 (this can be verified by grepping in /var/log/messages
<li> The http server's IP is 207.219.33.101 (IP have been changed for security reasons).
<li> The time-to-live is 38 hops.
<li> The Don't Fragment (bit) has been set informing the intermediate routers not to fragment the datagram.
<li> The ACK flag has been set (ack number 736 - piggybacking).
<li> The window size is 31856.
<li> The port on the receiver end is 33003
</ul>
</p>
<p align=justify>
<b> Example #2 </b> <br>
This packet dump was captured from a NIC (interface denoted by eth0)
<table>
<td bgcolor=#FFAADD>
<pre>
#tcpdump -a -i eth0
</pre>
</td>
</table>
<table>
<td bgcolor=#FFFF99>
<pre>
06:21:11.414863 &gt; pca03.nt.co.in.ssh &gt; pcc03.mum.nt.co.in.4944: P 252143283:252143331(48) ack 2638534821 win 62780 (DF) [tos 0x10]
E^P ^@ X .... @^@ @^F .. N .... ....
.... .... ^@^V ^S P ^O^G f.. .. D ....
P^X .. < .. t ^@^@ k + Y^Q .... .. (
^.. )^G c 3 ^\ v t.. ..^G ^J.. .. t
9.. .. - F.. .... 6.. /.. .... 9..
[.. .... G.. .. d
</pre>
</td>
</table>
Here we are telling TCPdump to resolve IPs to domain names if possible (-a)
and explicitly asking it to capture packets on interface eth0. If we don't give the
(-i) option TCPdump itself searches for the interfaces and then starts capturing
packets arriving on them.
Some of the information that can be gleamed from the above packet dump is:-
<ul>
<li> The ssh port (22) has been used on the server side. This can be seen from
the /etc/services file.
<li> One of the bits of Type of Service (TOS) has been set so the QoS enabled networks
can give the requested TOS to the packet.
<li> The window has been advertised as 62780.
<li> The length of the packet is 48 bytes.
</ul>
</p>
<b> Example #3 </b> <br>
<p align=justify>
The following snippet shows a packet dump of SYN (connection requesting) packet.
The packet dump was taken on Ethernet.
<table>
<td bgcolor=#FFFF99>
<pre>
15:57:56.074928 203.94.236.47.33003 &gt; 216.239.33.101.http: S [tcp sum ok] 937694521:937694521(0) win 5840 <mss 1460,sackOK,timestamp 2801712 0,nop,wscale 0> (DF) (ttl 64, id 54537, len 60)
</pre>
</td>
</table>
The following information can be interpreted from the above dump:-
<ul>
<li> The Header checksum is correct ([tcp sum ok])
<li> This is a SYN packet (denoted by S).
<li> The amount of data encapsulated by tcp segment is 0.
<li> The window scaling option has been set to null.
<li> The MSS (Maximum Segment size is 1460). On Ethernet MSS = 1500 - 40 = 1460.
<li> The Length of the packet is 60 bytes (20 + 40) (see diagram above)
</ul>
</p>
<p align=justify>
<b> Example #4 </b> <br>
The following packet dump was taken using tethereal
<table>
<td bgcolor=#FFAADD>
<pre>
#tethereal -i lo
</pre>
</td>
</table>
<table>
<td bgcolor=#FFFF99>
<pre>
26 19.624878 localhost.localdomain -&gt; localhost.localdomain TCP 33283 &gt; http [FIN, ACK] Seq=877643253 Ack=882239950 Win=37296 Len=0
</pre>
</td>
</table>
As can be seen be seen from the above output the output of tethereal is not much different from
TCPdump. The above is a FIN,ACK Packet (to close the connection). Tethereal when used with it's
front-end ethereal can be very useful to detect network anomalies as well.
</p>
<h3> Final Words </h3>
<p align=justify>
While TCPdump is an extremely good tool, it focuses mainly on TCP/IP protocol. It does it's job well.
Ethereal is much more versatile and can understand a variety of protocols. Also, the user interface of
ethereal is well designed so that even a newbie can understand which packets are getting captured and
what information do they contain. The good interface makes the learning process even more enjoyable.
</p>
<h3> Resources </h3>
<ul>
<li> <a href="http://www.faqs.org/rfcs/"> Protocol RFCs </a>
<li> W. Richard Stevens TCP/IP Illustrated Vol I
<li> <a href="http://www.tcpdump.org"> TCPdump home </a>
<li> <a href="http://www.ethereal.com"> Ethereal Homepage </a>
</ul>
<!-- *** BEGIN author bio *** -->
<P>&nbsp;
<P>
<!-- *** BEGIN bio *** -->
<P>
<img ALIGN="LEFT" ALT="[BIO]" SRC="../gx/2002/note.png">
<em>My life changed since I discovered Linux. Suddenly Computers became
interesting as i could try out lots of stuff on my Linux box due to the easy
availably of source code. My interests are predominantly in the fields of
networking, embedded systems and programming languages. I currently work for
Aparna Web services where we make Linux accessible for academia/corporations by
configuring remote boot stations (Thin Clients).
</em>
<br CLEAR="all">
<!-- *** END bio *** -->
<!-- *** END author bio *** -->
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright &copy; 2003, Vinayak Hegde.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 86 of <i>Linux Gazette</i>, January 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>
<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 WIDTH="380">
<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">Is vmWare good for Linux users?</FONT></STRONG></BIG></BIG>
<BR>
<STRONG>By <A HREF="../authors/ward.html">Alan Ward</A></STRONG>
</CENTER>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
<p align=center><i>The pros and cons of vmWare for the Linux enthusiast.</i></p>
<p>vmWare is a virtual machine. That is to say, it emulates an Intel-based PC in
much the same way there are emulators for Motorola-based machines out there. Though
the fact that it is emulating an Intel-based platform while running on ... an Intel-
based platform (!) means that vmWare can in fact pass many instructions straight to
the CPU for execution with no intermediate translation, thus speeding up the process
somewhat. This is a bit different from a Java virtual machine, for instance, where
the emulator gets to translate Java byte-codes to Intel instructions before getting
them executed.</p>
<p>Yes, it is a commercial program; i.e. you <EM>should</EM> pay for it, though you do get to
evaluate for free. Now, before going into the details, allow me to state my position
on commercial programs: I am not against commercial programs. I have used several
commercial programs that were in fact pretty good, and well worth the money invested.
However, I do prefer open-source software, not for the ecomical aspect but because that
if - or rather when - something goes wrong or is not quite what I need, I
can fix it myself instead of depending on a corporation to do it at their leasure.
I have nothing against vmWare, on the contrary ... but for the above reason I would
much prefer to be reviewing an open source version of the same type of program.</p>
<p><b>Why use vmWare?</b></p>
<p>1/. One good reason to use it is when you really must. For example, I use a laptop
at work that is shared between several people (not yet Linux users), and that
for mainly administrative reasons:</p>
<ul><li>must run Windows 2000</li>
<li>cannot be repartitioned as a dual-boot</li></ul>
<p>On the other hand, I teach a course on web site creation and administration with
Apache and PHP, for which it is expedient to use a laptop running Linux and
X Windows.</p>
<p>2/. vmWare sets up a virtual machine that you can configure according to your needs -
not according to the real hardware on your computer. For example, it sets up by
default a 4 GByte file on the hard drive to emulate the drive on the virtual machine.
To the virtual machine, this file looks like a SCSI drive, when it is in fact just
a file on the IDE drive. Also by default, it uses an IDE CD drive just like ... an IDE
CD drive. Though you can tell it to use it as a SCSI drive, or set up an ISO CD-ROM
image as a drive with the CD inside it (e.g. for installation). You get to use hardware
you don't actually have, such as tape drives. Good for experimentation.</p>
<p align=center><img src="misc/ward/screen0.jpg"></p>
<p>3/. You can also have several virtual machines running at the same time, and set up a
local network on your computer with different operating systems. This is good either to </p>
<ul><li>try out a new OS without repartitionning (wiping it back out is just a click away :-)</li>
<li>see how the new OS integrates your existing network before having to format a
(sometimes unavaiblable) computer</li>
<li>show people how multiple OS integrate with a single LCD projector</li></ul>
<p align=center><img src="misc/ward/screen3.jpg"></p>
<p>4/. If you really need a program that does not run on the main operating system,
you get it in a window.</p>
<p>Rather interestingly, this used to be a problem for Linux users that needed
programs available only under Windows (usually commercial). Word processors and
spreadsheets were a bit of a problem before StarOffice and OpenOffice became
commonplace. Right now, I find I often have this problem in reverse: I get interesting
programs for Linux that are available only with difficulties for Windows, or not any
recent versions. Some examples are mathematical plotting tools such as gnuplot and scilab,
or just user programs I prefer like Evolution.</p>
<p><b>Why not use vmWare?</b></p>
<p>1/. Speed. After all, we are sharing a single CPU between two or more operating
systems. Though this problem is mitigated if we run user-land programs on just one
system at a time. By the way, it would be nice on a SMP system to have vmWare dedicate
one CPU to each virtual machine ... though probably impossible to have without
redesigning the host operating system's kernel completely.</p>
<p>2/. Speed once again. You do need plenty of physical RAM to run at a reasonable
speed. Try to have at least 128 MByte per operating system, or be prepared for intensive
swapping. This may be a problem on a laptop, either way (remember that a laptop's hard disk
is not built for intensive use). Try not to use the virtual machines' swap systems.</p>
<p>3/. Speed, third time 'round. All peripherics (drives, network cards) are shared
between virtual machines. For example, on a machine with two virtual machines running
and with much luck, each system gets a fair share (one third - remember the host
system!) of the bandwidth. Actual results can be much lower, depending mainly on the
host operating system's design and efficiency.</p>
<p><b>Installing vmWare</b></p>
<p>Using vmWare is rather easy. I got to install only the Windows version (because of
bandwith problems for downloading), and as noted above it is the version I needed the most.
However, it may make more sense to use the more stable OS as host; i.e. run Windows
in a virtual machine on a Linux host computer instead of the opposite as I was forced
to do.</p>
<p>Installing Linux in a virtual machine is as easy as:</p>
<ul><li>creating a new virtual machine with the desired characteristics</li>
<li>inserting the Linux bootable CD in the drive (or you could set up it's ISO
image as a virtual CD drive)</li>
<li>powering up the virtual machine</li></ul>
<p>I installed both SuSE 8.1 and Mandrake 8.2 with no problems in this way,
though the virtual machine insisted on an IDE CD drive for booting. I was able
to switch to a SCSI drive once the system was installed, though.</p>
<p align=center><img src="misc/ward/screen2.jpg"></p>
<p>The virtual machine has access to the network through a proprietary vmWare
bridging protocol - but only if your network card has been enabled on the host system.
It can either use a static IP address or get a dynamic address from your
network DHCP server.</p>
<p>You can then connect to a server running on the virtual machine from the
virtual machine itself, from other computers on your network, or even from
the host computer through the virtual machine's external network address.</p>
<p>Note that vmWare assigns to both the host system and virtual machines addresses
on subnetworks 192.168.19.0/24 and 192.168.199.0/24 for its bridging protocol -
you cannot use these for your connections.</p>
<p align=center><img src="misc/ward/screen4.jpg"></p>
<p>There may be more straightforward ways of passing files from one system to
another, but the easiest I found was to set up a Samba server on the virtual
Linux machine. It works well enough, and is logically faster than a 100 Mbaud
link, but may not be a good idea in a production environment.</p>
<p align=center><img src="misc/ward/screen5.jpg"></p>
<p>The end result of all this is that I find vmWare a fascinating concept - with
its drawbacks, true enough. It can be useful in a development environment, either
for programming or for systems administration. But it should be avoided for
production: if you really need two operating systems, you may be better off buying
two computers!</p>
<p>PS. Should anybody want to translate this article: I wrote it in
the spirit of the GPL software licence. i.e. you are free (and
indeed encouraged) to copy, post and translate it -- but please,
PLEASE, send me notice by email! I like to keep track of translations --
it's good for the curriculum :-)</p>
<!-- *** BEGIN author bio *** -->
<P>&nbsp;
<P>
<!-- *** BEGIN bio *** -->
<P>
<img ALIGN="LEFT" ALT="[BIO]" SRC="../gx/2002/note.png">
<em>
Alan teaches CS in Andorra at high-school and university levels. His hobbies
include science photography (both digital and traditional), trekking, rock and
processor collecting.
</em>
<br CLEAR="all">
<!-- *** END bio *** -->
<!-- *** END author bio *** -->
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright &copy; 2003, Alan Ward.
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 86 of <i>Linux Gazette</i>, January 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>
<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 WIDTH="380">
<CENTER>
<BIG><BIG><STRONG><FONT COLOR="maroon">The Back Page</FONT></STRONG></BIG></BIG>
</CENTER>
</TD></TR>
</TABLE>
<P>
<!-- END header -->
<ul>
<li><a HREF="#greetings">Greetings from Iron</a>
<li><a HREF="#wacko">Wacko Topic of the Month</a>
<li><a HREF="#nottag">Not The Answer Gang</a>
<li><a HREF="#spam">World of Spam</a>
</ul>
<a name="greetings"></a>
<P> <hr> <P>
<!--====================================================================-->
<center><H3><font color="maroon">Greetings from Iron</font></H3></center>
<P> <HR> <P>
<!--======================================================================-->
<P> Look ma, I got a greetings column just like Heather now!
<P> Only two changes to LG's format this month:
<OL>
<LI> The author bios are the bottom of the articles again. Raj Shekhar
requested this, so he can print the articles and read them off-line while
still seeing the bios. As always, the lastest bio and contact info is on
the author's Author page.
<LI> The yellow articles table on the Front Page and Site Map is smaller now
(when viewed in a graphical browser). Now, if I could just make it smaller
vertically....
</OL>
<P> SSC was closed Christmas week so I had a wonderful five days off. I finished
a long-awaited project, updating the
<A HREF="http://www.cheetahtemplate.org/learn.html">Cheetah Users' Guide</A>.
<P> Then I started putting together a computer for my mom. Right now she's got
Windows 95 on a 486. I gave her the
<A HREF="http://store.linuxjournal.com/Merchant2/merchant.mv?Screen=PROD&Store_Code=LJS&Product_Code=litw&Category_Code=B">Linux in the Workplace</A> book a month ago so that
the transition to Linux won't be a total shock. The book goes over the KDE
user interface step by step with lots of screenshots. Then I had her open her
Word documents on my computer so she could verify they opened properly and that
the user interface was OK, before I commandeer her monitor and keyboard for the
new computer. I had her try out AbiWord, KWord (part of the KOffice suite) and
OpenOffice Writer. Both AbiWord and OpenOffice opened all the documents, but
OpenOffice handled her headers/footers and tabs the best and had a slightly better
user interface. KWord failed to open two of the documents, which had a .doc
extension but were really RTF (Rich Text Format). She doesn't know how they
got that way. So I used "Save As..." in OpenOffice to convert them back to Word
format.
<P> Rather than installing Debian from scratch and remembering all my
customizations, I decided to clone my existing partitions and delete what she
won't use. That went well enough, although again I had to use "linear" in
/etc/lilo.conf instead of "lba32". That's the third drive it's happened with,
which confirms that it's my BIOS' fault, not the drives'. We'll see what the
new motherboard does when I connect it up.
<P> I did have trouble making a boot floppy. First, I couldn't find my Debian
rescue disk. Then I found a disk that booted my current system. It contained
just a kernel, no LILO. I could use <CODE>rdev</CODE> to change the root
device, but I didn't want to sabotage my only boot floppy, so I tried to make
another boot floppy. But every time I copied the kernel to a disk and booted
from it, it would hang after the "Uncompressing Linux..." message, saying something
like, "unexpected end of compressed data: system halted". One disk gave an I/O
error so I threw it out, but it wouldn't work on two other disks either. I tried
both <CODE>cp</CODE>'ing and <CODE>dd</CODE>'ing the kernel, but neither way
worked. Then I realized I could set up LILO for my new system from my old
system, so I did that instead. The first time I got the "L 99 99 99" error, but
the second time it worked.
<P> Friday my DSL went down, and I spent four days calling Qwest and The River
(my ISP) to do something about it. Actually, it's not "down" but there's 99%
packet loss, which is essentially the same thing. It would come up every
several hours just long enough for a bit of e-mail to slip in and out, and then
go down again. The ISP and Qwest wouldn't support Linux so I had to plug in my
roommate's Windows XP box so they could troubleshoot it. We checked the IP
configuration multiple times and reconfigured the DSL modem (which involves
plugging in a serial "management cable" and running
Minicom/Kermit/HyperTerminal and typing commands to a router OS). I kept
asking, "Can you see the ping packets going back and forth? Can you see the
ATM packets?" They could (sometimes), but I wasn't getting replies. I decided
to call them both once a day until somebody took responsibility for it, or I
cancelled the service, whichever came first. Finally on Monday, Qwest admitted
they were having severe hardware problems in the DSLAM (that's the DSL
connector in the central office), and that it had been going up and down for a
week. Contradicting what the woman had told me Sunday, that there had been a
DSLAM problem but they had fixed in at 10pm Saturday. It's doing a lot better
today (Tuesday), but it's still not fixed.
<P> Just for fun, here's a
<A HREF="misc/backpage/mad_mike_nolegos.png">picture of me</A> that LJ made for the
<A HREF="misc/backpage/lj-cover104.png">December cover</A>, then decided not to
use. Here's how they
<A HREF="misc/backpage/mad_mike.png">would have gone together</A>. (I can already
see Ben Okopnik saying, "I knew it. I just knew it. You can't trust that Mike
any farther than you can throw him....") It was Don Marti's
idea, but then the Marketing department decided they couldn't have a picture of
somebody smashing people with a hammer on the cover, even if they are lego
people....
<a name="wacko"></a>
<P> <hr> <P>
<!--====================================================================-->
<center><H3><font color="maroon">Wacko Topic of the Month</font></H3></center>
<P> <HR> <P>
<!--======================================================================-->
<EM>Thomas Adam got this from his local LUG. Ben Okopnik says it's a
</EM>very<EM> old list, and he can't figure out which version of csh or
Unix they apply to, certainly not to <CODE>bsd-csh</CODE> or <CODE>tcsh</CODE>
under Linux.</EM>
<BLOCKQUOTE>
The following extracts are typed into the Unix "Cshell":-
<PRE>
% ^How did the sex change^operation go?
Modifier failed.
% make love
Make: Don't know how to make love. Stop.
% man woman
No manual entry for woman.
% sleep with me
bad character
% got a light?
No match.
% man: why did you get a divorce?
man:: Too many arguments.
% scan for &lt;&lt;"Arnold Schwarzenegger"^J^D
"Arnold Schwarzenegger": &lt;&lt; terminator not found
% ar m God
ar: God does not exist
% ^What is saccharine?
Bad substitute.
% %blow
%blow: No such job.
% cat 'the can of tuna'
cat: cannot open the can of tuna
$ mkdir matter; cat&gt;matter
matter: cannot create
$ drink <bottle; opener
bottle: cannot open
opener: not found
</PRE>
</BLOCKQUOTE>
<HR NOSHADE WIDTH="80%%"> <!--*********************** -->
Here's another old Unix joke Walt R sent in. It's a bit late for Christmas,
but at least now it's in LG for posterity.
<H4>Santa learns Unix(Author Unknown)</H4>
<PRE>
better !pout !cry
better watchout
lpr why
santa claus &lt; north pole &gt; town
cat /etc/passwd &gt; list
ncheck list
ncheck list
cat list | grep naughty &gt; nogiftlist
cat list | grep nice &gt; giftlist
santa claus &lt; north pole &gt; town
who | grep sleeping
who | grep awake
who | grep bad || good
for (goodness sake) {be good}
echo "Oh,"
better !pout !cry
better watchout
lpr why
santa claus &lt; north pole &gt; town
</PRE>
<a name="nottag"></a>
<P> <hr> <P>
<!--====================================================================-->
<center><H3><font color="maroon">Not The Answer Gang</font></H3></center>
<P> <HR> <P>
<!--======================================================================-->
<BLOCKQUOTE><STRONG>
when i start up my pc sometimes a window box comes up saying your system has
performed an illegal operation and it reads:
<BR><TT>spool32 caused invalid page in
module spool32 exe at 0167:00402015</TT><BR>
please help
</STRONG></BLOCKQUOTE>
<H4>Iron:</H4>
That's normal Windows behavior.
<H4>Thomas Adam:</H4>
My only guess is that you're using Linux (good man!)
and that you've neglected to realise that you
currently have the BSOD (Blue Screen Of Death)
screensaver running.
I know it is confusing, especially as you've probably
only just made the crossover from Windows to Linux,
but bear with us, the BSOD screensaver is only a
joke!! You poor thing -- you don't have to be haunted
anymore. YOU'RE FREE!!
<IMG ALT=":)" SRC="../gx/dennis/smily.gif" WIDTH="20" HEIGHT="24">
<IMG ALT=":)" SRC="../gx/dennis/smily.gif" WIDTH="20" HEIGHT="24">
<IMG ALT=":)" SRC="../gx/dennis/smily.gif" WIDTH="20" HEIGHT="24">
<IMG ALT=":)" SRC="../gx/dennis/smily.gif" WIDTH="20" HEIGHT="24">
<HR NOSHADE WIDTH="80%%"> <!--*********************** -->
<BLOCKQUOTE><STRONG>
my question is<BR>
1. The beginning of gangs?<BR>
2.their reason for joining a gang in those years?<BR>
3. In what state/country did gang first began?<BR>
please write as much as you can about this is for a report.
</STRONG></BLOCKQUOTE>
<H4>Iron:</H4>
(1) What is a gang? Is a group of close friends a gang? If not, what would they
have to do to be a gang? Get a name? A clubhouse? A secret handshake?
Choose a bandana color? Look menacing? Sell drugs and shoot people?
<P> (2) I bet you can already answer this. If not, you can ask some gang members, or
see any of the hundreds of studies and documentaries that focus on this
question. Or take any pop movie (Colors, West Side Story, American History X,
8 Mile, A Clockwork Orange, Quadrophenia, etc) and ask, why did those people
join gangs? What benefits do they get by being in them? What is their family
life like? Is there something missing in their family life? Is there any
connection between the two?
<P> Quadrophenia has a lot to say about this. Why is Jimmy a mod? Why is he so
excited about the demonstration in Brighton? Why is he so devastated when he
goes to Brighton again and it's empty? How does his mom treat him? How does
his dad treat him? When he tries to convince his girlfriend not to dump him,
what are their differing views about the Brighton rumble?
<P> (3) depends on how you answer (1).
<HR NOSHADE WIDTH="80%%"> <!--*********************** -->
<BLOCKQUOTE><STRONG>
what is meant by Tier 2/3 ISPs<BR>
send tme the details if u dont mind
</STRONG></BLOCKQUOTE>
<H4>Rick Moen:</H4>
the details r that u dont quite grasp what "linux-questions-only@ssc.com"
means. thx. have a nice day. c ya.
<a name="spam"></a>
<P> <hr> <P>
<!--====================================================================-->
<center><H3><font color="maroon">World of Spam</font></H3></center>
<P> <HR> <P>
<!--======================================================================-->
<P> The Register has an article on how
<A HREF="http://www.theregister.co.uk/content/28/28561.html">Nigeria scam money
can help pay off the US national debt</A>!
<HR NOSHADE WIDTH="80%%"> <!--*********************** -->
&lt;title&gt;Wipe Out Junk Email!&lt;/title&gt;<BR>
a.copy:link {font-family: verdana; font-size: 13px; color: black; text-deco=
ration: none; }=0D<BR>
&lt;span style=3D"font-family: verdana; font-size: 12px;"&gt;If you can not=
see this please go to:=0D
<P>
&lt;!--TRACKING IMAGE--&gt;&lt;!--TRACKING IMAGE--&gt;=0D
&lt;img src=3D"http://www.mailwiper.com/images/501.gif" width=3D"1" height=3D"=
1" alt=3D"" border=3D"0"&gt;=0D
&lt;!--TRACKING IMAGE--&gt;&lt;!--TRACKING IMAGE--&gt;&lt;/td&gt;
<P>
Tired of Deleting Junk Mail?<BR>
Are you fed
up with a <b>flood</b> of unwanted <b>offensive eMails?</b> This is referred to
as junk e-mail, Spam, <b>unsolicited e-mail...Nasty eMails etc</b>.
The problem is it's <b>disgusting and ugly</b>, it's an <b>invasion of your
privacy</b>, and it is <b>definitely a huge waste of Your time</b>.
<P>
Wipe Out Junk Mail Forever!<BR>
XXXXX works 100% of the time or your money back!
<BLOCKQUOTE><EM>
[Spam-killing software that's advertised in a highly decorated HTML
spam? That really gives me a lot of confidence. Especially when the ad
has a TRACKING IMAGE built into it. How do I know this software I'm buying
won't have its own tracking utility built into it too? -Iron.]
</EM></BLOCKQUOTE>
<HR NOSHADE WIDTH="80%%"> <!--*********************** -->
I have visited your site and I think that design looks not good now.
Here we are - XXXXX.com. Check it out! We have hired 2 new designers
from Indonesia. They rocks!
<HR NOSHADE WIDTH="80%%"> <!--*********************** -->
Do not show ugly website to people! Make cool website.
Let it start here - www.liquid2d.com .
Website templates are here for your website. Use most
advanced design concept from the best designers.
Become the best amoung other websites. Use the
best designers in the world.
<HR NOSHADE WIDTH="80%%"> <!--*********************** -->
<PRE>
SPAM: -------------------- Start SpamAssassin results ----------------------
SPAM: This mail is probably spam. The original message has been altered
SPAM: so you can recognise or block similar unwanted mail in future.
SPAM: See http://spamassassin.org/tag/ for more details.
SPAM:
SPAM: Content analysis details: (25.60 hits, 5 required)
SPAM: INVALID_DATE_TZ_ABSURD (4.4 points) Invalid Date: header (timezone does not exist)
SPAM: SUBJ_HAS_SPACES (4.2 points) Subject contains lots of white space
SPAM: INVALID_MSGID (1.2 points) Message-Id is not valid, according to RFC 2822
SPAM: BAD_CREDIT (2.5 points) BODY: Eliminate Bad Credit
SPAM: NO_OBLIGATION (1.5 points) BODY: There is no obligation.
SPAM: NO_FEE (0.9 points) BODY: No Fees
SPAM: MORTGAGE_OBFU (0.7 points) BODY: Attempt at obfuscating the word "mortgage"
SPAM: WHY_WAIT (0.7 points) BODY: What are you waiting for
SPAM: CLICK_BELOW (0.3 points) BODY: Asks you to click below
SPAM: SPAM_PHRASE_08_13 (-0.1 points) BODY: Spam phrases score is 08 to 13 (medium)
SPAM: [score: 8]
SPAM: HTML_70_90 (0.9 points) BODY: Message is 70-90% HTML tags
SPAM: KNOWN_MAILING_LIST (-2.1 points) Email came from some known mailing list software
SPAM: DATE_IN_FUTURE_06_12 (1.7 points) Date: is 6 to 12 hours after Received: date
SPAM: SUBJ_HAS_UNIQ_ID (0.2 points) Subject contains a unique ID
SPAM: RCVD_IN_DSBL (3.2 points) RBL: Received via a relay in list.dsbl.org
SPAM: [RBL check: found 50.148.244.195.list.dsbl.org]
SPAM: RCVD_IN_MULTIHOP_DSBL (0.8 points) RBL: Received via a relay in multihop.dsbl.org
SPAM: [RBL check: found 2.16.57.200.multihop.dsbl.org]
SPAM: RCVD_IN_OSIRUSOFT_COM (0.4 points) RBL: Received via a relay in relays.osirusoft.com
SPAM: [RBL check: found 50.148.244.195.relays.osirusoft.com.]
SPAM: RCVD_IN_UNCONFIRMED_DSBL (0.8 points) RBL: Received via a relay in unconfirmed.dsbl.org
SPAM: [RBL check: found 2.16.57.200.unconfirmed.dsbl.org]
SPAM: X_OSIRU_OPEN_RELAY (2.7 points) RBL: DNSBL: sender is Confirmed Open Relay
SPAM: CTYPE_JUST_HTML (0.7 points) HTML-only mail, with no text version
SPAM:
SPAM: -------------------- End of SpamAssassin results ---------------------
</PRE>
<HR NOSHADE WIDTH="80%%"> <!--*********************** -->
Dear in christ,<BR>
Permit me to inform you of my desire of going into business relationship with you. I got
your name and contact from the Ivoirian chamber of commerce and industry.
<P> I prayed over it and selected your name among other names due to its
esteeming nature and the recommendations given to me as a reputable and trust
worthy person that I can do business with and by the recommendation , I must
not hesitate to confide in you for this simple and sincere business . I am Miss
PAULINE ATTAN the only daughter of late Mr.and Mrs. ATTAN . My father was a
very wealthy cocoa merchant in Abidjan , the economic capital of Ivory coast,
my father was poisoned to death by his business associates on one of their
outings on a business trip .
<P> My mother died when I was a baby and since then my father took me so
special. Before the death of my father on November 2001 in a private hospital
here in Abidjan he secretly called me on his bed side and told me that he has
the sum of eighten million,five hundred thousand United State Dollars. USD
($18.500,000) left in one of the Security Companies in overseas.
<HR NOSHADE WIDTH="80%%"> <!--*********************** -->
<BLOCKQUOTE><EM>
[Note the use of quotes to confuse spamfilters. -Iron.]
</EM></BLOCKQUOTE>
<P> From: A Millionaire &lt;success@dailypromo.com&gt;
<P> You May Be closer (maybe hours away) To 'Financial' 'Freedom'
than you think...
<P> If you needed '$24,000' in 24 Hours
And your life depended on it?. How would you do it?
'Click' 'Here'
<HR NOSHADE WIDTH="80%%"> <!--*********************** -->
<P> U-harvest turns your PC to a powerful marketing machine. It scans, in a
blinding speed, every word and every page of targeted, well defined list of
websites, defined by your favorite search engine and harvests e-mail addresses.
<P> U-harvest- business at the speed of thought.
<HR NOSHADE WIDTH="80%%"> <!--*********************** -->
I WANT TO ORDER 50 OF THIS BOOK [Linux Firewalls (2nd Edition)] FORM YOUR
SHOP AND I WANT MY ORDER TO BE SHIPPED TO MY SHOP IN LAGOS NIERIA I WILL BE
HAPPY IF YOU CAL.
<HR NOSHADE WIDTH="80%%"> <!--*********************** -->
I'd like to stay informed. Could you add my home account to our mailing list?
It's XXXXX@hotmail.com Thanks for adding me to your mailing list.
And, if you're every in the market for music industry contacts let me know.
<HR NOSHADE WIDTH="80%%"> <!--*********************** -->
Please note that after years, the registration on the domain name
PhpInternational.Com was not renewed and this domain had become available to
register. Consequently, we have been approached to market this domain name
that has beentracked an PhpInternational.Com now available from us for
IMMEDIATE transfer.
With so many companies that could benefit from this domain, along with what
many would consider to be a "wholesale price", we hope to secure a quick
transfer.
<P> Please note that the domain name market is extremely solid at the moment and
similar domains are currently selling on afternic.com, greatdomains.com
(domain auction sites) and by domain name brokers, in some cases, for many
thousands of US dollars.
<HR NOSHADE WIDTH="80%%"> <!--*********************** -->
Do you hate those annoying, unwanted pop-up ads?
Sure you do!! Everyone does!!
Get rid of pop-up ads with the Pop-Up Defender Software!!
<P> For only $19.95 you can regain control of your web browsing
experience and eliminate unwanted pop-ups!!
SAVE $20.00 off the regular price!!
<HR NOSHADE WIDTH="80%%"> <!--*********************** -->
Do you want to run your own dating or adult contact site for free ?
Whether you are interested in making money or new friends/contacts, running
your own dating site can be the best way to do it.
<HR NOSHADE WIDTH="80%%"> <!--*********************** -->
I am Madam Brenda Williams wife/widow to late Gen Patrick Williams
an Army Officer, im also a mother of 3 lovely boys, Patrick
(12yrs), Kevin (8yrs), Dotun which is a traditional name, he his 5
yrs, and im also the last wife out of 3, married to my late husband.
<P> Before my husband died he willed all his landed property to his elder
wives and children, all the elder wives and their children enjoyed
what is left of our husbands wealth, leaving me the last wife with
nothing, well we did not get along well when he was alive but he
loved the kids i had for him.
<P> Things are not going too well, after 1yr of his death, i mean raising
the kids, sending them to school, clothing them even shelter and
feeding, my parents are already dead, just me in this miserable world
and i have just 2 months to evacuate the house im staying now, all
the other wives dont allow me in their houses including the house i
used to live with my husband before he died or even render any kind
of help, but i really loved my husband.
<P> Why i have contacted you is because my late husband left some money
for his children (7 million US Dollars) deposited in a Security
Company(www.XXXXX.net) abroad, which was revealed to me by
the family lawyer just 6 months ago, which he claimed to be the time
stated on the will by my late husband to avoid clashes between myself
and the other wives.
<P> But this money can only be claimed when each child is up to 21yrs in
age, not even myself can extract from this fund according to the
will. The other option is if i can provide someone(FORIEGNER) who
will stand as a caretaker for my kids and my self, and help invest
this money with profit in future.
<HR NOSHADE WIDTH="80%%"> <!--*********************** -->
Subject: Urgent for {%Address%}
<HR NOSHADE WIDTH="80%%"> <!--*********************** -->
Subject: Run in DOS mode.
<PRE>
--F5785stD5yBm2edp57QD583O07A3k2RY1
Content-Type: text/html;
Content-Transfer-Encoding: quoted-printable
&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;
&lt;iframe src=cid:J3d6lrE5 height=0 width=0&gt;
&lt;/iframe&gt;
&lt;FONT&gt;&lt;/FONT&gt;&lt;/BODY&gt;&lt;/HTML&gt;
--F5785stD5yBm2edp57QD583O07A3k2RY1
Content-Type: audio/x-midi;
name=mode..bat
Content-Transfer-Encoding: base64
Content-ID: <J3d6lrE5>
TVqQAAMAAAAEAAAA//8AALgAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAA2AAAAA4fug4AtAnNIbgBTM0hVGhpcyBwcm9ncmFtIGNhbm5vdCBiZSBydW4gaW4g
--F5785stD5yBm2edp57QD583O07A3k2RY1
--F5785stD5yBm2edp57QD583O07A3k2RY1
Content-Type: application/octet-stream;
name=pcmcia_result.htm
Content-Transfer-Encoding: base64
Content-ID: <J3d6lrE5>
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACBydW4gaW4g
RE9TIG1vZGUuDQ0KJAAAAAAAAAD0wSw9sKBCbrCgQm6woEJuWL9JbrGgQm4zvExuuaBCbtK/
UW63oEJusKBDbv2gQm5Yv0huqqBCbgimRG6xoEJuWL9GbrGgQm5SaWNosKBCbgAAAAAAAAAA
--F5785stD5yBm2edp57QD583O07A3k2RY1--
</PRE>
<BLOCKQUOTE><EM>
[Did you catch the names of those files? -Iron.]
</EM></BLOCKQUOTE>
<HR NOSHADE WIDTH="80%%"> <!--*********************** -->
Have you ever seen a fully automated popcorn vending machine that allows your
customer to insert a coin or coins and receive a bag of freshly cooked popcorn
within a minute, complete with buttery topping and a choice of delicious
flavorings?
Here is a unique opportunity to profit from healthy popcorn, the largest and
the fastest growing segment of the snack food industry.
<HR> <!-- ************************************************************** -->
<P> Happy Linuxing!
<P> Mike ("Iron") Orr<br>
Editor, <A HREF="http://www.linuxgazette.com/"><i>Linux Gazette</i></A>, <A
HREF="mailto:gazette@ssc.com">gazette@ssc.com</a>
<BR CLEAR="all">
<!-- *** BEGIN author bio *** -->
<P>&nbsp;
<P>
<!-- *** END author bio *** -->
<!-- *** BEGIN copyright *** -->
<hr>
<CENTER><SMALL><STRONG>
Copyright &copy; 2003, .
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
Published in Issue 86 of <i>Linux Gazette</i>, January 2003
</STRONG></SMALL></CENTER>
<!-- *** END copyright *** -->
<HR>
</BODY></HTML>