<?xml version="1.0" ?>

<kc>

<headquote>
<a href="http://www.slug.org.au/"><img src="../ktimages/slug.gif" height="105"
width="150" border="0" alt="SLUG Logo"/><br />Check out the Sydney Linux User
Group</a>!
</headquote>


<title>SLUG Pearls</title>
<author contact="mailto:jdub@aphid.net">Jeff Waugh</author>
<issue num="4" date="25 Jun 2000 00:00:00 -0800" />


<intro>

<p>Welcome SLUGgers and Kernel Cousin readers!</p>

<p>This edition of SLUG Pearls is the first written for both our website,
and Linuxcare's Kernel Cousins page. We hope readers far, far away from
Sydney can enjoy the ongoing ramblings of our mailing list as much as we
do.</p>

<p>Thanks aplenty to Terry Collins of <a
href="http://www.woa.com.au/">Wombat Outdoor Adventures</a>, who saved #1
and #3 with his copy of the SLUG mailbox.</p>

<p align="center"><b>- Jeff</b></p>

<h3>Announcements:</h3>

<ul>
	<li><a
	href="http://linux.org.au/installfest/"><b>InstallFest 2000</b></a>
	<p>Currently in planning, InstallFest 2000 will be a round-the-continent
	series of advocacy and installation days, beginning with <a
	href="http://www.linuxsa.org.au/">LinuxSA</a> in Adelaide. SLUG is
	planning to take part on August 26th at Macquarie University. Supporters
	and voluteers welcome!</p>
	</li>
	
	<li><a
	href="http://www.progsoc.uts.edu.au/lists/slug/2000/June/msg00853.html">linux.conf.au
	Call for Participation</a></li>

	<li><a
	href="http://www.progsoc.uts.edu.au/lists/slug/2000/June/msg00915.html">New
	Kernel Cousin: SLUG Pearls!</a></li>

	<li><a
	href="http://www.progsoc.uts.edu.au/lists/slug/2000/June/msg01088.html">Book
	Review: Linux Desktop Starter Kit</a></li>
</ul>

</intro>



<section
  title="No pussyfooting around"
  subject="split and join?"
  archive="http://www.progsoc.uts.edu.au/lists/slug/2000/June/msg00762.html"
  posts="7"
  startdate="18 Jun 2000 00:00:00 -0800"
  enddate="19 Jun 2000 00:00:00 -0800">

<p>We'll start off with a quick one this week: Ben Donohue had split a file
for transfer on floppy with the <tt>split</tt> command, and found that
<tt>join</tt> wasn't the command for joining the pieces back together.</p>

<p>DaZZa provided a quick and easy solution with <quote who=""><tt>cat
xaa xab &gt; zzz</tt></quote> (cat is short for con<i>cat</i>enate).</p>

</section>


<section
  title="Superblocks found!"
  subject="Superblocks and lost mp3"
  archive="http://www.progsoc.uts.edu.au/lists/slug/2000/June/msg00771.html"
  posts="1"
  startdate="18 Jun 2000 00:00:00 -0800"
  enddate="18 Jun 2000 00:00:00 -0800">

<mention></mention>

<p>Simon Rumble kindly posted a <a
href="http://www.progsoc.uts.edu.au/lists/slug/2000/June/msg00771.html">solution</a>
to his <a href="http://slug.org.au/pearls-20000618.shtml#2">problem</a> from
last week. The <tt>findsuper</tt> command allowed him to do an fsck on the
partition, but the recovered files were a mess, if anything.</p>

<p><quote who="Simon Rumble">No idea if these are recoverable but since I
have a cable modem, recovering all these legal mp3s that I own the original
CDs for shouldn't be a problem. Erm. ;)</quote></p>

</section>


<section
  title="When Men are Men: Uptime"
  subject="9:52am up 368 days, 17:37, 1 user, load average: 1.02, 1.01, 1.00"
  archive="http://www.progsoc.uts.edu.au/lists/slug/2000/June/msg00822.html"
  posts="10"
  startdate="20 Jun 2000 00:00:00 -0800"
  enddate="22 Jun 2000 00:00:00 -0800">

<mention>Matt Allen</mention>
<mention>Tony Cook</mention>

<p>Someone has to start these things. Ian Ward:</p>

<quote who="Ian Ward">

<p>What a great OS!</p>

