"Linux Gazette...making Linux just a little more fun!"


More 2¢ Tips!


Send Linux Tips and Tricks to gazette@linuxgazette.net


Contents:


No Linux support Lexmark 40 printers

Date: Thu, 15 Oct 1998 12:18:37 -0600 (MDT)
From: "D. Snider", dsnider@nmia.com

For your information:
The Lexmark 40 color printers do all setup/alignment from MS whatever OS.

Lexmark first told me they don't support Linux on their new 40 & 45 printers (all alignment functions are from software under MS something). But hey, the guys at Lexmark came through. They sent me a C program for aligning the printer.

It would be a good candidate to go into an archive (sunsite.unc.edu). I don't know the process for putting software into an archive so I am passing it on to you folks. I also am sending it to Grant Taylor gtaylor+pht@picante.com, who is listed as the custodian of the Printing-HOWTO. The model 40 printer is PostScript and works well.

Cheers
Dale

The Mailbag: Re: text browsers

Date: Mon, 05 Oct 1998 19:46:43 +0200
From: Tomas Pospisek - Sysadmin, tpo@spin.ch
User has problems with <B>, that is not visible in lynx.
Well, this is not the problem of the page, but a problem of lynx configuration. At the bottom of the default lynx config file one can configure the colors for the display of the different tags as one wishes. It is very clear from the comments in the config file on how to do it. One can start lynx with an option lynx -f config.file if I remember right.

Tomas


RE: Problem mounting vfat filesystem ...

Date: Mon, 05 Oct 1998 10:13:54 +0100 (IST)
From: Caolan McNamara, Caolan.McNamara@ul.ie
Jan Jansta wrote...
I have permanent problem with mounting any vfat/dos filesystem with write permisions for all users on my Linux machine. I'm using Red Hat 5.1, kernel version 2.0.34 . Does someone know what's not working properly ?
Here's what I've done. The exact line from my /etc/fstab:
 
/dev/hda1                 /mnt/win95                vfat   umask=000,auto 1 1
The trick is in setting the umask. Caolan


Re: Linux Newbie

Date: Sat, 03 Oct 1998 12:59:16 +0200
From: "Anthony E. Greene", agreene@pobox.com

I saw your letter to Linux Gazette and decided to drop you a few pointers.

Linux Documentation Project:
First, the Linux Documentation Project is your friend. Take a look around the site http://sunsite.unc.edu/LDP/. The documents that you'll find most valuable as a new Linux user are the "Installation and Getting Started Guide" and the "The Linux Users' Guide". Both are available for download in multiple formats. Descriptions and pointers are at http://sunsite.unc.edu/LDP/ldp.html. If you really consider yourself (or your curious friends) clueless, then I'd advise you to buy a ream of paper and print the PDF version of the Linux User's Guide for casual reading. Then get one of the easier distributions, back up your Win95 data, and give Linux a whirl.

Linux Distributions:
I'd recommend Caldera http://www.caldera.com/ for casual non-programmers that are comfortable with Win95 and just want to try Linux. Current versions of Caldera come with the KDE desktop http://www.kde.org/. KDE presents a familiar interface to Win95 users. Red Hat http://www.redhat.com/ is very popular and also relatively easy but is oriented more toward knowledgeable computer users. I'm not familiar enough with SUSE http://www.suse.com/ to make a recommendation, although it's supposed to be easy too. Debian http://www.debian.org/ and Slackware http://www.slackware.org/ are considered by most to be for those who already know how to install and use Linux. There are other distributions, but these are the most popular.

Included Documentation:
Once you get Linux installed, fire up Midnight Commander from the command line using 'mc'. This is an easy to use file manager that, despite its DOS look & feel, is also powerful. Use it to take a look around the /usr/doc directory for the wealth of documentation installed in any popular Linux system. You'll be astounded at the amount of information available if you're accustomed to the Win95 way of doing things. The HOWTO documents in particular will be very useful to new users. HOWTOs are cookbook-style documents written by Linux users who have taken the time to share the steps they took to accomplish something in Linux. Perhaps if you use Linux for a while, you'll have occasion to write a HOWTO of your own.

Manual Pages
If you see references to a command in Linux and would like to know more about using it, chances are you'll find a comprehensive description of the command and all its options in the associated Manual Page. Just type: 'man command' at the command line, substituting the name of the command you're interested in and you'll be presented with a summary of the syntax, usage, and available options for the command. Many man pages also include examples and references to related man pages and commands. To see how to use the manual page system itself, just use 'man man'.

Mailing Lists and Newsgroups
Mailing lists and newsgroups provide a good way to find the answer to a question you haven't been able to find the answer to in the extensive documentation included with Linux or available from the LDP. Mailing lists are generally archived and the archives will probably be able to answer your question. If not, post a note asking for a pointer to the documentation and you'll probably get several good answers. If the problem is simple enough, you'll probably get an explanation too. I've found pointers to comprehensive documentation to be more valuable in the long run though. Often, understanding the solution to one problem allows you to solve other problems later. When subscribing to a mailing list or newsgroup, try to find one that's specific to the distribution you use. Most things are the same across distributions, but there are enough small differences that new users would be best served by getting help that's specific to their distribution.

One more thing; be prepared to do lots of reading. ;-)

--
Anthony E. Greene


Locally Searching the Linux Gazette

