old-www/LDP/LG/issue61/lg_tips61.html

1071 lines
37 KiB
HTML
Raw Permalink Blame History

<!--startcut ======================================================= -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<META NAME="generator" CONTENT="lgazmail v1.3E.i">
<TITLE>More 2 Cent Tips & Tricks LG #61</TITLE></HEAD><BODY BGCOLOR="#FFFFFF" TEXT="#000000"
LINK="#3366FF" VLINK="#A000A0">
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<P>
<CENTER>
<!-- *** BEGIN navbar *** -->
<IMG ALT="" SRC="../gx/navbar/left.jpg" WIDTH="14" HEIGHT="45" BORDER="0" ALIGN="bottom"><A HREF="lg_answer61.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="../faq/index.html"><IMG ALT="[ FAQ ]" SRC="./../gx/navbar/faq.jpg"WIDTH="62" HEIGHT="45" BORDER="0" ALIGN="bottom"></A><A HREF="andreiana.html"><IMG ALT="[ Next ]" SRC="../gx/navbar/next.jpg" WIDTH="15" HEIGHT="45" BORDER="0" ALIGN="bottom" ></A><IMG ALT="" SRC="../gx/navbar/right.jpg" WIDTH="15" HEIGHT="45" ALIGN="bottom">
<!-- *** END navbar *** -->
</CENTER>
</p>
<!-- QUICK TIPS SECTION ================================================== -->
<!-- endcut ======================================================= -->
<center>
<H1><A NAME="tips"><IMG ALIGN=MIDDLE ALT="" SRC="../gx/twocent.jpg">
More 2&cent; Tips!</A></H1> <BR>
Send Linux Tips and Tricks to <A HREF="mailto:gazette@ssc.com">gazette@ssc.com</A></center>
<!-- BEGIN tips -->
<UL>
<!-- index_text begins -->
<li><A HREF="#2c/1"
><strong>Let cron put backup files into your Gnome trashcan</strong></a>
<li><A HREF="#2c/2"
></a>Baffled --or--
<br><A HREF="#2c/2"
><strong>Seeing what's changed since your tar backup</strong></a>
<li><A HREF="#2c/3"
><strong>2cent tip: lynx mpg123 and mp3.com</strong></a>
<li><A HREF="#2c/4"
></a>Dohhh! Check if your screen is really locked --or--
<br><A HREF="#2c/4"
><strong>The Unattended Risk</strong></a> Lock your system!
<li><A HREF="#2c/7"
><strong>Modem Question - Easy One</strong></a>
<li><A HREF="#2c/9"
><strong>Monitor goes blank in X</strong></a>
<li><A HREF="#2c/12"
><strong>Tips: sendmail offline</strong></a>
<li><A HREF="#2c/13"
><strong>Measure your modem connection - Bogospeed</strong></a>
<li><A HREF="#2c/14"
><strong>2-cent tip - module resource detection</strong></a>
<li><A HREF="#2c/15"
><strong>Backup via shell script</strong></a>
<li><A HREF="#2c/17"
><strong>devices list</strong></a>
<li><A HREF="#2c/19"
><strong>Linux core files</strong></a>
<li><A HREF="#2c/21"
><strong>linux login problem</strong></a>
<li><A HREF="#2c/23"
><strong>networked machine goes to sleep?</strong></a>
<li><A HREF="#2c/24"
><strong>NT Log on a Linux Box</strong></a>
<li><A HREF="#2c/25"
><strong>Graphics Programming for Printing / Faxing (Issue 60)</strong></a>
<li><A HREF="#2c/26"
><strong>About RS422</strong></a>
<li><A HREF="#2c/27"
><strong>x-base languages for Linux</strong></a>
<li><A HREF="#2c/28"
><strong>NT Event Reporting in Unix/Linux</strong></a>
<li><A HREF="#2c/29"
><strong>Need Outlook to speak to Linux</strong></a>
<li><A HREF="#2c/31"
><strong>Fat 32 Linux instillation</strong></a>
<li><A HREF="#2c/32"
><strong>Available spcae avail on Hd!</strong></a>
<!-- index_text ends -->
</UL>
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="2c/1"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">Let cron put backup files into your Gnome trashcan</FONT></H3>
Sat, 30 Dec 2000 01:02:24 -0500
<BR>From: Allan Peda (<a href="mailto:linux-questions-only@ssc.com?cc:tl082@yahoo.com">tl082@yahoo.com</a>)
<BLOCKQUOTE>
Cron to put bacup files in trash (if you have a gnome desktop):
</BLOCKQUOTE>
<BLOCKQUOTE>
I typed this up to keep my home dir clean, it assumes backup files over
1 day old should
be moved to the trashcan. I run it every 5 minutes under cron
</BLOCKQUOTE>
<BLOCKQUOTE><pre>
#!/bin/sh
# script to move trash files to trash can
# use cron to run this every 5 minutes
if [ x"$HOME" = x ]; then
echo "\$HOME not defined"
exit 1
fi
TRASHCAN=${HOME}'/.gnome-desktop/Trash/'
if [ ! -d $TRASHCAN ]; then
echo "Need a trash can to work"
exit 1
fi
FARGS=' -maxdepth 1 -type f -mtime +1 '
find ~ $FARGS -name '.saves-*' -exec mv {} $TRASHCAN \;
find ~ $FARGS -name '\#*\#' -exec mv {} $TRASHCAN \;
</pre></BLOCKQUOTE>
<!-- sig -->
<!-- end 1 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="2c/2"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">Seeing what's changed since your tar backup</FONT></H3>
Fri, 29 Dec 2000 09:35:11 -0800
<BR>Jim Dennis (<a href="mailto:linux-questions-only@ssc.com">The Answer Guy</a>)
<BLOCKQuote>
(If you have a full tar backup of your root and <TT>/usr</TT> filesystems
you can use the '<tt>tar df</tt>' or '<tt>tar dzf</tt>' directives to report on
differences between your current files and those in your backup.
</BLOCKQuote>
<!-- sig -->
<!-- end 2 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="2c/3"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">2cent tip: lynx mpg123 and mp3.com</FONT></H3>
Mon, 11 Dec 2000 19:58:01 -0800
<BR>From: collver@softhome.net(<a href="mailto:linux-questions-only@ssc.com?cc:collver@softhome.net">collver@softome.net</a>)
<BLOCKQUOTE>
mp3.com uses MIME to describe audio content to web browsers.
A year or two ago, mp3.com had instructions to set up audio/mpeg and
audio/mpegurl in Netscape. These MIME types no longer work because
mp3.com now uses audio/x-mpeg and audio/x-mpegurl instead.
</BLOCKQUOTE>
<BLOCKQUOTE>
Two places to configure viewers for MIME types:
</BLOCKQUOTE>
<BLOCKQUOTE><BLOCKQuote>
/etc/mailcap
$HOME/.mailcap
</BLOCKQuote></BLOCKQUOTE>
<BLOCKQUOTE>
I suggest editting $HOME<tt>/.mailcap</tt> as it overrides <TT>/etc/mailcap</TT>.
</BLOCKQUOTE>
<BLOCKQUOTE>
You might already have entries placed by Netscape. If so, they assume you
only use X and they look like:
</BLOCKQUOTE>
<BLOCKQUOTE><BLOCKQUOTE><CODE>
#mailcap entry added by Netscape Helper
<BR>audio/x-scpls;xmms %s
<BR>#mailcap entry added by Netscape Helper
<BR>audio/x-mpegurl;xmms %s
<BR>#mailcap entry added by Netscape Helper
<BR>audio/x-mpeg;xmms %s
</CODE></BLOCKQUOTE></BLOCKQUOTE>
<BLOCKQUOTE>
If you don't want to use xmms, delete these lines.
If you want to use xmms when in X, replace '<TT>xmms %s</TT>'
with '<TT>xmms %s; test=test -n "$DISPLAY"</TT>'
</BLOCKQUOTE>
<BLOCKQUOTE>
Then add:
</BLOCKQUOTE>
<BLOCKQUOTE><BLOCKQuote><code>
audio/x-scpls; mpg123 -@ %s
<br>audio/x-mpegurl; mpg123 -@ %s
<br>audio/x-mpeg; mpg123 $s
</code></BLOCKQuote></BLOCKQUOTE>
<!-- sig -->
<!-- end 3 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="2c/4"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">The Unattended Risk</FONT></H3>
Thu, 28 Dec 2000 18:57:54 -0800
<BR>allan
<P><STRONG>
I realized the other day that locking your screen is next to useless if
you start your linux box in text mode, performing a "startx &amp;" to begin
an X session, <em>unless</em> you Ctrl-Alt-F1 to your text virtual console
and Ctrl-D logout, then you can Ctrl-Alt-F7 back to the X console, and
lock the screen. Otherwise all a passerby need do is switch virtual
terminals and use you account.
</STRONG></P>
<P><STRONG>
It's sorta obvious when you think about it. Of course an unattended
Linux machine is not really secure, but still, just switching virtual
consoles is a little <em>too</em> easy.
</STRONG></P>
<P><STRONG>
Allan
</STRONG></P>
<BLOCKQUOTE>
I've been doing "<tt>exec startx</tt>" from non-xdm machines to save myself
having to log out when I quit my X session. I think it would help with
this situation too. -- Don Marti
</BLOCKQUOTE>
<BLOCKQUOTE>
... or
<br><code>startx &amp; vlock</code>
<br>... to ensure that your login session will not be
inadvertantly be left unlocked and unattended.
</BLOCKQUOTE>
<BLOCKQUOTE>
Naturally you'll also want to look at xautolock --- adding
it to your .Xclients, .xsession or other
windowing system start-up/configuration files as necessary.
<br> -- Jim Dennis
</BLOCKQUOTE>
<!-- end 4 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="2c/7"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">Modem Question - Easy One</FONT></H3>
Sun, 17 Dec 2000 19:59:45 EST
<BR>From: Franklyn
(<a href="mailto:linux-questions-only@ssc.com?cc:I3utane@aol.com">I3utane@aol.com</a>)
<p><strong>
Answer Guy,
</strong></p>
<p><strong>
I've read an response that you posted about a win modem running in linux, it
wont'. But I it was posted on Feb 22, 1999. So I was hoping that came out
and gave us the source and stuff. I have a US Robotics 56k Voice Win. If
they haven't, i'm out to comp usa to buy a external 3 comm (or is a internal
ok?).
</strong></p>
<p><strong>
Be good man - thanx in advance.
</strong></p>
<p><strong>
Franklyn
</strong></p>
<BLOCKQUOTE>
See if <A HREF="http://linmodems.org"
>http://linmodems.org</A> or the Linmodem Mini HOWTO
www.linuxdoc.org/HOWTO/Linmodem-HOWTO.html+linmodem&amp;hl=en
help.
</BLOCKQUOTE>
<BLOCKQUOTE>
An external modem is usually better anyway because modems generate
a lot of heat, plus external modems don't have any OS-specific
idiosynchracies.
</BLOCKQUOTE>
<BLOCKQUOTE>
--
Mike Orr
</BLOCKQUOTE>
<!-- end 8 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="2c/9"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">Monitor goes blank</FONT></H3>
Sun, 24 Dec 2000 15:29:28 +0200
<BR>From: Marius Andreiana
<P><STRONG>
I'd like to turn off blanking of the monitor in X. After 10 min or so
it goes blank, so I have to move the mouse from time to time when
watching movies
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle">
</STRONG></P>
<P><STRONG>
I've tried setterm <TT>-blank</TT> 0 before starting the movie (put that in
rc.local too)
but no effect. setterm <TT>-blank</TT> 60 won't work either.
</STRONG></P>
<BLOCKQUOTE>
setterm affects only the console. My ~/.xsession has the following
command:
</BLOCKQUOTE>
<BLOCKQUOTE>
&quot;`
xset dpms 1800 2400 3600
&quot;'
</BLOCKQUOTE>
<BLOCKQUOTE>
which blanks the screen at 30 minutes, goes into power-save mode at 40
minutes, and "off" at 60 minutes. I use such a long time so it doesn't
blank out when I'm moving back and forth between the computer and the
kitchen.
</BLOCKQUOTE>
<BLOCKQUOTE>
There are also some options in XF86Config you can try. See
"man 5 XF86Config-v3" or "man 5 XF86Config". You have to put in a
"power_saver" option; then set the BlankTime, StandbyTime, SuspendTime,
and OffTime in the Screen section. These are overridden by xset.
</BLOCKQUOTE>
<BLOCKQUOTE>
--
Mike Orr
</BLOCKQUOTE>
<BLOCKQUOTE>
You're on the right track but in the wrong lane. The setterm
command only affects the (virtual) <EM>terminal</EM> settings. You
want the xset command.
</BLOCKQUOTE>
<BLOCKQUOTE>
Try the command:
</BLOCKQUOTE>
<blockquote><pre> xset s off
</pre></blockquote>
<BLOCKQUOTE>
... from any xterm. Then start your moving, kick back, and
watch the show.
<br>-- Jim Dennis
</BLOCKQUOTE>
<!-- end 11 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="2c/12"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">Tips: sendmail offline</FONT></H3>
Tue, 26 Dec 2000 23:35:19 +0100 (MET)
<BR>From: Karl-Heinz Herrmann
(<A HREF="mailto:k.-h.herrmann@fz-juelich.de"
>k.-h.herrmann@fz-juelich.de</A>)
<BLOCKQUOTE>
Hi,
</BLOCKQUOTE>
<BLOCKQUOTE>
since I just solved a little nuisance with the newer Sendmail 8.9.3 on my system I
thought it could help somebody else.
</BLOCKQUOTE>
<BLOCKQUOTE>
My setup: dialup connection, local sendmail is handling all outgoing e-mail and is
</BLOCKQUOTE>
<BLOCKQUOTE>
queuing them until online. In my ppp-start scripts sendmail will then be
triggered by '<TT>sendmail -q</TT>' to run the queue.
</BLOCKQUOTE>
<BLOCKQUOTE>
Now since the last upgrade this didn't always work for mails sent offline but would
work for mails sent while I was online. I now found out that sendmail is keeping a
persistent host status directory.
</BLOCKQUOTE>
<BLOCKQUOTE><BLOCKQUOTE><CODE>
sendmail.cf says:
<BR>-------
<BR># persistent host status directory
<BR>O HostStatusDirectory=.hoststat
</CODE></BLOCKQUOTE></BLOCKQUOTE>
<BLOCKQUOTE>
[...]
</BLOCKQUOTE>
<BLOCKQUOTE>
O Timeout.hoststatus=60m
---------
</BLOCKQUOTE>
<BLOCKQUOTE>
So if a mail was undeliverable (offline) sendmail would remember that for 60m. Only
then it would ever try it again even if online and '<TT>sendmail -q</TT>' is run.
This status seems to be associated with each mail, so new ones go out, old ones
stay.
</BLOCKQUOTE>
<BLOCKQUOTE>
Possible solutions:
</BLOCKQUOTE>
<BLOCKQUOTE><ol>
<li> reduce the timeout to 1m or similar.
<br>or
<li> run '<tt>sendmail -bH</TT>' as well in the ppp-start script. This will purge the
host status cache.
</ol></BLOCKQUOTE>
<BLOCKQUOTE>
I Hope this helps others to get a similar setup working faster then me
<IMG SRC="../gx/dennis/smily.gif" ALT=";-)"
height="24" width="20" align="middle">
</BLOCKQUOTE>
<BLOCKQUOTE>
-- Karl-Heinz Herrmann
</BLOCKQUOTE>
<!-- end 12 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="2c/13"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">Measure your modem connection - Bogospeed</FONT></H3>
Sat, 16 Dec 2000 11:44:11 -0500
<BR>From: Ben Okopnik (<a href="mailto:linux-questions-only@ssc.com">of The Answer Gang</a>)
<BLOCKQUOTE>
This one does a 'bogo-measurement' of the modem connection speed. Given
that I'm in the process of playing with a rather shitful internal modem
(bleagh!), it comes in very handy.
</BLOCKQUOTE>
<BLOCKQUOTE>
Several times, I've seen people write in to LG and ask "How can I tell how
fast my modem connection is?" This little script will... well, it'll do
_something_ that will at least give you an idea.
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle">
</BLOCKQUOTE>
<BLOCKQUOTE>
In the tradition of "BogoMIPS", "bogospeed" gives you a <EM>relative</EM> value
of your connection speed. This means that the numbers you see do not
represent the actual speed of your connection <TT>-</TT> in my experience, they are
about 25% high <TT>-</TT> but give you a general idea of what you should expect.
If, for example, you normally see "55000 bps" as your 'bogospeed', and you
see "33000 bps" on a given connection, you'll know that the connection
you've just made is about 40% slower than usual (and that you should
probably try reconnecting.)
</BLOCKQUOTE>
<BLOCKQUOTE>
"bogospeed" normally takes about 10-15 seconds to do its stuff on a decent
connection with a 56k modem, and MUCH longer on a very slow connection. To
stop you from wasting your time, it prints the time that is required for
the first 'ping' to reach your ISP, as well as the time that it takes to
execute that ping. In my experience, if that execution time is much longer
than 3 seconds, you've got a poor connection and should try redialing.
</BLOCKQUOTE>
<BLOCKQUOTE>
Ben Okopnik
</BLOCKQUOTE>
<BLOCKQUOTE><pre>
#! /bin/bash
# Estimates connection speed to your ISP
# Be nice to MindSpring; put in your own ISP's name here
ISP="www.mindspring.com"
# Check if 'traceroute' is installed on the system
[ -z `which traceroute` ] &amp;&amp; {
echo "\"${0:2}\" requires 'traceroute' to be installed."
exit
}
# Check if 'bing' is installed on the system
[ -z `which bing` ] &amp;&amp; {
echo "\"${0:2}\" requires 'bing' to be installed"
exit
}
remote=`time traceroute -m 1 $ISP 2&gt;/dev/null|awk '{gsub("\(|\)","");print $3 " " $4}'`
echo
echo -e "Ping time to ISP:" ${remote:15} "ms\nMeasuring speed...\n"
bing -c 1 -e 20 -S 1024 localhost ${remote:0:14} 2&gt;&amp;1|grep throughput
</pre></BLOCKQUOTE>
<!-- end 13 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="2c/14"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">2-cent tip - module resource detection</FONT></H3>
Sat, 16 Dec 2000 11:19:44 -0500
<BR>From: Ben Okopnik (<a href="mailto:linux-questions-only@ssc.com">of The Answer Gang</a>)
<BLOCKQUOTE>
Here's a rather nifty script I've crufted. Given the number of times I've
seen people have problems with loading modules, I think it would be pretty
useful.
</BLOCKQUOTE>
<BLOCKQUOTE>
Actually, this two-cent tip is more like a dime (hey, I worked hard on this thing!
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle"> Recently,
I installed <A HREF="http://www.debian.org/">Debian</A> 2.2 (potato). For various reasons <TT>-</TT> namely, the fact
that I've got a weird soundcard <em>and</em> decided to play around with an
internal (yechhh) PnP modem <TT>-</TT> I needed to load several modules that
required various combinations of IRQs, DMAs, and I/O addresses. Having
suffered with this in the past, I decided, once and for all, to resolve
the mess.
</BLOCKQUOTE>
<BLOCKQUOTE>
If you are trying to load a module, and failing with a "Device or resource
busy" error, then 'shotgun' is just what you need. It will try to load your
module with permutations of the three supplied lists for the above values.
It's smart enough to figure out which modules don't require any parameters,
as well as warning you about modules that require other things. It will, as
a last resort, try to load the module with "auto" values, and will give you
good advice on what to do if everything else fails. All in all, it's a very
useful tool if you're going to load modules for strange hardware. It will
also let you know what the correct values are when it <em>does</em> succeed; this
allows you to write them into "<TT>/etc/modules</TT>" and forget them: they'll be
auto-loaded the next time you boot.
</BLOCKQUOTE>
<BLOCKQUOTE>
Happy resource hunting to all!
<IMG SRC="../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle">
</BLOCKQUOTE>
<BLOCKQUOTE>
Ben Okopnik
</BLOCKQUOTE>
<BLOCKQUOTE><pre>
#!/bin/bash
#
# Requires bash, basename, cat, find, grep, insmod/lsmod, strings
[ -z "$1" ] &amp;&amp; {
cat &lt;&lt; @END@
* 'shotgun' - a parameter guessing routine for module loading *
*** Copyright Ben Okopnik 2000 - released under the GNU GPL ***
Syntax: `basename $0` module_name
@END@
exit
}
# Parameter value lists - make sure the 'iolist' makes sense for your
# hardware!
#
# Note that '0' is not an actual value - it tells the module to try
# a default value. This usually works, but is not the best thing.
irqlist="3 4 5 6 7 8 9 10 11 12 13 14 15 0"
dmalist="1 2 3 4 5 6 7 0"
iolist="200 210 220 230 240 250 260 270 280 290 2a0 2b0 2c0 2d0 2e0 2f0 300 310 320 330 340 350 360 370 380 390 3a0 3b0 3c0 3d0 3e0 3f0"
# Clipping the ".o" for uniform syntax
module=${1#\.o}
fname=$(find /lib/modules -name ${module}.o)
[ -z "$fname" ] &amp;&amp; {
echo "No module called \"$module\" exists under /lib/modules."
exit
}
clear
warn
parms="$(strings -a $fname|grep ^parm)"
for p in $parms
do
par=${p#parm_}
echo ${par%=*}
done
[ -z $par ] &amp;&amp; {
echo "This module does not require any parameters. Loading..."
insmod $module &amp;&amp; echo -e "\n$module loaded.\n"
exit 1
} || {
echo -e "\nPress a key to start the test process or 'Ctrl-C' to quit."
}
read
echo -e "This might take a while...\n"
echo -n "Running"
for irq in $irqlist
do
for dma in $dmalist
do
for io in $iolist
do
echo -n "."
result="$(insmod $module irq=$irq dma=$dma io=0x$io 2&gt;/dev/null)"
invalid=$(echo "$result"|grep -c invalid)
unresolved=$(echo "$result"|grep -c unresolved)
if [ $(($invalid+$unresolved)) -eq 0 ]
then
out=$(lsmod|grep ^$module)
echo
echo
if [ -z "$out" ]
then
badnews
else
echo "If the module loaded successfully, you should see"
echo "its name on the following line:"
echo ${out% *}
echo
echo "The parameter values were: irq=$irq dma=$dma io=0x$io"
echo
exit
fi
fi
done
done
done
function badnews()
{
clear
cat &lt;&lt; @END@
Oops. It didn't load. OK, try typing "insmod $module" and see what it
says - if you get a whole bunch of 'unresolved symbol' messages, that
means there's another module that needs to be loaded before this one;
take a look in "/lib/modules/&lt;version&gt;/modules.dep" to find out what
that might be. Other than that, here are a few things to try:
1) Modify the values in the parameter lists at the beginning of this
script: the IRQ and the DMA ranges are probably OK, but the IOs can vary
widely - make sure they make some kind of sense for your module. This
might mean looking at the paperwork that came with your hardware or
starting up Windows to see what I/O address it's been assigned there.
2) Load the values manually. The module you're trying to load may
require more than just IRQ, DMA, and IO - the parameter list at the
start of this program will show you all the possibilities.
3) Do some more research on what the appropriate value ranges for your
module might be. Search the Web for your hardware name plus "linux" - I've
usually had good success with Google and AltaVista's "advanced" search.
4) Often, reading the appropriate part of the kernel source - even if
you are not a programmer - can be very helpful. As a good example,
reading the source for the SoundBlaster/ESS module - 'sb_ess.c' in the
'/usr/src/kernel-source-&lt;version&gt;/drivers/sound/' directory - enabled me
to get my WAV files to play at normal speed, by using the "esstype=1688"
parameter; it was explained in the comments near the top of the file.
The source files tend to be about half code and half comments: the good
folks that write them *want* you to understand.
Good luck!
@END@
exit
}
function warn()
{
cat &lt;&lt; @END@
NOTE: The following is a list of parameters your module can accept; usually,
most of these are not required. Most often, 'irq', 'io', and 'dma' are all
that are necessary; this script will try to load your module with various
values of those parameters.
If after pressing a key you do not see all three of these - 'irq', 'dma',
_and_ 'io' - on the list, you should probably quit the script by pressing
'Control-C', as the module will almost certainly fail to load despite the
lack of error messages. If the module takes <EM>no</EM> parameters, the script
will notify you of that and load it properly.
* Press 'Enter' to see the parameter list *
@END@
read
}
</pre></BLOCKQUOTE>
<!-- end 14 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="2c/15"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">Backup via shell script</FONT></H3>
Thu, 14 Dec 2000 11:27:58 -0600
<BR>From: Michael Williams (not from the answer gang)
<P><STRONG>
How do you back up your home file system to a remote system using shell
script
</STRONG></P>
<BLOCKQUOTE>
If the computers are connected via TCP/IP and you have rsync and ssh
installed on both machines, do:
</BLOCKQUOTE>
<BLOCKQUOTE><pre>
#!/bin/sh
# backup.sh
rsync -av --delete -e ssh /local/dir/ user@remote_computer:/remote/dir
</pre></BLOCKQUOTE>
<BLOCKQUOTE>
Put a slash at the end of the first argument but not on the second
argument. Try it first running rsync on the command line with option
<TT>-n</TT> added, to see what it would do. Otherwise you may discover you're
specifying the wrong directory and deleting stuff you don't want to delete.
</BLOCKQUOTE>
<BLOCKQUOTE>
You will have to configure ssh to let your script login without a
password. If you don't have an ssh public key yet, run "ssh-keygen".
Then copy your local ~/.ssh/identity.pub to the remote
~/.ssh/authorized_keys . (Or append to authorized_keys if you already
have some entries in it).
</BLOCKQUOTE>
--
Mike Orr
</BLOCKQUOTE>
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="2c/17"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">devices list</FONT></H3>
Thu, 14 Dec 2000 12:15:11 +0100
<BR>From: Monserrat Seisdedos Nu<4E>ez
<P><STRONG>
Hello those in the gazette:
</STRONG></P>
<P><STRONG>
My question is :
</STRONG></P>
<P><STRONG>
there is any <TT>/dev/devices</TT> list where it is pointed out which device
belongs to???
that is
<br>hdx--&gt; hard disks
<br>fdx--&gt; floppy disks
<br>etc...
</STRONG></P>
<BLOCKQUOTE>
Download the kernel source (any version) and look at
Documentation/devices.txt .
</BLOCKQUOTE>
<BLOCKQUOTE>
--
Mike Orr
</BLOCKQUOTE>
<!-- end 18 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="2c/19"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">Linux core files</FONT></H3>
Wed, 13 Dec 2000 15:10:02 -0500
<BR>From: ken ramseyer
<P><STRONG>
I read your article in
<A HREF="../issue41/tag/4.html"
>http://www.ibiblio.org/mdw/LDP/LG/issue41/tag/4.html</A> which talks about
Linux core files.
</STRONG></P>
<P><STRONG>
Do you know of any reasons why a core file would go to a directory other
than the current working directory (cwd)?
</STRONG></P>
<BLOCKQUOTE>
I thought core files always went to the current directory. Meaning,
the current directory <EM>of the process that was killed</EM>.
</BLOCKQUOTE>
<P><STRONG>
Do you know if there is a way to tell the Linux kernel where to put core
files?
</STRONG></P>
<BLOCKQUOTE>
Not that I know of.
</BLOCKQUOTE>
<BLOCKQUOTE>
I have "ulimit <TT>-c</TT> 0" in my .zshrc to prevent core files from being written
at all. That affects the shell process and all its descendants. Since
I'm not (much of) a C programmer, core files are useless to me.
</BLOCKQUOTE>
<BLOCKQUOTE>
Initscript(5) says that if you have a shell script called
<TT>/etc/initscript</TT>, init will use it for every process it spawns.
"This script can be used to set things like ulimit and umask default
values for every process." Since init is the anscestor of everything,
this would be a way to stamp out all core files at once.
</BLOCKQUOTE>
<BLOCKQUOTE>
--
Mike Orr
</BLOCKQUOTE>
<!-- sig -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="2c/21"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">linux login problem</FONT></H3>
Wed, 27 Dec 2000 15:57:40 -0800
<BR>From: Joseph Cheek to Howard Hsu...
<P><STRONG>
I have found posts of yours which seem to relate to a
problem I am currently having. Any help which you
might provide would be greatly appreciated.
</STRONG></P>
<P><STRONG>
We are having trouble logging into our linux server
via the console or telnet, but are able to login using
the same l/p for ftp.
</STRONG></P>
<BLOCKQUOTE>
what are the permissions on <TT>/etc/securetty?</TT>
</BLOCKQUOTE>
<!-- end 21 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="2c/23"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">networked machine goes to sleep?</FONT></H3>
Sun, 03 Dec 2000 18:41:56 -0500
<BR>From: Christopher Curtis
<BLOCKQUOTE>
This problem exists, or used to exist, for several people, including
myself. The concensus is that the problem has to do with a cisco
router: The router expects chatty windows machines that crash <TT>-</TT> if your
Linux box just sits around not saying anything, cisco assumes it's dead
and stops routing traffic towards it. There's a config option in the
router that can turn this 'feature' off, but, as for myself, I cron a
ping since I can't access the router.
</BLOCKQUOTE>
<BLOCKQUOTE>
Christopher
</BLOCKQUOTE>
<!-- end 23 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="2c/24"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">NT Log on a Linux Box</FONT></H3>
Wed, 13 Dec 2000 11:15:27 -0600
<BR>From: Jonathan Hutchins
<BLOCKQUOTE>
Boy, talk about "think outside the box...". [Cesar] complained that he
couldn't cron the dumpel.com program to dump the NT Event Log to a flat file
for viewing on Linux. While it isn't called cron, NT does have a scheduler.
The command line interface is "at", and a GUI interface comes with the
Resource Kit. Yes, he needs admin privileges on NT to schedule it, but he'd
need root if he were trying the same thing on a Linux box.
</BLOCKQUOTE>
<BLOCKQUOTE>
There are also various programs to give you a remote virtual console from an
NT box. We use PCAnywhere within Windows environments, but the VNC project
might be very useful... <A HREF="http://www.uk.research.att.com/vnc"
>http://www.uk.research.att.com/vnc</A>
</BLOCKQUOTE>
<!-- end 24 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="2c/25"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">Graphics Programming for Printing / Faxing (Issue 60)</FONT></H3>
Tue, 5 Dec 2000 01:50:32 -0500 (EST)
<BR>From: Anthony E. Greene
&lt;<A HREF="mailto:linux-questions-only@ssc.com?cc:agreene@pobox.com"
>agreene@pobox.com</A>&gt;
<BLOCKQUOTE>
The quick and easy way for a Perl programmer to do convert data to faxable
invoices/reports is to output the data as HTML, convert it to Postscript
using html2ps &lt;<A HREF="http://www.tdb.uu.se/~jan/html2ps.html&gt"
>http://www.tdb.uu.se/~jan/html2ps.html&gt</A>;, then fax the
result using efax or mgetty+sendfax.
</BLOCKQUOTE>
<BLOCKQUOTE>
-- Tony
</BLOCKQUOTE>
<!-- end 25 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="2c/26"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">About RS422</FONT></H3>
Fri, 1 Dec 2000 16:46:54 +0800
<BR>From: Elijah Pau (<a href="mailto:linux-questions-only@ssc.com?cc:e.pau@tct.com.hk">e.pau@tct.com.hk</a>)
<BLOCKQUOTE>
Hi James,
</BLOCKQUOTE>
<BLOCKQUOTE>
Stumble across you page while looking for some info on RS422 product. Sorry
to say that you may be answering the wrong question. As far as I know,
RS422 is a hardware spec. i.e., it's about how hardware talk amongst
themselves. The original question seems to be about how Linux (software)
talk to the adaptor card. The representative for the card would probably be
a UART. Identify that, and you are almost home.
</BLOCKQUOTE>
<BLOCKQUOTE>
Just my 2cents.
</BLOCKQUOTE>
<BLOCKQUOTE>
Cheers, and keep the helping out spirit going.
</BLOCKQUOTE>
<BLOCKQUOTE>
=== Elijah Pau
</BLOCKQUOTE>
<!-- end 26 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="2c/27"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">x-base languages for Linux</FONT></H3>
Mon, 04 Dec 2000 22:55:06 -0500
<BR>From: Hiram & Patti Rosenberg
<BLOCKQUOTE>
Dear Mr. Answer Guy,
</BLOCKQUOTE>
<BLOCKQUOTE>
I do not know if this is the correct venue for writing to you in
relation to the Linux Gazette column, so please do not throw any
brickbats my way. I just wanted to add one piece of knowledge to the
puzzle raised by a Michael "Mookie" Kepler's inquiry from back in 1998.
I've been programming in Recital, a 4GL xbase product that runs over our
Sun Solaris network. They have a product for Linux; I can not recall
the price but a developer kit was only a 3 digit number as I recall. I
work in the tech pubs section of a major world-class helicopter factory
and we use their Unix product as the backbone of the publication
production and illustration tracking system.
</BLOCKQUOTE>
<BLOCKQUOTE>
Recital is in Danvers, MA, just north of Boston.
</BLOCKQUOTE>
<BLOCKQUOTE>
Hi Rosenberg
</BLOCKQUOTE>
<!-- end 27 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="2c/28"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">NT Event Reporting in Unix/Linux</FONT></H3>
Fri, 1 Dec 2000 13:58:37 -0500
<BR>From: Sheldon Dubrowin
(<A HREF="mailto:linux-questions-only@ssc.com?cc:sdubrowin@ibasis.net"
>sdubrowin@ibasis.net</A>)
<BLOCKQUOTE>
I was looking for something like this also and found an article in the
September 2000 issue of SysAdmin Magazine (www.sysadminmag.com). In that
article, they talk about a Perl Script that can be run on the NT box that
will format NT Event Log messages in a syslog format and send them to a
Unix/Linux syslog server. The article is by Joe Aguiar, I haven't tried
this technique yet, but I will be looking into trying this out, just not
yet. Anyways, I thought you might be interested in this article.
</BLOCKQUOTE>
<BLOCKQUOTE>
Sheldon M Dubrowin
</BLOCKQUOTE>
<!-- end 28 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="2c/29"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">Need info</FONT></H3>
Tue, 12 Dec 2000 12:26:11 +0200
<BR>From: Dori Adler
<P><STRONG>
Hi
</STRONG></P>
<P><STRONG>
I don't know if this is the appropriate email address if not I'm truly
sorry.
</STRONG></P>
<P><STRONG>
Question: Is there a MS Exchange Server Emulator for Linux?
</STRONG></P>
<BLOCKQUOTE>
We were given a Tip about Tradewinds in the last month or two. Not being
Windows users ourselves, we don't know how good it is. But you can try it,
and if it works for you, you could write an article for us.
</BLOCKQUOTE>
<P><STRONG>
I need to get MS Outlook Clients with MS Exchange server Services (Only) to
connect to the linus server , do you know how <TT>/</TT> where?
</STRONG></P>
<BLOCKQUOTE>
Normal Linux mail servers are POP3 ... IMAP is a bit less common but certainly
available. So if you are more concerned about the mail than about other
Exchange features, MS Outlook should already work.
</BLOCKQUOTE>
<P><STRONG>
Thanks and sorry again
Dori
</STRONG></P>
<BLOCKQUOTE>
Best of luck -- Heather
</BLOCKQUOTE>
<!-- end 30 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="2c/31"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">Fat 32 Linux instillation</FONT></H3>
Sat, 16 Dec 2000 01:25:47 -0600
<BR>From: (<a href="mailto:linux-questions-only@ssc.com?cc:tomvanberkel@mindspring.com">tomvanberkel@mindspring.com</a>)
<p><strong>
Can I install Linux on a FAT 32 partition with a dual boot configuration
including windows ME on the primary partition?
Thanks, TVB
</strong></p>
<blockquote>Yeah, there's a handful of distros aimed at living on a FAT
filesystem. You can find a bunch of them listed on Linux Weekly
News (<a href="http://www.lwn.net/">www.lwn.net</a>) - Zipslack
and PhatLinux have been around a while, with new ones like Lin4Win
popping up occasionally.
<br>-- Heather
</blockquote>
<!-- end 31 -->
<!-- .~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~.~~. -->
<P> <A NAME="2c/32"><HR WIDTH="75%" ALIGN="center"></A> <P>
<H3><IMG ALIGN=BOTTOM ALT="" SRC="../gx/lil2cent.gif">
<FONT COLOR="navy">Available spcae avail on Hd!</FONT></H3>
Tue, 12 Dec 2000 09:14:44 -0800
<BR>The Chief
<P><STRONG>
Hi:Iam Newbie with Linux How do I find out how much space avail on Hd! My
system I have mandrake 7.1 installed on my 3Gig Hd!
</STRONG></P>
<BLOCKQUOTE>
The "df" command shows the amount of free space on each filesystem.
</BLOCKQUOTE>
<BLOCKQUOTE><pre>
% df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/hda5 1981000 1620129 258459 87% /
/dev/hda1 7746 5141 2205 70% /boot
</pre></BLOCKQUOTE>
<BLOCKQUOTE>
My total amount of free space is 258459 + 2205 = 260664 KB (260 MB).
</BLOCKQUOTE>
<BLOCKQUOTE>
Extra hint: to see how much space a particular directory and all its
subdirectories use, run "<tt>du</tt> DIRECTORY". This lists each subdirectory
separately and then a total at the bottom. To get just the total, run
"<TT>du -s</TT> DIRECTORY".
</BLOCKQUOTE>
<!-- end 32 -->
<!--startcut ======================================================= -->
<P> <hr> </p>
<!-- *** BEGIN copyright *** -->
<H5 align="center">This page edited and maintained by the Editors
of <I>Linux Gazette</I>
<a href="http://www.linuxgazette.com/copying.html"
>Copyright &copy;</a> 2001
<BR>Published in issue 61 of <I>Linux Gazette</I> January 2001</H5>
<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>
<!-- *** END copyright *** -->
</BODY></HTML>
<!--endcut ========================================================= -->