<p><tt>[root@gateway /root]# cat /etc/redhat-release<br />
Red Hat Linux release 5.2 (Apollo)<br />
[root@gateway /root]# uptime<br />
 9:52am  up 368 days, 17:37,  1 user,  load average: 1.02, 1.01, 1.00<br />
[root@gateway /root]#</tt></p>

</quote>

<p>Howard Lowndes, seeing through the whole size of a man's... charade
commented that, <quote who="Howard Lowndes">You might be able to keep it up,
but are you sure that you have got it properly covered. (8-)</quote> Nyuk,
nyuk, nyuk.</p>

<p>Matt Allen (who was too embarrased to show his uptime) wondered why Ian's
load average was up at 1.00. Tony Cook (who didn't have a very good uptime, but
felt obliged to tell) commented that his dual processor machine stays at 2.00
due to the obligatory distributed.net client.</p>

<p>Aravind Naidu felt the need to blame someone else for his uptime, then
standing at 262 days. Of course, <quote who="Aravind Naidu">it would have been
easily &gt;400 odd days otherwise</quote>.</p>

<p>CaT:</p>

<quote who="">

<p>[root@box /root]# uptime<br />
 10:21am  up 396 days,  8:46,  1 user,  load average: 0.09, 0.02,
 0.01</p>

<p>Mine's bigger then yours. ;)</p>

</quote>

<p>And then, <quote who="">Here we go again...</quote> Rodos:</p>

<quote who="">

<p><tt>
[rodos@digit rodos]$ uptime<br />
 11:29am  up 456 days,  4:43,  4 users,  load average: 0.01, 0.08, 0.08<br />
[rodos@digit rodos]$</tt></p>

</quote>

<p>Gus, one of our resident Debian Weenies (who also omitted his own uptime),
commented: <quote who="Angus Lees">heh, now try and upgrade it to the latest
redhat - keeping the uptime (if thats too easy, do it remotely ;)</quote></p>

<p>Chiming in with veiled support, our president, Mr. Conrad Parker: <quote
who="Conrad Parker">sheesh gus, next thing you'll be expecting people to do
that in one command!</quote></p>

<p>Thanks Ian... ;)</p>

</section>


<section
  title="The Distribution Question"
  subject="Distributions"
  archive="http://www.progsoc.uts.edu.au/lists/slug/2000/June/msg00875.html"
  posts="34"
  startdate="20 Jun 2000 00:00:00 -0800"
  enddate="22 Jun 2000 00:00:00 -0800">

<mention></mention>
<mention>Aravind Naidu</mention>
<mention>Jim Clark</mention>
<mention>Jeff Waugh</mention>
<mention>Chuck D</mention>

<p>There must be something in the water. Jon Biddell said, <quote who="Jon
Biddell">Not wanting to start another Religious War (which this probably
will), but who is using which distro for what ?  What is "the best", if this
can be quantified ?</quote></p>

<p>After a quick conversation, Terry Collins offered these tips:</p>

<quote who="Terry Collins">
<p>If YOU are going to support the box, go with what you know best/find
easiest.</p>

<p>If there is stiff resistance, go with something with the name, like,
sigh, RedHat.</p>

<p>If you have a very specific job in mind, then ask on the list for
people's experience with distro's and apps, e.g. network monitor, etc.  It
is usually the apps you want to know, rather than the distro,</p>
</quote>

<p>Jeff Waugh posted a lengthy Debian <a
href="http://www.progsoc.uts.edu.au/lists/slug/2000/June/msg00879.html">recommendation</a>,
which Jon was interested in.</p>

<p>Jim Hague posted his personal guide:</p>

<quote who="Jim Hague">
<ul>
	<li>Debian. For the hardcore Linux user. I must get to know it
	better.</li>
	<li>Mandrake. Nice desktop.</li>
	<li>RedHat. Installed base.</li>

	<li>SuSE. Does ISDN proper. Install doesn't ask about NIS. All the rest
	do. I needed to set up NIS.</li>
</ul>
</quote>

<p>Some quick recommendations included:</p>
<ul>
	<li>Mandrake, for being bleeding-edge fresh (Tom Massey)</li>
	<li>Mandrake, for being compatible with RedHat, and thus with many
	commercial applications (Aravind Naidu)</li>
	<li>Mandrake, for being more polished than RedHat (Jim Clark)</li>
	<li>RedHat, for at least having the Linux kernel (John Zantey)</li>
	<li>OpenBSD, for having the "cat" command (a meddling Chuck Dale, who
	really uses just about anything he can get his hands on)</li>