Date: Sat, 3 Oct 1998 01:33:17 -0400 (EDT)
From: Ray Marshall, raym@vnet.net

To begin with, I often like to browse and/or reference present and past issues of the Linux Gazette. But, since I'm not always connected to the Internet, and even when I am, I hate waiting for a page to download; I mirror it locally, both at home, and at work.

On occasion I have found myself grepping the TWDT files for specific references to various topics, commands, packages, or whatever. But, just a plain grep of lg/issue??/issue??.html, will only show references in all but the first 8 issues. So, I made some minor changes in lg/issue01to08, and put an alias (command) in ~/.bashrc, to allow easy scanning of ALL issues.

First, the changes:

 
  cd ~/html/lg/issue01to08
  ln linux_gazette.html lg_issue1.html
  ln linux_gazette.aug.html lg_issue2.html
  ln linux_gazette.sep.html lg_issue3.html
  ln linux_gazette.oct.html lg_issue4.html
  ln linux_gazette.nov.html lg_issue5.html
Now the command declaration (for bash):
 
  lgfind () { command grep -i ""$@"" ~/html/lg/issue01to08/lg_issue?.html ~/html/lg/issue??/issue??.html | more ; }
The same declaration in C-shell (csh):
 
  alias lgfind 'grep  -i ""\!*"" ~/html/lg/issue01to08/lg_issue?.html ~/html/lg/issue??/issue??.html | more'
I suppose I could have used "linux_gazette*" in my grep, but that would have put the resulting output out of order. Besides, these links allow the grep to show which issue number a match is found in.

And I suppose I could also have created either soft or hard links to ALL of the TWDT files in another directory. But I would then have to go there and add another link, every time a new issue came out.

Using this is simple, just:

 
  lgfind <string>
and obvious to most experienced UNIX users, I quote the string if it contains spaces. Also, the string can be a regex expression. You may have noticed the "-i" -- I don't like having to remember the case of the characters I'm looking for.

