My adventures setting up Linux

This is just to document my Linux adventures. I don't intend to replace the how-to documents, they are quite nice. But I thought there might be value in documenting how one person set up their system. Please be sure your backups are up-to-date before you fiddle anything in your system.

What I have

No laughing! I'm running a Packard Bell D-160 tower, it has a P133 chip, 32 Mbytes of RAM, and 2 IDE drives, 2.1 Gbytes and 3.2 Gbytes. I added the 3.2 drive. It came with Win95, which I moved to a partition on the 3.2 Gbyte drive. My drives are set up like this :
/dev/hda1 : 957 kb - C: drive with nothing on it except the DOS stuff.
/dev/hda2 : swap
/dev/hda3 : 1 Gbyte - Linus kernel & workspace

/dev/hdb1 : 2 Gbytes - D: drive Win95 stuff
Also have an E: drive in the other partition on /dev/hdb
I have a 33 kb modem, and an 8x CDrom drive, soundcard & speakers.

I bought the Caldera CD for Linux, and it loaded quite easily. The instructions were reasonably clear, and I got some nice e-mail hand-holding through the early stages from their technical support. My biggest problem was moving Win95 (it's still not quite right), and I have never found *really* good instructions for that. However, after I finished, I found that there is a piece of software that will do it. I don't recall the name, but if you ask me *real* nice, I'll rummage around for it.

Although Linux is a multi-user OS, I am running as a single user on the machine, no network, dialup POP to an ISP. So I will talk in terms of setup for a personal Linux system, not a shared system. I have a bias towards Perl, so apps written in Perl appeal to me since I can hack them if necessary. I have 7 years of experience on SunOS and Solaris, so I know Unix quite well. I never learned DOS, and found Win3.1 painful (unstable and requiring too many repetitive mouse movements), and Win95 worse than Win3.1 in terms of being inflexible and inefficient. A little more stable, though I can easily crash it in a DOS window. So I am biased towards perl, a mix of GUI (easier to remember what to do) and command-line (more powerful and flexible). I'm not a programmer, sys admin, or engineer - I'm just a Physicist who likes to be able to do what I need to do as efficiently as possible. Most of what I do is email, web-browsing, web-authoring, light perl programming for miscellaneous projects, writing, and a small amount of Word Processing and spreadsheet stuff.

I still have to go to W95 for a few things, but I'm working on them.


I updated my system from Caldera OL-Base 1.0 to Caldera OL-Base 1.2. It seemed easy - an update script was provided. But it turned into a bit of a trial. I documented the details, maybe they can help someone else.

I have now also set up a second system, intending it to be my firewall. Details of those adventures are on another page.


Moving mail from Pegasus to exmh

I tried a number of email packages on the Win side, and settled on Pegasus as the most complete and powerful for the best price (free).

I'm an old mh/xmh hand (Mail Handler), so I was pleased to find exmh, which has mime support and other nice features. I'm about 2x more efficient with exmh than I was with Pegasus. One problem that is not yet solved - installing exmh requires the latest version of Tcl/Tk, which cause glimse to break. Sigh.

When I migrated my stuff to Linux, I searched around a bit and decided that, for my purposes, I would run fetchmail to establish my POP connection and download the mail, MailAgent would then do my sorting and mail processing, and my GUI interface would be exmh. Note that in order to run exmh, you must have the latest version Tcl/Tk loaded, that is 8.0.

After I got my mail set up on the Linux side, I needed to move my large mail archive from Pegasus over to mh. It's not too bad, and I wrote some Perl scripts to help.

If you wish to look at / use my scripts, download the gzipped tarfile and give it a whirl. As always, there is no warrenty stated or implied, use at your own risk, etc. Also, this code (for what it is worth) is posted as freeware, protected under the Gnu copyleft. If it is useful, drop me a note & let me know - that is payment enough.

Here is the README file

Moving mail from Pegasus to mh
Alan Jackson, alan@ajackson.org, 1997.
http://www.ajackson.org/

Copy the files you will need from your DOS partition over to your Linux
disk. They all live in pmail\mail.


1. The file desktop.pm# has the names of all the folders and their aliases.
use the script bustup_desktop to break it into a readable form. The output
will be used to run the rest of the routines.

2. The foldxxxx.pmm files are the folders. Each one will appear in the
output of the step above with it's alias. To load a folder from
Pegasus to mh, type :
load_folder foldxxxx.pmm +output/folder
where +output/folder is the mh folder name. Be sure you precede
the name with a plus.
3. For the mail in the Pegasus inbox, it is all in separate files
named pxxxxxx.cnm . To load all these into the mh inbox,
type 
load_inbox 
4. Mail aliases - these are in files names addrxxxx.pmr . Since I didn't have
a very big address book, I blew this off. To get the addresses I wanted
out of the book, I used the strings command, which strips out all the ascii
strings from a binary file :
strings -n 1 addrxxx.pmr

Getting Navigator to work

Retrieve the Linux version from Netscape, but to install it, use the special rpm that will fix a little library incompatibility.

Setting up a pop dialup connection

I didn't document this when I did it, so I may miss something. But I'll put down what I remember.

I created a file :
/usr/local/bin/dialup
that looks like this :

#!/bin/sh

pppd
tail -f /var/log/messages
This fires up ppp and then displays the messages as they appear so you can see the dialup connection status.
In /etc/ppp I created a file chatscript
TIMEOUT 5
"" ATZ
OK ATDT*707133415000
ABORT "NO CARRIER"
ABORT BUSY
ABORT "NO DIALTONE"
ABORT WAITING
TIMEOUT 45
CONNECT ""
TIMEOUT 15
Login: ajackson
Password: xxxthis_is_s_passwordxxx
I also created a file /etc/ppp/options contaning options for pppd
connect "/usr/sbin/chat -v -f /etc/ppp/chatscript" /dev/cua0 38400 crtscts modem noipdefault defaultroute debug

After all that, execute these two commands :

chmod u+s /usr/sbin/pppd
chmod u+s /usr/sbin/chat
and you will then be able to do dialup from your user account, and won't have to log in as root.

To establish a connection, open an xterm and type dialup. When the following appears, you have a connection:

Dec 16 14:34:08 starman pppd[4834]: Serial connection established.
Dec 16 14:34:09 starman pppd[4834]: Using interface ppp0
Dec 16 14:34:09 starman pppd[4834]: Connect: ppp0 <--> /dev/cua0
Dec 16 14:34:13 starman pppd[4834]: local  IP address 207.235.114.228
Dec 16 14:34:13 starman pppd[4834]: remote IP address 207.235.114.5
To kill the connection, type
kill -SIGHUP processid
where processid is the number taken from the listing as shown, in this case it would be 4834. It will be different each time you dial up. 

Mounting my Win95 disks

I started off by issuing the mount command as root, which was a pain. I quickly learned to add entries to the /etc/fstab file, so that the disks would get mounted automatically. But I still had to become root to write to them. Then I learned how to modify those entries so that my user account (ajackson) could write to them. Finally, since I am running fat32 (windows 95 long filenames), I couldn't see the full filenames, and there is a fix for that. Here are the details :

The magical entries for /etc/fstab are
/dev/hda1 /mnt/c_drive vfat user,rw,uid=510,gid=100
/dev/hdb1 /mnt/d_drive vfat user,rw,uid=510,gid=100
hda1 is the half left of my old c-drive, the rest is Linux swap and workspace. hdb1 is the windows d-drive partition of my 2.3 Gbyte second drive. The vfat option mounts it as a fat32 partition, allowing long filenames, and the uid and gid correspond to my ajackson account. Just look in the /etc/passwd file to get the right values.

One further note, to get the vfat option to work, I had to add an entry to the kernel. In the file /etc/modules/2.0.25/#1 Fri Nov 8 23:27:52 MET 1996.default, I added a line
vfat
at the end, to cause the vfat module to get loaded.


Daylight Savings

I reset the clock in my cmos in Win95, but when I booted up Linux, crum, the clock was wrong. I executed (as root) 'clock' and 'date', and saw different times. 'Clock' was correct (Cmos time), but date was off by an hour. How to fix it? Try this (logged in as root, change the year as necessary) :
date --set="`clock | sed 's/1997/CST 1997/'`"


Time synchronization

I tried to run a time synchronization command, and had the following result :

% ntpdate clock.llnl.gov

and got an error that the socket was busy (for the time synch), I checked and saw that xntpd was running,
so I killed it with a -SIGHUP signal, and then ran the command again, and it worked fine. Note that it must be run
as root.

I suppose I could edit the /etc/ntp.conf file to have the time updated automatically, but I looked at the
file and it appeared somewhat complicated. For my purposes, ntpdate worked just fine.


Tools I have chosen

These may not be optimal, but I'm reasonably happy with them. For FTP, I tried ftptool, but the interface was kind of painful, and I found I was error-prone using it. I haven't tried xftp, though it sounds good. What I settled on was Midnight Commander, which is also nice for file manipulation. It makes ftp look like file copy, keeps things pretty simple.

For reading and writing tar and zip files, I, like most folks, really like WinZip on windows. There is a similar facility available on *nix systems, TkZip.

To alter the setting for my window manager (I use fvwm), I got fvwmconf which uses Perl/Tk, which may be gotten from CPAN. Note that in order to install Perl/Tk I had to first install the X11 include files, which were not installed on my PC. These came off the Caldera CD, just be root and type rpm -i XFree86-devel-3.2-1.i386.rpm.

Howvever, I tried it and my system hung so tight I had to power it off. Forget that! I'll reconfig by hand, thank you!


Christmas Card database

Why does this rate a whole section? Because it took a little extra effort! But I'm now free of Microsoft Works ® for one more task, mailing lists (which is all I ever used their database for anyway).
Installing and modifying MDB
  1. downloaded the static rpm from redhat
  2. copied it to /tmp/era and (as root) ran
  3.  rpm -i mdb-static-1.9-1.i386.rpm
  4. To get it to work properly, I had to create a file (as root)
  5. touch /usr/lib/mdb/Mdb.config
    chmod 777 /usr/lib/mdb/Mdb.config
    chmod 777 /usr/lib/mdb/Mdb
  6. Against instructions, to build a new database, I hand edited the file ~/.mdb/MyMdb and added the line :
  7. *folderName1:                   private
    because I couldn't figure out how to get the configurator to do it.
  8. I created a new template for my Christmas card list, and then exported my old list from Microsoft Works as a tab-delimited ASCII file. I ran that file through a spreadsheet (xesslite) to move columns around and do some simple cleanup, so I could then import it to the database. Piece of cake!
  9. Setting up the printing to create mailing labels was fairly easy, easier than doing it for Microsoft Office. Just follow the obvioud directions.
  10. I didn't have mp (pretty print), and it is a bit hard to find. Look for mpdist, that is the name of the package it is part of. I downloaded it from ftp://ftp.x.org/contrib/utilities/mpdist-3.3.2.tar.Z . There is no rpm file. Note that this is not necessary for printing mailing labels, only for some other functions.

  11. You have to hand-edit the makefile and recompile. Here are my edits. Note that there is an error in the makefile for this first one, he has an underscore in the flag which does not appear in the c source.
    BSD_PRINT = -DBSDPRINT
    MOTIFINCDIR     = -I/usr/X11R6/include
    MOTIFLIBDIR     = -L/usr/X11R6/lib
    X11INCDIR       = -I/usr/X11R6/include
    X11LIBDIR       = -L/usr/X11R6/lib
I had to copy the man file by hand - he wanted to use manl and I had man1 ("ell" vs "one").
Couldn't get mptool to compile, missing the Motif libraries. 

Backups


I run a script that creates a tar file of all the updated files, copy it to my W95 partition, and back it up to tape on W95.

The script follows :

#!/bin/sh

#       Do backups using tar
#               first clean up files that should not be backed up (like deleted
mail)
#               then create a list of files newer than the last backup
#               save the current time by touching a file
#               tar the listed file to a compressed tar file