</ul>

<p>Thankfully, there were no flames directed at anyone on the list, but
RedHat got a bit of a grilling, as per usual.</p>

</section>


<section
  title="Bash Precedence"
  subject="bash"
  archive="http://www.progsoc.uts.edu.au/lists/slug/2000/June/msg00883.html"
  posts="5"
  startdate="21 Jun 2000 00:00:00 -0800"
  enddate="22 Jun 2000 00:00:00 -0800">

<mention></mention>

<p>Minh Van posed a teaser:</p>

<quote who="Minh Van">
<p>given the expression:</p>

<p>1. <tt>if [ -n $dirname ] &amp;&amp; [ \( -d $dirname \) -a \( -x $dirname \) ];
then</tt></p>

<p>in bash, i don't understand why it is any different and less tedious from:</p>

<p>2. <tt>if [ -n $dirname ] &amp;&amp; [ -d $dirname ] &amp;&amp; [ -x $dirname ];
then</tt></p>

<p>could somebody explain the reason or need to have embedded boolean
constructs and escaped parentheses in the first expression ?</p>
</quote>

<p>Herbert Xu:</p>

<quote who="Herbert Xu">

<p>Use the second form whenever you can.  &amp;&amp; is guaranteed to short
circuit while -a never does.  Also, to use -a safely you have to put in
those ugly brackets :)</p>

<p>And if you shell doesn't have test built-in, well, dump it :)</p>
</quote>

<p>Cameron Simposon disagreed: <quote who="Cameron Simpson">Not so. They're
only needed if you have precedence issues, which don't obtains in the
examples cited.</quote></p>

<p>Herbert gave an example showing why <quote who="Herbert Xu">it's a good
habit to use &amp;&amp;/|| in place of -a/-o</quote>:</p>

<quote who="Herbert Xu">
<p>Consider "$dirname" := "=", and we had</p>

<p><tt>[ -d $dirname -a -x $dirname ]</tt></p>

<p>Since = has the highest precedence among all operators, this becomes</p>

<p><tt>[ \( -d = -a \) -d = ]</tt></p>

<p>which causes an error.</p>

<p>This can be avoided by either using brackets or &amp;&amp;.</p>
</quote>

</section>


<section
  title="Machine Safety in the Workplace"
  subject="Look mum, no hands (writing)."
  archive="http://www.progsoc.uts.edu.au/lists/slug/2000/June/msg00933.html"
  posts="1"
  startdate="21 Jun 2000 00:00:00 -0800"
  enddate="21 Jun 2000 00:00:00 -0800">

<p>Rodos posted a helpful recipe for anyone using a single-purpose Linux
machine in a hostile environment. A summary:</p>

<quote who="">
<p>Well I have been trying to make a read-only system that in theory can't
get a file system corruption.</p>

<p>I have a box that runs one application only. It is headless so if someone
turns it off and on (likely, its in a factory mounted on a pilon) I want to
be as sure as possible that it will restart without human intervention.</p>
</quote>

<p><a
href="http://www.progsoc.uts.edu.au/lists/slug/2000/June/msg00933.html">Here's
how he did it.</a></p>

</section>


<section
  title="Don't Cache My Images!"
  subject="Automatic update of html pages"
  archive="http://www.progsoc.uts.edu.au/lists/slug/2000/June/msg01097.html"
  posts="4"
  startdate="24 Jun 2000 00:00:00 -0800"
  enddate="24 Jun 2000 00:00:00 -0800">

<mention></mention>

<p>Grahame Kelly's <a href="http://www.wildpossum.com/">Wild Possum Cam</a>
was not being updated as the page refreshed, though he was using the correct
meta tags. Matt Allen (who solves this one fairly regularly it seems),
wrote:</p>

<quote who="Matt Allen">

<p>Another solution is, if the page is being parsed by any sort of server
side scripting, tack a unique number on the end of the grahpic, ie in PHP it
would look like</p>

<p><tt>&lt;img src="images/blah.jpg?&lt;?php echo time();?&gt;"&gt;</tt></p>

<p>That sould append the current unix time stamp on the end and ALL caches
will reload it.</p>

<p>Its a good little trick to know.</p>

</quote>

<p>Which worked perfectly.</p>

</section>

</kc>
