misc

This is part of The Pile, a partial archive of some open source mailing lists and newsgroups.



Date: Fri, 16 Apr 1999 10:35:45 -0400
From: Jan Carlson <janc@iname.com>
Subject: Re: Backing up vfat partitions

I don't think dump supports vfat.

> tar -cvf - /dev/hda1 | ssh sillyname dd of=/dev/rmt/0

Yes, that will just back up the device entry, not the
contents of the device.

tar -cvf - /c | ssh sillyname dd of=/dev/rmt/0

should work if /c is mounted, and if the vfat filesystem
on /c is not corrupt.  This is more flexible when
you want to restore, possibly to a larger or smaller
partition.


cat /dev/hda1 | ssh sillyname dd of=/dev/rmt/0

should also work if /c is NOT mounted, for any filesystem type.
The tape has to be able to hold the entire partition on one tape,
and when you restore from the tape, it may give a warning
'invalid attempt to write beyond end of partition', 
or 'end of tape' or words to the same effect.  
You can ignore the warning.

Don't forget to back up the partition table of the machine,
somehow - you'll need it to restore after a disk crash.

=====

From: Uncle Meat <kcsmart@kcinter.net>
Date:

If /home/sher/.netscape/lock doesn't exist, try:

        locate lock

If one exists (and it likely does someplace) it will show you the path
to all of them, including the one for netscape. Simply delete that file
and all should be well.

=======

Subject: Re: Cool!
From: fred smith <fredex@fcshome.stoneham.ma.us>
Date: Mon, 26 Apr 1999 07:02:08 -0400


On Sun, Apr 25, 1999 at 07:03:04PM +0100, Bruce Richardson wrote:
> On Sun, 25 Apr 1999, Ken Archer wrote:
> > How?
> 
> Just use mv - what Gordon is referring to is the fact that ext2 files are
> uniquely identified by an inode, not a path/name, so you can change the
> path and/or name even while the file is being downloaded, since you won't
> be changing the unique identifier.

Actually it's more general than that, it's not an ext2 feature at all,
but the way Unix(-like) filesystems work. A directory entry is nothing
more than a pointer to an inode... it is the inode that defines other
attributes of the file (like, where on the disk it is stored). The 'mv'
command merely moves the directory entry to another location, or changes
the name associated with the directory entry. So, you're not really
moving the file at all, just the pointer to it.

=======



Subject: Re: Easiest way to mirror a scsi? With/without Raid?
From: Ray Curtis <ray@ray.clark.net>
Date: Mon, 26 Apr 1999 12:46:41 -0400 (EDT)


>>>>> "lo" == Larry Owens <owens@oak.cats.ohiou.edu> writes:

lo> 	Anyone care to comment on the easiest way to mirror a scsi drive? With or
lo> without raid? (Preferably without) I have a machine with two identical scsi
lo> drives in it, and I'd like to be able to simply power down the machine,
lo> unplug the failed drive, and fire it back up again. 

There are many methods to do just this, such as mirror, cp -a, rsync,
etc, etc.
My personal favorite is rsync, but everyone has their own opinion.
Check out rsync at:

http://rsync.samba.org/rsync/ 

=========

Subject: RE: Mirroring
From: "George Lenzer" <glenzer@chuhpl.lib.oh.us>
Date: Mon, 26 Apr 1999 15:42:17 -0400


Try a program called 'fmirror'.  It's on the RPM archive site:

http://rufus.w3.org

It works very well and comes with some sample config files.  I used this
last week to try out Caldera OpenLinux 2.2 and about a month ago to get
Linux-Mandrake 5.3.
=======

Subject: RE: Backing up with tar
From: "Chapman, Matt" <chapmam2@ocps.k12.fl.us>
Date: Wed, 28 Apr 1999 14:19:12 -0400


One option that I am using

Say you have a tape drive /dev/nst0
and partitions say
/
/home
/var

;I first rewind the tape

mt -f /dev/nst0 rewind

;then tar each partition to the tape
tar cvf /dev/nst0 / /home /var

need to restore a full partition
; this would restore the / partition
cd /
tar xvf /dev/nst0 /

need to restore say /home/userid/hi.txt

cd /
tar xvf /dev/nst0 home/userid/hi.txt

I also would remember to rewind the tape first before restoring something...
I have done this several times and although rather simplistic it works for
my small server.

=======