Once I have the output of lgfind, I point my browser to another html page that I have generated, that contains just links to all of the TWDT files. I will attach that page to this message. You can either add it to the base files, publish it, or whatever TYO. ;-) I put it in the directory that contains your `lg' directory.

I hope this helps someone else, too.

Ray Marshall

PS: I agree with your decision to use "TWDT". It can be read in whatever way one wishes, including very inoffensively. Wise choice.


Re: Problem mounting vfat filesystem

Date: Fri, 02 Oct 1998 21:48:55 +0000
From: Nick Matthews, jerrikthyne@geocities.com

From: Jan Jansta
I have a permanent problem with mounting any vfat/dos filesystem with write permissions for all users >on my Linux machine. I'm using Red Hat 5.1, kernel version 2.0.34 Does someone know what's not working properly ?

I had somewhat the same problem. What I did was to put this in my

 
/etc/fstab:
/dev/hda1                 /dos                      vfat   user,noauto 0
0
I don't always want my /dos partition mounted, because I don't want its files cluttering up my db for locating files. But making it a user partition means that anyone can mount and use it.

Good luck,
Nick


Mounting DOS Partitions in Linux

Date: Fri, 02 Oct 1998 17:08:23 -0400
From: Ed Young, youngej@magpage.com

Secure Mounting for DOS Partitions:

In order to open up permissions on your DOS partitions in a secure way, do the following:

Note: in the samples below, the dos usrid (63) and grpid(63) were selected so they wouldn't duplicate any other usrid or grpid in /etc/passwd or /etc/group.

Also, this solution works with Red Hat 5.1, you may have to adjust it slightly if you are using a different distribution.

1) Make a dos user who can't log in by adding the following line to /etc/passwd: dos:*:63:63:MSDOS Accessor:/dos:

2) Make a dos group and add users to the dos group. In the following example, root and ejy are in the dos group. To do this, add a line like the following to /etc/group: dos::63:root,ejy

3) Add the following line (changed to suit your system) to

 
   /etc/fstab:
     /dev/hda1  /C      vfat    uid=63,gid=63,umask=007 0 0
   
Of course, you have to locate your DOS partitions in the first place. This is done by issuing the following commands as 'root':
 
     /sbin/fdisk -l
     df
     cat /etc/fstab
The `fdisk -l` command lists all available devices. `df` shows which devices are mounted and how much is on them. And /etc/fstab lists all mountable devices. The devices remaining are extended partitions, a kind of a partition envelope, which you don't want to mount. And the partition's allocated to other operating systems which you may want to mount.

4) Create a mount point for your DOS disk by issuing the following commands as root: mkdir /C chown dos:dos /C

With this setup, the C: drive is mounted at boot time to /C. Only root and ejy can read and write to it. Note that vfat in /etc/fstab works for vfat16 (and vfat32 natively for Linux 2.0.34 and above).

Enjoy...


Re: Canon BJC-250 question

Date: Fri, 2 Oct 1998 21:32:20 +0200 (CEST)
From: rsmith@xs4all.nl
In issue 33 of the Linux Gazette you wrote:
I have a Canon BJC-250 color printer. I have heard many people say that the BJC-600 printer driver will let me print in color. But I have not heard anyone say where I can get such a driver. I have looked everywhere but where it is. Can you help me?
When people are talking about printer drivers for Linux, they are mostly referring to a piece of code that enables the "Ghostscript" program to produce output on your printer.

Ghostscript is an interpreter of the Postscript page-description language. In the Unix world, it is kind of a lingua franca of talking to a printer. A lot of programs can produce Postscript output.

More expensive printers support Postscript in hardware, other printers need Ghostscript with a driver for that particular printer compiled in.

Invoke Ghostscript as "gs -?" to see a list of all the printers for which support is compiled in. If your printer is not in the list, use a driver for a printer from the same family. Otherwise you might have to compile GhostScript with another driver.

The Ghostscript 5.1 that I'm using (Debian distro) is compiled with the bjc600 driver.

Roland


Re: Help : Modem + HP

Date: Fri, 2 Oct 1998 21:20:58 +0200 (CEST)
From: Roland Smith, rsmith@xs4all.nl
In issue 33 of the Linux Gazette you wrote:
I have already spent hours trying to fix my Supra336 PnP internal modem and my HP DeskJet 720C under Linux! The result is always the same, no communication with teh modem and no page printed on the HP printer! Could someone help me, I am close to abandon!
To use a Plug-and-Play device under Linux, you have to configure it. For that, you can use isapnptools package. It will probably be included with your distribution.

Log in as root, and execute the command "pnpdump >isapnp.conf" Now edit this file to choose sensible values for the parameters the modem requires. Read the isapnp.conf man page. You might want to do "cat /proc/interrupts", "cat /proc/dma" and "cat /proc/ioports" to see which interrupts, DMA channels and I/O addresses are already in use. Once you're finished. copy the isapnp.conf file to /etc (as root). You can now configure the card by issuing the command "isapnp /etc/isapnp.conf" as root.

This probably must be done before the serial ports are configured. Look at the init(8) manpage, and see where the serial ports are configured in the system initialization scripts. Make sure that isapnp is called before the serial ports are configured.

If the modem is an internal one, you might have to disable one of the serial ports in your BIOS, so the modem can use in's address and interrupt.

Now, about the printer, AFIAK all HP *20 models are Windows-only printers. They use the host computer's CPU to perform all kinds of calculations that are normally done by the printer hardware. Therefore it needs a driver. Since HP doesn't release programming info on these devices, there will probably never be Linux drivers for these printers.

You should avoid this kind of brain-dead hardware (mostly referred to as "winprinters", or "winmodems").

Hope this helps :-)

Roland


Gnat and Linux: C++ and Java Under Fire LG #33

Date: Fri, 2 Oct 1998 14:47:46 -0400
From: "Terry Westley", twestley@buffalo.veridian.com

If you want the best of both worlds of Java and Ada, write applets targeted to the JVM in Ada! See these URLs for further info:

http://www.adahome.com/Resources/Ada_Java.html http://www.buffnet.net/~westley/AdaJava/

--
Terry J. Westley


Re: Canon BJC-250 question

Date: Fri, 2 Oct 1998 10:21:52 -0500 (CDT)
From: mhammel@graphics-muse.org
You asked:
I have a Canon BJC-250 color printer. I have heard many people say that the BJC-600 printer driver will let me print in color. But I have not heard anyone say where I can get such a driver. I have looked everywhere but where it is. Can you help me?
Most printing on Linux is handled through the use of the Ghostscript drivers. Ghostscript takes postscript input directed to it via the lpr command and converts it to the raw data streams that a particular output device can handle. Ghostscript can handle devices like printers but can also be used to display postscript files to your display (via the ghostview program).

To see if you have ghostscript installed, type the following:

 
% gs -v
"gs" is the command name for the ghostscript program (yes, it's really a program that has a bunch of output drivers compiled into it). The -v option asks it to print version information. If you have gs installed you'll see something like this:
 
Aladdin Ghostscript 4.03 (1996-9-23)
Copyright (C) 1996 Aladdin Enterprises, Menlo Park, CA.  All rights
reserved.
Usage: gs [switches] [file1.ps file2.ps ...]
Most frequently used switches: (you can use # in place of =)
 -dNOPAUSE           no pause after page   | -q       `quiet', fewer messages
 -g<width>x<height>  page size in pixels   | -r<res>  pixels/inch resolution
 -sDEVICE=<devname>  select device         | -c quit  (as the last switch)
                                           |            exit after last file
 -sOutputFile=<file> select output file: - for stdout, |command for pipe,
                                         embed %d or %ld for page #
Input formats: PostScript PostScriptLevel1 PostScriptLevel2 PDF
Available devices:
   x11 x11alpha x11cmyk x11mono deskjet djet500 laserjet ljetplus ljet2p
   ljet3 ljet4 cdeskjet cdjcolor cdjmono cdj550 pj pjxl pjxl300 bj10e bj200
   bjc600 bjc800 faxg3 faxg32d faxg4 pcxmono pcxgray pcx16 pcx256 pcx24b pbm
   pbmraw pgm pgmraw pgnm pgnmraw pnm pnmraw ppm ppmraw tiffcrle tiffg3
   tiffg32d tiffg4 tifflzw tiffpack tiff12nc tiff24nc psmono bit bitrgb
   bitcmyk pngmono pnggray png16 png256 png16m pdfwrite nullpage
Search path:
   . : /usr/openwin/lib/X11/fonts/Type1 : /usr/openwin/lib/X11/fonts/Type3 :
   /opt/AEgs/share/ghostscript/4.02 : /opt/AEgs/share/ghostscript/fonts
