<?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="3" date="18 Jun 2000 00:00:00 -0800" />

<intro>

<p>Phew - that was quick!</p>

<p>Due to the long weekend, SLUGgers had less time at work to spend posting
to the mailing list. Thus, this week's SLUG Pearls is shorter than usual.</p>

<p>Announced this week:</p>

<p><ul>
	<li><a
		href="http://www.progsoc.uts.edu.au/lists/slug/2000/June/msg00692.html"
		>Games Fest!</a></li>
	<li><a
		href="http://www.progsoc.uts.edu.au/lists/slug/2000/June/msg00725.html"
		>Monthly Meeting - 30th June, 2000</a></li>
</ul>
</p>

</intro>

<section
  title="More Apache, sed and grep"
  subject="Virtual hosts on a dynamic IP"
  archive="http://www.progsoc.uts.edu.au/lists/slug/2000/June/msg00552.html"
  posts="4"
  startdate="12 Jun 2000 00:00:00 -0800"
  enddate="12 Jun 2000 00:00:00 -0800">
  
<mention></mention>

<p>Continuing a <a
href="http://www.slug.org.au/pearls-20000612.html#7">thread from last
week</a>, Paul Robinson thanked Gus for his help with httpd.conf and
mentioned that whilst working the script, he found that restarting Apache
with kill -HUP didn't always work. Gus knew a better way of doing it:</p>

<quote who="Angus Lees">

<p>the "cut -c"s make me nervous .. a new version of some tool will come
out that adds a little whitespace and suddenly your script is off
killing the wrong processes</p>

<p>try:</p>

<p>myip=`/sbin/ifconfig ppp0 | sed -n 's/^.* addr:\([0-9.]\+\) .*$/\1/p'`
sed "s/@MYIP@/$myip/" &lt; httpd.conf.orig &gt; httpd.conf<br />
kill `ps -ax | grep '[/]usr/sbin/httpd' | cut -d' ' -f 1`
/usr/sbin/httpd</p>

<p>(the square brackets on the grep regex is an amusing trick i once saw to
avoid matching the grep process itself - better would be to use pidof(8) or
similar)</p>

</quote>

<p>James Wilkinson liked the sound of that, <quote who="James
Wilkinson">Hey, thanks for this! Up 'til now I've been adding a '| grep -v
grep' to do the same, which I've always hated ;)</quote></p>

</section>


<section
  title="Superblocks &amp; The Lost MP3s"
  subject="Argh!  My drive no work"
  archive="http://www.progsoc.uts.edu.au/lists/slug/2000/June/msg00582.html"
  posts="9"
  startdate="13 Jun 2000 00:00:00 -0800"
  enddate="14 Jun 2000 00:00:00 -0800">

<p>Simon Rumble had an unfortunate problem with his "big mutha of a
drive with stacks of mp3s and the like":</p>

<quote who="Simon Rumble">

<tt>
<p>
bash-2.04$ sudo e2fsck /dev/hdc3<br />
e2fsck 1.18, 11-Nov-1999 for EXT2 FS 0.5b, 95/08/09<br />
Couldn't find ext2 superblock, trying backup blocks...<br />
e2fsck: Bad magic number in super-block while trying to open /dev/hdc3</p>

<p>The superblock could not be read or does not describe a correct ext2
filesystem.  If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock is
corrupt, and you might try running e2fsck with an alternate
superblock:</p>

<p>e2fsck -b 8193 &lt;device&gt;</p>
</tt>

</quote>

<p>Doing what it suggested gave the same error.</p>

<p>DaZZa commented that when mkfs runs, it reports the position of the
backup superblocks, but added, <quote who="">Unfortunately, if you're
anything like me, you don't bother writing them down/storing them anywhere,
and you're stuffed.</quote></p>

<p>Whilst she couldn't test these ideas at work, Jill Rowling remembered that
<tt>mkfs -V &lt;options used to create the drive&gt;</tt> wouldn't actually
write to the drive, but would return the same commands used to originally
create it - and thus the superblock information.</p>

<quote who="Jill Rowling">

<p>Another possibility is <tt>mkfs -m /dev/hdc3</tt> which is supposed to
return the command line that was used to create the partition.</p>

<p>Please check with your local man page before trying these options, of
course...</p>

<p>If you do find out what spare superblocks you have, maybe you could pick one
of the higher numbered ones. Chances are if something trashed the disk by
writing to the raw device, it only overwrote the first set of
superblocks.</p>

<p>Of course if it was a huge MP3, then, maybe you have really lost it.</p>

</quote>

<p>chesty offered the Filesystem HOWTO as a helpful read, and on hearing
that Simon had read it, linked to some of the more relevant software <a
href="http://www.progsoc.uts.edu.au/lists/slug/2000/June/msg00641.html">directly</a>.</p>

</section>


<section
  title="Word into Wine"
  subject="wine"
  archive="http://www.progsoc.uts.edu.au/lists/slug/2000/June/msg00621.html"
  posts="7"
  startdate="14 Jun 2000 00:00:00 -0800"
  enddate="14 Jun 2000 00:00:00 -0800">

<mention></mention>

<p>Gus made his victory post:</p>

<quote who="Angus Lees">

<p>figured i might try out the old wine torture test, just to see if i
can get past the splash screen this time:</p>

<blockquote><tt>wine winword.exe</tt></blockquote>

