Linux Gazette... making Linux just a little more fun! Copyright © 1996-97 Specialized Systems Consultants, Inc. linux@ssc.com _________________________________________________________________ Welcome to Linux Gazette! (tm) Sponsored by: InfoMagic 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. _________________________________________________________________ _________________________________________________________________ Table of Contents June 1997 Issue #18 _________________________________________________________________ * The Front Page * The MailBag + Help Wanted -- Article Ideas + General Mail * More 2 Cent Tips + A Fast and Simple Printing Tip + Grepping Files ina Directory Tree + ViRGE Chipset + Maintaining Multiple X Sessions + Automatic File Transfers + Setting Up Newsgroups + Color Application in X + X With 256 Colors + Video Cards on the S3/ViRGE + C Source With Line Numbers + ncftp Vs. ftplib + Domain & Dynamic IP Names + netcfg Tool + Putting Links to Your Dynamic IP + Hard Disk Duplication + Untar and Unzip * News Bytes + News in General + Software Announcements * The Answer Guy, by James T. Dennis + Networking Problems + Fetchmail + Procmail + Tcl/tlk Dependencies + /var/log/messages + OS Showdown + Adding Linux to a DEC XLT-366 + Configuration Problems of a Soundcard + Procmail Idea and Question + UUCP/Linux on Caldera + ActiveX For Linux + What Packages Do I Need? + Users And Mounted Disks + [q] Map Left Arrow to Backspace + Adding Programs to Pull Down Menus + Linux and NT + pcmcia 28.8 Modems and Linux 1.2.13 Internet Servers * bash Strng Manipulations, by Jim Dennis * Brave GNU World, by Michael Stutz * Building Your Linux Computer Yourself, by Josh Turial * Cleaning Up Your /tmp, The Safe Way, by Guy Geens * Clueless at the Prompt: A Column for New Users, by Mike List * DiskHog: Using Perl and the WWW to Track System Disk Usage, by Ivan Griffin * dosemu & MIDI: A User's Report, by Dave Phillips * Graphics Muse, by Michael J. Hammel * New Release Reviews, by Larry Ayers + Bomb: An Interactive Image Generator + On-The_Fly Disk Compression + Xlock and Xlockmore * Red Hat Linux: Linux Installation and Getting Started, by Henry Pierce * SQL Server and Linux: No Ancient Heavenly Connections, But..., by Brian Jepson * The Weekend Mechanic, by John M. Fisk * The Back Page + About This Month's Authors + Not Linux A.L.S. The Answer Guy The Weekend Mechanic _________________________________________________________________ TWDT 1 (text) TWDT 2 (HTML) are files containing the entire issue: one in text format, one in HTML. They are provided strictly as a way to save the contents as one file for later printing in the format of your choice; there is no guarantee of working links in the HTML version. _________________________________________________________________ Got any great ideas for improvements! Send your comments, criticisms, suggestions and ideas. _________________________________________________________________ This page written and maintained by the Editor of Linux Gazette, gazette@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: Wed May 28 11:16:14 1997 Subject: Help wanted: 2.1.40 will not boot From: Duncan Simpson, D.P.Simpson@ecs.soton.ac.uk 2.1.40 dies after displaying the message Checking whether the WP bit is honored even in supervisor mode... A few prints hacked in later reveals that in enters the page fault handler, detects the bootup test and gets to the end of the C (do_fault in traps.c). However it never gets back to continue booting---exactly where it gets lost is obscure. Anyone have any ideas/fixes? Duncan _________________________________________________________________ Date: Fri, 16 May 1997 16:17:47 -0400 Subject: CD-ROMs From: James S Humphrye, humpjs@aur.alcatel.com I just found the LG today, and I have read most of the back issues... Great job so far! Lots of really useful info in here! Now to my "problem". I installed Slackware 3.0, which went just fine. I had XFree86 and all the goodies working perfectly (no, really, it all worked just great!) Then I upgraded my machine to a P150, and installed a Trident 9660) PCI video card. Then the X server wasn't happy any more. So...I upgraded the kernel sources to 2.0.29, got all the required upgrades for GCC, etc. I built a new kernel, and it was up and running...sort of. Despite having compiled in support for both IDE and SCSI CDROMs, I can only get the IDE one to work. I have edited the rc.* scripts, launched kerneld, run depmod -s, and all the other things the docs recommend. I have rebuilt the kernel to zdisk about 25 times, trying different combinations of built-in and module support, all to no avail. When the system boots, the scsi host adapter is not detected (it is an AHA1521, located on a SB16/SCSI-2 sound card, and it worked fine under 1.2.13 & 1.3.18 kernels) When the aha152x module tries to load, it says it does not recognize scd0 as a block device. If I try to mount the SCSI unit, it says "init_module: device or resource busy". Any advice would be welcome. What I want is to at least be able to use the SCSI CDROM under Linux, or better yet, both it and the IDE CDROM... There are also a bunch of messages generated by depmod about unresolved symbols that I don't understand, as well as a bunch of lines generated by modprobe that say "cannot locate block-major-XX" (XX is a major number, and the ones I see are for devices not installed or supported by the kernel) The second group of messages may be unimportant, but I don't know.. Thanks in advance, Steve _________________________________________________________________ Date: Mon, 26 May 1997 12:18:40 -0700 Subject: Need Help From Linux Gazette From: Scott L. Colantonio, scott@burbank.k12.ca.us Hi... We have Linux boxes located at the remote schools and the district office. All remote school clients (Mac, WinNT, Linux) attempting to access the district office Linux boxes experience a 75 second delay on each transaction. On the other hand, we do not experience any delay when district office clients (Mac, WinNT, Linux) attempt to access the remote school Linux boxes. The delay began when we moved all the remote school clients to a separate network (and different ISP) than the district office servers. To provide a map, consider this: remote school <-> city hall city hall <-> Internet Internet <-> district office We experience a 75 second delay: remote school client -> city hall -> Internet -> District office Linux box We do not experience any delay: remote school client -> city hall -> Internet We do not experience any delay: city hall -> Internet -> District office Linux box We do not experience any delay: District office client -> Internet -> city hall -> remote school Linux box ... The remote schools use a Linux box at City Hall for the DNS. In effect, the problem is isolated to the remote school clients connecting to the district office Linux boxes, just one hop away from city hall. As a result, the mail server is now a 75 second delay away from all educators in our district. Our Cisco reps do not think, after extensive tests, that this is a router configuration problem. I setup a Microsoft Personal web server at the district office to test if the delay was universal to our route. Unfortunately, there was no delay when remote school clients attempted to access the MS web server. Is this a known Linux network problem? Why is this a one-way problem? Any help would be greatly appreciated. Scott L. Colantonio _________________________________________________________________ Date: Thu, 1 May 1997 16:16:58 -0700 Subject: inetd From: Toby Reed, toby@eskimo.com I have a question for the inetd buffs out there...perhaps something like xinetd or a newer version has the capability to do the job, but what I want is this: normal behavior: connect to inetd look in /etc/inetd.conf run program enhanced behavior: connect to inetd find out what hostname used to connect to inetd look in /etc/inetd.conf.hostname if it exists, if not, use /etc/inetd.conf run program listed in /etc/inetd.conf So if dork1.bob.com has the same IP address as dork2.bob.com, inetd would still be able to distinguish between them. In other words, similar to the VirtualHost directive in Apache that allows you to make virtual hosts that have the same IP address, except that with inetd. Or, depending on the hostname used to access inetd, inetd could forward the request to another address. This would be extremely useful in many limited-budget cases where a multitude of IPs are not available. For example, in combination with IP masquerading, would allow a lan host to be accessed transparently both ways on all ports, so long as it was accessed by a hostname, not an IP address. No port masquerading or proxies would be required unless the service needed was very very special. Even non-inetd httpd servers would work with this kind of redirection because the forwarded connection would still be handled by httpd on the machine with the masqueraded machine. Anyone know if this already exists or want to add to it so I can suggest it to the inetd group? -Toby _________________________________________________________________ Date: Thu, 8 May 1997 08:05:03 -0700 (PDT) Subject: S3 Virge Video Board From: Tim Gray & Family, timgray@lambdanet.com I have a Linux box using a S3 Virge video board with 4 meg Ram. The problem is that X refuses to start with no other color depth than 8bpp. As X is annoying at 8bpp (Color flashing on every window and several programs complain about no free colors) Is there a way to FORCE X to start in 16 bpp? using the command .... startx -bpp 16 does not work and erasing the 8bpp entry in the XF86Config file causes X to self destruct. Even changing the Depth from 8 to 16 causes errors.. Anyone have experience with this X server? _________________________________________________________________ Date: Fri, 9 May 1997 09:20:05 Subject: Linux and NT From: Greg McNichol, mcnichol@mcs.net I am new to LINUX (and NT 4.0 for that matter) and would like any and all information I can get my hands on regarding the dual-boot issue. Any help is appreciated. --Greg _________________________________________________________________ Date: Wed, 14 May 1997 00:02:04 Subject: Help with CD-ROM From: Ralph, ralphs@kyrandia.com I'm relatively new to Linux...not a coder or anything like that...just like messing with new things....anyways I have been running Linux for about a year now and love the H*** out of it. About two weeks ago I was testing some HD's I picked up used with this nifty plug and play bios I got and when I went to restore the system back to normal and now my CD-Rom does not work in Linux...I booted back into 95 and it still worked so I tried forcing the darn thing nothing, nada , zero. I booted with the install disks and still no CD-Rom...its on the 2nd eide set for cable select I tried removing the 2nd hard drive and moving it there still nothing....can anyone give me some more suggestions to try? _________________________________________________________________ Date: Thu, 15 May 1997 12:40:27 -0700 Subject: Programming in C++ From: Chris Walker, crwalker@cc.weber.edu Hi, I'm Chris Walker. I'm an undergrad computer science major at Weber State University. During my object oriented programming class Linux was brought up. The question was asked "if c++ is so good for programs that are spread over different files or machines, why are Linux and Unix programmed in c not c++?" I was hoping that you may have an answer. Has anyone converted Linux source to c++, would there be any advantages/disadvantages? Thanks, Chris Walker _________________________________________________________________ Date: Thu, 15 May 1997 11:27:17 -0700 (PDT) Subject: Programming Serial Ports From: Celestino Rey Lopez, claude@idecnet.com First of all congratulations for your good job in the Linux Gazette. I'm interested in programming the serial ports in order to get data from other computers or devices. In other Unixes it is possible, via ioctl, to ask the driver to inform a process with a signal every time a character is ready in the port. For example, in HP-UX, the process receive a SIGIO signal. In Linux SIGIO means input/output error. Do you know where can I get information about this matter? Is there any books talking about that? Thanks in advance and thanks for providing the Linux community with lot of tricks, ideas and information about this amazing operating system. Yours, Celestino Rey Lopez. _________________________________________________________________ General Mail _________________________________________________________________ Date:Fri, 16 May 1997 10:53:18 Subject: Response to VGA-16 Server in LG Issue 17 From: Andrew Vanderstock, Andrew.van.der.Stock@member.sage-au.org.au I'll look into it, even though VGA_16 has a very short life. Yes, he is correct, there isn't much in the way of testing dual headedness with a herc card and VGA16, as both are getting quite long in the tooth. VGA_16 disappears in a few months to reappear as the argument -bpp 4 on most display adapters. One bug fixer managed to re-enable Herc support in the new source tree a while back, so there may be life there yet. Also, there was one 2c issue that was a little out of whack in regards to linear addressing. The Cirrus chipsets are not fabulous, but many people have them built into their computers (laptops, HP PC's etc). All I can suggest is that he try startx -- -bpp 16 and see if that works. If it doesn't have a look at the release notes for his chipset. If all else fails, report any XFree bugs to the bug report cgi on www.xfree86.org I'll ask the powers that be if I can write an article for you on XFree86 3.3, the next version of the current source tree, as it is due soon. How many words are your articles generally? Andrew Vanderstock _________________________________________________________________ Date: Sat, 24 May 1997 01:32:29 -0700 Subject: Secure Anonymous FTP setup mini-howto spotted, then lost From: Alan Bailward, ajb@direct.ca I saw once on a friend of mines linux box, running Slackware 3.1, in /usr/docs/faq/HOWTO/mini, a mini-howto on how to setup a secure anonymous FTP server. It detailed how to setup all the directories, permissions, and so on, so you could upload, have permissions to write but not delete on your /incoming, etc etc etc. It looked like a great doc, but for the life of me I can't find it! I've looked on the slackware 3.2 cdrom, the 3.1 cdrom, searched all through the net, but to no avail. As I am trying to setup an anonymous ftp site now, this would be invaluable... I'd feel much better reading it than 'chmod 777'ing all over the place :) If anyone has seen this document, or knows where it is, please let me know. Or even if there is another source of this type of information, I would sure appreciate it sent to me at ajb@direct.ca Thanks a lot, and keep on Linuxing! alan _________________________________________________________________ Date: Mon, 26 May 1997 13:21:20 +0800 Subject: Tuning XFree86 From: Soh Kam Yung, kysoh@ctlsg.creaf.com I've been reading Linux Gazette since day one and it has been great. Keep up the good work. I've been seeing comments and letters in the Gazette from people who are having trouble with their XFree86. Well, here's a tip for those not satisfied with the way their screen looks (offset to one side, too high/wide, etc.). While looking through the XFree86 web site for tips on how to tweak my XF86 configuration, I noticed a reference to a program called xvidtune. Not many people may have heard about it, but it is a program used to tune your video modes. Among its features include: 1. the ability to modify your graphics screen 'on-the-fly'. You can move the screen, strech/compress it vertically or horizontally and see the results. 2. it can generate a modeline of the current screen setting. Just copy it into the correct area of your XF86Config file and the next time you start up the XFree86 server, the screen will come up the way you like it. Just run xvidtune and have fun with it! But be careful: as with XFree86 in general, it does not guarantee that the program will not burn your monitor by generating invalid settings. Fortunately, it has a quick escape (press 'r' to restore your previous screen settings). Regards, -- Soh Kam Yung _________________________________________________________________ Date: Fri, May 30 1997 12:34:23 Subject: Certification and training courses for Linux From: Harry Silver, hsilver@pyx.net I am currently on a mailing list for consultants for Red Hat Linux. One of my suggestions to that list is contained below. I truly hope as part of a broader international initiative, Linux International will pick up the ball on this one so as to ensure that Linux generically will survive. I truly hope that someone from your organization will follow up both with myself and with the Red Hat consulting mailing list as to a more generic Linux support effort in this area. All that would be required is gathering up the manuals from the older Unixware CNE course and 'porting' them to Linux and creating an HTMLized version. This along with online testing could easily generate a reasonable revenue stream for the generic Linux group involved. Respectfully, MY SUGGESTION: About two years ago, Novell still had Unixware before sending it over to the care of SCO. At the time Unix was under the stewardship of Novell, a Unixware CNE course was developed. Since, Ray Noorda of Caldera and former CEO of Novell is also an avid supporter of Linux as well as the good folks at Red Hat and other distributions, rather than RE-INVENT the wheel so to speak, wouldn't it make more sense to pattern certification AFTER the Unixware CNE courses by 'porting' the course to Linux GENERICALLY ? Harley Silver _________________________________________________________________ Date: Fri, 24 May 1996 11:39:25 +0200 Subject: Duplicating a Linux Installed HD From: Dietmar Kling, kling@tao.de Hello. I did duplicate my Hard disk before you release this articles for it. A friend of mine new to linux tried to do it, too using your instructions. But we discovered, when he copied my root partition, that he couldn't compile anything on his computer afterwards. A bug in libc.so.5.2.18 prevented his old 8 MB Machine from runnig make or gcc. it always aborted with an error. After updating libc.so5.2.18 and running ldconfig the problem was solved. We had a SuSe 4.0 installation. Dietmar _________________________________________________________________ Date: Sat, 10 May 1997 16:09:29 +0200 (MET DST) Subject: Re: X Color Depth From: Roland Smith, rsmit06@ibm.net In response to Michael J. Hammel's 2cent tip in issue #17: I disagree that a 16bit display displays less colors than a 8 bit display. Both kinds of displays use a colormap. A color value is nothing more than an index into a color map, which is an array of red,green,blue triplets, each 8 bits. The amount of colors that can be shown simultaneously depends on the graphics hardware. An 8bit display has an eight bit color value, so it can maximally have 256 different color values. The color map links these to 256 different colors which can be displayed simultaneously. Each of these 256 colors can be one of the 2^24 different colors possible with the 3*8 bits in each colormap entry (or color cell, as it is called). A 16bit display has a sixteen bit color value, which can have 2^16=65536 different values. The colormap links these to 65535 different, simultaneously visible, colors (out of 2^24 possible colors). (actually it's a bit more difficult than this, but thats beyond the point). So both a 8 and 16 bit display can show 2^24=16.7*10^6 colors. The difference lies in the number of colors they can show *at once*. Regards, Roland _________________________________________________________________ Date: Fri, May 30 1997 13:24:35 Subject: Using FTP as a shell-command with ftplib From: Walter Harms, Walter.Harms@Informatik.Uni-Oldenburg.DE ... Any drawbacks? Of course, for any ftp session you need a user/paswdr. I copy into public area using anonymous/email@ others >will need to surly a password at login, what is not very useful for regular jobs or you have to use some kind of public login but still I think it's easier and >better to use than the r-cmds. -- walter _________________________________________________________________ Date: Mon, 12 May 1997 17:05:09 -0700 Subject: RE: Using ftp Commands in Shellscript From: James Boorn, jboorn@optum.com I recommend you depend on .netrc for ftp usernames and passwords for automated ftp. James Boorn _________________________________________________________________ Date: Thu, 29 May 1997 09:09:35 -0500 Subject: X limitation to 8 Bit Color (Response to Gary Masters) From: Omegaman, omegam@COMMUNIQUE.NET I read your question in Linux Gazette regarding an X limitation to 8 bit color when the system has more that 14 megs of RAM. Where did you find that information? I ask because my system has 24 megs of RAM, and I run 16 bit color all the time. One difference between our systems is that I am using a Diamond Stealth 64 video card. Gary, Just caught this letter in Linux Gazette. This limitation is specific to Cirrus Logic cards, particularly those on the ISA bus and some on VLB (ie. old systems -- like mine. Since you're using a Diamond Stealth 64, you don't have this limitation. Full details are in the readme.cirrus file contained in the XFree86 Documentation. Some cirrus owners may be able to overcome this limitation. See http://xfree86.org _________________________________________________________________ Date: Fri, May 30 1997 8:31:25 Subject: Response to Gary Masters From: Ivan Griffin, Ivan Griffin@ul.ie From: Gary Masters gmasters@devcg.denver.co.us I read your question in Linux Gazette regarding an X limitation to 8 bit color when the system has more than 14 megs of RAM. Where did you find that information? I ask because my system has 24 megs of RAM, and I run 16 bit color all the time. One difference between our systems is that I am using a Diamond Stealth 64 video card. XFree86 needs to be able to map video memory in at the end of physical memory linearly. However, ISA machines cannot support greater than 16MB in this fashion - so if you have 16 or greater MB or RAM, you cannot run XFree86 in higher than 8 bit color. Ivan _________________________________________________________________ Published in Linux Gazette Issue 18, June 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. More 2¢ Tips! Send Linux Tips and Tricks to gazette@ssc.com _________________________________________________________________ Contents: * A Fast and Simple Printing Tip * Grepping Files in a Directory Tree * ViRGE Chipset * Maintaining Multiple X Sessions * Automatic File Transfers * Setting Up Newsgroups * Color Application in X * X With 256 Colors * Video Cards on the S3/ViRGE * C Source With Line Numbers * ncftp Vs. ftplib * Domain & Dynamic IP Names * netcfg Tool * Putting Links to Your Dynamic IP * Hard Disk Duplication * Untar and Unzip _________________________________________________________________ Monitoring a ftp Download. Date: Tue, 27 May 1997 09:57:20 -0400 From: Bob Grabau bob_grabau@fmso.navy. mil Here is a tip for monitoring a ftp download. in another virtual console enter the following script: while : do clear ls -l prompt after the first line and continue until you enter the last line. -- Bob Grabau _________________________________________________________________ Logging In To X Tip Date: Mon, 26 May 1997 10:17:12 -0500 (CDT) From: Tom Barron barron@usit.net Xlogin.mini-howto Several people regularly use my Linux system at home (an assembled-from- components box containing a 133 Mhz Pentium, 2Gb of disk, 32Mb of memory, running the Slackware distribution) -- my step-son Stephen, who's learning to program and likes using X, my younger step-son Michael, who likes the X screen-savers and games like Doom, my wife Karen, who prefers the generic terminalness of the un-X'd console, and myself -- I like to use X for doing software development work since it lets me see several processes on the screen at once. I also like to keep an X screen saver running when no-one is using the machine. I didn't want to run xdm (an X-based login manager), since Karen doesn't want to have to deal with X. She wants to be at the console when she logins in and not have to worry about where to click the mouse and such. But I wanted to have a simple way of getting into X when I login without having to start it up manually. Here's what I came up with: * In my .profile (my shell is bash), I put: if [ "$DISPLAY" = "" ]; then cal > ~/.month xinit .Xsession > /dev/null 2>&1 clear if [ ! -f .noexit ]; then exit fi else export TTY=`tty` export TTY=`expr "$TTY" : "/dev/tty\(.*\)"` export PS1=" \n$ " export PATH=${PATH}:~/bin:. export EDITOR=emacs export WWW_HOME=file://localhost/home/tb/Lynx/lynx_bookmarks.html export DISPLAY alias cls="clear" alias dodo="$EDITOR ~/prj/dodo" alias e="$EDITOR" alias exit=". ~/bin/off" alias l="ls -l" alias lx="ls -x" alias minicom="minicom -m" alias pg=less alias pine="export DISPLAY=;'pine'" alias prj=". ~/bin/prj" alias profile="$EDITOR ~/.profile; . ~/.profile" fi When I first login, on the console, $DISPLAY is not yet set, so the first branch of the if statement takes effect and we start up X. When X terminates, we'll clear the screen and, unless the file .noexit exists, logout. Running cal and storing the output in .month is in preparation for displaying a calender in a window under X. * Once X comes up, $DISPLAY is set. My .Xsession file contains: : xsetroot -solid black fvwm & oclock -geometry 75x75-0+0 & xload -geometry 100x75+580+0 & emacs -geometry -0-0 & xterm -geometry 22x8+790+0 -e less ~/.month & color_xterm -font 7x14 -ls -geometry +5-0 & exec color_xterm -font 7x14 -ls -geometry +5+30 \ -T "Type 'exit' in this window to leave X" So when my color_xterms run, with -ls as an argument (which says to run a login shell), they run .profile again. Only this time $DISPLAY is set, so they process the else half of the if, getting the environment variables and aliases I normally expect. _________________________________________________________________ xlock Tip Date: Mon, 26 May 1997 10:14:12 -0500 (CDT) From: Tom Barron barron@usit.net Xscreensaver.mini-howto Several people regularly use my Linux system at home (an assembled-from- components box containing a 133 Mhz Pentium, 2Gb of disk, 32Mb of memory, running the Slackware distribution) -- my step-son Stephen, who's learning to program and likes using X, my younger step-son Michael, who likes the X screen-savers and games like Doom, my wife Karen, who prefers the generic terminalness of the un-X'd console, and myself -- I like to use X for doing software development work since it lets me see several processes on the screen at once. I also like to keep an X screen saver running when no-one is using the machine. I didn't want to run xdm (an X-based login manager), since Karen doesn't want to have to deal with X. She wants to be at the console when she logins in and not have to worry about where to click the mouse and such. But I wanted to have a simple way of starting up the X-based screensaver xlock when I (or anyone) logged out to the console login. Here's what I did (as root): * I created a user called xlock. It has no password and its home directory is /usr/local/xlock. Its shell is bash. * In xlock's .profile, I put if [ "$DISPLAY" = "" ]; then xinit .Xsession > /dev/null 2>&1 clear exit fi * In xlock's .Xsession, I put : exec xlock -nolock -mode random Now, anybody can login xlock and instantly bring up the X screen-saver. The "random" keyword tells it to select a pattern to display at random, changing it every so often. When a key is pressed or a mouse button clicked, the screensaver process exits, the X session is ended, and control returns to the console login prompt. In my next article, I show how I arranged to jump into X from the console login prompt just by logging in (i.e., without having to start X manually). _________________________________________________________________ Hex Dump Date: Sat, 24 May 1997 00:29:20 -0400 From: Joseph Hartmann joeh@arakis.sugar-river.net Hex Dump by Joseph L. Hartmann, Jr. This code is copyright under the GNU GPL by Joseph L. Hartmann, Jr. I have not been happy with Hex Dump. I am an old ex-DOS user, and am familiar with the HEX ... ASCII side-by-side presentation. Since I am studying awk and sed, I thought it would be an interesting excercise to write this type of dump. Here is a sample of what you may expect when you type the (script) command "jhex " to the shell: 0000000 46 69 6c 65 6e 61 6d 65 0000000 F i l e n a m e 0000008 3a 20 2f 6a 6f 65 2f 62 0000008 : / j o e / b 0000010 6f 6f 6b 73 2f 52 45 41 0000010 o o k s / R E A 0000018 44 4d 45 0a 0a 62 6f 6f 0000018 D M E . . b o o 0000020 6b 2e 74 6f 2e 62 69 62 0000020 k . t o . b i b 0000028 6c 69 6f 66 69 6e 64 2e 0000028 l i o f i n d . 0000030 70 65 72 6c 20 69 73 20 0000030 p e r l i s If you like it, read on.... The 0000000 is the hexadecimal address of the dump 46 is the hexadecimal value at 0000000 69 is the hexadecimal value at 0000001 6c is the hexadecimal value at 0000002 ...and so on. To the right of the repeated address, "F i l e n a m e" is the 8 ascii equivalents to the hex codes you see on the left. I elected to dump 8 bytes in one row of screen output. The following software is required: hexdump, bash, less and gawk. gawk is the GNU/Linux version of awk. There are four files that I have installed in my /joe/scripts directory, a directory that is in my PATH environment. The four files are: combine -- an executable script: you must "chmod +x combine" jhex -- an executable script: you must "chmod +x jhex" hexdump.dashx.format -- a data file holding the formatting information for the hex bytes. hexdump.perusal.format -- a data file holding the formatting information for the ascii bytes. Here is the file jhex: hexdump -f /joe/scripts/hexdump.dashx.format $1 > /tmp1.tmp hexdump -f /joe/scripts/hexdump.perusal.format $1 > /tmp2.tmp gawk -f /joe/scripts/combine /tmp1.tmp > /tmp3.tmp less /tmp3.tmp rm /tmp1.tmp rm /tmp2.tmp rm /tmp3.tmp Here is the file combine: # this is /joe/scripts/combine -- it is invoked by /joe/scripts/jhex { getline < "/tmp1.tmp" printf("%s ",$0) getline < "/tmp2.tmp" print } Here is the file hexdump.dashx.format: "%07.7_ax " 8/1 "%02x " "\n" Here is the file hexdump.perusal.format: "%07.7_ax " 8/1 "%_p " "\n" I found the "sed & awk" book by Dale Dougherty helpful. I hope you find jhex useful. To make it useful for yourself, you will have to replace the "/joe/scripts" with the path of your choice. It must be a path that is in your PATH, so that the scripts can be executed from anyplace in the directory tree. A trivial note: do not remove the blank line from the hexdump.dasx.format and hexdump.perusal.format files: it will not work if you do! A second trivial note: when a file contains many characters all of same kind, the line-by-line display will be aborted and the display will look similar to the example below: 0000820 75 65 6e 63 65 20 61 66 0000820 u e n c e a f 0000828 74 65 72 20 74 68 65 20 0000828 t e r t h e 0000830 0a 20 20 20 20 20 20 20 0000830 . 0000838 20 20 20 20 20 20 20 20 0000838 * * 0000868 20 20 20 20 20 6c 61 73 0000868 l a s 0000870 74 20 72 65 63 6f 72 64 0000870 t r e c o r d Instead of displaying *all* the 20's, you just get the * * . I don't like this myself, but I have reached the end of my competence (and/or patience), and therefore, that's the way it is! _________________________________________________________________ A Fast and Simple Printing Tip Date: Fri, 23 May 1997 07:30:38 -0400 From: Tim Bessell tbessell@buffnet.net I have been using Linux for about a year, as each day passes and my knowledge increases, my Win95 patitions decrease. This prompted me to by a notebook, which of course is loaded with Windows. Currently these two machines are NOT networked :-( But that doesn't mean I can't print a document created in Word for Windows, Internet Explorer, etc., without plugging my printer cable into the other machine. My solution is rather simple. If you haven't already, add a new printer in the Windows control panel, using the driver for the printer that is connected to your Linux box. Select "FILE" as the port you wish to print to and give it a name, eg: Print File (HP Destjet 540). Now print your document to a floppy disk file, take it to the Linux machine, and issue a command simular to: cat filename > /dev/lp1. Your document will be printed with all the formatting that was done in Windows. Enjoy, Tim Bessell _________________________________________________________________ Grepping Files in a Directory Tree Date: Wed, 21 May 1997 21:42:34 From: Earl Mitchell earlm@Terayon.COM Ever wonder how you can grep certain files in a directory tree for a particular string. Here's example how grep foo `find . -name \*.c -print` This command will generate a list of all the .c files in the current working directory or any of its subdirectories then use this list of files for the grep command. The grep will then search those files for the string "foo" and output the filename and the line containing "foo". The only caveat here is that UNIX is configured to limit max chars in a command line and the "find" command may generate a list of files to huge for shell to digest when it tries to run the grep portion as a command line. Typically this limit is 1024 chars per command line. -earl _________________________________________________________________ ViRGE Chipset Date: Wed, 30 Apr 1997 22:41:28 From: Peter Amstutz amstpi@freenet.tlh.fl.us A couple suggestions to people with video cards based on the ViRGE Chipset... 1. XFree 3.2 has a ViRGE server! I have heard a number of people complain about XFree's lack of ViRGE support. Yo GUYZ! That's because your wonderful Linux CD has XFree86 3.1.2 WHICH IS NOT THE MOST RECENT VERSION! 2. There is a minor hack you can make to svgalib 1.12.10 to get it to reconignize your nice S3 based card as actually being such. The s3/ViRGE chip is, in the words of some guy at C|Net, "basically a S3 Trio 64 with a 3d engine bolted on top." Unfortunately, it returns a card code totally different to the Trio64. With just a minor little bit of hacking, you too can do 1024x768x16bpp through svgalib. Get the source, untar it & everything. Go into the main source directory, and with your favorite editor, open up s3.c (or it maybe vga.c it has been sometime since I did this and I do not have the source now in front of me) Now, search for the nice little error message it gives you when it says something like "S3 chip 0x(some hex number) not reconignized." Above it there should be a switch()/case statement that figures out which card it is. Find the case statement that matches a Trio64. Insert a fall-through case statement that matches the code your card returns, so svgalib treats it as a Trio64! You're home free! Recompile, re-install libraries, and now, what we've all been waiting for, test 640x480x256! 640x480x16bpp! 800x600x24bpp! YES!!! Note: this trick has not been authorized, reconignized, or in any way endorsed, recommended, or even considered by the guy(s) who wrote svgalib in the first place. (that last version of svgalib is over a year old, so I don't expect there to be any new versions real soon) It works for me, so I just wanted to share it with the Linux community that just might find it useful. Peter Amstutz _________________________________________________________________ Maintaining Multiple X Sessions Date: Sun, 04 May 1997 21:02:10 +0200 From: David Kastrup dak@neuroinformatik.ruhr-uni-bochum.de Suppose you have an X running, and want to start another one (perhaps for a different user). startx alone will complain. Writing startx -- :1 will work, however (if screen 0 is already taken). Start another one with startx -- :2 if you want. You want that to have hicolor, and your Xserver would support it? Then start it rather with startx -- -bpp 16 :2 Of course, if no Xserver is running yet, you can get a non-default depth by just starting with startx -- -bpp 16 or startx -- -bpp 8 or whatever happens to be non-standard with you. -- David Kastrup _________________________________________________________________ Automatic File Transfer Date: Sat, 3 May 1997 12:58:11 +0200 (MDT) From: Gregor Gerstmann gerstman@tfh-berlin.de Hi there, Here is a small tip concerning the 'automatic' file transfer; Linux Gazette Issue 17, May 1997. Everything is known stuff in Unix and Linux. To 'automate' file transfer for me means to minimize the load on the remote server as well as my own telephone costs - you have to pay for the time you think if or not to get a special file, for changing the directories and for the time to put the names into the PC. The procedure is called with the address as parameter and generates a protocol. #!/bin/bash # date > prot # ftp -v $1 >> prot # # date >> prot # Ftp now looks if a .netrc file exists; in this file I use macros written in advance and numbered consecutively: ... machine ftp.ssc.com login anonymous password -gerstman@tfh-berlin.de macdef T131 binary prompt cd ./pub/lg pwd dir . C131.2 get lg_issue17.tar.gz SSC17 macdef init $T131 bye ... Now I first get the contents of several directories via dir . C131... and, to have some book-keeping, logically use the same numbers for the macros and the directories. The protocol shows, if I am really in the directory I wished to. Until the next session begins, the file C131... is used to edit the last .netrc file, therefore the names will always be typed correctly. If you are downloading under DOS from your account the shorter names are defined in the .netrc file. Everything is done beforehand with vi under Linux. Dr.Werner Gerstmann _________________________________________________________________ Setting Up Newsgroups Date: Mon, 05 May 1997 16:19:05 -0600 From: "Michael J. Hammel" mjhammel@emass.com But I just can't seem to find any documentation explaining how to set up local newsgroups. smtpd and nntpd are running, but the manpages won't tell anything about how to set up ng's smtpd and nntpd are just transport agents. They could just as easily transport any sort of message files as they do mail or NetNews files. What you're looking for is the software which manages these files on your local system (if you want newsgroups available only locally then you need to have this software on your system). I used to use CNEWS for this. I believe there are some other packages, much newer than CNEWS, that might make it easier. Since I haven't used CNEWS in awhile I'm afraid I can't offer any more info than this. Michael J. Hammel _________________________________________________________________ Color Applications in X Date: Tue, 06 May 1997 09:25:01 -0400 (EDT) From: Oliver Oberdorf oly@borg.harvard.edu Saw some X Window tips, so I thought I'd send this one along.. I tend to use lots of color rich applications in X. After cranking up XEmacs, Gimp, etc., I find that I quickly run out of palette on my 8-bit display. Most programs don't behave sensibly when I run out of colors - for example, CGoban comes up black and white and realaudio refuses to run at all (not enough colors to play sound, I suppose. I've found I can solve these problems by passing a "-cc 4" option to the X server. This tells it to pretend I have a bigger pallete and to pass back closest matches to colors when necessary. I've never run out of colors since then. There are caveats: programs that check for a full colormap and install their own (color flashing) will automatically do so. This includes netscape and XForms programs (which I was running with private color maps anyway). My copy of LyriX makes the background black. Also, I tried Mosaic on a Sun and had some odd color effects. oly _________________________________________________________________ X With 256 Colors Date: Tue, 06 May 1997 09:40:10 -0400 (EDT) From: Oliver Oberdorf oly@borg.harvard.edu I forgot to add that the -cc 4 can be used like this: startx -- -cc 4 (I use xdm, so I don't have to do it this way) sorry about that oly _________________________________________________________________ Video Cards on the S3/ViRGE Date: Mon, 05 May 1997 20:44:13 -0400 From: Peter Amstutz amstpi@freenet.tlh.fl.us A couple suggestions to people with video cards based on the S3/ViRGE Chipset... (which is many video cards that ship with new computers that claim to have 3D accelerated graphics. Don't believe it. The 3D graphics capability of all ViRGE-based chips sucks. They make better cheap 2D accelerators) 1. XFree 3.2 has a ViRGE server! I have heard a number of people complain about XFree's lack of ViRGE support. Yo GUYZ! That's because your wonderful Linux CD has XFree86 3.1.2 WHICH IS NOT THE MOST RECENT VERSION! 2. There is a minor hack you can make to svgalib 1.12.10 to get it to reconignize your nice S3 based card as actually being such. The s3/ViRGE chip is, in the words of some guy at C|Net, "basically a S3 Trio 64 with a 3d engine bolted on top." (as noted, the 3D engine is really slow) Unfortunately, it returns a card ID code totally different to the Trio64. But, drum roll please, with just a little bit of hacking, you too can do 1024x768x16bpp through svgalib! Just follow these E-Z steps: I)Get the source, untar it & everything. II) Go into the main source directory, and with your favorite editor (vim forever!), open up s3.c III) Now, search for the nice little error message "S3: Unknown chip id %02x\n" around line 1552. Above it there should be a switch()/case statement that figures out which card it you have based on an ID code. Find the case statement that matches a Trio64. Insert a fall-through case statement that matches the code your card returns, so svgalib treats it as a Trio64! Like this: (starts at line 1537 of s3.c) case 0x11E0: s3_chiptype = S3_TRIO64; break; becomes case 0x11E0: case 0x31E1: s3_chiptype = S3_TRIO64; break; Replace 0x31E1 with the appropriate ID if your card returns a different code. Save it! You're home free! Recompile, re-install libraries, and now, what we've all been waiting for, test some svga modes! 640x480x256! 640x480x16bpp! 800x600x24bpp! YES!!! But wait! One thing to watch out for. First, make sure you reinstall it in the right place! Slackware puts libvga.a in /usr/lib/, so make sure that is that file that you replace. Another thing: programs compiled with svgalib statically linked in will have to be rebuilt with the new library, otherwise they will just go along in their brain dead fashion blithely unaware that your card is not being used to nearly it's full potential. Note: this hack has not been authorized, reconignized, or in any way endorsed, recommended, or even considered by the guy(s) who wrote svgalib. The last version of svgalib is over a year old, so I don't expect there to be any new versions real soon. It works for me, so I just wanted to share it with the Linux community that just might find it useful. This has only been tested on my machine, using a Diamond Stealth 3D 2000, so if you have a different ViRGE-based card and you have problems you're on your own. No, there are no Linux drivers that use ViRGE "accelerated 3D" features. It sucks, I know (then again, the 3D performance of ViRGE chips is so bad you're probably not missing much) Peter Amstutz _________________________________________________________________ C Source with Line Numbers Date: 5 May 1997 From: joeh@sugar-river.net I wanted to print out a c source with line numbers. Here is one way to do it: Assuming you are using bash, install the following function in your .bashrc file. jnl () { for args do nl -ba $args > /tmp.tmp done lpr /tmp.tmp } "nl" is a textutils utility that numbers the lines of a file. "-ba" makes sure *all* the lines (even the empty lines) get numbered. /tmp.tmp is my true "garbage" temporary file, hence I write over it, and send it to the line printer. For example to print out a file "kbd.c", with line numbers: jnl kdb.c There are probably 20 different methods of accomplishing the same thing, but when you don't even have *one* of them in your bag of tricks, it can be a time-consuming detour. Note: I initially tried to name the function "nl", but this led to an infinite loop. Hence I named it jnl (for Joe's number lines). Best Regards, Joe Harmann _________________________________________________________________ ncftp Vs. ftplib Date: Thu, 08 May 1997 13:30:04 -0700 From: Igor Markov imarkov@math.ucla.edu Hi, I read your 2c tip in Linux gazette regarding ftplib. I am not sure why you recommend downloading ftpget, while another package, actually, a single program, which is available on many systems does various ftp services pretty well. I mean ncftp ("nikFTP"). It can do command line, it can work in the mode of usual ftp (with the "old" or "smarter" interface") and it also does full-screen mode showing ETA during the transfer. It has filename and hostname completion and a bunch of other niceties, like remembering passwords if you ask it to. Try man ncftp on your system (be in Linux or Solaris) ... also, ncftp is available from every major Linux archive (including ftp.redhat.com where you can find latest RPMs) Hope this helps, Igor _________________________________________________________________ Domain and Dynamic IP Names Date: Thu, 08 May 1997 13:52:02 -0700 From: Igor Markov imarkov@math.ucla.edu I have a dial-up with dynamic IP and it has always been an incontinence for me and my friends to learn my current IP address (I had an ftp script which put the address every 10 minutes into ~/.plan file on my acct at UCLA, then one could get the address by fingering the account). However, recently I discovered a really cool project http://www.ml.org which * can give you a dynamic IP name, i.e. when your computer gets a new IP address, it needs to contact www.ml.org and update its record. Once their nameserver reloads its tables (once every 5-10mins!) your computer can be accessed by the name you selected when registered. For example, my Linux box has IP name math4.dyn.ml.org Caveat: if you are not online, the name can point to a random computer. In my case, those boxes are most often wooden (i.e. running Windoze ;-) so you would get "connection refused". In general, you need some kind of authentication scheme (e.g. if you telnet to my computer, it would say "Office on Rodeo Drive") * allows you to register domain name for free (e.g. you can register an alternative name for your computer at work which has a constant IP) * offer nameserver support for free (if you need it) Isn't that cool ? Cheers, Igor _________________________________________________________________ netcfg Tool Date: Sat, 10 May 1997 11:55:28 -0400 From: Joseph Turian turian@idt.net I used Redhat 4.0's netcfg tool to install my PPP connection, but found that I could only use the Internet as root. I set the proper permissions on my scripts and the pppd (as stated in the PPP Howto and the Redhat PPP Tips documents), but I still could not use any Internet app from a user's account. I then noticed that a user account _could_ access an IP number, but could not do a DNS lookup. It turns out that I merely had to chmod ugo+r /etc/resolv.conf _________________________________________________________________ Putting Links to Your Dynamic IP Date: Wed, 28 May 1997 13:24:45 From: Nelson Tibbitt nelson@interpath.com Sometimes it might be useful to allow trusted friends to connect to your personal Linux box over the Internet. An easy way to do this is to put links to your IP address on a full-time web server, then give the URL to whomever. Why would you want to do that? Well, I do it so my sister can telnet to Magnon, my laptop, for a chat whenever I'm connected. However it might prove difficult if, like me, your ISP assigns your IP address dynamically. So I wrote a short script to take care of this... The script generates an html file containing my local IP address then uploads the file via ftp to a dedicated web server on which I have rented some web space. It runs every time a ppp connection is established, so the web page always contains my current IP, as well as the date/time I last connected. This is pretty easy to set up, and the result is way cool. Just give my sis (or anyone else I trust) the URL... then she can check to see if I'm online whenever she wants, using Netscape from her vax account at RIT. If I am connected, she can click to telnet in for a chat. Here's how it works.... * determine local IP address * write an html file containing date/time and links to the IP address that has been assigned * upload the html file to a dedicated web server using ftp (and a .netrc file) To get ftp to work, I had to create a file named .netrc in my home directory with a line that contains the ftp login information for the remote server. My .netrc has one line that looks like this: machine ftp.server.com login ftpusername password ftppassword For more information on the .netrc file and its format, try "man ftp". Chmod it 700 (chmod 700 .netrc) to prevent other users from reading the file. This isn't a big deal on my laptop, which is used primarily by yours truly. But it's a good idea anyway. Here's my script. There might be a better way to do all of this, however my script works pretty well. Still, I'm always interested in ways to improve my work, so if you have any suggestions or comments, feel free to send me an email. #!/bin/sh # *** This script relies on the user having a valid local .netrc *** # *** file permitting automated ftp logins to the web server!! *** # # Slightly modified version of: # Nelson Tibbitt's insignificant bash script, 5-6-97 # nelson@interpath.com # # Here are variables for the customizing... # Physical destination directory on the remote server # (/usr/apache/htdocs/nelson/ is the httpd root directory at my virtual domain) REMOTE_PLANDIR="/usr/apache/htdocs/nelson/LinuX/Magnon" # Desired destination filename REMOTE_PLANNAME="sonny.htm" # Destination ftp server # Given this and the above 2 variables, a user would find my IP address at # http://dedicated.web.server/LinuX/Magnon/sonny.htm REMOTE_SERVER="dedicated.web.server" # Local (writable) temporary directory TMPDIR="/usr/tmp" # Title (and header) of the html file to be generated HTMLHEAD="MAGNON" # Existing image on remote server to place in html file.. # Of course, this variable isn't necessary, and may be commented out. If commented out, # you'll want to edit the html file generation below to prevent an empty image from appearing # in your web page. HTMLIMAGE="/LinuX/Magnon/images/mobile_web.gif" # Device used for ppp connection PPP_DEV="ppp0" # Local temporary files for the html file/ftp script generation TFILE="myip.htm" TSCPT="ftp.script" # Used to determine local IP address on PPP_DEV # There are several ways to get your IP, this was the first command-line method I came # up with. It works fine here. Another method, posted in May 1997 LJ (and which looks # much cleaner) is this: # `/sbin/ifconfig | awk 'BEGIN { pppok = 0} \ # /ppp.*/ { pppok = 1; next } \ # {if (pppok == 1 ) {pppok = 0; print} }'\ # | awk -F: '{print $2 }'| awk '{print $1 }'` GETMYIP=$(/sbin/ifconfig | grep -A 4 $PPP_DEV \ | awk '/inet/ { print $2 } ' | sed -e s/addr://) # Used to place date/time of last connection in the page FORMATTED_DATE=$(date '+%B %-d, %I:%M %p') # # # Now, do it! First give PPP_DEV time to settle down... sleep 5 echo "Current IP: $GETMYIP" # Generate the html file... # Edit this part to change the appearance of the web page. rm -f $TMPDIR/$TFILE echo "Writing $REMOTE_PLANNAME" echo >$TMPDIR/$TFILE echo "$HTMLHEAD
" >> $TMPDIR/$TFILE echo "$HTMLHEAD" >> $TMPDIR/$TFILE # Remove the imageThe last " >> $TMPDIR/$TFILE echo "time I connected was $FORMATTED_DATE, when the " >> $TMPDIR/$TFILE echo "Net Gods dealt $GETMYIPhttp://$GETMYIP