#       Clean up extraneous files

echo "Cleaning up mail"
find /home/ajackson/Mail \( -name ',[0-9]*' \) -ls -exec rm {} \;
echo "remove agentlog"
/bin/rm /home/ajackson/var/log/agentlog

#       first find all files newer than the .last_backup file
#       that are not directories
#       Do not look in mounted filesystems (this prevents looking at the
#       DOS partitions

echo "Running find command"
/bin/rm -f /tmp/backups
find / -mount -newer /.last_backups ! -type d  ! -name "backtar.gz" -fprint /tmp
/backups

#       reset .last_backups file

touch /.last_backups

#       Create tar file

tar -cvzf /backtar.gz --files-from /tmp/backups

echo "Tar file creation done. File is "
echo "`ls -als /backtar.gz`"

echo "copy file to a DOS partition and run DOS backup "

#--- end of script


Printing

This was so easy, I don't know why I waited so long to get it fixed up.
Become root
Type printtool
pick a reasonable printer driver and save.

I did run into one problem, I have a Lexmark 4076 inkjet, which wasn't supported by printtool. My printer documentation said that the IBM ProPrinter driver could be used, so I chose that one, not noticing the footnote that the printer would have to be set to PPDS mode. That didn't work very well, so I chose another driver suggested by the documentation, a DeskJet 510, and that worked wonderfully.
Moral : Always read the directions, all of them!