For more information, see /opt/AEgs/share/ghostscript/4.02/doc/use.txt.
Report bugs to ghost@aladdin.com; use the form in new-user.txt.
(the dashed lines are just to delimit the output from my email message)

This output comes from a version of ghostscript built for a Solaris system by someone other than myself. I don't know if this is the default set of devices you'll see on a Linux distribution or not.

The "available devices" say which devices you can use with gs. In this case the bubble jet 250 is not specifically listed (I suspect it would say bjc250, but I could be wrong), so I would (if I were using that particular printer) have to get the source and read the devices.txt file to find out if this printer is supported, either by its own driver or by one of the other drivers (perhaps the bjc600 supports it, for example).

This is the short explanation. To summarize, you'll need to familiarize yourself with Ghostscript and using lpr. If you're lucky and this printer is commonly supported by the various Linux distributions then you may already have this printer configured in the ghostscript you have installed on your box.

For information on Ghostscript you'll need to look at the Ghostscript FAQ at http://www.cs.wisc.edu/~ghost/gsfaq.html. Note that there are two versions of Ghostscript: Aladdin's and the GNU version. Aladdin's is a commercial product but it's free for personal use. If you're not planning on redistributing it then I recommend the Aladdin version.

Okay, that's all the good news. I just checked the devices list at http://www.cs.wisc.edu/~ghost/aladdin/devices.html and it doesn't list the Canon Color Bubble Jet 250. If this printer is supported it's either with a newer, unlisted driver or by one of the other drivers. You'll probably need to check the .txt files that come with the source, find the author of the Color Bubble Jet drivers and drop them a line to see if they know if this printer will work with one of the existing drivers.

Hope that helps point you in the right direction.

Michael J. Hammel, The Graphics Muse


re: problem mounting vfat filesystem

Date: Fri, 2 Oct 1998 08:20:38 -0500 (CDT)
From: Scott Carlson, ScottCarlson@technologist.com

Jan,
My /etc/fstab contains this line:

 
/dev/hda4     /f:  vfat    defaults,umask=007,gid=101        1 1
This mounts my dos directory at /f: ( to match when I boot NT ) it allows root, or anyone in the group 101 to read or write the directory. I set up the 101 group so I could say only people in that group could write to /f:

To allow everyone change it to defaults,umask=000

Scott Carlson


SMB Printing for users with spaces in their SMB username

Date: Tue, 06 Oct 98 14:31:42 -0800
From: vwdowns@bigfoot.com

In order to get SMB printing to work under Red Hat Linux 5.1 with my username (which has a single space in it), I made the following addition to the Red Hat print filter "smbprint", located in: /usr/lib/rhs/rhs-printfilters/smbprint

 
USER="`echo $usercmd | awk '{printf "%s %s", $2,
$3}'`"%$password
usercmd=""
(The above lines were inserted just prior to the last line in the script, which on my system was):
 
(echo "print -"; cat) | /usr/bin/smbclient "$share"
$password -E ${hostip:+-I} $hostip -N -P $usercmd
2>/dev/null
This has the effect of setting the USER variable to "User Name"%password, where User Name is the name of the user as passed in to the script in the $usercmd varible. AWK is used to strip out the leading "-U" supplied as part of $usercmd somewhere up the command chain.

This solution only works for usernames with a single space in them. A more complex and full-featured solution would deal with no spaces or multiple spaces, either way. In any case, I feel Red Hat should find a general solution to this and incorporate it in their next release.

Warren

P.S. Thanks for a great forum for sharing tips and tricks for Linux. BTW, does Red Hat read these tips? I'd appreciate it if someone would submit this bug to them for fixing. Generalized fix for SMB printing-- usernames w/spaces Date: Wed, 07 Oct 98 06:38:02 -0800
From: vwdowns@bigfoot.com

I wrote you earlier about a bug in Red Hat 5.1's /usr/lib/rhs/rhs-printfilters/smbprint

I later realized a simple generalized solution, by looking at the source code in more detail. The lines I added before can be replaced with:

 
export USER="$user"%$password
usercmd=""
(Just prior to the last line which calls smbclient).

For a more full-featured fix, simply modify the setting of $usercmd to: 1. Replace references to $usercmd with references to $USER.

2. $USER should be set/exported conditionally as $usercmd is at present.

3. $usercmd should be removed entirely from usage.

The only reliable way to pass a username/password to smbclient is via the USER environment variable.

1. The environment variable will not be seen on the cmd line by someone running ps, thus not exposing your password accidentally.

2. User names/passwords passed on the command line cannot contain spaces. If you embed them in quotes, smbclient keeps the quotes instead of trimming them off, causing username/password mismatch on the server. If you leave off the quotes, normal command-line parsing separates the username/password into separate parameters, and only the first word of each will get used.

Anyone using Red Hat print-filters will want to fix this, just in case they ever decide to set up SMB printing and are stuck with spaces in their username/password (as I am).

Warren E. Downs


2 Cent Tip -- Netscape

Date: Sun, 11 Oct 1998 10:37:37 +0200 (MET DST)
From: Hans-Joachim Baader, hans@grumbeer.inka.de

we all use Netscape every now and then. Most people won't use it as mailreader since it is too bloated, and the UNIX mailreaders are generally much better.

Nevertheless, Netscape seems to create a directory nsmail in the user's home directory every time it starts and doesn't find it, even if mail is not used. This is annoying. Here's a trick which doesn't make this directory go away, but at least makes it invisible.