Subject: Re: OK to delete files from /tmp?
From: ignatz@homebru.dminet.com (Dave Ihnat)
Date: Wed, 5 May 1999 21:59:41 -0500 (CDT)


Eric Wood wrote:

> I strong advice not blowing away all the /tmp file while running in
> multiuser mode.  Boot to single user first, then delete - make sure no
> server daemons are running.

Well...theoretically...ANYONE who uses /tmp or /usr/tmp *must* program
to expect their files to be deleted at any time.  This isn't generally
the problem you might think.  If a file is open, you can't _really_
delete it anyway; the instantiation in the /tmp|/usr/tmp directory will
be gone, but the inode lives on.  In fact, the *right* way to use files
in these directories (from a program) is to create the entry, make sure
it's open, then delete it yourself while still open.

If you find an RPM or software utility that gets hosed by files it
needs in /tmp|/usr/tmp being deleted, yelp <loudly> at the author!

===

From: Zenin <zenin@best.com>
Subject: Re: Working on a regexp to strip html tags
Date: 10 Aug 1996 00:51:01 GMT
Organization: Rocky Horror, Barely Legal (Berkeley, CA)

Joe Brenner <doom@kzsu.Stanford.EDU> wrote:
: Okay, so I need a script to strip out html tags.  I start
: thinking about things like this: 

	FYI, if it doesn't need to be in perl you can also use:
		lynx -dump filename.html > output.txt
	This not only strips the tags, but also will format the
	output according to the tags.

	>snip<
:     s/<.*>//g;
: This sort of works, it takes out most of the tags... but it
: doesn't work on tags that begin on one line and end on
: another (which was the whole point of the multi-line buffer
: business).  Why? Because, of course, "." matches all
: characters *except* the newline.  So I start to think about
: things like this: 
:     s/<(.|\n)*>//g;

	This would match:
		<.*>
	OR	<\n>
	But not <.*\n.*>

	Were you thinking of this maybe?:
		
		s/<[^<>]*>//g;	# perl4 or perl5
	or	s/<[.\n]*?>//g;	# perl5 only, but I like the above better

: And after fumbling around in the Camel's entrails, I came to
: the conclusion that this is the recommended way of doing
: this, on page 105 there's an example like

:    s/.*(some_string)(.|\n)*/$1/; 

	How would this take out tags?  You never match against
	">" or "<".

: The trouble is, when I try this, it gives me Core Dumps when
: I feed it files bigger than around 600 lines.

: So what's my problem? 
	Hmm, probably an implementation bug of some kind.  Try it on
	a different type (different unix is ok) of machine and see
	what happens.

===

Subject: Re: X mail readers
From: Steve Borho <sborho@ststech.com>
Date: Tue, 18 May 1999 12:03:27 -0500

On Tue, May 18, 1999 at 05:02:04PM +0100, Thomas Ribbrock Design/DEG" wrote:
> On Tue, May 18, 1999 at 03:31:18PM +0900, Matt Doughty wrote:
> > I was wondering what people suggest for an X-based mail reader?
> 
> I've just installed xfmail for a couple of colleagues and for my
> girlfriend at home - all seem to be happy with it. I myself had only a quick
> look - it looks nice and seems to have a lot of features. Won't get me to
> switch from mutt, though[0]... ;-)
> 
> You can find more information about xfmail here:
> 
> http://burka.netvision.net.il/xfmail/xfmail.html

xfmail is pretty good, but based on the proprietary xforms libraries.

> An RPM exists in contrib, at least for RH5.x.
> 
> I've also tried Postillion (again, for other users, not for myself), but I
> found it to be painfully slow (on a Sparc10 under Solaris 2.6). It can be
> found at: http://www.postilion.org/

Postillion is an outstanding mail reader, but you pay the tcl/Tk
performance tax with it.

> [0] *My* favorite X-based mail reader:
>     rxvt -e mutt
>     ;-)

My favorite is:
   Eterm -theme Mutt
in conjunction with vim 5.4, which does excellent syntax highlighting,
it's e-mail bliss.

===

Subject: Re: More on PATH
From: Todd Bordeaux <proceng@ibm.net>
Date: Wed, 19 May 1999 04:39:37 +0000

> epr@ilnk.com wrote:
>
> >   2) is there any reason to not include particular directories in PATH?
> >   For instance, I made up a directory that I want to have there.
>
I set mine (in /etc/profile) to:
/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/opt/bin
In ~/.bash_profile, I modify it to $PATH:$HOME/bin - This appends my bin
directory to the above.  Don't forget to add the "export PATH" statement
to make it take effect across the board