Transferring files and perl scripts between Linux and W95


Email and account naming


Changing ISP's

My ISP got sold, so I had to change stuff to match the new ISP. Here is what I did, as always, your mileage may vary...

First thing, the IP addresses for DNS resolution changed, as well as the telephone number for the dialup. I changed these first, and left the actual domain name alone, since the old one would overlap for a few months. For ease of understanding, my old ISP was nettap.com, and the new one was icct.net.

  1. Change IP addresses for DNS - changed the nameserver ip address in /etc/resolv.conf, for now I left the names alone, just changed the numbers.
  2. Change phone number in /etc/ppp/chatscript. I also had to edit the replies to be expected from the new server (slightly).
This got me up and running. Then at my leisure I updated my hostname, and then update sendmail to use my new address.
  1. Edit /etc/HOSTNAME, /etc/hosts, /etc/mailname, /etc/system.cnf, /etc/sysconfig/network to change netap.com to icct.net. Used a script, rgrep to find all occurrances of nettap.
  2. Edited in my home directory, .TkZip.rc, .mailagent, .signature_* .fetchmailrc, Mail/.mh_composition. In the mailagent bin directory, edited mailagent.
  3. Then I rebooted the system. This got me a new hostname. Next I had to update sendmail. At first I tried editing the /etc/sendmail.cf file by hand - and that didn't work. Finally I realised that I would actually have to recompile it.
  4. sendmail - for some reason I didn't have the doc and source files on my system, so I went back to the cd and grabbed sendmail-cf and installed it. Then I precisely followed the instructions Erik Ratcliffe of Caldera had sent me :