I didn't find a GUI equivalent to change this setting so you have to do the following:

Edit the file ~/.netscape/preferences.js and change all occurences of 'nsmail' to '.netscape'. The important thing here is, of course, the leading dot before 'netscape'.

Regards,
hjb


Cobol

Date: Wed, 14 Oct 1998 23:10:35 +1000
From: "John Leach", leachj@ozemail.com.au
To: cbbrowne@hex.net

I saw your request for help in the Linux Gazette re Cobol. I've been using AcuCobol for 2 years under Linux and I strongly recommend the product and the company.

I don't know the cost of the compiler because my company bought it - but email them and ask for a student copy - they can only refuse... They have a full development environment called 'AcuBench' which currently only runs only under Windows.

The amazing thing about AcuCobol is that programs compiled on one platform will run totally unchanged on another machine - I tend to develop under Windows but install at clients sites on Linux. I hope this has been helpful.

Regards
John Leach


Piped Signatures

Date: Fri, 16 Oct 1998 17:03:41 +0000
From: Colin Smith, colin@melly.europe.dg.com

This has probably come up before, but the "more fun with pipes" thing in issue 33 reminded me of it.

Have a different signature appear in your emails every time you send one.

Create a subdrectory in your home called .signatures and copy your .signature file into it under a visible name. delete your .signature file and create a pipe in its place using

 
mkfifo .signature
Create a script which simply "cat"s each of the files in the .signatures directory out to the .signature pipe:
 