You can set individual paths in the users .bash_profile files (if your are using bash) so

 that each user has a unique environment.

>   3) is there any reason to have certain directories in the path more than
>   once?  I noticed my user acct's path had several directories with
>   multiple listings, and I did not put them there manually.. maybe a funky
>   install script or whatever.

What I have found is that many scripts include a line like "PATH=$PATH:/usr/local/bin",

which will mean that each invocation will add "/usr/local/bin" to the script.

>   4) I accidentally deleted my root path and am trying to reconstruct.
>   Would someone with a stock install of RH6.0 send me a copy of theirs?

I'm still running 5.2, but you're welcome to my root path:

/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin/X11:/usr/X11R6/bin

===
Subject: Re: More on PATH
From: Alan Shutko <ats@acm.org>
Date: 18 May 1999 22:35:54 -0500

Joe Brenner <doom@kzsu.Stanford.EDU> writes:

> This sounds like an interesting question.  My guess would be
> that there's no point in putting an "sbin" in a user
> account's path, but you probably do want it in your root
> path.

FWIW, I always put /sbin and /usr/sbin in my path.  I've found both
/sbin/ifconfig and /usr/sbin/lpc useful on occasion.  But that would
depend on the user.

===
From: Dave Reed <dreed@capital.edu>
Date: Sun, 11 Apr 1999 18:44:37 -0400
Subject: Re: Shutdown as ordinary user

> From: "Julian Thomas" <jt@epix.net>
> 
> In <14096.63158.859623.484605@em2.my.own.domain>, on 04/11/99 
>    at 09:23 PM, Svante Signell <svante.signell@telia.com> typed:
> 
> >Hello, I wonder if some key combination for shutdown could be agreed on
> >and implemented, similar to C-A-Del for reboot. I would like my kids to
> >learn Linux. I can create user accounts for them, but I don't want them
> >to know the root password. 
> 
> 1.  C-A-D does a shutdown before reboot.  What I do is C-A-D and then when
> the bios screen comes up, power off.

Or change the line in /etc/inittab to look like:
# Trap CTRL-ALT-DELETE
ca::ctrlaltdel:/sbin/shutdown -t3 -h now

The -r changes to -h

===
From: Greg Thomas <gregt@nadel.com>
Date: Mon, 5 Apr 1999 15:35:12 -0700 (PDT)
Subject: Re: Booting Multiple Linices (?)

On Mon, 5 Apr 1999, Gordon Messmer wrote:
> Uncle Meat wrote:
> > Going through man lilo.conf I wasn't clear on how to do this. 'Doze and
> > a single linux is a piece of cake. Is the lilo.conf entry a simple
> > stanza, similar to another kernel (using the proper root partition of
> > course) or does something else need to be done?
> 
> It should be as simple as you expect, a new section containing the other
> linux kernel and the other root partition.  You could probably use just
> one kernel, but you'd have to make sure you had the same modules on both
> linux partitions.  Anywho, exemplia gratia:  (is that even close to
> correct?)
> 
> image=/boot/vmlinuz-2.2.5-3
>         label=redhat
>         root=/dev/hdb2
>         read-only
> image=/mnt/suse/boot/vmlinuz-2.2.5-3
>         label=suse
>         root=/dev/hdb3
>         read-only
> 
> Supposing that you are using your shiny Red Hat linux, with root
> partition on /dev/hdb2, and you have your gleaming SuSE linux mounted on
> /mnt/suse.

Just one little side note:  up to 5.3 (not sure about 6) a standard SuSE
installation put the kernel in /, not in /boot as does RedHat.  So the
image line for suse would be image=/mnt/suse/vmlinuz-2.2.5-3.

===


From: Ryan Weaver <ryanw@infohwy.com>
Date: Tue, 13 Apr 1999 03:01:31 -0500
Subject: mswordview-0.5.7-1


Description :
MSWordView is a program that understands the Microsoft Word 8
binary file format (Office97) and is able to convert Word
documents into HTML, which can then be read with a browser.

===
From: Statux <statux@bigfoot.com>
Date: Wed, 14 Apr 1999 18:54:10 -0400
Subject: Re: bz files

Nate Keegan wrote:

> I downloaded a kernel patch from www.kernel.org (patch-blah blah blah.bz2)
> and I am unsure of exactly what format the file is in. What is a bz2 file? Is
> it like a zip or tar/gzip file?