That does it. As a side benefit, I found that I could now easily switch between my old and new domain names for email by doing the following :
  1. vi sendmail.cf

  2. Change the domain name on the line
    # who I masquerade as (null for no masquerading) (see also $=M)
    DMicct.net
  3. /etc/rc.d/init.d/sendmail stop
  4. /etc/rc.d/init.d/sendmail start
The final step was to unsub/resub to all my email lists. I built two little scripts to help do this. Here is the sub list, for resubscribing.
#!/bin/sh

mhmail LISTSERV@peach.ease.lsoft.com -body "sub SPAM-L" -subject "Subscribe"

mhmail MXSERVER@DRAGON.COM -body "SUBSCRIBE EPISCOPAL Alan Jackson" -subject "Subscribe"
mhmail MXSERVER@DRAGON.COM -body "SUBSCRIBE ACNS Alan Jackson" -subject "Subscribe"
mhmail MXSERVER@DRAGON.COM -body "SUBSCRIBE ENS Alan Jackson" -subject "Subscribe"
mhmail MXSERVER@DRAGON.COM -body "SUBSCRIBE ANG-CE Alan Jackson" -subject "Subscribe"

mhmail LISTSERV@AMERICAN.EDU -body "SUBSCRIBE ANGLICAN Alan Jackson" -subject "Subscribe"

mhmail listproc@pwa.acusd.edu -body "subscribe e-church Alan Jackson" -subject "Subscribe"

mhmail majordomo@ns.us.net -body "subscribe cursillo" -subject "Subscribe"

mhmail listserv@mhn.org -body "subscribe reflections" -subject "Subscribe"

mhmail bread-bakers-request@lists.best.com -body "subscribe" -subject "Subscribe"

mhmail majordomo@rim.caldera.com -body "subscribe caldera-users" -subject "Subscribe"

mhmail majordomo@tictalk.org -body "subscribe tictalk" -subject "Subscribe"
Trivial changes will turn this into an unsub script. Then I did the following :
  1. Became my new identity, and ran the sub script. Waited to receive all the confirmations, and do the confirmation mailbacks.
  2. Became my old identity, and ran the unsub script. Again I waited for all the confirmations.
  3. Became my new self again. Whew!

Reading Word files - especially email attachments.

Don't you just hate getting those Word attachments? Personally I'd like to see the DOJ go after Microsoft
for using proprietary document formats as a way to extend their monopoly, but that's another topic. Anyway,
I installed a hack to read the stupid things. Here is what I did.

The key is to acquire mswordview  which will translate Word 8 files into html. The ftp site for it is
http://www.csn.ul.ie/~caolan/publink/mswordview/ and the documenttation webpage is at
http://www.csn.ul.ie/~caolan/docs/MSWordView.html

I use exmh for my email client, so to access mswordview for a message I built 2 scripts :
seeword
#!/usr/bin/sh
#more /tmp/seeword.html
lynx  /tmp/seeword.html

xseeword
#!/usr/bin/sh
cat | uudecode -p > /tmp/seeword.doc
mswordview /tmp/seeword.doc > /tmp/seeword.html
/usr/bin/X11/xterm -e $HOME/bin/seeword &

In the "apply command to body" menu, set it up as :
cat $file | xseeword

Enjoy!



The Webmaster is Alan Jackson, who may be reached via email at alan@ajackson.org.

Unsolicited Commercial e-mail sent to the webmaster will not be welcomed and will be dealt with agressively