#!/bin/sh
while true
do
	for SIGNATURE in ${HOME}/.signatures/*
	do
		# Cat each file out to the .signature and throw away any errors.

		cat ${SIGNATURE} > ${HOME}/.signature 2> /dev/null

		# This sleep seems to be required for Netscape to work properly
		# I think buffering on the filesystem can cause multiple signatures
		# to be read otherwise. I think the sleep allows Netscape to see
		# the End Of File.

		sleep 1
	done
done
Have this script kick off in the background every time you log in to the system in your profile or xsession. Add more entries to the .signatures directory and they automatically get used in your emails.

Issues and problems:
One issue might be blocking on the pipe. If there is no process feeding signature files down the pipe, any programs which open the pipe can appear to hang until something is written.

--
Colin Smith


Fixing backspace and delete Key in X-windows

Date: Sun, 18 Oct 1998 17:40:28 +1000
From: "Steven K.H. Siew", ksiew@tig.com.au

If you have installed Red Hat version 5.0, you will have come across this problem. It will not take you long to realise that the backspace key (by this I mean the key above the ENTER key) and the delete key (by this I mean the key below the INSERT key and to the left of the END key) behaves differently on the console than on xterm in X-windows.

This is extremely irritating if like me you work in both the text-only console and xterm on X-windows. I set about to make sure that the behaviour is the same on both of them. In other words I want them to be standardise.

My solution is to make the backspace, delete and the pageup and pagedown key to behave exactly like they do in the text-only console.

The literature to do this is available on the web, however here I shall show those who have not done this yet, the steps needed to acheive this. A word of warning! This is dangerous. You can potentially stuff things up very very badly. In other words you must do this extremely carefully (and make lots of backups).

For your information I included the links below where you may obtain more details about this matter.

http://www.best.com/~aturner//RedHat-FAQ/ http://www.ibbnet.nl/~anne/keyboard.html

Okay now for the step by step instruction to fix the problem

Step one
* * * is to create a directory to store the original files

 
ksiew > mkdir original-terminfo-file
ksiew > cd original-terminfo-file/
original-terminfo-file > pwd
/home/ksiew/original-terminfo-file

Step two
* * * is to save the original copy of the xterm terminfo file

 
original-terminfo-file > locate xterm | grep terminfo | grep x/xterm
/usr/lib/terminfo/x/xterm
/usr/lib/terminfo/x/xterm-bold
/usr/lib/terminfo/x/xterm-color
/usr/lib/terminfo/x/xterm-nic
/usr/lib/terminfo/x/xterm-pcolor
/usr/lib/terminfo/x/xterm-sun
/usr/lib/terminfo/x/xterms
/usr/lib/terminfo/x/xterms-sun
original-terminfo-file > cp /usr/lib/terminfo/x/xterm xterm.original
original-terminfo-file > ls -al
total 5
drwxrwxr-x   2 ksiew    ksiew        1024 Oct 18 15:35 .
drwxr-xr-x  24 ksiew    ksiew        2048 Oct 18 15:31 ..
-rw-rw-r--   1 ksiew    ksiew        1380 Oct 18 15:35 xterm.original
Step three
* * * is to obtain the xterm terminfo settings and save it into a file called "xterm" in the current directory

original-terminfo-file > infocmp xterm > xterm
original-terminfo-file > less ./xterm
#	Reconstructed via infocmp from file: /usr/lib/terminfo/x/xterm
xterm|vs100|xterm terminal emulator (X11R6 Window System), 
	am, km, mir, msgr, xenl, xon, 
	cols#80, it#8, lines#65, 
	acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~..--++\
054\054hhII00, 
	bel=^G, bold=\E[1m, clear=\E[H\E[2J, cr=^M, 
	csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H, 
	cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C, 
	cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A, 
	dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, dl1=\E[M, 
	ed=\E[J, el=\E[K, enacs=\E(B\E)0, home=\E[H, ht=^I, 
	ich=\E[%p1%d@, ich1=\E[@, il=\E[%p1%dL, il1=\E[L, 
	ind=^J, 
	is2=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l, 
	kbs=^H, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, 
	kcuu1=\EOA, kend=\EOe, kent=\EOM, 
	kf1=\E[11~, kf10=\E[21~, kf11=\E[23~, kf12=\E[24~, 
	kf2=\E[12~, kf3=\E[13~, kf4=\E[14~, kf5=\E[15~, 
	kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, 
	khome=\EO\200, kich1=\E[2~, kmous=\E[M, knp=\E[6~, 
	kpp=\E[5~, rc=\E8, rev=\E[7m, ri=\EM, rmacs=^O, 
	rmam=\E[?7l, rmcup=\E[2J\E[?47l\E8, rmir=\E[4l, 
	rmkx=\E[?1l\E>, rmso=\E[m, rmul=\E[m, rs1=^O, 
	rs2=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l\E<, 
	sc=\E7, sgr0=\E[m, smacs=^N, smam=\E[?7h, 
	smcup=\E7\E[?47h, smir=\E[4h, smkx=\E[?1h\E=, 
	smso=\E[7m, smul=\E[4m, tbc=\E[3k, u6=\E[%i%d;%dR, 
	u7=\E[6n, u8=\E[?1;2c, u9=\E[c, 
Step four
* * * is to modify the file called "xterm" in the current directory to change the kbs setting and to insert a new kdch1 setting

Change from

 
	kbs=^H, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, 
	kcuu1=\EOA, kend=\EOe, kent=\EOM, 
to
 
	kbs=\177, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, 
	kcuu1=\EOA, kdch1=\E[3~, kend=\EOe, kent=\EOM, 
Step five
* * * is to create a .terminfo directory, setup the TERMINFO, setup TERM as xterm, change into superuser and then recompile the "xterm" settings file
 
original-terminfo-file > mkdir ~/.terminfo

original-terminfo-file > export TERMINFO=~/.terminfo
If you are using tcsh, type instead
 
    original-terminfo-file > setenv TERMINFO ~/.terminfo

original-terminfo-file > export TERM=xterm
If you are using tcsh, type instead
 
    original-terminfo-file > setenv TERM xterm

original-terminfo-file > su
password: opensesame

#| tic xterm
Step six
* * * is to change to the ~/.terminfo/x/ directory and copy the xterm file to /usr/lib/terminfo/x/xterm
 
#| cd ~/.terminfo/x/
#| cp xterm /usr/lib/terminfo/x/xterm
#| cd ~
#| rm -rf .terminfo
#| exit
ksiew>
Step seven * * * is to logoff and log back on (this is to get rid of the TERMINFO variable) and change the .Xdefaults file
 
ksiew> logout
login: ksiew
password: opensesame
ksiew> less .Xdefaults
Output from less
Now change the last few lines from
 
xterm*VT100.Translations: #override\n\
	<KeyPress>gt;Prior : scroll-back(1,page)\n\
	<KeyPress>gt;Next : scroll-forw(1,page)
nxterm*VT100.Translations: #override\n\
	<KeyPress>gt;Prior : scroll-back(1,page)\n\
	<KeyPress>gt;Next : scroll-forw(1,page)
to the following lines
 
xterm*VT100.Translations: #override\n\
	<KeyPress>gt;Prior : string("\033[5~")\n\
	<KeyPress>gt;Next  : string("\033[6~")
nxterm*VT100.Translations: #override\n\
	<KeyPress>gt;Prior : string("\033[5~")\n\
	<KeyPress>gt;Next  : string("\033[6~")
*VT100.Translations: #override \
        <Key>gt;BackSpace: string(0x7F)\n\
        <Key>gt;Delete:    string("\033[3~")\n\
        <Key>gt;Home:      string("\033[1~")\n\
        <Key>gt;End:       string("\033[4~")
*ttyModes: erase ^?
That's it! Save the .Xdefaults file and now you can start X-windows and the backspace key, the delete key, the pageup key and the pagedown key will work just like in the text-only console window.

Steven


Creating bzgrep Program

Date: Sun, 18 Oct 1998 17:35:43 +1000
From: "Steven K.H. Siew", ksiew@tig.com.au

If you have ever used zgrep on gzip-textfiles then you would have realise what a wonderful it is. The program zgrep allows you to grep a textfile even if the text file is compressed in gzip format. Not only that it can also grep a uncompress textfile. For example if you have the following directory

 
testing > ls -al
total 2086
drwxrwxr-x   2 ksiew    ksiew        1024 Oct 18 11:07 .
drwxr-xr-x  24 ksiew    ksiew        2048 Oct 18 11:00 ..
-rwxrwxr-x   1 ksiew    ksiew     1363115 Oct 18 11:01 cortes.txt
-rwxrwxr-x   1 ksiew    ksiew      172860 Oct 18 11:01 lost_world_10.txt.gz
-rwxrwxr-x   1 ksiew    ksiew      582867 Oct 18 11:00 moon10a.txt
Then if you are looking for the word "haste",
 
testing > zgrep -l haste *
cortes.txt
lost_world_10.txt.gz
moon10a.txt
Tells you that "haste" is in all three files.

Now if you compress a textfile using the famous bzip2 compress program, you have a problem.

 
testing > bzip2 cortes.txt 
testing > ls -al
total 1098
drwxrwxr-x   2 ksiew    ksiew        1024 Oct 18 11:12 .
drwxr-xr-x  24 ksiew    ksiew        2048 Oct 18 11:12 ..
-rwxrwxr-x   1 ksiew    ksiew      355431 Oct 18 11:01 cortes.txt.bz2
-rwxrwxr-x   1 ksiew    ksiew      172860 Oct 18 11:01 lost_world_10.txt.gz
-rwxrwxr-x   1 ksiew    ksiew      582867 Oct 18 11:00 moon10a.txt
testing > zgrep -l haste *
lost_world_10.txt.gz
moon10a.txt
What happen now is that zgrep no longer recognise the file cortes.txt.bz2 as a compress text file.

What we need is a new program bzgrep which can recognise bzip2 compress text files.

The best way to create bzgrep file is to modify the existing zgrep file.

 
testing > locate zgrep
/usr/bin/zgrep
/usr/man/man1/zgrep.1

testing > su
password: opensesame
#| cp /usr/bin/zgrep /usr/local/bin/bzgrep
The bzgrep file is a copy of zgrep file can contain this text.

We cannot change the last few lines to the following

res=0
for i do
  if test $list -eq 1; then
    bzip2 -cdf "$i" | $grep $opt "$pat" > /dev/null && echo $i
    r=$?
  elif test $# -eq 1 -o $silent -eq 1; then
    bzip2 -cdf "$i" | $grep $opt "$pat"
    r=$?
  else
    bzip2 -cdf "$i" | $grep $opt "$pat" | sed "s|^|${i}:|"
    r=$?
  fi
  test "$r" -ne 0 && res="$r"
done
exit $res

Now the bzgrep file is a program that will be able to grep bzip2 compressed textfiles. BUT there is a problem.

bzgrep program WILL NOT recognise ordinary textfiles or gzip compress textfiles. This is a major problem! It means you have to compress all your textfiles with bzip2 in order to use bzgrep program.

Luckily there is always a solution in Linux. All we have to do is alter the program to be more choosy on which decompression program to use. ie. Do it uses gzip -cdfq or bzip2 -cdf

Now change the last few lines again to resemble this

 
res=0
for i do
  case "$i" in

  *.bz2 )
      if test $list -eq 1; then
        bzip2 -cdf "$i" | $grep $opt "$pat" > /dev/null && echo $i
        r=$?
      elif test $# -eq 1 -o $silent -eq 1; then
        bzip2 -cdf "$i" | $grep $opt "$pat"
        r=$?
      else
        bzip2 -cdf "$i" | $grep $opt "$pat" | sed "s|^|${i}:|" 
        r=$?
      fi ;;

  * )
      if test $list -eq 1; then
        gzip -cdfq "$i" | $grep $opt "$pat" > /dev/null && echo $i
        r=$?
      elif test $# -eq 1 -o $silent -eq 1; then
        gzip -cdfq "$i" | $grep $opt "$pat"
        r=$?
      else
        gzip -cdfq "$i" | $grep $opt "$pat" | sed "s|^|${i}:|" 
        r=$?
      fi ;;
  esac
  test "$r" -ne 0 && res="$r" 
done
exit $res
Finally, this is the contents of a working bzgrep program.

Steve


Re: Linux on PalmPilot

Date: Sat, 17 Oct 1998 17:00:37 -0600 (MDT)
From: "Michael J. Hammel", mjhammel@graphics-muse.org
In a previous message, dino jose says:
Hi... Mike, I read your article about the Linux in palm pilot.Its very intersting.Iam kind of new in LINUX platform! Because Iam so curious about Linux. I bought a palm pilot 111 the new version of palm with 2meg of memory.the main problem is, I don't know where to get the Linux operating system that it runs on palm pilot 111 the newer version. what about the HOW TO LINUX DOCUMENTATION FROM from its official site? Once I get this software do I run this in Linux operating system then transfer this to palm 111? Iam kind novice in Linux. If you could help me.I would gladly appreciated. Thanks a lot....
Actually, you don't run Linux on the PalmPilot itself (although there is a project to do so - I don't know much about that however). You run Linux on your PC and transfer data files between the Linux system and the Pilot. You still run the same programs you normally would *on* the PalmPilot - it's just that you can transfer these programs and their data file to the Pilot using tools on Linux.

Don't let using Linux confuse you. You use Linux in the same way you use Microsoft Windows - it runs on your PC to do word processing or spreadsheets or whatever. You then pass data files back and forth the the Pilot using special tools.

If you want to try out a program that helps transfer files back and forth you can try my XNotesPlus. Its a sticky notes program that will allow you do backups of your Pilot to your local hard disk and will transfer the Address database from the Pilot to be used in doing some simple printing of envelopes. You can download the program from http://www.graphics-muse.org/xnotes/xnotes.html. You will also need to get the PilotLink software that I described in the article you read. XNotesPlus uses PilotLink to do the actual data transfers to and from the Pilot.

Hope this helps.

Michael J. Hammel, The Graphics Muse


Red Hat 5.1 + Acrobat Reader 3.01 HOWTO

Date: Thu, 22 Oct 1998 22:55:27 -0400
From: Louis-Philippe Brais, lpbrais@grm94.polymtl.ca

Some people I know went nuts trying to install Acrobat Reader 3.01 as a helper app in Netscape, as shipped with Red Hat Linux 5.1. Here's how I've done it:

1. Download Acrobat Reader 3.01 from ftp.adobe.com. Let the installer script install the whole thing under /usr/local/Acrobat3.

2. Create the following shell script: /usr/local/Acrobat3/bin/nsacroread

 
    #!/bin/sh
    unset LD_PRELOAD
    exec /usr/local/Acrobat3/bin/acroread $* >$HOME/.nsacroread-errors
2>&1

3. Don't forget to make this script executable:

 
    # chmod 755 /usr/local/Acrobat3/bin/nsacroread
4. If the directory /usr/local/lib/netscape doesn't already exist, create it.

5. Copy (exactly) the following two files into this directory.

mailcap:

 
      #mailcap entry added by Netscape Helper
      application/pdf;/usr/local/Acrobat3/bin/nsacroread -tempFile %s
mime.types:
 
      #--Netscape Communications Corporation MIME Information
      #Do not delete the above line. It is used to identify the file
type.
      #
      #mime types added by Netscape Helper
      type=application/pdf  \
      desc="Acrobat Reader"  \
      exts="pdf" 

Note: You can do without the last two steps and instead configure the helper apps with the Edit >> Preferences menu of Netscape. This will create similar .mailcap and .mime.types files in the user's home dir. But IMHO the first method is best because this way you can configure Acrobat Reader for all users at once.

Cheers,
Louis-Philippe Brais


2 $.25 tips

Date: Thu, 22 Oct 1998 11:19:22 -0600
From: Bob van der Poel, bvdpoel@kootenay.com

1. I was having some real problems with Netscape (3.04 Gold) the other day. No matter what I did, I could not get the helpers to work. Somewhere in the back of my mind, I knew that they had worked in the past, but I couldn't see anything that I'd changed. A few messages on various newsgroups turned on the lights: I had upgraded my Bash to 2.0.0--and this version has a bug in it. Expressions of the form ((..) .. ) are interpreted as arithmetic expressions, rather than nested sub-shells. Upgrading to 2.02.1(1) was almost painless and fixed the Netscape problem.

To get 2.02.1(1) go to the gnu site (www.gnu.org) and follow the links to the software sections. The new software should compile out of the box (it did for me). One problem I had was that the install script put the new binaries in /usr/local/bin, and since I had my old versions in /usr/bin they weren't found. A quick mv solved that.

2. For a number of years I've been struggling trying to read the results of color-ls on my xterm screens. A number of the colors (green and blue) were just too bright to read. I didn't want to turn down the brightness of my monitor...so I mostly just squinted. For some reason I was looking at the XTerm.ad file, and noticed that the colors could be adjusted! The XTerm.ad file should be located in /usr/lib/X11/app-defaults (or something similar). It is read each time a new xterm start up and sets various options. If you look near the end of this file you'll see a number of definitions for the VT100 colors. I changed:

	*VT100*color2: green3
to
 
	*VT100*color2: green4
and
 
	*VT100*color6: cyan3
to
 
	*VT100*color6: cyan4
Like magic, the colors are darkened and I can read the results. If you don't want to fool with your global default file, you could also just add the entries to your ~/.Xresources file.

--
Bob van der Poel


S3 Virge/DX and XFree

Date: Mon, 26 Oct 1998 00:56:25 -0500 (EST)
From: "Andy K. Jalics", ab212@acorn.net

I had a S3 Virge/DX, and couldn't get it working well in XFree. This made me very mad since there is a specific XFREE_S3V (S3 virge server).

I used a borrowed Xaccel, but it made me feel guilty real quick. :) So I decided that I need to get XFree configured well, and then ditch Xaccel. I found that xfree86config can not be well used to configure a Virge.

Here are the modelines I use for a mid-range 17 inch monitor @ 16bpp using the SVGA server. *WARNING* If this blows up your monitor/card, It's not my fault, although it shouldn't.

 
   Modeline "640x480"    31.5   640  680  720  864   480  488  491  521
   ModeLine "640x480"    31.5   640  656  720  840   480  481  484  500 -HSync -VSync
   Modeline "640x400"     36     640  696  752  832   480  481  484 509 -HSync -VSync
   Modeline "800x600"     40     800  840  968 1056   600  601  605  628 +hsync +vsync
   Modeline "800x600"     50     800  856  976 1040   600  637  643  666 +hsync +vsync
   Modeline "800x600"    60.75  800  864  928 1088   600  616  621 657 -HSync -VSync
#  Modeline "1024x768"   85.00 1024 1032 1152 1360 768 784 787 823
   Modeline "1024x768"     85.00   1024 1052 1172 1320    768  780  783 803
#  Modeline "1152x864"   85.00   1152 1240 1324 1552   864  864  876  908
   Modeline "1152x864"     85.00   1152 1184 1268 1452    864  880  892 900
This cured me of using Xaccel, and should cure your S3 Virge blues. P.S. A S3 Virge can go up to 1600x1000?

Andy


Published in Linux Gazette Issue 34, November 1998


[ TABLE OF 
CONTENTS ] [ FRONT PAGE ]  Back  Next


This page maintained by the Editor of Linux Gazette, gazette@linuxgazette.net
Copyright © 1998 Specialized Systems Consultants, Inc.