bz2 files are created with bzip2 (Block Zip 2)

do: bzip2 -dv file.bz2
this will decompress the bz2 file and give verbose output.

Note: bzip2 gives better compression than gzip, but the compression is
significantly slower.

===

From: Rob Napier <rnapier@employees.org>
Date: Thu, 15 Apr 1999 17:14:52 -0400
Subject: Re: Limit a command to one process


I don't believe there's any "simple" way to do it. For the
"traditional" way, look at /etc/rc.d/init.d/functions::daemon() and
pidofproc().

Rob

On Wed, Apr 14, 1999 at 10:29:56AM -0400, Clarence Donath wrote:

> Is there an easy way with Linux to limit a command to one
> process?  I've written a wrapper Perl script to do this,
> but am wondering if anyone knows of a more traditional way
> to do this.  There are actually two methods.  One is to
> deny the execution of a command if that command is already
> running.  This can be accomplished with a locking (lock
> file) mechanism.  Another is to kill off the running
> process, actually all processes that match a given name,
> and execute a fresh process.

===
From: "Tony Johnson" <gjohnson@showmaster.com>
Date: Thu, 22 Apr 1999 14:29:39 -0500
Subject: RE: Unix Programming

Fred Lenk RHL Linux account [mailto:fllnx@commpower.com] wrote:
> 
> "John Mai" <johnhm@jps.net> wrote:
> 
> > I know this is a wrong place to post this question, but I
> > need help.  I am writing a C program that checks a deamon
> > every 30 minutes, if it is not running then start it, If
> > it is running then leave it alone.
> 
> 'course you can do it with C, but that would be like using a
> tank to drive to the store.  A simple shell script that
> pipes the output of ps thru grep looking for your daemon
> could easily accomplish the task. Then depending on the
> status of the command (known to the shell as $? ), could
> either startup the daemon, or exit the shell script.  fred

Simple sendmail example

#!/usr/local/bin/bash
pid=`ps aux | grep -E 'sendmail: accepting' | grep -v grep | awk '{print
$2}'`
if [ -z $pid ]
then
   sendmail -bd -q30m
fi


edit crontab and add a like like...

0/30 * * * * root /usr/sbin/checksendmail.sh

===
From: Steve Borho <sborho@ststech.com>
Date: Thu, 22 Apr 1999 17:35:10 -0500
Subject: Re: Re: Roots: / vs. /root vs. /su -


On Thu, Apr 22, 1999 at 03:55:21PM -0400, Michael George wrote:
> On Apr 22, Ramon Gandia wrote:
> > Steve Borho wrote:
> > 
> > > I can tell you are getting close to the point where you reach the Unix
> > > epiphany where you say "Oh, I get it, that makes sense now when you think
> > > about it, how cool, these guys had a good reason for everything."
> > 
> > More often, you'd sometimes like to SHOOT the sunnovabitch that
> > thought of this or that!
> 
> Sometimes that happens, but I usually find things are very consistent.
> Speaking of epiphanies, did anyone else have the experience with C where you
> were trying to keep all the pointers and indirections and variables (local and
> global) straight?  And then, all of a sudden, it all just clicked.  You began
> to see just how everything worked?  And from there on you could look at any
> obscure construct and see exactly how it would execute?

I think one of the reasons I like Unix and Linux so much is that I was already
a C fan long before I ever sat down in front of a Unix machine.  Unix's
heritage is strongly intertwined with C and they both share the same
philosophies of "hide nothing" and "the user knows what (s)he's doing".

There is elegance in both designs: for instance, in C you use a * to both
declare and dereference a pointer.  It helps to understand them if you can
think like the machine.  This is hard to explain to people, even those who
work with computers all day long.

As a C programmer, when I looked at the /dev directory and realized that all
the files in there were merely a means for placing human names on device
drivers in the kernel, it just clicked.  Wow, that's pretty cool.  Then you
see /proc where every file is just another kernel entry point and you say...
slick.  Then everything just kind of slides into place... file permissions,
symlinks, dlls, rpms, ttys, etc.  The ultimate zen for me was the discovery of
zsh.

BTW: real programmers use bunzip2 > a.out
BTW2: real programmers debug code with their eyes closed
           find . -name "*.[ch]" -exec cat {} \; > /dev/audio

===

the rest of The Pile (a partial mailing list archive)

doom@kzsu.stanford.edu