Linux Gazette... making Linux just a little more fun! Copyright © 1996-97 Specialized Systems Consultants, Inc. linux@ssc.com _________________________________________________________________ Welcome to Linux Gazette! (tm) _________________________________________________________________ Published by: Linux Journal _________________________________________________________________ Sponsored by: InfoMagic S.u.S.E. Red Hat Our sponsors make financial contributions toward the costs of publishing Linux Gazette. If you would like to become a sponsor of LG, e-mail us at sponsor@ssc.com. _________________________________________________________________ "Linux Gazette...making Linux just a little more fun!" _________________________________________________________________ The Mailbag! Write the Gazette at gazette@ssc.com Contents: * Help Wanted -- Article Ideas * General Mail _________________________________________________________________ Help Wanted -- Article Ideas _________________________________________________________________ Date: Mon, 18 Aug 1997 00:25:47 -0400 From: Anthony Wilson anthony@pisces.globalserve.net Subject: Difficulty running programmes I am using Linux Slackware 3.0 with kernel version 2.0. I am running a LAN and whenever I try to run a script or a program that I created on the server, I get a command not found error, even though I have read write permissions on the file in my own directory. If I transfer that same file to another Linux box on this LAN, I can run it without any problems. Is there an easy fix to this problem? Thank you. Anthony Wilson _________________________________________________________________ Date: Wed, 20 Aug 1997 06:00:38 +0200 From: Denny denny@ele.kth.se Subject: Connecting to dynamic IP via ethernet Hello. I want to connect my Linux box to our ethernet ring here at my company. The problem is that they(we) use dynamic IP adresses, and I don't know how to get an adress. I use win95 on one partition on my pc, from where it works fine to connect. I know the IP adress to the DCHP-server (that the one who distributes the IP-adresses, right?) but how do I do to get assigned an IP-adress from Linux? I got so tired of trying, that I finally just assigned an adress myself and hey, somethings work. I can use telnet and ftp but X takes 15 minutes to start, and emacs likewise. I can't wait that amount and also I'm sure there are several thing that don't work. Please, if you know how to do, explain carefully, I'm not all that good at linux and tcp/ip hacking. Denny _________________________________________________________________ Date: Fri, 15 Aug 1997 09:47:03 -0500 From: Cory Sticha csticha@apci.net Subject: Printing PostScript to a DeskJet 682C I've got a question that I'd to have answered. I've got an HP DeskJet 682C printer that I'd like to use to print pages out from Netscape. Unfortunately, the printer only recognizes text and PCL 3, while Netscape only uses PostScript. Is there a filter that is capable of converting PostScript to PCL 3. Also, to print text to this printer, I have to pipe the file that I want to print to todos and then pipe that to the printer. How can I automate this? Thank you very much in advance for any help that you can give me. Cory Sticha, SrA, USAF _________________________________________________________________ Date: Mon, 04 Aug 1997 14:12:42 +1000 From: Marcus B marcus@cwi.net.au Subject: Problem with adaptec 2940U Answer: RedHat versions 2.x kernels only) but there are problems on some hardware configurations. _________________________________________________________________ Date: Wed, 6 Aug 97 20:55:49 BST From: George russell george.russell@clara.net Subject: Linux Help needed to connect to Internet I am a new Linux user, and inexperienced in Unix environments. My aim in using Linux is to connect to the internet without needing to use Windows, in order to learn about Linux and update my linux setup (Slackware Linux Toolkit March 1997, which I will install again soon). I have had X Windows and Netscape Navigator 3.01 installed,and will do so again after a hard disc upgrade. I am unable to connect to the internet. Could anyone help me to do this? My modem is on COM2, and works under windows as a generic modem. I know the number of my ISP, that my IP address is server assigned. I have the IP addresses of the primary and secondary DNS, and have my own username and password. Is there anyhing else I need to know, and can anyone help me with this? I would be very grateful for all assistance given. _________________________________________________________________ Date: Wed, 06 Aug 1997 15:35:20 -0700 From: Luke luke@holdens.org Subject:LILO Problems I have this 2 gig scsi drive. I have Linux and Windows 95 on my system. 95 is on the first gig and Linux is on the 2nd. Lilo gives me problems with booting Linux from the second gig. And windows just will not see it. Its a old scsi disk. So I cant use sector compadibility mode. Right now. I use Lodlin (and some 95 proggy) to drop out of 95 and kick linux in. Eather this or I have to use a installation floppy (I cant load lilo on a floppy because it gives me disks problems there too) You know of any boot managers that I can gain access to that can read the entire disk? I know the NT boot loader can do this. But there is no point in loading NT for this task. Another problem I have is this. I have a Windows NT box as a proxy server for my internet connection. (I can't convert it to Linux, it's not my box) I can get Windows 95 to send all ip requests threw the proxy using the ms proxy client. (ex: quake over the net) But with Linux I can't seem to do that. I have used Netscape a bit for this purpose. But I still can't do anything else. Is there a way to get Linux to work over a proxy itself? I could just dail into my ISP va PPP. But I already have a 10 megabit connection to them. What's the point of using a modem. Is there a way I can get around this problem? Another question I have is can I make a swap from an image or some other media. I don't want to kill my Linux partition to gain this. But, I have a 16 meg swap partition and 16 megs of ram. Trying to run progams like Wabi is of no use. They don't seem to have enough memory. Is there a way to add more swap space with out disturbing the exsisting partitions? Well thank you for your time. Long live LINUX!!! Luke Holden _________________________________________________________________ Date: Sat, 09 Aug 1997 23:14:04 -0400 From: David Nghiem Subject: Pointers Hey all, Do you guys know of any information regarding programming a game in Linux on the X11 platform? I want to use it as a cross developer for some DOS games. The main issue here is this: How do I display my output? Laterz, Dave. _________________________________________________________________ Date: Fri, 08 Aug 1997 20:03:21 -0400 From: Raymond E. Rogers rrogers@voyager.net Subject: Apllixware -- Fax I bought applixware some time ago and found that I was supposed to roll my own Fax interface. Somebody at work suggested just setting up a "printer" for fax. Logical to me. As I don't do Linux for a living or a hobby; it would be nice if somebody could write and article on how to do it. Or point me to instructions. I looked around and was unable to find any. There is supposed to be instructions in how to make netscape do standard PGP/RSA digital signatures that can be verified on any PGP system, not just inside of netscape. Simple instructions on this would be nice. If I get around to doing these things first, I will write an article on how I did it. Enjoy Ray (An article entitled "Faxing from the Web" will be included in the upcoming November issue of Linux Journal. While the magazine won't be out until next month, the listings that go with it (including his front end) are available at ftp://ftp.ssc.com/pub/lj/listings/issue43/2044.tgz. Since the author was not using Applixware, I'm not sure how much his code will help, but check it out, it may be just what you need. --Editor) _________________________________________________________________ General Mail _________________________________________________________________ Date: Wed, 30 Jul 1997 12:22:41 -0700 From: Tom Schenck tschenck@concentric.net Subject: Organize and overtake! Well, I'm pretty sure there are people doing this, but not very fast or efficiently. We need a stable, friendly, easy-to-install system that comes equiped with applications that allow the user to begin working right away, and configure without programming knowledge! Yes, it's *nix. Yes, it's a programmers environment. Yes, it doesn't HAVE to be terse, hard to configure, etc. Hell, maybe I'll have to do it! _________________________________________________________________ Date: Fri, 22 Aug 97 21:09:09 BST From: Duncan Simpson feynmen.ecs.soton.ac.uk Subject: M$ word Those who need to read a word document might like to get the latest version of wqord2x by anonymous ftp from amil.telstar.net in the pub/duncan directory. Note the machine's main job is a mail redirection service, which sends me the logs, amoung other things!! Duncan _________________________________________________________________ Date: Sun, 10 Aug 1997 13:56:23 -0600 (MDT) From: Michael J. Hammel mjhammel@csn.net Subject: MS quote This comes via a Mac friend of mine. We should look closely at aligning with the Mac users of the world. They hate MS almost as much as we do. :-) From: EvangeList evangelist@apple.com This tidbit is from: Dave Reiser, dbr@ptd.net In a page 1 article in the July 28, 1997 Computerworld there's an article ENTITLED "Microsoft Declares War" about how MS has announced that it will not ship the Java class libraries. I absolutely howled when I read this quote: "'We have no intention of shipping another bloated operating system and forcing that down the throats of our Windows customers'" [attributed to Paul Maritz, Microsoft Group Vice President] Are they feeling guilty about the fact that they've already rammed one bloated operating system down their customers' throats? -- Michael J. Hammel _________________________________________________________________ From mjhammel@csn.net Fri Aug 8 21:48:52 1997 Date: Fri, 08 Aug 1997 23:00:22 -0600 Subject: Descent 3D for Linux? Linux has always been the perfect platform for games, it's just very few developers (id and Crack.com are the only two worth mentioning that I know of) know that. Actually I think many of the developers know the value of Linux, but there is no marketing proof that a Linux port will make money. As many others have said in the past, we need certifiable numbers to prove the market exists and that its willing to spend money on commercial products. I don't have any info on it, but I'd love to know if either Id or Crack.com made any money on their Linux ports. And I'd like to know if it was enough, in their eyes, to warrant future ports. I've a gut feeling the Id guys may have done their port simply because they liked the idea and did it for fun, but thats just an unsubstantiated hunch. I just got back from SIGGRAPH today and after having talked to many engineers from lots of different companies I can say that nearly all are *very* aware of Linux and most (that I talked to) are using it. One engineer from Cosmos Software, the new division at SGI, said they'd probably be happy to let someone do the port of the new Cosmo Player 1.0 to Linux (although he wasn't sure how to go about getting that done). Most of the companies at the conference who are Unix aware are also Linux aware. They just need a little proof that the market will return their investment within a reasonable time frame. One of the things I decided to do while I was at SIGGRAPH was to write an article outlining how to begin to get reasonable market figures for Linux with respect to graphics tools and games (other vertical markets are a bit out of my league). I'm sketching this out now and will probably submit it to the Linux Journal in September or October. Much of it resolves around the use of simple Multimedia applications. Anyway, once we have the numbers to back us up, it will be a little easier to convince game developers to include Linux ports of their software. -- Michael J. Hammel _________________________________________________________________ Date: Fri, 08 Aug 1997 22:36:23 -0600 From: Michael J. Hammel mjhammel@csn.net Subject: Firewire and DV I just got back from SIGGRAPH. To my knowledge there are no plans for Firewire support for Linux, but I have to admit I didn't specifically go looking for it. I'm not even completely sure what it is (although thought it was just another 3D chipset). I've been on a personal crusade to get Linux noticed as a terrific platform for image processing and graphic arts tools, and that includes (eventually) Digital Video (DV) tools. However, although there are quite a large number of tools for doing computer graphics (including plenty of support for OpenGL, both commercially and in the freeware MesaGL package), I've not seen any DV style tools. I'd say its a little early for such tools on a commercial basis since more basic tools are not commercially supported yet. But its certainly something I'll continue to keep an eye on and do my best to encourage. DV tools would work as well on Linux as any other high-end Unix system, but tools like graphics tablets and scanners need better support before we'll get into DV tools. We also need a decent GUI toolkit. Motif is ok, but a bit bloated. Most of the other toolkits don't have enough printed documentation available yet. While at SIGGRAPH, Mark Kilgard told me that there is a new toolkit that sits on top of GLUT that might be a good basis for a more advanced toolkit. I haven't had time to look at it yet (I just got back today). Anyway, I hope this helps a little. If you find any DV tools or have contacts that could use a little polite prodding, feel free to drop me a line. -- Michael J. Hammel _________________________________________________________________ Date: Wed, 27 Aug 1997 09:04:22 -0700 (PDT) From: Riley Eller RILEYE@datalight.com It took Linus to make it happen It took everyone to make it right It takes HOWTOs to make it work It takes the Gazette to make it FUN Thank You Linux Gazette :-) Riley Eller Newbie Jihad Warrior _________________________________________________________________ Published in Linux Gazette Issue 21, September 1997 _________________________________________________________________ [ TABLE OF CONTENTS ] [ FRONT PAGE ] Next This page written and maintained by the Editor of Linux Gazette, gazette@ssc.com Copyright © 1997 Specialized Systems Consultants, Inc. "Linux Gazette...making Linux just a little more fun! " _________________________________________________________________ More 2¢ Tips! Send Linux Tips and Tricks to gazette@ssc.com _________________________________________________________________ Contents: * Changing Video Modes * Colormap Questions * Netcat! * Starting and Stopping Services * A New Tool for Linux * Of Logs and Other Things * Calculator Tip * Another Way to View Tarred Files * Script Ease * Syslog Thing * Sorta E-mail-to-FAx...Well, to-Printer * Setting Xterm Title to Current Process * CVS _________________________________________________________________ Changing Video Modes Date: Fri, 08 Aug 1997 22:41:05 -0600 From: Michael J. Hammel mjhammel@csn.net I don't know how AccelX and XiGraphics and MetroX handle these things. AccelX is ( I think) a PC graphics company. You might mean Xaccel, which is the actual program name for Xi Graphics X server. Its product name is "AcceleratedX". Xi Graphics is the company name. As for how Xaccel changes its video modes - try CTRL-ALT-+ (thats a plus sign). I believe that cycles through the various modes. Check the man pages or manual to be certain. I believe MetroX does similar, but the keystroke is probably different. -- _________________________________________________________________ Colormap Question Date: Fri, 08 Aug 1997 23:47:31 -0600 From: Michael J. Hammel mjhammel@csn.net The question was "can you force an X application to use its own colormap in some way other than using a command line option". The answer is: it depends (aint it always the case?). An applications ability to use its own colormap is not a "builtin" part of X. Colormaps are part of X, but the application still has to add code to make use of colormaps. So if the application doesn't have any code specifically for handling colormaps (for example, my XPostitPlus doesn't have any such code) then neither the command line or any other method will force it to use a private colormap. The default for applications (like XPostitPlus) is to use the default colormap, and thats why you often see applications with weird colors that you can't get rid of till you exit some other application. Now, if the application *does* have code to deal with colormaps, it can also make the use of the private colormap a user configurable option. X provides a mechanism for making an option either a command line option (eg. -usePrivateColormap) or an X resource. X resources can be specified in X resource files (like .Xdefaults) or on the command line using the -xrm option. X is so configurable that the number of ways for a user to supply configuration information can often be quite confusing, both for the user and the developer. In any case, its up to the programmer to make any of these methods available. None is available by default simply becaue its "an X windows program". The correct thing for an application to do is to allow the user to configure the use of the private colormap in at least one way and to provide a best-guess default for determining if a private colormap would be the best thing to do or not if the user doesn't provide a preference. Few applications do this, however. The GIMP does. So do XV and Netscape. Even my own programs aren't very good at this, although I intend to get much better in the very near future. As for an X column, well, I'd love to see one. We just need to convince some X hack to spend a little time writing articles instead of code. Thats kinda hard to do. I'll probably be adding some X coding tidbits to my Muse column, but only with respect to using Motif or OpenGL in graphical and multimedia applications. Hope this helps a little. -- Michael _________________________________________________________________ Netcat! Date: 01 Aug 1997 15:46 EDT From: Jean-Philippe Sugarbroad da1wizard@geocities.com I was going through back issues of the Linux Gazette and I remembered a program I use quite frequently... netcat. This program enables you to open sockets and connect or listen with them - all from a shell script! It's a great way to quickly fetch web pages or see if a server is running... It even has UDP 'connection' mode and zero-io mode (which closes the connection as soon as it succeeds...). The UDP mode even uses a TCP connection to check round-trip time :) I love it! Jean-Philippe Sugarbroad _________________________________________________________________ Starting and Stopping Services Date: Tue, 5 Aug 1997 18:55:19 -0600 (CST) From: Terrence Martin twm139@its.to I was just reading the August version of Linux Journal and I noticed refrence to rebooting the system after making changes to the /etc/syslog.conf file in order for those changes to take affect. This is contrary to a feature that is the main reason I use Linux at home and at work. It is only generally necessary to reboot Linux to add/remove hardware or when installing a new kernel. In the specific case of syslogd(8) you can inform the server to reread it's initialization file by sending it a SIGHUP signal. eg. kill -HUP `cat /var/run/syslogd.pid` This will work with many of the servers available for Linux including (most) httpd(8), named(8), and inetd(8). Sometimes however it is preferable to actually restart these services. In Slackware I believe most of your services are placed in a single script and this makes it a little more difficult to pick and choose which services to stop and start. In RedHat it is a little more modular. In the directory /etc/rc.d/init.d are the scripts that are run on bootup to start various services. These scripts allow you to start and stop various services just as if you had shutdown and rebooted your machine. eg. # /etc/rc.d/init.d/named.init stop # /etc/rc.d/init.d/named.init start This will start and stop the name service. The scripts supplied with RedHat are not too complex compared to similar scripts I have seen on other systems. They can usually be adapted to new services that you may wish to have start on bootup, without complicating the rc.local file and giving you much finer control. If you examine the soft links in /etc/rc.d/rc0.d through /etc/rc.d/rc6.d you will notice that they link to the files in /etc/rc.d/init.d. Each of these numbers on these directories refer to a "runlevel". As the system boots the /etc/inittab tells the init process which directories to examine to determine which services to start up, most systems not running xdm will end at runlevel 3, otherwise it is runlevel 5. All of the files(softlinks) in runlevel 3 beginning with 'S' are executed in order of occurance in the directory, this is controlled by giving each a number ie S30syslog -> ../init.d/syslog comes before S40cron -> ../init.d/cron.init. Note: Links with the same number are executed in lexical order. The sequence may be important depending what services depend on other services. I put most of the services I add in runlevel 3, as I usually boot into multiuser mode. You then should add the approriate script link to /etc/rc6.d as those are the files that are executed on shutdown. Note the convention here is to begin all soft link names with 'K'. ie K10named.init -> ../init.d/named.init Again these scripts are executed on order with the highest number being last to run. The net effect of all these links is that with an 'S' preceding the soft link the script is run with the argument "start" and with a 'K' it is run with the argument "stop". Over the last two weeks I have set up and configured a news server, web server, name server, sshd server, updated the syslog.conf file plus a hundred other little tweaks on our RedHat 4.x box and I have not had to reboot once. In fact the system has not been rebooted since we added a new CPU and SCSI card 31 days ago...I love Linux :)... Regards Terrence Martin _________________________________________________________________ A New Tool for Linux Date: Fri, 22 Aug 1997 08:29:59 -0500 From: Ian Beth13@mail.utexas.edu The version posted in issue 20 assumes you have exec access to ALL dirs under the one you 'TREE' Here's a modified version which works even in cases of unreadable folders: -------------------------------- cut here -------------- #!/bin/sh # @(#) tree 1.1 30/11/95 by Jordi Sanfeliu # email: mikaku@arrakis.es # # Initial version: 1.0 30/11/95 # Next version : 1.1 24/02/97 Now, with symbolic links # Patch by : Ian Kjos, to support unsearchable dirs # email: beth13@mail.utexas.edu # # Tree is a tool for view the directory tree (obvious :-) ) # search () { for dir in `echo *` do if [ -d $dir ] ; then zz=0 while [ $zz != $deep ] do echo -n "| " zz=`expr $zz + 1` done if [ -L $dir ] ; then echo "+---$dir" `ls -l $dir | sed 's/^.*'$dir' //'` else echo "+---$dir" if cd $dir ; then deep=`expr $deep + 1` search # with recursivity ;-) numdirs=`expr $numdirs + 1` fi fi fi done cd .. if [ $deep ] ; then swfi=1 fi deep=`expr $deep - 1` } # - Main - if [ $# = 0 ] ; then cd `pwd` else cd $1 fi echo "Initial directory = `pwd`" swfi=0 deep=0 numdirs=0 zz=0 while [ $swfi != 1 ] do search done echo "Total directories = $numdirs" -------------------------------- cut here -------------- The changes are to put the "cd $dir" as the predicate of an IF statement, NOT IN A SUBSHELL, and the recursive part is the switched clause. This prevents infinite recursion in the case of an unreadable or unexecable dir. _________________________________________________________________ Of Logs and Other Things Date: Sun, 10 Aug 1997 21:47:39 +0200 From: D. Emilio Grimaldo T. grimaldo@panama.iaehv.nl Hi, I recently saw on the August issue of Linux Gazzete and some previous issues about the handling of system logs. Well, it doesn't have to be complicated, in fact I have written a very useful script/package that has been around for a couple of years, it is called Chklogs and is used by major network providers, companies and small-time users of Linux systems. In fact it is going to be featured in the Linux Journal some time this year. IT fulfills all the log handling needs. For more information see http://www.iaehv.nl/users/grimaldo/info/ Catch the link to Chklogs Best Regards, Emilio _________________________________________________________________ Calculator Tip Date: Sun, 27 Jul 1997 23:43:37 +0200 (MET DST) From: Hans Zoebelein zocki@goldfish.cube.net Hello Linux Gazetters, Here comes a real cheap command line calculator. Since shell scripts do only integer calculation, you are stuck if you want floating point precision. You also want to do sometimes stuff like 'how much is 1200*3/7' at the commandline without firing up a full blown GUI calculator. Just for that work you can use the calcme command line calculator, which is hacked in perl. Dont forget that a shell thinks differently about 10*3 than a calculator. So do it as 10\*3 or "10*3". The icing of the cake is the optional formatting. If you supply something like %.3f as second parameter, the output is nicely formatted as floating point number and up/down rounded correctly after 3 decimals. You also can do a calc 10/3 %20.6f which returns a string with 6 digits and 20-6=14 spaces like ______________3.3333. So formatting of lists in shell scripts is real fun now. Enjoy! Hans #!/usr/bin/perl # # The ultimate command line calculator :-^ # Usage calcme [] # # Input is a string like (10+3)/7 or "(10 + 3) / 7" # Output is the calculated result of the string (sic!). # Optional formatting can supplied as 2nd parameter. if (@ARGV == 0 || @ARGV > 2) { die("Usage: $0 <\"formula_to_calculate\"> []\n"); } $format = ""; $calcme = $ARGV[0]; (@ARGV == 2) && ($format = $ARGV[1]); $output = eval($calcme); if(@ARGV == 1) { print(STDOUT "$output\n"); } else { printf(STDOUT "$format\n", $output); } exit(0); -- Hans _________________________________________________________________ Another Way to View Tarred Files Date: Sat, 02 Aug 1997 02:18:07 +1000 (GST) From: Gerald J Arce garce@starcommand.mang.net In issue 19, I read a 2 cents tip regarding viewing a tarred file. I use less instead.. ex: tar tzf foo.tar.gz less foo.tar.gz Less typing (grin). _________________________________________________________________ Script Ease Date: Wed, 6 Aug 1997 01:54:19 +0200 (GMT+0200) From: Trucza Csaba ctrucza@cemc.soroscj.ro Hi all, As a programmer-wannabe, I do a lot of typing. To ease at least the beginning of each source file (which is mainly the same: include-s, define-s, imports and stuff), I wrote a script to automatize this. For the quality of the script please read the notice at the end of my mail. (file: se) ---------cut here--------------- #!/bin/sh # # source editor (se) # # usage: se # # WARNINGS: # 1. do not supply extension: # se MyProg.java will make a MyProg.java.java!!! # # 2. manually create the # SE_HOME_DIR, # SE_HOME_DIR/temp, # SE_HOME_DIR/templates # # man se: # # create two files for each type of the source you want to se. # the script will copy the first file+filename+second file into a new # file (you got it?:-) # # so: if you want java, create two files: # # templates/java.1: # # ---8<--- # public class # --->8--- # (Do not put a newline at the end!) # # templates/java.2 # # ---8<--- # { # public static void main(String args[]){ # } # } # --->8--- # # the script for se MyProg java (or jus se MyProg if the last time you # used java as type) will create a new file called MyProg.java: # # public class MyProg # { # public static void main(String args[]){ # } # } # # examine and modify at will # # author: Trucza Csaba ctrucza@cemc.soroscj.ro # # this script may be full of errors # SE_HOME_DIR=~/.source-editor LAST_USED=$SE_HOME_DIR/last_used if [ -f $LAST_USED ] ; then SE_DEFAULT_TYPE=`cat $LAST_USED` fi case $# in 0) echo "no parameter" if [ -z $SE_DEFAULT_TYPE ] ; then SE_DEFAULT_TYPE=java fi FILE_TYPE=$SE_DEFAULT_TYPE FILENAME=~/.source-editor/temp/temp.$FILE_TYPE ;; 1) echo "filename" if [ -z $SE_DEFAULT_TYPE ] ; then SE_DEFAULT_TYPE=java fi FILE_TYPE=$SE_DEFAULT_TYPE FILENAME=$1.$FILE_TYPE ;; 2) echo "name and type" FILE_TYPE=$2 FILENAME=$1.$FILE_TYPE ;; esac echo "FILE_TYPE="$FILE_TYPE echo "FILENAME="$FILENAME if [ -f $FILENAME ]; then echo file exists else build-template $FILE_TYPE $1 mv ~/.source-editor/templates/$FILE_TYPE.template $FILENAME fi echo $FILENAME echo $FILE_TYPE > $LAST_USED jstar -tab 4 $FILENAME ---------cut here--------------- The second script is a simple backup script, to back all the sources up and edit the tracking file. (file: backup) ---------cut here--------------- #!/bin/sh # # kind of backup with kind of version control # usage: backup # # backs up the current directory (well not all of it, just your # programs) # # 1. creates a dir named backup (or whatever) # 2. in this directory will be a tracking file, a plain text file # in which you can write some comments every backup # 3. optionally in the file named filelist you can write the names of # the files you want to back up # 4. examine and modify at will # # author: Trucza Csaba ctrucza@cemc.soroscj.ro # # this script may be full of errors # # # where to back up # if [ -z $BACKUPDIR ] ; then BACKUPDIR=backup fi if [ ! -d $BACKUPDIR ] ; then mkdir $BACKUPDIR fi # # last version backed up # LAST_FILE=$BACKUPDIR/last if [ -f $LAST_FILE ] ; then VERSION=`cat <$LAST_FILE` else VERSION=0 fi let VERSION=$VERSION+1 # # prepare next backup directory # NEXT_DIR=$BACKUPDIR/ver.$VERSION mkdir $NEXT_DIR # # get files to back up # LIST_FILE=$BACKUPDIR/filelist if [ -f $LIST_FILE ] ; then cp `cat $LIST_FILE` $NEXT_DIR else # # if no filelist found, backup C and Java files # modify as you wish # cp *.c $NEXT_DIR >/dev/null 2>&1 cp *.h $NEXT_DIR >/dev/null 2>&1 cp *.java $NEXT_DIR >/dev/null 2>&1 fi # # update last # echo $VERSION >$LAST_FILE # # edit trackfile # TRACK=$BACKUPDIR/track echo >> $TRACK echo >> $TRACK echo "=====================================================================">> $TRACK date >> $TRACK echo "Version: "$VERSION >>$TRACK # # here use your favorite editor :) # jstar $TRACK ---------cut here--------------- They should be self-explanatory. but, These scripts should not be used for design or development of nuclear, chemical, biological, weapons or missile technology, or any other places where humans can be hurt _________________________________________________________________ Syslog Thing Date: Thu, 07 Aug 1997 15:00:29 -0700 From: Kent Friis dk5f@ehs.dk In issue 20, I saw a 2c tip regarding syslog, Including changing the config file, and REBOOTING. Now wait a minute, I thought this was Linux. How can one get uptime's of 300+ days, if you need to reboot every time you change a config file. The solution is simply to edit the config file, and kill -HUP (pid of syslogd). You should NEVER need to reboot, except to install a new kernel. Kent Friis. _________________________________________________________________ Sorta E-mail-to-Fax...Well to-Printer Date: Fri, 8 Aug 1997 20:04:30 +0500 (PKT) From: Tee Emm tm@super.net.pk Hello, I can bet that many of you readers will try out this tip atleast for once. Here we go: I work at an ISP here in Pakistan with 4 more shift engineers. We have offices in three different locations and, although email and talk are used very frequently, we sometime require ABSOLUTELY IMMEDIATE responce from the other office. Emails remain unchecked and talk request are sometimes ignored because the other party might be busy doing something else on a talk-disabled terminal. Well, you cannot ignore a Panasonic Dotmatrix printer printing out messages in your control center! One of my so-to-say boss talked of having a utility which will poll a POP3 mailbox every few seconds and printing out any mail that might be in the box. He, being a visual basic guru, started writing a windows based application that would do the required. I, being a die hard Linux creature, started thinking how I can do the same on my dear Linux box. Well, it took me a day to ponder on this issue and when I clicked, it was just a breeze! Sixteen key strokes and I was ready with my system. I yelled 'Windoz Suxs, Linux Rules'! I edited the /etc/aliases file and keyed in the following line: urgent: "| lpr" saved, the file and did a 'newaliases' and bingo! Any mail sent to urgent@super.net.pk was immediately printed on the screaming dot matrix printer. My boss was duly stunned! (Note: You must have your 'lpr' command working before you can go ahead with this tip.) Tariq Mustafa, _________________________________________________________________ Setting Xterm Title to Current Process Date: Tue, 12 Aug 1997 01:09:02 -0500 (CDT) From: Rob Mayoff mayoff@dqd.com I saw this tip the Gazette: Hi, after searching (to no avail) for a way to display the currently executing process in the xterm on the xterm's title bar, I resorted to changing the source of bash2.0 to do what I wanted. from line 117 of eval.c in the source, add the lines marked with # (but don't include the #) If you use ksh instead of bash, you can get the same effect without changing the source: typeset -A Keytable trap -- 'eval "${Keytable[${.sh.edchar}]}"' KEYBD [[ "$TERM" == xterm ]] && \ Keytable[$'\r']=$'[[ -n ${.sh.edtext} ]] && print -n "\E]2;${.sh.edtext}\a"' You can download ksh (the POSIX-compliant Korn shell) for free from http://www.research.att.com/orgs/ssr/book/reuse _________________________________________________________________ CVS Date: Thu, 14 Aug 1997 11:08:27 -0400 From: Paul Rensing paulr@dragonsys.com Mario Storti wrote: Using shar + RCS to Backup Set of Source Files Hi, RCS (see rcs(1)) is a very useful tool that allows to store versions of a file by storing only the differences between successive versions. In this way I can make a large amounts of backups of my source files but with a negligible amount of storage. I use it all the time, even for TeX files!! However, when you are working with a set of source files (*.c, shell or Perl scripts, I work mainly with Fortran .f and Octave *.m files) what I want is to make backups of the whole set of files in such a way that you can recover the state of the whole package at a given time. I know that there is a script called rcsfreeze around, but I know that it has problems, for instance if you rename, delete or create new files, it is not guaranteed to recover the same state of the whole set. I think a good way to handle this is by "upgrading" to CVS. CVS is a version control system built on top of RCS and was designed specifically to handle version control of large trees of files (the company who wrote it was a Sun VAR and handled the > 1000 files which they regularly received from Sun). Once you have the project set up, you could simply do "cvs commit" from the top directory of a project, and CVS will check in all the changes to all the controlled files in the tree. If you are using this for "backup", you would only need to keep a copy of the CVS "repository". Paul Rensing _________________________________________________________________ Published in Linux Gazette Issue 21, September 1997 _________________________________________________________________ [ TABLE OF CONTENTS ] [ FRONT PAGE ] Back Next _________________________________________________________________ This page maintained by the Editor of Linux Gazette, gazette@ssc.com Copyright © 1997 Specialized Systems Consultants, Inc. "Linux Gazette...making Linux just a little more fun!" _________________________________________________________________ News Bytes Contents: * News in General * Software Announcements _________________________________________________________________ News in General _________________________________________________________________ Linux® Trademark Resolution Ownership of Linux® Trademark Resolved Monterey, California, August 20, 1997 - A long standing dispute over ownership of the Linux® operating system trademark has been resolved. As a result of litigation brought by a group of five Linux companies and individuals against William R. Della Croce, Jr. of Boston, Massachusetts, Della Croce has assigned ownership for the registered mark to Linux Torvalds, the original author of Linux, as part of the a settlement agreement. The plaintiffs in the suit were Linus Torvalds; specialized Systems Systems Consultants, Inc. (the Linux Journal of Seattle; Yggdrasil computing, Inc. in San Jose; Linux International, Amherst, NH; and Work Group Solutions of Aurora, CO. Non-plaintiffs Red Hat Software, Inc., Metrolink Inc., and Digital Equipment Corporation supported the litigation and contributed to the cost of the litigation. The five plaintiffs brought suit against Della Croce in the U.S. Trademark Trial and Appeals Board, in November 1996. Della Croce had obtained registration of the Linux mark in September 1995, which created a storm of protests by the Linux community, who felt the mark belonged to Torvalds or the Linux community and not to any individual. In an attempt to correct the situation, the plaintiffs retained the internationally known intellectual property law firm of Davis & Schroeder of Monterey, California, who handled the case on a greatly reduced fee bases, as a service to the Linux community. The five plaintiffs, through their attorneys, announced that (1) the matter has been settled by the assignment of the mark to Linus Torvalds, on behalf of all Petitioners and Linux users, and the dismissal with prejudice of the pending PTO Cancellation Proceeding; and (2) that Respondent was reimbursed for his trademark filing fees and costs by Petitioners. The other terms of the Settlement Agreement are confidential. All inquiries should be referred to Petitioners' law firm, Davis & Schroeder at 408-649-1122 or by email at ggd@iplawyers.com. A copy of the original Cancellation Petition filed in the TTAB, can be found at http://www.iplawyers/text/linux.htm. _________________________________________________________________ Linux Journal 1996 Back Issue CD-ROM Linux Journal announced the release and ship date of their 1996 back-issue CD-ROM. It will be available September 17, 1997. LJ's first back-issue CD-ROM will consist of twelve issuews of Linux Journal published during 1996. Features covered in 1996 include; systems administration, World Wide Web, back-ups, Linux distribution comparisons, software development, shell programming, getting new users started, graphics and several other topics. An HTML interface will allow you to access the CD-ROM infromation using any World Wide Web browser. For those that don't have a World Wide Web browser, gzilla, has been included on the CD-ROM. Linux Journal's 1996 back issues CD-ROM is $19.95 plus shipping and handling and can be ordered directly from Linux Journal. For more information take a look at http://www.linuxjournal.com/. _________________________________________________________________ Vi Mugs You might be interested in the vi reference mugs found at http://www2.cic.net/~gpoulos/vimug_main.html. Check them out! _________________________________________________________________ New Mailing List Check out a new mailing list for Linux users to help each other with problems.. To subscribe send email to majordomo@ourweb.net with the following in the body: subscribe linuxlst _________________________________________________________________ Linux Aptitude Test There is a project which is trying to establish a quantitative measure to assist in determining a person's knowledge and general usefulness in Linux setup, configuration, and maintenance. The project is aiming to create a test that can be used to assess an employee's strenths and general understanding of Linux. Take a look at http://www.icv.net/LAT _________________________________________________________________ Software Announcements _________________________________________________________________ The Hawkeye Project "Hawkeye" is the name of a new Linux Web server program, which has recently been released to the public. IT is an Internet/Intranet server suite, implementing Internet protocols for information interchange. A short list of the most important functions of Hawkeye: * HTTP 1.0 Server, HTTP 1.1 coming soon * POP3 / SMTP Server (E-Mail) * NNTP Server (Newsgroups) * FTP Server (File area) Hawkeye is running under the LINUX operating system and requires the Linux SQL database MySQL http://www.tcs.se. Hardware requirements are much like what you would need to build a normal Linux system. For optimal performance, we recommend a Pentium machine withat least 16 Megabytes of RAM. Hawkeye itself uses very little Harddisk space, so the size depends mainly on your site. Check it out on the Hawkeye Web Home Site _________________________________________________________________ LinkScan 3.1 Released Electronic Software Publishing Corporation introduced a number of new features in LinkScan version 3.1. There is added ability to check hyperlinks that are embedded within Adobe Acrobat PDF files and enhanced TapMap features such as... Free evaluation copies of LinkScan 3.0 may be downloaded from the company's website at: http://www.elsop.com/linkscan _________________________________________________________________ Published in Linux Gazette Issue 21, September 1997 _________________________________________________________________ [ TABLE OF CONTENTS ] [ FRONT PAGE ] Back Next _________________________________________________________________ This page written and maintained by the Editor of Linux Gazette, gazette@ssc.com Copyright © 1997 Specialized Systems Consultants, Inc. "Linux Gazette...making Linux just a little more fun!" _________________________________________________________________ The Answer Guy By James T. Dennis, jimd@starshine.org Starshine Technical Services, http://www.starshine.org/ _________________________________________________________________ Contents: * Linux Control Panel * Linux Command Line Arguments * More Random Crashes * More on Disk Defrag * X-Windows is Crashing * Lunx and Frames * More on ftpd * DNS Problem * Sendmail * Linux PPP Server * Linux/Unix Emulator * LILO Concerns * Crypt * Apache 1.2.1 * PPP and Internet MCI * Enabling Automounter on a Linux Notebook * XLocks Monitor * Pop3d That Doesn't Use /etc/passwd * Configuration of Two Ethernet Cards * Attaching a Colsole to a PC _________________________________________________________________ Linux Control Panel To: ggonzale@ix.netcom.com I have recently installed RedHat Linux ver 4.2 on my pc . My problem is that I cannot get the control-panel to work when I run startx or XDM . The panel comes up but I am unable to activiate any buttons in control-panel . I don't know what I did wrong or what to check ! Please help... Are you running it as root? Are there any interesting error messages in /var/log/messages? Are there any interesteing error messages back on the text console from which you ran "startx" (you can switch out of XFree86 with {Ctrl}+{Alt}+{Fx} -- where {Fx} is the function key that corresponds to any of you other virtual consoles). Are you sure you installed the Python and related libraries (last I heard all of the Red Hat GUI control panel stuff is written in Python). As I've said several times -- I'm not a Red Hat specialist (although that is what I'm running here at the moment) and I barely use X (since I vastly prefer old fashion text mode). Have they ever gotten a support line running that can answer questions that are specific to their code? (Hey! I wouldn't even object to a paid support line -- if it was good). Thank you for responding to my question I will look into the areas you suggested . However I have one other question that is how would I activate my modem from a Linux command line? I thought I needed the xwindow to do that in the first place. One of the virtues of Unix is that you don't need X Windows to do anything except run X applications -- there are other ways to access graphics (SVGALib, MGR) use your mouse (GPM) do cut and paste (GPM/select, 'screen'), provide task/session switching (virtual consoles, and 'screen'), do screen management ('splitvt', emacs) etc. In answer to your question regarding modems: There are a number of programs that are included with the typical Linux distribution that may use your modem: pppd is the PPP daemon -- it usually uses the 'chat' command to talk to the modem. minicom is a vaguely Telix like ncurses terminal emulation package (Telix is a popular shareware MS-DOS program). It provides a fullscreen, color interface. 'cu' is a "call utility" usually associated with UUCP. It uses the UUCP configuration files for information about your modem -- if you have those configured. It's a very limited communications package -- that's only virtue is that it is small. UUCP is a suite of programs -- of which the uucico program actually talks to the modem. You almost certainly are not planning on using this. However UUCP was (and still is) used as a mail, file, and netnews transport protocol for years before TCP/IP existed. I still use it for my mail. C-Kermit is a communications package from Columbia University. You can fetch it freely -- but it can't be included with Linux (or other) CD-ROM collections of software due to it's licensing model. If you decide you like it you should buy a copy of the C-Kermit book by Frank da Cruz (the program's principal architect and head of the project since it's foundation). C-Kermit is also a scripting language and can be used as a telnet or rlogin client, and Kermit is a file transfer protocol which can be used by C-Kermit over any communications channel that it can establish. I wrote an article for SysAdmin Magazine on the subject just a couple of months ago. There are other program that access your modem if you want to use them, There's a SLIP package which usually controls the modem via 'dip' -- there's a variety of different "getty" implementations which "Get a tty" (terminal) so that you can log in from a terminal, or another system running a terminal package. I use mgetty which not only allows incoming dial-up data connections but adds support for FAX and even voice/DTMF with some modems. That package also includes "sendfax" -- a program for outgoing faxes. efax is another package for support FAXes under Linux. Judging from your earlier question regarding the Red Hat Control Panel I suspect that you're just interested in configuring your system for PPP access to your Internet service provider (ISP). There is a script floating around (on http://sunsite.unc.edu somewhere) called 'pppsetup'. I think this will allow you to setup your PPP configuration from a text console (I used plain old 'vi' and made my own configuration files -- so I've never used this -- though I've seen it recommended many times). There are several HOW-TO's on configuring PPP (and SLIP) which can be found at http://sunsite.unc.edu/LDP/HOWTO Look for the ones that refer to "PPP" and "ISP." Hope all of that helps. -- Jim _________________________________________________________________ Linux Command Line Arguments From: Ronald B. Simon ronald.b.simon@boeing.com Where can I find a list of the linux boot command line arguments? e-mail addresses: Look in the following HOW-TO document: BootPrompt HOWTO http://sunsite.unc.edu/LDP/HOWTO/BootPrompt-HOWTO.html -- Jim _________________________________________________________________ More Random Crashes Date: Fri, 01 Aug 1997 14:40:06 -0700 From: sloth sloth7@hotmail.com Hi, I wrote to you a while ago with a problem regarding random crashes while installing Linux... I recently tried again, with exactly the same hardware but a different hard disk and the whole thing worked fine. unfortunately, the hdd i used was only and 80mb conner :). The hard disk i want to use is a 2.1 gb Quantum Fireball. When I try on this hard disk the computer locks up at a different place each time during the installation ( but only when it is decompressing the files). I have an IDE Hard disk controller. h/w list: * Intel Pentium 150 CPU * Intel Triton VX m/b * S3 Virge 3d graphics card * 16mb EDO RAM * 2.1gb Quantum Fireball * onboard (ide) hdd controller * 24x IDE CDROM any help would be much appreciated. cheers, sloth... This new information about your situation suggests two possibilities: 1) Your HD is bad -- possibly it has some bad sectors that the drive electronics haven't mapped out, or possibly it's something more subtle. 2) Your controller (IDE) is incompatible with your HD and/or the combination of your HD and CD drive. Some notes: Any IDE drive that's over 540Mb requires an EIDE (enhanced IDE) controller/BIOS. There have been cases where specific IDE devices weren't compatible with one another -- where a particular combination of devices couldn't share the same IDE channel. So, try getting a new EIDE controller and disabling the interface on the motherboard (or configuring the new on as a "secondary" IDE channel. Try running the two devices on the new EIDE controller if you can get it installed as the primary (but don't blindly trust the motherboard documentation -- I've heard that some of the "disable me" settings on some boards just don't work). Then try running the CD-ROM drive and the hard disk on separate channels (controllers). If you can get a copy of Spinrite or the Norton Utilities for DOS then you might install a small DOS partition and run that on your Fireball. It might be able to map out any bad sectors. If you get a new controller (which will be less expensive then buying either of the software packages I just mentioned) I'd try a a QuickPath Portfolio or a GSI brand multi-funtion card with 4 high speed (16550 UART) serial ports. The QuickPath is an ISA card (rather than taking up one of your PCI slots for a set of relatively slow interfaces) and is what I'm using in a couple of my machines here. It combines floppy, four serial, two parallel, two IDE channels and a game port (for 13 devices in all). Hope that helps. Unfortunately the diversity and cheapness of PC hardware results in a diversity of inexplicable incompatibilities and a common "cheapness" in quality that's imposed by the competition. So, as much as I hate to recommend "black magic" experiments in new hardware -- it's frequently the most effective approach. -- Jim _________________________________________________________________ More on Disk Defrag Date: Mon, 4 Aug 1997 20:27:11 +0200 From: Markus Enzenberger Markus.Enzenberger@physik.uni-muenchen.de ...them in any Linux books that I have consulted. Is disk degragmentation not needed in maintaining a Linux file system? No, disk fragmentaion is a particular problem of the DOS FAT file system and its descendants. You can see the fragmentation status of one your partitions by running the e2fsck file system check program as root on an unmounted partition. It is run every boot time too. It will report the amount of non-contiguous files. - Markus _________________________________________________________________ X-Windows is Crashing Date: Sun, 13 Jul 1997 19:34:12 -0700 From: Gerramie Dinselgerr@weaveworld.unix.net Hello. I am searching all over for an answer or a pointer to this problem: I upgraded my memory from 18 megs to 48. Now, X-Windows crashes on me when I load FVWM2.. Odd, because XDM loads fine and will sit there, waiting, without crashing for as long as you want. Also, console mode works wonderfully... Can you offer any help? Gerramie Dinsel The first guess might be that the new memory is bad -- and that you normal (console) usage -- and the overhead of xdm just doesn't "land" on the bad chips. One way to test this would be to do something from console mode that will use *a lot* of memory. make's -j switch (to parallelize as many gcc processes as memory allows) is a good way to test for this sort of thing. Just make a new kernel (no need to even to an install of it -- just the make is fine). If that runs O.K. than we have linked the problem X -- possibly to any graphical use of the card beyond xdm's. So we try to run X with no window manager and a minimal configuration file (no setting of special root images like xli, xloadimage, or xsetroot, no -16bpp or any of that). It could be that your video card uses a region of address space (a video frame buffer). Look carefully in the configuration settings, or call the manufacturer's tech support. That's the most likely problem. If you have access to another, simpler video card -- try swapping it in and seeing if that helps. If it does than you need to reconfigure that video card or use one that's better behaved. If that doesn't help then it's just anyone's guess what's happening. Try rearranging the adapters in your card cage -- it may be that the video card is emanating some noise or crosstalk that's affecting your RAM. Re-arranging adapters used to be a time honored sport among PC technicians. I think it's more rare in the PCI era -- but you don't even mention what sort of bus your using -- and I have no information about your hardware. Besides -- it can't hurt. If it still doesn't work try switching to 32Mb. This might be some weird chipset bug on your amount of RAM. More systems work with 16 or 32Mb of RAM than with 24 or 48Mb. There are a plethora of parameters you can pass to the kernel for excluding specific memory address ranges from its use. They might help -- but I'd hate to have to experiment with them. -- Jim _________________________________________________________________ Lynx and Frames Date: Tue, 05 Aug 1997 02:48:26 -0700 From: Scott omegam@COMMUNIQUE.NET Hey Jim, Caught this quote in your article: (Warning for Lynx users -- both of these sites use frames and neither bothers to put real content in the "noframes" section -- Yech!) Current versions of lynx support frames and tables in a fairly nice and elegant fashion. They even handle cookies. Check out http://lynx.browser.org Just thought you should know. Sure, I use Netscape for some of my browsing and I hope to begin using Mnemonic soon. But for really fast, heavy-content oriented browsing, lynx on the console or in a color-xterm does the trick. Scott Oh, I know that Lynx 2.7.1 can handle frames, by simply showing you a list of the available frames as a set of hot points at the top of the rendered page. I use Lynx for almost all of my web browsing. The problem is that the HTML editors used by many sites don't put meaningful names on the frames so you get a list of: frame01.html, frame02.html, etc. instead of something like: navigation.html, main.html, toolbar.html etc. It's as irritating as those sites that use large tableaus of image icons with no Alt="" attributes or imagemaps that with no sane information in the .map file. (The current Lynx can also handle most types of image maps. -- Jim _________________________________________________________________ More on ftpd Date: Tue, 05 Aug 1997 01:59:18 -0700 From: Benjamin Peikes benp@npsa.com Jim, I am currently trying to set up some user accounts on our webserver so that other people working on their sites can ftp their files up and down easily. I am using wu.ftpd and have set up the line guestgroup ftponly in /etc/ftpaccess. I have also added the group into /etc/group and added the users name to the group. The problems is that everything seems to work correctly except that ls and dir return nothing during an ftp session. 1. ftpd chroot's to the correct directory. 2. ftpd changes to the correct home directory. 3. you can upload and download files without any problems if you know the name of the files you want. 4. I have made the directories world rwx just to make sure it wasn't a permissions problem. I'm so close that it's driving me nuts. The main problem arises when people need to transfer entire directories. Most of them are using GUI driven ftp clients and the lack of directory listings kill those clients. I know there must be a simple solution. Any help would be great. Ben You're probably having problems with the shared libraries or devices that are typically required by the ls command. Some version of ls require that you have a /dev/null and/or a /dev/tcp in order to work properly. Most versions of ls require some shared libraries and all of them require the existence of some of /etc/passwd and /etc/group files (even with completely fictional data in them) in order to resolve UID numbers into symbolic ownership information to display in long listings. For real information about setting up wu-ftpd on any platform look at the following resources: http://www.landfield.com/wu-ftpd/ http://www.cetis.hvu.nl/~koos/we-ftpd-faq.html (Or, send mail with subject of "send faq" no quotes, body ignored). ... and information about the guestgroups feature in particular can be found at: http://www.landfield.com/wu-rtpd/guest-howto.html ... or ftp://ftp/fni/com/pub/wu-ftpd/guest-howto A document describing virtual ftp servers: http://www.westnet.com/providers/multi-wu-ftpd.txt Ftpaccess on virtual ftp servers ftp://ftp.meme.com/pub/software/wu-ftpd-2.4.2/README.ALT.FTPACCESS Hope that covers it. -- Jim _________________________________________________________________ DNS Problem Date: Mon, 04 Aug 1997 18:31:36 -0700 From: Dr Ceezaer ceezaer@cyberspace.org (Ping doesn't work -- but /etc/resolv.conf and /etc/hosts.conf are correct and nslookup works). It used to work before I upgraded my library files (/lib and /usr/lib) so I don't think there is an error in /et/resolv.cfg Well... I've solved the problem. First I re-installed Linux on a small 120 MB harddisk. By comparing all relevant directories I found that I had a file called libc.so.5 (no symlink) in /usr/X11R6/lib plus the normal one in /lib. By removing the file /usr/X11R6/lib/libc.so.5 it all works again :) Ahh the mysteries of the shared libraries. I've always wondered how the dynamic loading code searches for these .so (shared object) files. However I've never wondered enough to leave stray copies of them laying around. Well... I would need such a HOWTO, I didn't even got chroot to run... The only real trick is to do a 'cd' before trying to execute the command -- otherwise your process is very confused becuase it can't access its current working directory (cwd). The other problem is that your target program must be contained in the chroot tree with any shared libraries and usually it will need a set of /etc/ files including the termcap and maybe a set of /usr/lib/terminfo files. -- Jim _________________________________________________________________ Sendmail Date:Sun, 10 aug 1997 14:4457 -0700 From: Stephen P. Smith ssmith1@vilma.bcasd.az.honeywell.com When I send mail (using the mail program) to someone my reply to address is wrong. What sendmail is sending is account@computername.isp.com What I want is popaccount@isp.com What do I need to change to fix this Stephen Smith You use the "masquerade" feature in your local sendmail configuration. I recommend that you use the m4 macro package to reate a new sendmail configuration. First copy the old configuration. I like to use RCS -- the revision control system to track changes to my configuration files. Here's how you'd do that: (As root) # cd /etc # mkdir RCS (unless you already have one) # ci sendmail.cf (checks the cf file into the RCS directory) # co -l sendmail.cf (checks it back out, locked for editing) Now you want to create a sendmail "mc" file. This is a file that uses sendmail specific macros -- which is then processed by the m4 program to generate the full sendmail.cf. A typical sendmail.cf is over a 1000 lines long -- a typical "mc" file is less than 20. Under my Red Hat installation the sample "mc" files are located in /usr/lib/sendmail-cf/cf/. You can put yours there, or you might use /usr/local/lib/sendmail (and perhaps add a symlink under the other path). This helps maintain the separation between your local changes and the distribution's files "as shipped." I name my "mc" files after my hostnames -- so mine is "antares.mc." It looks like this: divert(-1) include(`../m4/cf.m4') VERSIONID(`@(#)antares.uucp.mc .9 (JTD) 8/11/95') OSTYPE(`linux') FEATURE(nodns) FEATURE(nocanonify) FEATURE(mailertable) FEATURE(local_procmail) FEATURE(allmasquerade) FEATURE(always_add_domain) FEATURE(masquerade_envelope) MAILER(local) MAILER(smtp) MAILER(uucp) MASQUERADE_AS(starshine.org) SITECONFIG(uucp.antares, starshine.org, U) define(`UUCP_RELAY', a2i) define(`UUCPNAME', starshine) define(`UUCPNODES', a2i) define(`RELAY_HOST', a2i) define(`RELAY_MAILER',uucp) define(`SMART_HOST', uucp-dom:mailer) define(`PSEUDONYMS', starshine|antares|antares.starshine.org|starshine.org) undefine(`BITNET_RELAY') I've seen some of these that end each line with a 'dnl' -- which is a macro to "do newline" -- I don't bother with that. You'll want to ignore all the UUCP references and my SITECONFIG line (mine is also a UUCP reference -- so yours will be different -- preserve whatever is in the samples that mathc your current configuration). What your interested in here is the various "masquerade" lines. Now you'd just 'cd' to the directory where you've created this "mc" file and issue a command like: m4 < $MYFILE > /etc/sendmail.cf (where you replace $MYFILE with whatever you named your "mc" file, of course). It's also possible to to simply add a line like: DMisp.com ... directly to your /etc/sendmail.cf. DM "defines masquerading" to be for "isp.com" (from your earlier example). This is easier, on the one hand -- but learning the m4 configuration method will serve you well if you ever have to do upgrades to your sendmail -- and it's a valuable skill if you ever have to administer Unix systems as (or as part of) your work. There are a variety of HOWTO's on configuring your mail to work well with your ISP. I don't have my PPP connection up at the moment -- but you should search the SSC web site (http://www.ssc.com) for the the HOWTO archive and look for the strings "ISP" and "mail." -- Jim _________________________________________________________________ Linux PPP Server Date: Sun, 10 Aug 1997 05:34:45 -0700 From: sengir@ozemail.com.au I have a Linux PPP server but I can not get my Windows95 client to do the "automatic" login. Sure, I can get it all to work if I check "bring up terminal window after connecting". All I have is the login: prompt, followed by the Password: prompt then right into PPP. What gives ? TIA -Rob Here's a URL that talks about getting Linux mgetty to work with Microsoft's infamous "AutoPPP": ISP Resources - mgetty info(AutoPPP) For more general information about mgetty look at: Mgetty + Sendfax Documentation Centre -- Jim _________________________________________________________________ Linux/Unix Emulator Date: Sun, 10 Aug 1997 05:30:18 -0700 From: Jun Liu stefan@public.sta.net.cn Hi, Dear James, First I'd like express my gratitude for your great work on the Linux Gazette. But for the Linux/Unix Emulator, I think you're somehow wrong. Actually there do exist at least one such product as far as I know. When I was staying in Japan, I've learned there're quite some people there use a software called BOW (namely BSD on Windows ), which is a BSD emulator for Windows. Check out http://www.ascii.co.jp/superascii/bow if you do know Japanese. In short, this is a BSD kernel emulator for 4.4BSD-Lite based BSD Unix program. It's said most BSD binaries (x86 certainly,character mode applications only, no X, no debuggers like gdb) can be run unmodified. Actually, there has been quite a bit of work on supporting Unix under NT. Cygnus Support (http://www.cygnus.com) has made quite a bit of progress with their GNU-Win32 Project A couple of other sources worth noting are: OpenNT 2.0 Server Data Sheet UNIX to NT Resource Center There was also a paper presented at the Anaheim USENIX conference this year: * Title: Porting UNIX to Windows NT * Author: David G. Korn * Pages: 43-57 * Publisher: USENIX * Proceedings: 1997 Annual Technical Conference * Date: January 6-10, 1997 * Location: Anaheim, CA * Institution: AT&T Labs-Research The advantages are, you have the rich development environment from Unix, and the nice( ? ) UI from Windows as well as lots of Windows applications around all at the same time. It's said BOW Version 1.5 which is Windows95 compatible, is already published last year in May as a book and available in Japanese bookstores, priced at 9,800 yen with one floppy disk and one CD-ROM. Hope this can be helpful. Best regards. Stefan Again, in the article to which you refer I was asking what the original person was asking for. Many Unix packages have been ported to NT, Windows '95, and DOS (emacs, perl, awk, most of the simple commands like grep, cp, find, and a couple of shells: Korn, bash) -- and it would certainly be possible to host some binaries under (ELF, iBCS). At what point to NT become Unix? -- Jim _________________________________________________________________ LILO Concerns Date: Sun, 10 Aug 1997 03:50:35 -0700 From: Tibs tjf1@acpub.duke.edu I have been looking all over for an answer to my linux question...nobody seems able to help so I thought I'd ask you (liked the LG web stuff very much). I am about to take the plunge and install linux but I am concerned about how LILO will work on my system. I have two IDE drives on my system. The first is 1 gig and I have DOS, Win95, etc. on it and that's what I boot to. The second is divided into two 1.5 gig partitions, and 1 500 meg partition. I planned on putting linux on that last 500 meg partition. First: you'll want to learn how to use paragraphs. Break your question down into short steps so we can read it (particularly when we're doing the reading at 3:30 in the morning after hacking all day) .... The problem is that in order for my computer to recognize the full 3.5 gig capacity of the second hard drive, the hard drive installation floppy (it's a Maxtor) installed something called EZ-BIOS. So booting to DOS or Win95 now works and my BIOS recognizes all 3.5 gigs of the space. When I boot to a floppy I have to use the EZ-BIOS "boot to a:" option otherwise I can only access the first partition on the second drive. So when I install linux and add LILO, will LILO start doing stuff after the EZ-BIOS stuff loads? If so then it is not a problem but if LILO starts before EZ-BIOS does it's thing, then I don't think I'll be able to access my 500 meg partition. And since that's wherelinux would be, that would be a bit of a problem. You're using an alternative master boot program which will be incompatible with any other boot software. You should use LOADLIN and forget all about LILO. I've written about LOADLIN several times in this column -- so please look back through some of the pack issues for details. So I guess my question would be: 1. do you know anything about this EZ-BIOS stuff and it's compatibility with linux (the Maxtor people aren't helping with linux questions) The EZ-BIOS and the old Ontrack Disk Manager and similar drivers were originally created to allow DOS to see larger partitions (which they did by hooking into the BIOS Int 13H disk access routines before DOS was loaded -- by replacing the MBR). They have always been a bad idea. Now that DOS supports partitions larger than 32Mb these programs have a different purpose -- to allow older systems to see IDE drives that are larger than 512Mb. The BIOS interface only supports a maximum of 1024 cylinders of up to 64 sectors each. A typical drive is less than 16 heads. This "geometry" gives a maximum of about 528Mb. It's possible to "lie" to some BIOS' and double the number of heads -- or even go up do 255 "virtual heads" -- the drive electronics will simply translate for you. Essentially this is how SCSI and EIDE drives give you access to larger disks (up to about 9Gb). Your other alternative is to get an EIDE controller and get rid of the non-standard software (sofware which isn't supported under OS that I know of, Linux, any Unix, FreeBSD, NT, OS/2 or anything other than DOS). 2. is there some workaround that would still let me use linux if EZ-BIOS would be a problem (like using a boot floppy everytime I wanted to use linux, or something like that) You can probably just use LOADLIN. However you might have to cook up some weird boot time parameters (you can store them in the bathc file that invokes LOADLIN) to tell the kernel what the drive geometry really is -- so it doesn't step on anything. Here are the two HOWTO documents you want to read: Large Disk mini-HOWTO Loadlin+Win95 mini-HOWTO -- Jim _________________________________________________________________ Crypt Date: Fri, 08 Aug 1997 20:47:11 -0700 From: David Saccon, dasac@speed.it Hi; I'm a Linux enthusiast bla bla bla, compliments for the good work, etc etc. Well, charmed I'm sure! I don't know if an e-mail to this address is the right way to ask you a question. It isn't really -- but most of the readers of Linux Gazette's "The Answer Guy" column haven't see the "tag@" address that I currently prefer. Please feel free to get rid of this mail if it bugs you. Anyway, my question is: where can I find an implementation of the fine tool "crypt" for Linux ? You know, "crypt myfile.x password", and back to the clear text the same way. I'm not sure that the traditional Unix 'crypt' command is all that "fine." I'd suggest that you obtain a copy of PGP from one of the international sites that carry it. (Please don't obtain it from any of my "free" fellow U.S. citizens -- since it would be illegal for them to exercise this particular form of free speech at this time. I'd like to apologize for the ludicrous attitude my government takes with regards to cryptographic software -- feel free to refer to the "Electronic Freedom Frontier" (http://www.eff.org) for more information about that). I haunted the internet for days but couldn't find it. I also tried something like this: include "stdio.h" include "unistd.h" void main(int argc, char ** argv ) { puts(crypt(argv[1], argv[2])) } but it doesn't work the same way. Help! Thank you Davide Saccon There is a library function named "crypt" which is technically a "hash" rather than a cryptographic function -- it's used to compute the hash of a password for comparison to that which is stored in the second field each entry in the /etc/passwd file. I've heard that the program named 'crypt' varies from one Unix implementation to another. I think its currently not included in many Linux distributions to the export (U.S. ITAR and related) restrictions to which I alluded earlier. Since many of the companies that produce these distributions are U.S. they would have to ensure that their products were for "domestic use" only if they were to include this on their CD's and in their FTP sites. Here are a few sites I picked off of Yahoo! International PGP FAQ Guida Pratica a PGP Guida Pratica a PGP PGP User's Guide (in Italian -- 250K) The Crypto Chamber -- Italian Cryptographer's WorkBench. There are other strong cryptographic products available internationally for other purposes. I think the new Linux "TCFS" (transparent cryptographic filesystem) is being done in Italy. TCFS is apparently similar to Matt Blaze's research on CFS -- it allows a Linux admin to create filesystems that are encrypted in such a away that users can have confidence that no other user access their files. Given its design is should be difficult even for the root user to compromise the cryptographic integrity of any local user -- and it should be impractical for remote systems. Here's some more links for that: Transparent Cryptographic File System Project Page TCFS TCFA FAQ v1.7.7 Come to think of it STEL (a secure telnet) was also done in Italy. Seems that a lot of work on cryptography is coming out of your country. Obviously your government hasn't been interferring in this work. If you'd like to look at the sources for STEL I'd FTP over to ftp://idea.sec.dsi.unimi.it/cert-it/ Another set of useful cryptographic resources are in Eric A. Young's free implementation of Netscape's SSL (secure sockets layer) specification and a set of related applications (like ssltelnet and sslftp): SSLeay: SSLeay and SSLapps FAQ SSLeay: SSLeayand SSLapps FAQ (This set of pages is an excellent resource for anyone that wants to learn anything about SSL). Eric's work was instrumental in the development of the Stronghold web server by C2 Software Inc. (http://www.c2.net) (I recently published an interview with C2's founder, Sameer Parekh, in Linux Journal, if your interested). And, of course, no discussion of Internet cryptography tools would be complete without a mention of Tatu Ylongen's SSH ssh (Secure Shell) ssh FAQ -- Jim _________________________________________________________________ Apache 1.2.1 Date: Mon, 11 Aug 1997 13:53:14 -0700 From: Alf Stockton stockton@acenet.co.za I am playing with Apache 1.2.1 and have it running well except that it won't run cgi scripts. If I give the full path in the command line of the browser the CGIs run fine but the server cannot/does not run these CGIs when I expect it to. Where can I turn for help? The Apache team don't appear too interested. I suspect that one of my config files is wrong but don't know enough to tell which. I wouldn't necessarily say that the Apache team isn't "interested." However, they far more interested in providing the software than in answering questions about it. It sounds like you don't have your "ScriptAlias" set up correctly -- or you're trying to access a CGI script that isn't stored in one of the proper "ScriptAlias" directories. Here are links to the relevant documentation pages at the Apache site (http://www.apache.org): Apache: Configuration: ScriptAlias http://www.apache.org/docs/mod/mod_alias.html#scriptalias Apache: FAQ: How do I enable CGI execution in directories other than the ScriptAlias? http://www.apache.org/docs/misc/FAQ.html#CGIoutsideScriptAlias Another possibility is that you have built it with no CGI support. Apache has many compile-time configuration options -- include a large list of "modules" that can ben enabled or disabled. However I'm sure that it would take some work to build Apache with no CGI support -- so I think this possibility is remote. -- Jim _________________________________________________________________ Red Hat Questions From: Brent Johnson brent@saturn.msstate.edu So are you the answer guy and can you answer a very important question for me? I appear to have been dubbed "The Answer Guy" (it wasn't a self-appointment -- but I did volunteer for it). I can certainly answer any question. Answering it correctly and usefully are not as sure a bet -- but I'll try. I first heard about RedHat's Linux distribution about a year ago and there was no way Slackware could compete to the easy installation procedure, RPMS, and other great features included in RedHat. But, ever since I moved to RedHat Ive had a terrible gcc compiler problem. This has happened to me on two different machines... on the first Id assumed it was some memory problem (as in hardware), but now Im on a totally different machine that has (or shouldnt have) any memory problem. Everytime I try and compile anything (Apache 1.2.1 for example)... it gets to about the 3rd or 4th .c file, and it bombs out with the following error: gcc -c -Iregex -O2 -DLINUX=2 util_date.c gcc -c -Iregex -O2 -DLINUX=2 util_snprintf.c gcc: Internal compiler error: program cc1 got fatal signal 11 make: *** [util_snprintf.o] Error 1 It happens at different times on different .c files when compiling different things. Any help would be greatly appreciated... a Unix system with a defective compiler or defective hardware is almost useless! - Brent I notice that you haven't told me *which version* of Red Hat you're working with. However I've used 3.03, 4.0, 4.1, and 4.2 -- and I think I remember playing with an earlier one before 3.03 and I never saw this behavior from gcc. I did get it from my original copy of minicom anytime I was running in an extended video mode and trying to use the dialer (and not when issuing the same dialing function as a direct ATDT command from the terminal window). In this case I suspect there was a bug in the ncurses calls being made by minicom. In any event I switched to CKermit and forgot all about it. In your case the signal 11 (SEGV) is probably not caused by curses/ncurses calls. Do you have a swap partition or file? If so, have you tried disabling it (possibly creating a new one temporarily)? If you have a defect on the disk you could get a SEGV from some piece of data/code that gets swapped out, read back in (with errors) and subsequently used by the running process. If you don't have a swap partition or file you might just be running out of RAM completely. gcc does use up quite a bit of memory -- so I'd suggest at least 32Mb virtual memory (RAM + swap) available when running it (you could certainly ask the FSF for more specific recommendations -- this is just my unsubstantiated and untested suggestion). When you installed, did you let Red Hat's install routine perform thorough block checking while it was making filesystems? If not, try re-installing and enabling that (in case you hit some bad spots on your disk and you have corrupted gcc binaries). This is extremely unlikely to be related to your distribution, but you could try installing Slackware to see if its gcc works on this system -- or you could try booting up in single user mode and just run a few test "make's" from a simple shell line (no emacs M-x shell mode, no X Windows, no "integrated dev. environment" nothing else running). If you still get SEGV's then, you want to find some other sort of memory intensive program to run as a test -- to see what else will die. It may be worth extracting the RAM and taking it to a good hardware tester -- and/or removing any ethernet cards or unecessary adapters for other tests. These sorts of things can be very frustrating to track down regardless of OS. If you have a copy of DOS and an old copy of Norton Utilities (version 8 or later) you could boot that up and run NDIAGS.EXE. There are several other diagnostics packages that were available before it -- but NU is still my personal favorite untill the Linux crowd does up a suite of them. Unfortunately the results of any software diagnostics package aren't definitive -- they can detect trouble -- but they can't "prove" that there isn't any hardware problem. I suppose, for some systems, particularly some 386's and 386SX's, you might also try twiddling the CMOS "wait states" settings. Those used to make a difference -- particularly with earlier generations of "3-chip" SIMM's. Apparently in the early attempts to use SIMM's with three chips (two four bit chips and a parity bit chip) there were some slight timing differences between the "signal settling" characteristics -- so the parity bit wouldn't "settle" before the system was trying to read the memory. This resulted in parity errors if the systems were set for "zero wait states" -- and was generally solved by changing the CMOS settings. (I've never heard of a Pentium system or any system using 72-pin SIMM's having these problems -- but that doesn't mean it's not worth looking in your "advanced" CMOS and trying some experiments therein). I hope some of this helps. -- Jim _________________________________________________________________ PPP and Internet MCI From: Demosthenes radams@capaccess.org Subject: Re: PPP and InternetMCI Hey there, I've been reading through your column from August in the Linux Gazette, and ran across the gentleman's question regarding GTE's internet services. I'm trying to switch over to MCI from a local ISP, and I'm having some of the oddest connection problems. I use PAP currently with my local ISP, and MCI is supposed to use PAP/CHAP (one, the other, or both :P). I beleive i have everything setup properly, as I don't get any rejections from PAP/CHAP, but after a few seconds of modem activity with the server, MCI just hangs up. I did misspell something before, and got a PAP rejection, and I've got full debugging logs regarding the connection, but I can't make much sense of them. I know the server isn't asking for MS-CHAP (chap 80, vs chap 05). It looks like it dies during the configuration. I'm not sure. Do you have any information regarding connecting to InternetMCI via Linux? MCI tech support is clueless, and I can't even get someone that knows how their own software works on the phone. Any help would be highly appreciated, and I'd be more than glad to share my debugging logs if you think they will help. Thanks again! Russell Adams My first impulse is to say "vote with your feet." Fire off a polite, assertive, note to their VP of Customer Service and go find a Linux/Unix friendly ISP with quality tech support (and maybe spend a little more in the process). My provider isn't the cheapest -- and isn't even the friendliest -- but they understand Unix and they provide quality service (refusing to structure their rates to "compete" with an unreasonable "quality of service" -- i.e. I get few busy signals). That bit of non-technical advice aside I'd ask: What are your MTU and related parameters? You could send the logging output -- but it would probably be as incomprehensible to me as it is to you. I've never set up a PAP/CHAP system (yet). However I'll look at them and suggest some experiments. -- Jim _________________________________________________________________ Enabling Automounter on a Linux Notebook From: Dennis Dai gqdai@intergate.bc.ca Hi, Jim I think I need to ask you for help. My problem is: Originally I have a 1.6G HD. Last month I bought a new one (3.2G) in order to accommodate linux and NT. I placed the swap partition in the very last part of the new harddisk (it seems that this is a bad idea, isn't it?) which is hdc8 and initialized it without problem. After a while, I made a new NTFS partition for NT which resides in front of the swap partition (I installed NT system on one of my original HD's partition which is hda7), then I moved some of my data on the new NTFS partition. But after I booted up to linux, I realized that the swap partition didn't initialized properly, so I issue a command like this: mkswap /dev/hdc8 And this was how I screwed up things. Actually the new NTFS partition became hdc8, and the original swap partition became hdc9. Now I can't access the new NTFS partition from NT! Immediately after I issued that command, I realized that I made a big mistake so I issued a "free" command and it showed that the swap partition (which is my NTFS partition) was not used. So I think I still have hope to retrieve the data on my NTFS partition. I know they are still there, just I can't get them out. I posted this to linux newsgroups, and received some kind response that suggested me to use linux fdisk to change the partition type to NT one. But I did check that, it is still NTFS (actually HPFS under linux fdisk). Others suggested me to zero out the first 512 byte of that partition as part of the recovery, but since I am not quite familiar with that I didn't dare to do that. So I hope you can get me out of the hole. Thanks in advance. Well, I haven't done regular data recovery for a few years (since I left Symantec' Peter Norton Tech Support Department). It's not something that I can do via e-mail (or for free) -- and I don't know diddly about the internals of NTFS (or HPFS or ext2fs for that matter). You best bet, of course, is to have recent backups from which you can recover. I don't know why they were suggesting that you blast the boot record (the first 512 bytes of a partition is the "logical boot record" or "superblock" while the first 512 bytes of a drive is the "master boot record" or MBR). Perhaps they believe that NT will be able to recover from this. If I was to do anything with the LBR I'd go to a different machine, create a new NTFS partition that was indentical in size and configuration to the one you think you've damaged, and use a disk editor (or a Linux dd command) to cut and paste that from the other machine onto the allegedly damaged partition. Before doing much of that I'd suggest do a dump to tape of the entire raw device (using 'dd'). This may allow you to return to the current state of brokenness after you've made unsuccessful attempts at repair. I don't recommend these procedures (disk surgery) unless the data on that drive is very important to you (and otherwise unreproducable) or you really like playing with hex editors. If it's of considerable financial value to you -- I'd suggested making a dump tape, extracting the drive from the system and sending it to a data recovery specialist. -- Jim _________________________________________________________________ X Locks Monitor From: Gord Urquhart urquhart@Newbridge.COM I have found when playing with my Xconfig I could get my monitor (MAG15) to go into power saving state (with a resulting black monitor) when I changed the pre and post sections of the horizontal scan line timings (I can't remember the proper names of these), to certain values. gord u. ... and? ... You can also cause a monitor to permanently damage itself if you play with those long (wrong) enough. This is well known and noted in the XFree86 configuration file. So, what's the point of this message? Or is it just a stray observation? -- Jim _________________________________________________________________ Pop3d That Doesn't Use /etc/passwd From: Benjamin Peikes benp@npsa.com Do you know if there is a pop3d that does not use /etc/passwd? I want to set up mail only accounts for some people but in.pop3d that I have uses /etc/passwd. I want to set up accounts that sendmail knows how to deliver for but I don't want to put these people in /etc/passwd because then I have to worry about all the other services on the machine. Have you heard of some daemon that will do this, or a set of packages that will do this type of seperate user management? Thanks. Ben Ultimately this issue of restricting specific classes of users to specific services on a system is goes way beyond the particular services you pick. PAM (the pluggable authentication modules) is supposed to solve this problem eventually. That is already included with recent versions of the RedHat distributions (and with recent Solaris releases). However it is still evolving -- so few of us have any idea how to "do it right." (A fact which leads to an understandable lack of confidence in recommending it). So, getting back to the original question: What POP daemon supports a user/password database that's distinct from the one used by other Unix services (/etc/passwd)? I've heard the rumor that this can be done in qpopper but I'd like to confirm that. So I go to Yahoo! and issue the "+qpopper +account" search and get: There is: http://www.hdshg.com/fixes/mail_patch/ ... which is supposed to be a patch to qpopper to allow this. However I couldn't connect to and I couldn't find any mirror of it even after several hours of trying. I traversed a number of links searching on strings like "+pop3 +passwd +passwd +separate" and various permuations. This was the only firm reference I found. Another approach would be to create a custom chroot environment. This isn't as hard as it sounds. The hard part is making your binary statically linked or including the necessary libraries. The other thing you'll have to consider is whether you want the POP-only accounts to use their own "virtual mail host" (requires an IP alias or an additional interface) or whether you your smtpd to run in the same chroot "jail" -- then requiring any local account holders to also use POP (perhaps using the fetchmail client to the "localhost" target). Here are some of the links that have more information on mail and POP in general. Harker's sendmail References Page Mr. Harker gives seminars and classes in sendmail Free Servers from Eudora: Servers Qualcomm, publishers of Eudora, also are the source of qpopper. POP/IMAP FAQ Passwdd/Passwd -- An authentication Daemon/Client This isn't mail related specfically -- but relates to alternative authentication model -- a passwd daemon running on a privileged TCP port via inetd. It shows examples for supporting Eudora/APOP and using alternate passwd files. /pub/smtpd directory -- Similar to TIS FWTK smapd Running a simpler, perhaps unprivileged smtpd to toss incoming mail into the queue is considered to be a good idea -- for isolating sendmail (which is large, powerful, complex, and has a long history of compromises). http://www.qmail.org The qmail Page An alternative to running sendmail at all. I won't get into this debate -- I'm just including it in this list because I'll receive lots of unnecessary mail if I don't. MH Message Handler Home Page The Rand MH is a particular mail user agent -- actually a set of programs for working with mail from a shell command line. There are several packages that provide full screen interfaces to this -- including an emacs mode/package, mh-e, which is what I use. Scripts and Patches for ISP's 4th UNIX SECURITY SYMPOSIUM -- Sendmail w/o Superuser How to Get There From Here -- Scaling e-mail to the enterprise Linux: Server-Linux FAQ I hope all of this helps. -- Jim _________________________________________________________________ Configuration of Two Ethernet Cards From: Carlos Gonzalez Andrade cglez@cfe.gob.mx Date: Mon, 11 Aug 1997 23:40:16 -0700 Hi Jim. I have a question about some problems i have while I was seting up 2 ether cards. first . the device eth1 is not recognized when I add the line append = ether=0,0,eth1 into the lilo.conf. You should consider putting the I/O base address, the IRQ, and any DMA or memory address information into this append clause in place of those zero's. You can test these by entering them at the LILO prompt (interactively, during boot) before editing the /etc/lilo.conf file. second . What files are necesary to set up to configure two IP address for my machine and get runing my gateway? I will apreciate your answer This depends on which distribution you're using and how closely you want to stick to their configuration conventions. Minimally all you need is a script file (typically located under /etc/rc.d/ and invoked by the rc.local) with calls to the 'ifconfig,' and a 'route add' command or two. Under Red Hat's SysV init system you'd leave your rc.d files alone and edit some file under your /etc/sysconfig/network-scripts/ directory (ifcfg-eth0, and ifcfg-eth1 if I recall correctly -- it should be obvious by browsing through those files). -- Jim _________________________________________________________________ Attaching a Console to a PC To: Benjamin Peikes benp@npsa.com Date: Mon, 11 Aug 1997 23:14:37 -0700 Jim, I'm not sure if you are the right person to ask but I figured you would be a good place to start. I have a handful of PC's that I need to be able to watch as they boot. What I would like to do is connect a dumb terminal(old laptop) to a rs-232 switch box and then be able to switch to any of the machines as I boot them. I was wondering if you knew any way to do this. Thanks. Ben Peikes It is possible to use a serial terminal as a console for Linux -- given some patches. With some PC hardware you'll have to leave the video card in their -- though you don't need a monitor attached. Unfortunately I don't remember where I saw these patches. I'd so a search on "+Linux +serial +console" (using the Yahoo! convention of preceding "required" terms with "plus" signs). -- Jim _________________________________________________________________ Copyright © 1997, James T. Dennis Published in Issue 21 of the Linux Gazette September 1997 _________________________________________________________________ [ TABLE OF CONTENTS ] [ FRONT PAGE ] Back Next "Linux Gazette...making Linux just a little more fun!" _________________________________________________________________ CLUELESS at the Prompt: A new column for new users by Mike List, troll@net-link.net _________________________________________________________________ [INLINE] Welcome to installment 7 of Clueless at the Prompt: a new column for new users. _________________________________________________________________ Well it's starting to happen.My learning curve is starting to settle down, and if you have been following this column, yours is too, although depending on what you want from Linux, you may have many more questions. At this point you probably are feeling more comfortable using the online resources like the comp.os.linux.??? newsgroups and some of the Linux pages that are hanging out there for you to glean info from. Some of my regular stops are: * Linux Users Support Team * Linuxnow.com * Walnut Creek ftp archive * Sunsite ftp archive If you use a browser the first time you visit the ftp sites you can get a good feel for the directory breakdown, but if you want to download large files ie. distributions, you should use the command line ftp, in my experience, it's faster. Speaking of the command line ftp program, here are a few tips that can make things go more quickly. You may already be familiar with some or all, but if not, just type ... ftp [ftp.cdrom.com] or whichever site you wish to visit. you will get a prompt to give a username, most commonly anonymous, followed by one for a password usually your e-mail address. If you have used a browser to check out these sites previously, you can cd to the desired directory.If not, cd pub usually is a good start. ls will show you whatis contained in that directory.If you are in a VC rather than an xterm, you can use theSHIFT+PageUp keys to scroll back, sinceyou will get a screenful or more of filenames that will just shoot by.This may or may not work in an xterm. If you want to download the files to a directory other than your current directory, lcd [directoryname] will direct the downloads to that location. hash will give you a display of# marks, one for each block rerieved, usually 1024 bytes.You can use this to check the progress of your download. bell will send an audible signal when your file is finished downloading. get [filename] will start your download,mget will retrieve everything in the current directory if you have an empty directory of the same name in your destination directory(the one you "cd'ed" to). You will be prompted for each file as the previous one finishes loading. when you finish downloading, type bye. That will close the connection. _________________________________________________________________ Config, dot and .rc files There are many ways that your linux programs can be altered to your liking, or just to make it work the way it should. Last time I gave an example of how to customize FVWM, but it hardly scratched the surface of all the things that can be done to make your linux environment truly yours. If you type: ls -a, you'll see several files that start with ".". These are typically configurable files that among other things, create aliases for shell commands, set environment variables, geometry of X applications, and other similar functions. Some of these "dotfiles"have eluded my attempts to alter them in the ways I'd like, but others have been extremely compliant. Some of the no-gos (for me) include .bashrc and .bash.profile. I'm sure someone will e-mail me and tell me why my aliases don't work, even though I edited the file exactly as shown in the"Bible". Others like the aforementioned .fvwmrc have had extemely gratifying results.Maybe my colleagues at "The Answer Guy" and "The Weekend Mechanic" can shed alittle more light on the subject. In the meantime, backup your dot files before altering them, by cp'ing them to, say .foo.old to keep serious problems at bay, should your editing fail to yield the desired results. Some of the "dot files" you might want to take a look at for possible tailoring (depending on what you have installed)include your .bash.profile, your .bashrc, or .rc files for any shell you might use, .xinitrc, your window manager's .rc file, browser .rc and .bookmark files. If you have root privilege. there are many more you have access to but be careful - some files have their own ways of being altered for instance crontabs -e is the way to edit your crontab which has the capability of taking care of routine maintenance at off hours upatedb to create a database for the find and locate commands. Usually run in the wee hours of the morning, this could be configured to run at bootup or every 12 hours or at the end of a workday. This would assure that all of the current day's work would be easily located the next day. The /etc/ppp/ip-upand ip-down files can cause certain functions when a ppp connection is established. If you don't have one already, you can probably write one that will be noticed by the current software. The same goes for the .bashrc and .bash_profile, with the above caveat in mind. For the most part, the lines you need to enter or alter will be essentially the same as you would use at the command line, and sometimes it will be as easy as removing the # from the beginning of the line. _________________________________________________________________ Don't use a .bat! One 'dot file that you can't edit to your liking, but could be useful just the same is .bash_history. If you cat .bash_history | sort>[filename] then less filenameyou will get an idea of what commands are used most often. You can then use this information to create shell scripts or aliases in your .bashrc or .bash.profile or other shell.rc files and save a few keystrokes. _________________________________________________________________ Keep those e-mails coming in, but just so you know, I don't run linux on a new pentium with all the bells and whistles and I don't know much about stuff I haven't used, so I might not be able to help you much with tape drives, CDroms, SCSI peripherals and the like. I'll do my best to point you in the right direction,but I use a 486/66 box with IDE drives and a floppy(3.5"), a vga monitor, a cirruslogic 5428 videocard, internal modem, and an 8bit soundblaster card.I mention this, not to beg for new hardware (although...), but to give you some kind of idea what kind of hardware questions I might be of help with. _________________________________________________________________ I invite questions, suggestions, reasonable criticism and just plain e-mail: troll@net-link.net See you next month! _________________________________________________________________ Copyright © 1997, Mike List Published in Issue 21 of the Linux Gazette, September 1997 _________________________________________________________________ [ TABLE OF CONTENTS ] [ FRONT PAGE ] Back Next _________________________________________________________________ "Linux Gazette...making Linux just a little more fun!" _________________________________________________________________ A Non-Technical Look Inside the EXT2 File System By Randy Appleton, randy@euclid.nmu.edu _________________________________________________________________ Introduction Everyone wants a fast computer. However, not everyone realizes that one of the most important factors of computer performance is the speed of the file system. Regardless of how fast your CPU is, if the file system is slow then the whole computer will also seem slow. Many people with very fast Pentium Pro's but slow disk drives and slower networked file systems rediscover this fact daily. Luckily, Linux has a very fast file system called the Extended File System Version 2 (EXT2). The EXT2 file system was created by Remy Card (card@masi.ibp.fr). This article will show you how the EXT2 file system is organized on disk and how it gets it's speed. Disk Layout Goals There are several objectives when deciding how to lay data out upon a disk. First and foremost, the data structure should be recoverable. This means that if there is some error while writing data to the disk (like a silly user pulling the power cord) the entire file system is not lost. Although loosing the data currently being written is often acceptable, loosing all the data on the disk is not. Secondly, the data structure must allow for an efficent implementation of all needed operations. The hardest operation to implement is normally the hard link. When using a hard link, there are more than one directory entry (more than one file name) that points to the same file data. Accessing the data by any of the valid file names should produce the same data. Another hard operation involves deleting an open file. If some application has a file open for access, and a user deletes the file, the application should still be able to access the file's data. The data can be cleared off the disk only when the last application closes the file. This behavior is quite unlike DOS/Windows, where deleting a file means that applications who have already begun to access the file loose all further access. Applications that use this UNIX behavior concerning deleted files are more common than one might think, and changing it would break many applications. Thirdly, a disk layout should minimize seek times by clustering data on disk. A drive needs more time to read two pieces of data that are widely seperated on the disk than the same sized pieces near each other. A good disk layout can minimize disk seek time (and maximize performance) by clustering related data close together. For example, parts of the same file should be close together on disk, and also near the directory containing the file's name. Finally, the disk layout should conserve disk space. Consurving disk space was more important in the past, when hard drives were small and expensive. These days, consurving disk space is not so important. However, one should not waste disk space unnecessarily. Partitions Partitions are the first level of disk layout. Each disk must have one or more partitions. The operating system pretends each partition is a seperate logical disk, even though they may share the same phyical disk. The most common use of partitioning is allow more than one file system to exist on the same physical disk, each in its own partition. Each partition has its own device file in the /dev directory (e.g. /dev/hda1, /dev/hda2, etc.). Every EXT2 file system occupies one partition, and fills the whole partition. Groups The EXT2 file system is divided into groups, which are just sections of a partition. The division into groups is done when the file system is formatted, and cannot change without reformatting. Each group contains related data, and is the unit of clustering in the EXT2 file system. Each group contains a superblock, a group descriptor, a block bitmap, an inode bitmap, an inode table, and finally data blocks, all in that order. Superblock Some information about a file system belongs to the file system as a whole, and not to any particular file or group. This information includes the total number of blocks within the file system, the time it was last checked for errors, and so on. Such information is stored in the superblock. The first superblock is the most important one, since that is the one read when the file system is mounted. The information in the superblock is so important that the file system cannot even be mounted without it. If there were to be a disk error while updating the superblock, the entire file system would be ruined. Therefore, a copy of the superblock is kept in each group. If the first superblock becomes corrupted, the redundent copies can be used to fix the error by using the command e2fsck. Group Descriptors and Bitmaps The next block of each group is the group descriptor. The group descriptor stores information on each group. Within each group descriptor is a pointer to the table of inodes (more on inodes in a moment) and allocation bitmaps for inodes and data blocks. An allocation bitmap is simply a list of bits describing which blocks or inodes are in use. For example, data block number 123 is in use if bit number 123 in the data bitmap is set. Using the data and inode bitmaps, the file system can determine which blocks and inodes are in current use and which are available for future use. Inodes and Such Each file on disk is associated with exactly one inode. The inode stores important information about the file including the create and modify times, the permissions on the file, and the owner of the file. Also stored is the type of file (regular file, directory, device file like /dev/ttyS1, etc) and where the file is stored on disk. The data in the file is not stored in the inode itself. Instead, the inode points to the location of the data on disk. There are fifteen pointers to data blocks within each inode. However, this does not mean that a file can only be fifteen blocks long. Instead, a file can be millions of blocks long, thanks to the indirect way that data pointers point to data. The first thirteen pointers point directly to blocks containing file data. If the file is thirteen or fewer blocks long, then the file's data is pointed to directly by pointers within each inode, and can be accessed quickly. The fourteenth pointer is called the indirect pointer, and points to a block of pointers, each one of which points to data on the disk. The fifteenth pointer is called the doubly indirect pointer, and points at a block containing many pointers to blocks each of which points at data on the disk. Perhaps the picture below will make things clear. [INLINE] Figure showing the pointers between an inode and it's associated data. This scheme allows direct access to all the data of small files (files less than fourteen blocks long) and still allows for very large files with only a few extra accesses. As the table below shows, almost all files are actually quite small. Therefore, almost all files can be accessed quickly with this scheme. File Size (bytes) 0-768 769-1.5K 1.5K - 3K 3K - 6K 6K-12K 12K and up Occurence (%) 38.3 19.8 14.2 9.4 7.1 10.1 Cumulative (%) 38.3 58.1 72.3 81.7 89.8 99.9 Table showing occurence of various file sizes. Inodes are stored in the inode table, which is at a location pointed to by the group descriptor within each group. The location and size of the inode table is set at format time, and cannot be changed without reformatting. This means that the maximum number of files in the file system is also fixed at format time. However, each time you format the file system you can set the maximum number of inodes with the -i option to mke2fs. Directorie> No one would like a file system where files were accessed by inode number. Instead, people want to give textual names to files. Directories associate these textual names with the inode numbers used internally by the file system. Most people don't realize that directories are just files where the data is in a special directory format. In fact, on some older UNIXs you could run editors on the directories, just to see what they looked like internally (imagine running vi /tmp). Each directory is a list of directory entries. Each directory entry associates one file name with one inode number, and consists of the inode number, the length of the file name, and the actual text of the file name. The root directory is always stored in inode number two, so that the file system code can find it at mount time. Subdirectories are implemented by storing the name of the subdirectory in the name field, and the inode number of the subdirectory in the inode field. Hard links are implemented by storing the same inode number with more than one file name. Accessing the file by either name results in the same inode number, and therefore the same data. The special directories "." and ".." are implemented by storing the names "." and ".." in the directory, and the inode number of the current and parent directories in the inode field. The only special treatment these two entries recieve is that they are automatically created when any new directory is made, and they cannot be deleted. The File System in Action The easiest way to understand the EXT2 file system is to watch it in action. Accessing a file To explain the EXT2 file system in action, we will need two things: a variable that holds directories named DIR, and a path name to look up. Some path names have many components (e.g. /usr/X11/bin/Xrefresh) and others do not (e.g. /vmlinuz). Assume that some process wants to open a file. Each process will have associated with it a current working directory. All file names that do not start with "/" are resolved relative to this current working directory and DIR starts at the current working directory. File names that start with "/" are resolved relative to the root directory (see chroot for the one exception), and DIR starts at the root directory. Each directory name in the path to be resolved is looked up in DIR as it's turn comes. This lookup yields the inode number of the subdirectory we're interested in. Next the inode of the subdirectory is accessed . The permissions are checked, and if you have access permissions, then this new directory becomes DIR. Each subdirectory in the path is treated the same way, until only the last component of the path remains. When the last component of the pathname is reached, the variable DIR contains the directory that actually holds the file name we've been looking for. Looking in DIR tells us the inode number of the file. Accessing this final inode tells where the data for the file is stored. After checking permissions, you can access the data. How many disk accesses were needed to access the data you wanted? A reasonable maximum is two per subdirectory (one to look up the name, the other to find the inode) and then two more for the actual file name itself. This effort is only done at file open time. After a file has been opened, subsequent accesses can use the inode's data without looking it up again. Further, caching eliminates many of the accesses needed to look up a file (more later). Put the starting directory in DIR. Put the pathname in PATH. While (PATH has one than one component) Take one component off PATH. Find that component in DIR yielding the INODE. If (permissions on INODE are not OK) Return ERROR Set DIR = INODE End-While Take the last component off PATH yielding FILENAME. Find FILENAME in DIR yielding INODE. If (permission on INODE are not OK) Return ERROR Store INODE with the process for quick later lookup. Return SUCCESS. Pseudo-code for opening a file. Allocating New Data When a new file or directory is created, the EXT2 file system must decide where to store the data. If the disk is mostly empty, then data can be stored almost anywhere. However, performance is maximized if the data is clustered with other related data to minimize seek times. The EXT2 file system attempts to allocate each new directory in the group containing it's parent directory, on the theory that accesses to parent and children directories are likely to be closely related. The EXT2 file system also attempts to place files in the same group as their directory entries, because directory accesses often lead to file accesses. However, if the group is full, then the new file or new directory is placed in some other non-full group> The data blocks needed to store directories and files can found by looking in the data allocation bitmap. Any needed space in the inode table can be found by looking in the inode allocation bitmap. Caching Like most file systems, the EXT2 system relies very heavily on caching. A cache is a part of RAM dedicated to holding file system data. The cache holds directory information, inode information, and actual file contents. Whenever an application (like a text editor or a compiler) tries to look up a file name or requests file data, the EXT2 system first checks the cache. If the answer can be found in the cache, then the request can be answered very quickly indeed without using the disk. The cache is filled with data from old requests. Therefore, if you request data that you have never requested before, the data will not be in the cache, and must be retrieved from disk. Luckily, most of the time most people ask for data they have used before. These repeat requests are answered quickly from the cache, saving the disk drive much effort while providing the user quick access. Of course, each computer has a limited amount of RAM available. Most of that RAM is used for other things like running applications, leaving perhaps 10% to 30% of total RAM available for the cache. When the cache becomes full, the oldest unused data (least recently used data) is thrown out. Only recently used data remains in the cache. Since larger caches can hold more data, they also can satisfy a larger number of requests. The figure below shows a typical curve of the total cache size versus the percent of all requests that can be satisfied from the cache. As you can see, using more RAM for caching increase the number of requests answered from the cache, and therefore increase the apparent speed of the file system. [INLINE] Figure #1: A typical curve of total cache size vs. the number of requests satisfied from the cache. Conclusion It has been said that one should make things as simple as possible, but no simpler. The EXT2 file system is rather more complex than most people realize, but this complexity results in both the full set of UNIX operations working correctly, and good performance. The code is robust and well tested, and serves the Linux community well. We all owe a debt of thanks to M. Card. Sources for More Information The data for the figures in this paper can all be found in my dissertation Improving File System Performance with Predictive Caching. See the URL http://euclid.nmu.edu/~randy . An excellent paper with more technical detail can be found at http://step.polymtl.ca/~ldd/ext2fs/ext2fs_toc.html . Some performance data can be found at http://www.silkroad.com/linux-bm.html . _________________________________________________________________ Copyright © 1997, Randy Appleton Published in Issue 21 of the Linux Gazette, September 1997 _________________________________________________________________ [ TABLE OF CONTENTS ] [ FRONT PAGE ] Back Next _________________________________________________________________ "Linux Gazette...making Linux just a little more fun!" _________________________________________________________________ Fvwm Configuration in Different Environments using cpp By Gerd Bavendiek, bav@rw.sni.de _________________________________________________________________ Do you use Linux at home ? In the office ? On a laptop ? Do you use fvwm 2.xx or fvwm95 as your windowmanager ? If yes, you should read on. Perhaps you have read my article about Using a Laptop in Different Environments. There I described an easy way to setup a Linux laptop to boot into different network configurations. I mentioned that setting up a shell variable called PROFILE is useful not only for configuring the network but also the windowmanager. Why should you do that ? Your windowmanager needs to be configured quite different when you are using it on a laptop with 600x420 pixel or on a 17"-monitor with 1024x768 pixel. This is a rather basic difference - there may be others. Think of using your system in a network environment. There it will be handy to have a taskbar labeled appropiate to rlogin-sessions. After fiddling some time with patching different fvwm configuration files on different machines I found this to be a pain. A typical .fvwm95rc is about 900 lines. Keeping several of them in sync is not the thing I like. Generating ~/.fvwm95rc using cpp My solution is simple: Use cpp, the C-preprocessor ! fvwm 2.xx as well as fvwm95 are configured by a central file. fvwm95 is derived from fvwm, so the basic idea applies to both. Let me show you the details using fvwm95. I keep my fvwm95 configuration in the file ~/.fvwm95rc-cpp. You can use the system default setup in /etc/X11/fvwm95/system.fvwm2rc95 as starting point. Look at this code fragment from my .xinitrc (For me, .xsession is linked to .xinitrc): ... # I need the value of PROFILE for generating .fvwm95rc # netenv contains an assignment like e.g. PROFILE=32 if [ -r /tmp/netenv ]; then . /tmp/netenv fi # Now the actual .fvwm95rc is generated depending on the value of PROFILE cpp -lang-c++ -D PROFILE=$PROFILE ~/.fvwm95rc-cpp ~/.fvwm95rc exec fvwm95 # exec saves the extra memory for a no longer useful shell ... ... The shell variable PROFILE contains the information about the current environment. The file /tmp/netenv is set up by init when going to run level 2. I described this in the article mentioned above. Obviously you need cpp, which comes either as an extra package or as part of gcc. Yes, I know that there is a module FvwmCpp (which calls cpp) - but I never managed to get it work. One advantage of the old-fashioned style of configuration files is that you can put comments in. You really should do this ! All that hidden dot files in your home directory make up your personal environment (these files will never be touched by a system update). Having comments will make it easier to maintain this environment. system.fvwm95rc comes in shell style comment syntax (so does fvwm). You can't feed this into cpp. I didn't like traditional c-style comments in a configuration file, so I switched all these comment lines # this is a useful comment into c++-style comments // this is a useful comment (hail emacs !). Calling cpp with -lang-c++ tells cpp to preprocess c++-code. A hint for those, who are not familiar with cpp: cpp strips off the comment lines of the input file. You probably will get output with a lot of blank lines. Examples how to use cpp-syntax Now let us have a look inside my .fvwm95rc-cpp. Of course, everything herein is strongly a matter of personal taste. I don't like to stress my eyes. So I hate small letters, I barely can read them in the evening of a long day ... So my desktop has 4x2 pages. Each page is assigned to one application (or a few). I use to