" >> $TMPDIR/$TFILE echo "ftp://$GETMYIP " >> $TMPDIR/$TFILE echo "

telnet://$GETMYIP
" >> $TMPDIR/$TFILE echo "(Telnet must be properly configured in your browser.)" >> $TMPDIR/$TFILE # Append a notice about the links.. echo "

The above links will only work while I'm connected." >> $TMPDIR/$TFILE # Create an ftp script to upload the html file echo "put $TMPDIR/$TFILE" $REMOTE_PLANDIR/$REMOTE_PLANNAME > $TMPDIR/$TSCPT echo "quit" >$TMPDIR/$TSCPT # Run ftp using the above-generated ftp script (requires valid .netrc file for ftp login to work) echo "Uploading $REMOTE_PLANNAME to $REMOTE_SERVER..." ftp $REMOTE_SERVER > $TMPDIR/$TSCPT &/dev/null # The unset statements are probably unnecessary, but make for a clean 'look and feel' echo -n "Cleaning up... " rm -f $TMPDIR/$TFILE ; rm -f $TMPDIR/$TSCPT unset HTMLHEAD HTMLIMAGE REMOTE_SERVER REMOTE_PLANDIR REMOTE_PLANNAME unset GETMYIP FORMATTED_DATE PPP_DEV TMPDIR TFILE TSCPT echo "Done." exit _________________________________________________________________ Hard Disk Duplication Date: Tue, 27 May 1997 11:16:32 From: Michael Jablecki mcablec@ucsd.edu Shockingly enough, there seems to be a DOS product out there that will happily make "image files" of entire hard disks and copy these image files onto blank hard disks in a sector-by-sector fashion. Boot sectors and partition tables should be transferred exactly. See: http://www.ingot.com for more details. Seagate (I think...) has also made a program that does the duplication in one step - transfers all of one hard disk to another identical disk. I'm not sure which of these products works with non-identical disks. Hope this helps. Michael Jablecki _________________________________________________________________ Untar and Unzip From: Paul Oh, here's a little tidbit of info to pass on, this has been bugging me for a while. Often times when people send in tips 'n' tricks, it requires one to untar and unzip an archive. It usually suggested that this be done in one of several cumbersome ways: gzcat foo.tar.gz | tar zxvf - or 1. gunzip foo.tar.gz 2. tar xvf foo.tar or some other multi-step method. There is a much easier, time-saving, space saving method. The version of tar shipped with most distributions of Linux is from the FSF GNU project. These people recognized that most tar archives are usually gzipped and provided a 'decompress' flag to tar. This is equivalent to the above methods: tar zxvf foo.tar.gz This decompress the tar.gz file on the fly and then untars it into the current directory, but it also leaves the original .tar.gz alone. However, one step I consider essential that is usually never mentioned, is to look at what's in the tar archive prior to extracting it. You have no idea whether the archiver was kind enough to tar up the parent directory of the files, or it they just tarred up a few files. The netscape tar.gz is a classic example. When that's untarred, it dumps the contents into your current directory. Using: gtar ztvf foo.tar.gz allows you to look at the contents of the archive prior to opening it up and potetially writing over files with the same name. At the very least, you will know what's going on and be able to make provisions for it before you mess something up. For those who are adventurous, (X)Emacs is capable of not only opening up and reading a tar.gz file, but actually editing and re-saving the contents of these as well. Think of the time/space savings in that! Seeya, Paul _________________________________________________________________ Published in Linux Gazette Issue 18, June 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 _________________________________________________________________ Atlanta Linux Showcase Linus Torvalds, the "Kernel-Kid" and creator of Linux, Jon "Maddog" Hall, Linux/Alpha team leader and inspiring Linux advocate, David Miller, the mind behind Linux/SPARC, and Phil Hughes, publisher of Linux Journal, and many more will speak at the upcoming Atlanta Linux Showcase. For more information on the Atlanta Linux Showcase and to reserve your seat today, please visit our web site at http://www.ale.org.showcase _________________________________________________________________ Linux Speakers Bureau SSC is currently putting together a Linux Speaker's Bureau. http://www.ssc.com/linux/lsb.html The LSB is designed to become a collage of speakers specializing in Linux. Speakers who specialize in talks ranging from novice to advanced - technical or business are all welcome. The LSB will become an important tool for organizers of trade show talks, computer fairs and general meetings, so if you are interested in speaking at industry events, make sure to visit the LSB WWW page and register yourself as a speaker. We welcome your comments and suggestions. _________________________________________________________________ The Linux System Administrator's Guide (SAG) The Linux System Administrator's Guide (SAG) is a book on system administration targeted at novices. Lars Wiraenius has been writing it for some years, and it shows. He has made an official HTML version, available at the SAG home page at: http://www.iki.fi/liw/linux/sag Take a Look! _________________________________________________________________ Free CORBA 2 ORB For C++ Available The Olivetti and Oracle Research Laboratory has made available the first public release of omniORB (version 2.2.0). We also refer to this version as omniORB2. omniORB2 is copyright Olivetti & Oracle Research Laboratory. It is free software. The programs in omniORB2 are distributed under the GNU General Public Licence as published by the Free Software Foundation. The libraries in omniORB2 are distributed under the GNU Library General Public Licence. For more information take a look at http://www.orl.co.il/omniORB. Source code and binary distributions are available from http://www.orl.co.uk/omniORB/omniORB.html _________________________________________________________________ The Wurd Project The Wurd Project, a SGML Word Processor for the UNIX environment (and hopefully afterwards, Win32 and Mac) is currently looking for developers that are willing to participate in the project. Check out the site at: http://sunsite.unc.edu/paulc/wp Mailing list archives are available, as well as the current source, documentation, programming tools and various other items can also be found at the above address. _________________________________________________________________ Linus in Wonderland Check it out... Here's the online copy of Metro's article on Linus... http://www.metroactive.com/metro/cover/linux-9719.html Enjoy! _________________________________________________________________ Software Announcements _________________________________________________________________ BlackMail 0.24 Announcing BlackMail 0.24. This is a bug-fix release over the previous release, which was made public on April 29th. BlackMail is a mailer proxy that wraps around your existing mailer (preferrably smail) and provides protection against spammers, mail forwarding, and the like. For those of you looking for a proxy, you may want to look into this. This is a tested product, and works very well. I am interested in getting this code incorporated into SMAIL, so if you are interested in doing this task, please feel free. You can download blackmail from ftp://ftp.bitgate.com. You can also view the web page at http://www.bitgate.com. _________________________________________________________________ CDE--Common Desktop Environment for Linux Red Hat Software is proud to announce the arrival of Red Hat's TriTeal CDE for Linux. Red Hat Software, makers of the award-winning, technologically advanced Red Hat Linux operating system, and TriTeal Corporation, the industry leader in CDE technology, teamed up to bring you this robust, easy to use CDE for your Linux PC. CDE includes Red Hat's TriTeal CDE for Linux provides users with a graphical environment to access both local and remote systems. It gives you icons, pull-down menus, and folders. Red Hat's TriTeal CDE for Linux is available in two versions. The Client Edition gives you everything you need to operate a complete licensed copy of the CDE desktop, incluidng the Motif 1.2.5 shared libraries. The Developer's Edition allows you to perform all functions of the Client Edition, and also includes a complete integrated copy of OSF Motif version 1.2.5, providing a complete development environment with static and dynamically linked libraries, Motif Window Manager, and sample Motif Sources. CDE is an RPM-based product, and will install easily on Red Hat and other RPM-based Linux systems. We recommend using Red Hat Linux 4.2 to take full advantage of CDE features. For those who do not have Red Hat 4.2, CDE includes several Linux packages that can be automatically installed to improve its stability. Order online at: http://www.redhat.com Or call 1-888-REDHAT1 or (919) 572-6500. _________________________________________________________________ TCFS 2.0.1 Announcing the release 2.0.1 of TCFS (Transparent Cryptographic File System) for Linux. TCFS is a cryptographic filesystem developed here at Universita' di Salerno (Italy). It operates like NFS but allow users to use a new flag X to make the files secure (encrypted). Security engine is based on DES, RC5 and IDEA. The new release works in Linux kernel space, and may be linked as kernel module. It is developed to work on Linux 2.0.x kernels. A mailing-list is available at tcfs-list@mikonos.dia.unisa.it. Documentation is available at http://mikonos.dia.unisa.it/tcfs. Here you can find instructions for installing TCFS and docs on how it works. Mirror site is available at http://www.globenet.it and http://www.inopera.it/~ermmau.tcfs _________________________________________________________________ Qddb 1.43p1 Qddb 1.43p1 (patch 1) is now available Qddb is fast, powerful and flexible database software that runs on UNIX platforms, including Linux. Some of its features include: * Tcl/Tk programming interface * Easy to use, you can have a DB application completely up and * running in about 5 minutes, using nxqddb. * CGI interface for quick and easy online databases/guestbooks/etc... * Fast, and powerful searching capability * Report generator * Barcharts and graphs * Mass mailings with Email, letters and postcards Qddb-1.43p1 is the first patch release to 1.43. This patch fixes a few minor problems and a searching bug when using cached secondary searching. To download the patch file: ftp://ftp.hsdi.com/pub/qddb/sources/qddb-1.43p1.patch For more information on Qddb, visit the official Qddb home page: http://www.hsdi.com/qddb _________________________________________________________________ Golgotha AUSTIN, TX- Crack dot Com, developers of the cult-hit Abuse and the anticipated 3D action/strategy title Golgotha, recently learned that Kevin Bowen, aka Fragmaster on irc and Planet Quake, has put up the first unofficial Golgotha web site. The new web site can be found at http://www.planetquake.com/grags/golgotha, and there is a link to the new site at http://crack.com/games/golgotha. Mr. Bowen's web site features new screenshots and music previously available only on irc. Golgotha is Crack dot Com's first $1M game and features a careful marriage of 3D and 2D gameplay in an action/strategy format featuring new rendering technology, frantic gameplay, and a strong storyline. For more information on Golgotha, visit Crack dot Com's web site at http://crack.com/games/golgotha. Crack dot Com is a small game development company located in Austin, Texas. The corporation was founded in 1996 by Dave Taylor, co-author of Doom and Quake, and Jonathan Clark, author of Abuse. _________________________________________________________________ ImageMagick-3.8.5-elf.tgz ImageMagick-3.8.5-elf.tgz is now out. This version brings together a number of minor changes made to accomodate PerlMagick and lots of minor bugs fixes including multi-page TIFF decoding and writing PNG. ImageMagick (TM), version 3.8.5, is a package for display and interactive manipulation of images for the X Window System. ImageMagick performs, also as command line programs, among others these functions: * Describe the format and characteristics of an image * Convert an image from one format to another * Transform an image or sequence of images * Read an image from an X server and output it as an image file * Animate a sequence of images * Combine one or more images to create new images * Create a composite image by combining several separate images * Segment an image based on the color histogram * Retrieve, list, or print files from a remote network site ImageMagick supports also the Drag-and-Drop protocol form the OffiX package and many of the more popular image formats including JPEG, MPEG, PNG, TIFF, Photo CD, etc. Check out: ftp://ftp.wizards.dupont.com/pub/ImageMagick/linux _________________________________________________________________ Slackware 3.2 on CD-ROM Linux Systems Labs, The Linux Publishing Company is pleased to announce Slackware 3.2 on CD-ROM This CD contains Slackware 3.2 with 39 security fixes and patches since the Official Slackware 3.2 release. The CD mirrors the slackware ftp site as of April 26, 1997. Its a great way to get started with Linux or update the most popular Linux distribution. This version contains the 2.0.29 Linux kernel, plus recent versions of these (and other) software packages: * Kernel modules 2.0.29 * PPP daemon 2.2.0f * Dynamic linker (ld.so) 1.8.10 * GNU CC 2.7.2.1 * Binutils 2.7.0.9 * Linux C Library 5.4.23 * Linux C++ Library 2.7.2.1 * Termcap 2.0.8 * Procps 1.01 * Gpm 1.10 * SysVinit 2.69 * Shadow Password Suite 3.3.2 (with Linux patches) Util-linux 2.6 LSL price: $1.95 Ordering Info: http://www.lsl.com _________________________________________________________________ mtools A new release of mtools, a collection of utilities to access MS-DOS disks from Unix without mounting them. Mtools can currently be found at the following places: http://linux.wauug.org/pub/knaff/mtools http://www.club.innet.lu/~year3160/mtools ftp://prep.ai.mit.edu/pub/gnu Mtools-3.6 includes the features such as Msip -e which now only ejects Zip disks when they are not mounted, Mzip manpage, detection of bad passwords and more. Most GNU software is packed using the GNU `gzip' compression program. Source code is available on most sites distributing GNU software. For more information write to gnu@prep.ai.mit.edu or look at: http://www.gnu.ai.mit.edu/order/ftp.html _________________________________________________________________ CM3 CM3 version 4.1.1 is now available for Unix and Windows platforms: SunOS, Solaris, Windows NT/Intel, Windows 95, HP/UX, SGI IRIX, Linux/ELF on Intel, and Digital Unix on Alpha/AXP. For additional information, or to download an evaluation copy, contact Critical Mass, Inc. via the Internet at info@cmass.com or on the World Wide Web at http://www.cmass.com newsBot: Extracts exactly what you want from your news feed. Cuts down on "noise". Sophisticated search algorithms paired with numerous filters cut out messages with ALL CAPS, too many $ signs, threads which won't die, wild cross posts and endless discussions why a Mac is superior to a Chicken, and why it isn't. newsBot is at: http://www.dsb.com/mkt/newsbot.html mailBot: Provides itendical functionality but reads mailing lists and e-zines instead of news groups. Both are aimed at responsible Marketers and Information managers. The *do not* extract email addresses and cannot be mis-used for bulk mailings. mailBot is at: http://www.dsb.com/mkt/mail.bot.html siteSee: A search engine running on your web server and using the very same search technology: a very fast implementation of Boyer Moore. siteSee differs from other search engines in that it does not require creation and maintenance of large index files. It also becomes an integrated part of your site design. You have full control over page layout. siteSee is located at: http://www.dsb.com/publish/seitesee.html _________________________________________________________________ linkCheck linkCheck: A hypertext link checker, used to keep your site up to date. Its client-server implementation allows you to virtually saturate your comms link without overloading your server. LinkCheck is fast at reading and parsing HTML files and builds even large deduplicated lists of 10,000 or more cross links faster than interpreted languages take to load. linkCheck is at: http://www.dsb.com/maintain/linkckeck.html All products require Linux, SunOS or Solaris. And all are sold as "age ware": a free trial license allows full testing. When the license expires, the products "age", forget some of their skills, but they still retain about 80% of their functionality. A GUI text editor named "Red" is available for Linux. The editor has a full graphical interface, supports mouse and key commands, and is easy to use. These are some of Red's features that might be interesting: * Graphical interface * Full mouse and key support * 40 step undo (and redo) * User-definable key bindings * Automatic backup creation * Cut/paste exchange with other X Windows applications * On-line function list, help and manual It can be downloaded free in binary form or with full source code. ftp://ftp.cs.su.oz.au/mik/red Also, take a look at the web site at: http://www.cs.su.oz.au/~mik/red-manual/red-main-page.html The web site also includes a full Manual - have a look if you are interested. _________________________________________________________________ Emacspeak-97++ Announcing Emacspeak-97++ (The Internet PlusPack). Based on InterActive Accessibility technology, Emacspeak-97++ provides a powerful Internet ready audio desktop that integrates Internet technologies including Web surfing and messaging into all aspects of the electronic desktop. Major Enhancements in this release include: * Support for WWW ACSS (Aural Cascading Style Sheets) * Audio formatted output for rich text * Enhanced support for browsing tables * Support for speaking commonly used ISO Latin characters * Speech support for the Emacs widget libraries * Support for SGML mode * Emacspeak now has an automatically generated users manual thanks to Jim Van Zandt. Emacspeak-97++ can be downloaded from: http://cs.cornell.edu/home/raman/emacspeak ftp://ftp.cs.cornell.edu/pub/raman/emacspeak _________________________________________________________________ Published in Linux Gazette Issue 18, May 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: * Networking Problems * Fetchmail * Procmail * Tcl/tlk Dependencies * /var/log/messages * OS Showdown * Adding Linux to a DEC XLT-366 * Configuration Problems of a Soundcard * Procmail Idea and Question * UUCP/Linux on Caldera * ActiveX For Linux * What Packages Do I Need? * Users And Mounted Disks * [q] Map Left Arrow to Backspace * Adding Programs to Pull Down Menus * Linux and NT * pcmcia 28.8 Modems and Linux 1.2.13 Internet Servers _________________________________________________________________ Tcl/tlk Dependencies From: David E. Stern, lptsua@i/wasjomgtpm/edu The end goal: to install FileRunner, I simply MUST have it! :-) My intermediate goal is to install Tcl/Tk 7.6/4.2, because FileRunner needs these to install, and I only have 7.5/4.1 . However, when I try to upgrade tcl/tlk, other apps rely on older tcl/tk libraries, atleast that's what the messages allude to: libtcl7.5.so is needed by some-app libtk4.1.so is needed by some-app (where some-app is python, expect, blt, ical, tclx, tix, tk, tkstep,...) I have enough experience to know that apps may break if I upgrade the libraries they depend on. I've tried updating some of those other apps, but I run into further and circular dependencies--like a cat chasing it's tail. In your opinion, what is the preferred method of handling this scenario? I must have FileRunner, but not at the expense of other apps. It sounds like you're relying too heavily on RPM's. If you can't afford to risk breaking your current stuff, and you "must" have the upgrade you'll have to do some stuff beyond what the RPM system seems to do. One method would be to grab the sources (SRPM or tarball) and manually compile the new TCL and tk into /usr/local (possibly with some changes to their library default paths, etc). Now you'll probably need to grab the FileRunner sources and compile that to force it to use the /usr/local/wish or /usr/local/tclsh (which, in turn, will use the /usr/local/lib/tk if you've compiled it all right). Another approach is to set up a separate environment (separate disk, a large subtree of an existing disk -- into which you chroot, or a separate system entirely) and test the upgrade path where it won't inconvenience you by failing. A similar approach is to do a backup, test your upgrade plan -- (if the upgrade fails, restore the backup). This is a big problem in all computing environments (and far worse in DOS, Windows, and NT systems than in most multi-user operating systems. At least with Unix you have the option of installing a "playpen" (accessing it with the chroot call -- or by completely rebooting on another partition if you like). Complex interdepencies are unavoidable unless you require that every application be statically linked and completely self-sufficient (without even allowing their configuration files to be separate. So this will remain an aspect of system administration where experience and creativity are called for (and a good backup may be the only thing between you and major inconvenience). -- Jim _________________________________________________________________ Networking Problems From: Bill Johnson, b_johnson@cel.co.chatham.ga.us I have two networking problems which may be related. I'm using a dial-up (by chat) ppp connection. 1) pppd will not execute for anyone without root privilege, even though it's permissions are set rw for group and other. I presume you mean that it's *x* (execute) bit is set. It's *rw* bits should be disabled -- the *w* bit ESPECIALLY. If you really want pppd to be started by users (non-root) you should write a small C "wrapper" program that executes pppd after doing a proper set of suid (seteuid) calls and sanity checks. You might be O.K. with the latest suidperl (though there have been buffer overflows with some versions of that. Note that the file must be marked SUID with the chmod command in order for it to be permitted to use the seteuid call (unless ROOT is running it, of course). Regardless of the method you use to accomplish your SUID of pppd (even if you just set the pppd binary itself to SUID): I suggest you pick or make a group (in /etc/group) and make the pppd wrapper group executable, SUID (root owned), and completely NON-ACCESSIBLE to "other" (and make sure to just as the "trusted" users to the group. 'sudo' (University of Colorado, home of Evi Nemeth) is a generalized package for provided access to privileged programs. You might consider grabbing it and installing it. I'd really suggest diald -- which will dynamically bring the link up and down as needed. Thus your users will just try to access their target -- wait a long time for dialing, negotiation, etc (just like pppd only a little faster) and away you go (until your connection is idle long enough to count as a "timeout" for diald. 2) http works, and mail works, and telnet works, but ftp does not work. I can connect, login, poke around, and all that. But when I try to get a file, it opens the file for writing on my machine and then just sits there. No data received, ever. Happens with Netscape, ftp, ncftp, consistently, at all sites. Even if user is root. Nothing is recorded in messages or in ppp-log. /etc/protocols, /etc/services and all that seems to be set up correctly. Any suggestions? Can you dial into a shell account and do a kermit or zmodem transfer? What does 'stty -a < /dev/modem' say? Make sure you have an eight-bit clean session. Do you have 16550 (high speed) UARTS. Do you see any graphics when you're using HTTP? (that would suggest that binary vs. text is not the problem). -- Jim _________________________________________________________________ Fetchmail From: Zia Khan, khanz@foxvalley.net I have a question regarding fetchmail. i've been successful at using it to send and recieve mail from my ISP via a connection to their POP3 server. there is a slight problem though. the mail that i send out has in its from: field my local login and local hostname e.g. ruine@clocktower.net. when it should be my real email address khanz@foxvalley.net those who recieve my message recieve an non existant email address to reply to. is there any way in modifying this behavior? i've been investigating sendmail with hopes it may have have a means of making this change,to little success. Technically this has nothing to do with fetchmail or POP. 'fetchmail' just *RECIEVES* your mail -- POP is just the protocol for storing and picking up your mail. All of your outgoing mail is handles by a different process. Sendmail has a "masquerade" feature and an "all_masquerade" feature which will tell it to override the host/domain portions of the headers addresses when it sends your mail. That's why my mail shows up as "jimd@starshine.org" rather than "jimd@antares.starshine.org." The easy way to configure modern copies of sendmail is to use the M4 macro package that comes with it. You should be able to find a file in /usr/lib/sendmail-cf/cf/ Mine looks something like: divert(-1) include(`../m4/cf.m4') VERSIONID(`@(#)antares.uucp.mc .9 (JTD) 8/11/95') OSTYPE(`linux') FEATURE(nodns) FEATURE(nocanonify) FEATURE(local_procmail) FEATURE(allmasquerade) FEATURE(always_add_domain) FEATURE(masquerade_envelope) MAILER(local) MAILER(smtp) MASQUERADE_AS(starshine.org) define(`RELAY_HOST', a2i) define(`SMART_HOST', a2i) define(`PSEUDONYMS', starshine|antares|antares.starshine.org|starshine.org) (I've removed all the UUCP stuff that doesn't apply to you at all). Note: This will NOT help with the user name -- just the host and domain name. You should probably just send all of your outgoing mail from an account name that matches your account name at your provider. There are other ways to do it -- but this is the easiest. Another approach would require that your sendmail "trust" your account (with a define line to add your login ID as one which is "trusted" to "forge" their own "From" lines in sendmail headers. Then you'd adjust your mail-reader to reflect your provider's hostname and ID rather than your local one. The details of this vary from one mailer to another -- and I won't give the gory details here). Although I said that this is not a fetchmail problem -- I'd look in th fetchmail docs for suggestions. I'd also read (or re-read) the latest version of the E-Mail HOW-TO. -- Jim _________________________________________________________________ Procmail Justin Mark Tweedie, linda@zanet.co.za Our users no not have valid command shells in the /etc/passwd file (they have /etc/ppp/ppp.sh). I would like the users to use procmail to process each users mail but .forward returns an error saying user does not have a vaild shell. The .forward file has the following entry |IFS=' '&&exec /usr/local/bin/procmail -f-||exit 75 #justin How can I make this work ??? Cheers Justin I suspect that its actually 'sendmail' that issuing the complaint. Add the ppp.sh to your /etc/shells file. procmail will still use /bin/sh for processing the recipes in the .procmailrc file. Another method would be to use procmail as your local delivery agent. In your sendmail "mc" (m4 configuration file) you'd use the following: FEATURE(local_procmail) (and make sure that your copy of procmail is in a place where sendmail can find it -- either using symlinks or by adding: define(`PROCMAIL_PATH', /usr/local/your/path/to/procmail); Then you don't have to muss with .forward files at all. 'sendmail' will hand all local mail to procmail which will look for a .procmailrc file. Another question to as is whether you want to use your ppp.sh has a login shell at all. If you want people to login in and be given an automatic PPP connection I'd look at some of the cool features of mgetty (which I haven't used yet -- but seen in the docs). These allow you to define certain patterns that will be caught by 'mgetty' when it prompts for a login name -- so that something like Pusername will call .../ppplogin while Uusername will login with with 'uucico' etc. If you want to limit your customers solely to ppp services and POP (with procmail) then you've probably can't do it in any truly secure or reasonably way. Since the .procmailrc can call on arbitrary external programs -- the user with a valid password and account can access other services on the system. Also the ftp protocol can be subverted to provide arbitrary interactive access -- unless it is run in a 'chroot' environment -- one which would make the processing of updating the user's .procmailrc and any other .forward or configuration files a hassle. It can be done -- but it ultimately is more of a hassle than it's worth. So if you want to securely limit your customers' from access to interactive services and arbitrary commands you'll want to look at a more detailed plan than I could write up here. -- Jim _________________________________________________________________ /var/log/messages From: Mike West, mwest@netpath.net Hi Jim, This may seem like a silly question, but I've been unable to find any HOW-TOs or suggestions on how to do it right. My question is, how should I purge my /var/log/messages file? I know this file continues to grow. What would be the recommended way to purge it each month? Also, are there any other log files that are growing that I might need to know about? Thanks in advance Jim. I'm sorry to have dropped the ball on your message. Usually when I don't answer a LG question right away it's because I have to go do some research. In this case it was that I knew exactly what I wanted to say -- which would be "read my 'Log Management' article in the next issue of LG" However haven't finished the article yet. I have finished the code. Basically the quick answer is: rm /var/log/messages kill -HUP $(cat /var/run/syslog.pid) (on systems that are configured to conform to the FSSTND and putting a syslog.pid file in /var/run). The HUP signal being send to the syslogd process is to tell it to close and re-open its files. This is necessary because of the way that Unix handles open files. "unlinking" a file (removing the directory entry for it) is only a small part of actually removing it. Remember that real information about a file (size, location on the device, ownership, permissions, and all three date/time stamps for access, creation, and modification) is stored in the "inode." This is a unique, system maintained data structure. One of the fields in the inode is a "reference" or "link" count. If the name that you supplied to 'rm' was the only "hard link" to the file than the reference count reaches zero. So the filesystem driver will clear the inode and return all the blocks that were assigned to that file to the "free list" -- IF THE FILE WASN'T OPEN BY ANY PROCESS! If there is any open file descriptor for the file -- then the file is maintained -- with no links (no name). This is because it could be critically bad to remove a file out from under a process with no warning. So, many daemons interrupt a "Hang-up" signal (sent via the command 'kill -HUP') as a hint that they should "reinitialize in some way. That usually means that they close all files, re-read any configuration or options files and re-open any files that they need for their work. You can also do a cp /dev/null /var/log/messages .. and you get away without doing the 'kill -HUP'. I don't really know why this doesn't get the syslog confused -- since it's offset into the file is all wrong. Probably this generates a "holey" file -- which is a topic for some other day. Another quick answer is: Use the 'logrotate' program from Red Hat. (That comes with their 4.1 distribution -- and is probably freely usable if you just want to fetch the RPM from their web site. If you don't use a distribution that support RPM's you can get converters that translate .rpm files into tar or cpio files. You can also just use Midnight Commander to navigate through an RPM file just like it was a tar file or a directory). The long answer looks a little more like: #! /bin/bash ## jtd: Rotate logs ## This is intended to run as a cron job, once per day ## it renames a variety of log files and then prunes the ## oldest. cd /var/log TODAY=$(date +%Y%m%d) # YYYYMMDD convenient for sorting function rotate { cp $1 OLD/${1}.$TODAY cp /dev/null $1 } rotate maillog rotate messages rotate secure rotate spooler rotate cron ( echo -n "Subject: Filtered Logs for: " ; date "+%a %m/%d/%Y" echo; echo; echo; echo "Messages:" /root/bin/filter.log /root/lib/messages.filter OLD/messages.$TODAY echo; echo; echo "Cron:" /root/bin/filter.log /root/lib/cron.filter OLD/cron.$TODAY echo; echo; echo "--"; echo "Your Log Messaging System" echo; echo; echo ) | /usr/lib/sendmail -oi -oe root ## End of rotate.logs That should be fairly self explanatory except for the part at the end with the (....) | sendmail .... stuff. The parenthese here group the output from all of those commands into the pipe for sendmail -- so the provide a whole message for sendmail. (Otherwise only the last echo would go to sendmail and the rest would try to go to the tty of the process that ran this -- which (when cron runs the job) will generate a different -- much uglier -- piece of mail. Now there is one line in the sendmail group that bears further explanation: /root/bin/filter.log /root/lib/messages.filter OLD/messages.$TODAY This is a script (filter.log) that I wrote -- it takes a data file (messages.filter) that I have created in little parts over several weeks and still have to update occasionally. Here's the filter.log script: #! /usr/bin/gawk -f # filter.log # by James T. Dennis # syntax filter.log patternfile datafile [datafile2 .....] # purpose -- trim patterns, listed in the first filename # from a series of data files (such as /var/adm/messages) # the patterns in the patternfile should take the form # of undelimited (no '/foo/' slashes and no "foo" quotes) # Note: you must use a '-' as the data file parameter if # if you to process stdin (use this as a filter in a pipe # otherwise this script will not see any input from it! ARGIND == 1 { # ugly hack. # allows first parameter to be specially used as the # pattern file and all others to be used as data to # be filtered; avoids need to use # gawk -v patterns=$filename .... syntax. if ( $0 ~/^[ \t]*$/ ) { next } # skip blank lines # also skip lines that start with hash # to allow comments in the patterns file. if ( $0 !~ /^\#/ ) { killpat[++i]=$0 }} ARGIND > 1 { for( i in killpat ) { if($0 ~ killpat[i]) { next }}} ARGIND > 1 { print FNR ": " $0 } That's about eight lines of gawk code. I hope the comments are clear enough. All this does is reads one file full of pattern, and then use that set of patterns as a filter for all of the rest of the files that are fed through it. Here's an excerpt from my ~root/lib/messages.filter file: ... ..? ..:..:.. antares ftpd\[[0-9]+\]: FTP session closed ... ..? ..:..:.. antares getty\[[0-9]+\]: exiting on TERM signal ... ..? ..:..:.. antares innd: .* ... ..? ..:..:.. antares kernel:[ \t]* ... ..? ..:..:.. antares kernel: Type: .* Basically those first seventeen characters on each line match any date/time stamp -- the antares obviously matches my host name and the rest of each line matches items that might appear in my messages file that I don't care about. I use alot of services on this machine. My filter file is only about 100 lines long. This scheme trims my messages file (several thousand lines per day) down to about 20 or 30 lines of "different" stuff per day. Everyone once in awhile I see a new pattern that I add to the patterns list. This isn't an ideal solution. It is unreasonable to expect of most new Linux users (who shouldn't "have to" learn this much about regular expressions to winnow the chaff from their messages file. However it is elegant (very few lines of code -- easy to understand exactly what's happening). I thought about using something like swatch or some other log management package -- but my concern was that these are looking for "interesting things" and throwing the rest away. Mine looks for "boring things" and whatever is left is what I see. To me anything that is "unexpected" is interesting (in my messages file) -- so I have to use a fundamentally different approach. I look at these messages files as a professional sysadmin. They may warn me about problems before my users notice them. (incidentally you can create a larger messages file that handles messages for many hosts -- if you are using remote syslogging for example). Most home users can just delete these files with abandon. They are handy diagnostics -- so I'd keep at least a few days worth of them around. -- Jim _________________________________________________________________ OS Showdown From: William Macdonald will@merchant.clara.net Subject: OS showdown Hi, I was reading one of the British weekly computing papers this week and there was an article about a shoot out between Intranetware and NT. This was to take place on 20th May in the Guggenhiem museum in NYC. Intranetware sounds interesting. Sadly I think it may be too little, too late in the corporate world. However, if Novell picks the right pricing strategy and niche they may be able to come back in from the bottom. I won't talk about NT -- except when someone is paying me for the discomfort. The task was to have a system offering an SQL server that could process 1 billion transasctions in a day. This was supposed to be 10 time what Visa requires and 4 time what a corporation like American Airlines. It was all about proving that these OSs could work reliably in a mission critical environment. If I wanted to do a billion SQL transactions a day I'd probably look at a Sun Starfire running Solaris. The Sun Starfire has 64 SPARC (UltraSPARC's??) running in parallel. Having a face off between NT and Netware (or "Intra" Netware as they've labelled their new release) in this category is really ignoring the "real" contenders in the field of SQL. Last I heard the world record for the largest database system was owned by Walmart and ran on Tandem mini-computers. However that was several years ago. I haven't seen the follow up article yet so I can't say what the result was. The paper was saying it was going to be a massive comp with both the boss' there etc. Sounds like typical hype to me. Pick one or two companies that you think are close to you and pretend that your small group comprises the whole market. How would linux fair in a comp like this ?? The hardware resources were virtually unlimited. I think the NT box was a compaq 5000 (proliant ??). Quad processors, 2 GB RAM, etc. The OS really doesn't have to much to do with the SQL performance. The main job of the OS in running an SQL engine is to provide system and file services as fast as possible and stay the heck out of the way the real work. The other issue is that the hardware makes a big difference. So a clever engineer could make a DOG of a OS still look like a charging stallion -- by stacking the hardware in his favor. If it was me -- I'd think about putting in a few large (9 Gig) "silicon disks." A silicon disk is really a bunch of RAM that's plugged into a special controller that makes it emulate a conventional IDE or SCSI hard drive. If you're Microsoft or Novell and you're serious about winning this (and other similar) face offs -- the half a million bucks you spend on the "silicon disks" may pay for itself in one showing. In answer to your question -- Linux, by itself, can't compete in this show -- it needs an SQL server. Postgres '95 is, from what I've seen and heard, much too lightweight to go up against MS SQL Server -- and probably no match for whatever Novell is using. mSQL is also pretty lightweight. Mind you P'gres '95 and mSQL are more than adequate for most businesses -- and have to offer a price performance ratio that's unbeatable (even after figuring in "hidden" and "cost of ownership" factors). I'm not sure if Beagle is stable enough to even run. So we have to ask: What other SQL packages are available for Linux? Pulling out my trusty _Linux_Journal_1997_Buyers's_Guide_ (and doing a Yahoo! search) I see: * Solid * Just Logic Technologies * YARD Software GmbH That's all that are listed in the Commercial-HOWTO However -- here's a few more: * Infoflex-- (which goes into my Lynx hall of shame list -- it was quite a challenge reading that without resorting to a GUI). * DBIX Information -- (SQL Server???) * InterSoft(Essential -- SQL Engine) * Byte Designs Home on the Internet (ISAM with ODBC/SQL gateways) * SQLGate User's Guide -- (Embedding SQL in HTML) * April-15-1995 DATAMATION: International -- Article on Linux Sadly the "big three" (Informix, Oracle, and Sybase) list nothing about Linux on their sites. I suspect they still consider themselves to be "too good" for us -- and they are undoubtedly tangled in deep licensing aggreements with SCO, Sun, HP, and other big money institutions. So they probably view us as a "lesser threat" -- (compared to the 800 lb gorilla in Redmond). Nonetheless -- it doesn't look like they are willing to talk about Linux on their web pages. I'd also like to take this opportunity to lament the poor organization and layout of these three sites. These are the large database software companies in the world -- and they can create a simple, INFORMATIVE web site. Too much "hype" and not enough "text." (My father joked: "Oh! you meant 'hypertext' -- I thought it was 'hype or text'" -- Obviously too many companies hear it the same way and choose the first option of a mutually exclusive pair). -- Jim _________________________________________________________________ Adding Linux to a DEC XLT-366 From: Alex Pikus of WEBeXpress alex@webexpress.net I have a DEC XLT-366 with NTS4.0 and I would like to add Linux to it. I have been running Linux on an i386 for a while. I have created 3 floppies: 1. Linload.exe and MILO (from DEC site) 2. Linux kernel 2.0.25 3. RAM disk I have upgrade AlphaBIOS to v5.24 (latest from DEC) and added a Linux boot option that points to a:\ You have me at a severe disadvantage. I'll be running Linux on an Alpha based system for the first time next week. So I'll have to try answering this blind. When I load MILO I get the "MILO>" prompt without any problem. When I do "show" or "boot ..." at the MILO>" I get the following result ... SCSI controller gets identified as NCR810 on IRQ 28 ... test1 runs and gets stuck "due to a lost interrupt" and the system hangs ... In WinNTS4.0 the NCR810 appears on IRQ 29. My first instinct is the ask if the autoprobe code in Linux (Alpha) is broken. Can you use a set of command-line (MILO) parameters to tell pass information about your SCSI controller to your kernel? You could also see about getting someone else with an Alpha based system to compile a kernel for you -- and make sure that it has values in it's scsi.h file that are appropriate to your system -- as well as insuring that the corrective drivers are built in. How can make further progress here? It's a tough question. Another thing I'd look at is to see if the Alpha system allows booting from a CD-ROM. Then I'd check out Red Hat's (or Craftworks') Linux for Alpha CD's -- asking each of them if they support this sort of boot. (I happened to discover that the Red Hat Linux 4.1 (Intel) CD-ROM was bootable when I was working with one system that had an Adaptec 2940 controller where that was set as an option. This feature is also quite common on other Unix platforms such as SPARC and PA-RISC systems -- so it is a rather late addition to the PC world). -- Jim _________________________________________________________________ Configuration Problems of a Soundcard From: Stuby Bernd, eacj1049@inuers17.inue.uni-stuttgart.de Hello there, First I have to metion that my Soundcard (MAD16 Pro from Shuttle Sound System with an OPTi 82C929 chipset) works right under Windows. I tried to get my Soundcard configured under Linux 2.0.25.with the same Parameters as under Windows but as I was booting the new compiled Kernel the Soundcard whistled and caused terrible noise. The same happened as I compiled the driver as a module and installed it in the kernel. In the 'README.cards' file the problem coming up just with this Soundcard is mentioned (something like line 3 mixer channel). I don't know what to do with this information and how to change the sounddriver to getting it working right. May be there's somebody who knows how to solve this problem or where I can find more information. With best regards Bernd Sigh. I've never used a sound card in my machine. I have a couple of them floating around -- and will eventually do that -- but for now I'll just have to depend on "the basics" Did you check the Hardware-HOWTO? I see the MAD16 and this chipset listed there. That's encouraging. How about the Soundcard-HOWTO? Unfortunately this has no obvious reference to your problem. I'd suggest browsing through it in detail. Is your card a PnP (plug and "pray")? I see notes about that being a potential source of problems. I also noticed a question about "noise" being "picked up" by the sound card http://sunsite.unc.edu/LDP/HOWTO/Sound-HOWTO-6.html#ss6.23 That might not match your probelm but it's worth looking at. Did you double check for IRQ and DMA conflicts? The thing I hate about PC sound cards is that most of them use IRQ's and DMA channels. Under DOS/Windows you used to be able to be fairly sloppy about IRQ's. When your IRQ conflicts caused conflicts the symptoms (like system lockups) tend to get lost in the noise of other problems (like system lockups and mysterious intermittent failures). Under Linux these problems usually rear their ugly heads and have nowhere to hide. Have you contacted the manufacturer of the card? I see a Windows '95 driver. No technical notes on their sound cards -- and no mention of anything other than Windows on their web site (that I could find). That would appear to typify the "we only do Windows" attitude of so many PC peripherals manufacturers. I've blind copied their support staff on this -- so they have the option to respond. If this is a new purchase -- and you can't resolve the issue any other way -- I'd work with your retailer or the manufacturer to get a refund or exchange this with hardware that meets your needs. An interesting side note. While searching through Alta Vista on Yahoo! I found a page that described itself as The Linux Ultra Sound Project. Perhaps that will help you choose your next PC sound system (if it comes to that). -- Jim _________________________________________________________________ Procmail Idea and Question From: Larry Snyder, larrys@lexis-nexis.com Just re-read your excellent article on procmail in the May LJ. (And yes, I've read both man pages :-). What I want to try is: 1. Ignore the header completely 2. Scan the body for [*emov* *nstruction*] or remove@* 3. /dev/null anything that passes that test This should be a MUCH cheaper (in cpu cycles) way of implementing a spam filter than reading the header then going through all the possible domains that might be applicable. Most of the headers are forged in your average spam anyway.... Not my idea, but it sounds good to me. What do you think, and how would I code a body scan in the rc? I think it's a terrible idea. The code would be simple -- but the patterns you suggest are not very specific. Here's the syntax (tested): :0 B * (\[.*remove.*instruction.*\]|\[.*remove@.*\]) /dev/null ... note the capital "B" specifies that the recipe applies to the "Body" of the message -- the line that starts with an asterisk is the only conditional (pattern) the parentheses enclose/group the regular expression (regex) around the "pipe" character. The pipe character means "or" in egrep regex syntax. Thus (foo|bar) means "'foo' or 'bar'" The square brackets are a special character in regexes (where they enclose "classes" of characters). Since you appeared to want to match the literal characters -- i.e. you wanted your phrases to be enclosed in square brackets -- I've had to "escape" them in my pattern -- so they are treated literally and not taken as delimiters. The * (asterisk) character in the regex means "zero or more of the preceding element" and the . (dot or period) means "any single character" -- so the pair of them taken together means "any optional characters" If you use a pattern line like: * foo*l ... it can match fool fooool and fooooolk and even fol but not forl or foorl. The egrep man page is a pre-requisite to any meaningful procmail work. Also O'Reilly has an entire book (albeit a small one) on regular expressions. The gist of what I'm trying to convey is that .* is needed in regex'es -- even though you might use just * in shell or DOS "globbing" (the way that a shell matches filenames to "wildcards" is called "globbing" -- and generally does NOT use regular expressions -- despite some similarities in the meta characters used by each). Not also that the * token at the beginning of this line is a procmail thing. It just identifies this as being a "condition" line. Lines in procmail recipes usually start with a token like a : (colon), a * (asterisk), a | (pipe) or a ! (bang or exclammation point) -- any that don't may consist of a folder name (either a file or a directory) or a shell variable assignment (which are the lines with = (equal signs) somewhere on them. In other words the * (star) at the begining of that line is NOT part of the expression -- it's a token that tells the procmail processor that the rest of the line is a regex. Personally I found that confusing when I first started with procmail. Back to your original question: I'm very hesitant to blindly throw mail away. I'd consider filing spam in a special folder which is only review in a cursory fashion. That would go something like this: :0 B: * (\[.*remove.*instruction.*\]|\[.*remove@.*\]) prob.spam Note that I've added a trailing : (colon) to the start of the recipe. This whole :x FLAGS business is a throwback to an early procmail which required each recipe to specify the number of patterns that followed the start of a recipe. Later :0 came to mean "I didn't count them -- look at the first character of each line for a token." This means that procmail will can forward through the patterns and -- when one matches -- it will execute ONE command line at the end of the recipe (variable assignments don't count). I'm sure none of that made any sense. So :0 starts a recipe, the subsequent * ... lines provide a list of patterns, and each recipe ends with a folder name, a pipe, or a forward (a ! -- bang thingee). The : at the *END* of the :0 B line is a signal that this recipe should use locking -- so that to pieces of spam don't end up interlaced (smashed together) in your "prob.spam" mail folder. I usually use MH folders (which are directories in which each message takes up a single file -- with a number for a filename). That doesn't require locking -- you'd specify it with a folder like: :0 * ^TO.*tag linux.gazette/. ... (notice the "/." (slash, dot) characters at the end of this). Also note that folder names don't use a path. procmail defaults to using Mail (like elm and pine). You can set the MAILDIR variable to over-ride that -- mine is set to $HOME/mh. To write to /dev/null (where you should NOT attempt to lock the file!) you must use a full path (I suppose you could make a symlink named "null" in your MAILDIR or even do a mknod but....). When writing procmail scripts just think of $MAILDIR as your "current" directory (not really but...) and either use names directly under it (no leading slashes or dot/slash pairs) or use a full path. The better answer (if you really want to filter mail that looks like spam) is to write an auto-responder. This should say something like: The mail you've sent to foo has been trapped by a filtering system. To get past the filter you must add the following line as the first line in the body of your message: ...... ... Your original message follows: ...... ... using this should minimize your risks. Spammers rely on volume -- no spammer will look through thousands of replies like this and manually send messages with the requisite "pass-through" or "bypass" directive to all of them. It's just not worth it. At the same time your friends and business associates probably won't mind pasting and resending (be sure to use a response format that "keeps" the body -- since your correspondents may get irritated if they have to dig up their original message for you. Here's where we can work the averages against the spammer. He uses mass mailings to shove their message into our view -- we can each configure our systems to require unique (relatively insecure -- but unique) "pass codes" to reject "suspicious" mail. Getting the "pass codes" on thousands of accounts -- and using them before they are changed -- is not a task that can be automated easily (so long as we each use different explanations and formatting in our "bypass" instructions. More drastic approaches are: * Require that all incoming mail be PGP, PEM or S/MIME signed -- and that the signatories signature be on your mail keyring. (Enhancements would allow anyone to add themselves to your mail keyring if they got thier signature "counter signed" by anyone on one of your other keyrings). * (Return any unsigned mail with a message of explanation). * Test all incoming mail against a list of associates and friends -- accept anything from them. Test all remaining mail against a list of know spammers -- reject those with an error message. Respond to all remaining mail to explain your anti-spam policy -- and provide "bypass" instuctions (so they can add themselves to your accept list). * Compare the "mail" and "envelope" addresses (the From: and From_ (space) header lines). Reject any that are inconsistent. * Upgrade to a recent sendmail and configure the "reverse lookup" and the "rejection mailer table" features (which I haven't done yet -- so I know NOTHING about). I hope some of these ideas help. Here is a copy of one of my autoresponders for your convenience: :0 * < 1000 * !^FROM_DAEMON * !^X-Loop:[ ]*info@starshine.org * ^Subject:[ ]*(procmail|mailbot) | ((formail -rk -A "Precedence: junk" \ -A "X-Loop: info@starshine.org" ; \ echo "Mail received on:" `date`) \ | $HOME/insert.doc -v file=$DOC/procmail.tutorial ) | $SENDMAIL -t -oi -oe I realize this looks ugly. The first condition is to respond only to requests that are under 1K in size. (An earlier recipe directs larger messages to me). The next two try to prevent reponses to mail lists and things like "Postmaster@..." (to prevent some forms of "ringing") and check against the "eXtended" (custom) header that most procmail scripts use to identify mail loops. The next one matches subjects of "procmail" or "mailbot." If all of those conditions are met than the message is piped to a complex command (spread over four lines -- it has the trailing "backslash" at the end of each of those -- to force procmail to treat it all as a single logical line: This command basically breaks down like so: (( formail -rk ... ... the two parenthese have to do with how the data passes through the shell's pipes. Each set allows me to group the output from a series of commands into each of my pipes. .... the formail command creates a mail header the -r means to make this a "reply" and the -k means to "keep" the body. The two -A parameters are "adding" a couple of header lines. Those are enclosed in quotes because they contain spaces. ... the echo command adds a "timestamp" to when I received the mail. The `date` (backtick "date") is a common shell "macro expansion" construct -- Korn shell and others allow one to use the $(command) syntax to accomplish the same thing. Now we close the inner group -- so formail's output -- and the echo's output are fed into my little awk script: insert.doc. This just takes a parameter (the -v file=) and scans its input for a blank line. After the first blank line insert.doc prints the contents of "file." Finally it then just prints all of the rest of it's input. Here's a copy of insert.doc: #! /usr/bin/gawk -f /^[ \t]*$/ && !INSERTED { print; system("cat " file ); INSERTED=1} 1 ... that's just three lines: the pattern matches any line with nothing or just whitespace on it. INSERTED is a variable that I'm using as a flag. When those to conditions are met (a blank line is found *and* the variable INSERTED has not yet been set to anything) -- we print a blank line, call the system() function to cat the contents of a file -- whose name is stored in the 'file' variable, and we set the INSERTED flag. The '1' line is just an "unconditional true" (to awk). It is thus a pattern that matches any input -- since no action is specified (there's nothing in braces on that line) awk takes the default action -- it prints the input. In awk the two lines: 1 ... and {print} ... are basically the same. They both match every line of input that reaches them and they both just print that and continue. ... Back to our ugly procmail recipe. 'insert.doc' has now "inserted" the contents of a doc file between formail's header and the body of the message that was "kept." So we combine all of that and pipe it into the local copy of sendmail. procmail thoughtfully presets the variable $SENDMAIL -- so we can use it to make our scripts (recipes) more portable (otherwise they would break when written on a system with /usr/lib/sendmail and moved to a system that uses /opt/local/new/allman/sendmail (or some silly thing like that)). The switches on this sendmail command are: * -t (take the header from STDIN) * -oi (option: ignore lines that contain just a dot) * -oe (option: errors generate mail) ... I'll leave it as an exercise to the reader to look those up in the O'Reilly "bat" book (the "official" Sendmail reference). There are probably more elegant ways to do the insertion. However it is a little messy that our header and our "kept" body are combined in formail's output. If we had a simple shell syntax for handling multiple file streams (bash has this feature -- but I said *simple*) then it would be nice to change formail to write the header to one stream and the body to another. However we also want to avoid creating temp files (and all the hassles associated with cleaning up after them). So -- this is the shortest and least resource intensive that I've come up with. So that's my extended tutorial on procmail. I'd like to thank Stephen R. van den Berg (SRvdB) (creator of procmail), Eric Allman (creator of sendmail), and Alan Stebbens (an active contributor to the procmail mailing list -- and someone who's written some nice extensions to SmartList). Alan Stebbens' web pages on mail handling can be found at: http://reality.sgi.com/aks/mail -- Jim _________________________________________________________________ UUCP/Linux on Caldera From: David Cook, david_cook@VNET.IBM.COM We have spoken before on this issue over the caldera-users list (which I dropped because of too much crap). I recently gave up on Caldera's ability to support/move forward and acquired redhat 4.1. All works well, except I cannot get uucico & cu to share properly the modem under control of uugetty. Other comm programs like minicom and seyon have no problem with it. Both uucico and cu connect to the port and tell me that they cannot change the flow control !? and exit. If I kill uugetty, both uucico and cu work perfectly. In your discussion on the caldera newsgroup of Nov 2/96 you don't go into the details of your inbound connection, but you mention "mgetty" as opposed to uugetty. What works/why doesn't mine? What are pros/cons of mgetty? By the way, I agree wholeheartedly with your rational for UUCP. Nobody else seems to apreciate the need for multiple peer connections and the inherit security concerns with bringing up an unattended TCP connection with an ISP. Dave Cook, IBM Global Solutions. The two most likely problems are: lock files or permissions There are three factors that may cause problems with lock files: location, name, and format. For lock files to work you must use the same device names for all access to a particular device -- i.e. if you use a symlink named 'modem' to access your modem with *getty -- then you must use the same symlink for your cu, uucico, pppd, minicom, kermit, seyon, etc. (or you must find some way to force them to map the device name to a properly named LCK..* file). You must also configure each of these utilities to look for their lock files in the same location -- /var/lock/ under Red Hat. This configuration option may need to be done at compile time for some packages (mgetty) or it might be possible to over-ride it with configuration directives (Taylor UUCP) or even command line options. The other things that all modem using packages have to agree on is the format of the lock file. This