<p>and goddamnit, it worked like a charm (or curse, or something)</p>

<p><a
href="http://www.cse.unsw.edu.au/~gusl/winword.jpg">http://www.cse.unsw.edu.au/~gusl/winword.jpg</a>
(warning: big image</p>

<p>i loaded up some old .doc's and everything.. it wouldn't let me print though
for some reason (i didn't try too hard)</p>

<p>(so much for everyone needing a commercial windows emulator :)</p>

</quote>

<p>There were some comments about the political nature of emulating Windows
applications under Linux, including (Mum's bogeyman) scare stories about
OS/2. Peter Rundle simply wanted to know whether Gus used a real Windows
installation, and how he managed to get it going. Gus replied:</p>

<quote who="Angus Lees">

<p>a very old (`96/97) win95 (b?) install that hasn't booted for a very long
time:</p>

<p><tt>-rwxr-xr-x    1 root     root        52539 Oct 22  1997 bootlog.txt</tt></p>

<p>i leave it lying around especially for wine and dosemu ;)</p>

<p>its a vanilla wine install from the debian (potato) package (version
0.0.20000109-3), with the Drive mappings changed to point to my
locations.</p>

<p>the only real changes from that was using the native windows version of
comdlg32/commdlg (since the wine ones have never really worked right), and
deleting the enture DllPairs section (both following last weeks advice on
wine weekly news). i have no idea whether these contributed at all - i
didn't try with/without.</p>

</quote>

</section>


<section
  title="Mkfs it so!"
  subject="Formating a new Drive"
  archive="http://www.progsoc.uts.edu.au/lists/slug/2000/June/msg00639.html"
  posts="4"
  startdate="14 Jun 2000 00:00:00 -0800"
  enddate="15 Jun 2000 00:00:00 -0800">

<p>Peter McCarthy installed a new hard drive, and was trying create and
mount a new filesystem:</p>

<quote who="Peter McCarthy">

<p>I have installed a new HDD setup as /dev/hdb</p>

<p>It is fdisk'ed with a Linux file system enabled.
However I can't work out how to format the drive to make it ready for
use.
I tried fsck and it bailed on me (not suprising) as it is the File system
checker.
I tried <tt>mkfs -c /dev/hdb</tt> and it just keeps coming up with
<tt>Usage: mkfs.minix [-c | -l filename] [-nXX] [-iXX] /dev/name
blocks</tt></p>

<p>But it looks ok to me !</p>

</quote>

<p>DaZZa:</p>

<quote who="">

<p>Asuming you've put only one partition on your new drive.</p>

<p><tt>mkfs.ext2 /dev/hdb1</tt></p>

</quote>

<p>Michael Lake:</p>

<quote who="Michael Lake">

<p>You just need to tell it what type of filesystem to make.</p>

<p><tt>/sbin/mkfs -t ext2 /dev/hdb<br />
/sbin/mkfs.ext2 /dev/hdb</tt>&#160;&#160;&#160;(v=verbose can be useful to show progress)<br />
<tt>/sbin/mke2fs /dev/fd0</tt></p>

<p>Either of the commands, mkfs, mkfs.ext2 or mke2fs, can be used. Do check the man pages for specific parameters.</p>

</quote>

</section>

<section
  title="Making a swap partition"
  subject="swap file creation"
  archive="http://www.progsoc.uts.edu.au/lists/slug/2000/June/msg00657.html"
  posts="4"
  startdate="14 Jun 2000 00:00:00 -0800"
  enddate="15 Jun 2000 00:00:00 -0800">

<p>With a similar problem, Ben Donohue was unable to get his swap partition
going. He had done the fdisk side of things, but needed to know more. DaZZa
offered:</p>

<quote who="">

<p><tt>mkswap /dev/hdaX</tt> - replacing X with your partition number.</p>

<p>Edit /etc/fstab and add the correct line - it should look something like
this</p>

<p><tt>/dev/hdaX       swap    swap    defaults        0 0</tt></p>

</quote>

<p>and Tony Cook explained how to put a swap partition to use without
rebooting, <quote who="Tony Cook">If you don't want to reboot to activate
the swap space you can use the swapon command, "<tt>swapon -a</tt>" to
activate all the swap partitions in /etc/fstab or "<tt>swapon device</tt>"
to activate the swap on a particular device - see man swapon for details
(priorities can be useful if you have more than one physical device, or if
you're using swap files.)</quote></p>

<p>Ben had a couple of problems getting it to work, but soon found that
fstab had two entries for the swap partition, thus giving him an error.</p>

</section>


<section
  title="X-Message to Outlook Users"
  subject="Using X-message in headers."
  archive="http://www.progsoc.uts.edu.au/lists/slug/2000/June/msg00695.html"
  posts="3"
  startdate="15 Jun 2000 00:00:00 -0800"
  enddate="15 Jun 2000 00:00:00 -0800">

<p>Alleged "Mystery Man" Rodos reports:</p>

<quote who="">

<p>I started putting in qwerky headers into my emails ('cause I can).</p>

<p>One that I did was "X-message : What did you think you would find here?".
The weird thing is that Outlook treats this header as really special and
shows it at the top of the message as an Informational thing.</p>

<p>See <a
href="http://digit.rodos.net/outlook.jpg">http://digit.rodos.net/outlook.jpg</a>
for an example of one.</p>

<p>A great way to annoy Outlook users!</p>

</quote>

</section>

</kc>
