More 2 Cent Tips & Tricks LG #45

Rate this post
% split -C1k lasg-0-0-9.pdf lasg-0-0-9.pdf
%ls -al Total 655
drwxrwxr-x 2 vocalist users 9216 Aug 21 08:53 .
drwxr-xr-x 20 vocalist users 2048 Aug 21 08:50 ..
-rw-rw-r-- 1 vocalist users 0 Aug 21 08:53 data
-rw-rw-r-- 1 vocalist users 292529 Aug 21 08:50 lasg-0-0-9.pdf
-rw-rw-r-- 1 vocalist users 898 Aug 21 08:52 lasg-0-0-9.pdfaa
-rw-rw-r-- 1 vocalist users 738 Aug 21 08:52 lasg-0-0-9.pdfab
-rw-rw-r-- 1 vocalist users 1024 Aug 21 08:52 lasg-0-0-9.pdfac
-rw-rw-r-- 1 vocalist users 1024 Aug 21 08:52 lasg-0-0-9.pdfad
[Lots and lots of lines not shown. -Ed.]
-rw-rw-r-- 1 vocalist users 1020 Aug 21 08:52 lasg-0-0-9.pdfno
-rw-rw-r-- 1 vocalist users 1000 Aug 21 08:52 lasg-0-0-9.pdfnp
-rw-rw-r-- 1 vocalist users 118 Aug 21 08:52 lasg-0-0-9.pdfnq 
Jimmy O'Regan chimes in:
You can find out more by typing "man split" or "info split".
But in your case you'd probably want to try
$ split -b 1380k your.file your.file.
 So it'll split the file "your.file" into files of 1.38m in size (ideal for
floppies), named your.file.aa, your.file.ab and (etc if you use
a different size). 
You can rejoin them with
$ cat your.file.aa your.file.ab & your.file
Remco Schellekens suggests:
dd will do the trick.
Use it in the form:
dd if=your-input-file of=first-out-file skip=0 count=2840
dd if=your-input-file of=second-out-file skip=2840 count=2840
dd if=your-input-file of=third-out-file skip=5680 count=2840
 ...and so on. 
Assuming blocksizes are 512 bytes, so the count of 2840 is approx. 1.4 Mb To get the file back just use cat command:
cat first-out-file > your-file
cat second-out-file >> your-file
 ... and so on 
of course it will be a bit easier if you make a shell script of it.
Thats it.
Roland Smith also suggests:
3) Zip the file and use zipsplit to split it into files that will fit on a floppy.
Hope this helps.

lil2cent-1046095 ANSWER: Formating drives

Tue, 03 Aug 1999 22:43:10 +0100

From: Murray Gibbins
if e.g. your LS120 is on /dev/hdb try
mksf -t ext2 /dev/hdb
or some variant thereof.

lil2cent-1046095 ANSWER: Kodak Problems

Tue, 03 Aug 1999 22:48:24 +0100

From: Murray Gibbins
Investigate using Perl and ImageMagick, it will automate the proccess and do everything you want.
Zak responds:
I would like to thank each and every person who responded to my question about using gimp with the subject disk. The problem was that when I put the images on the HD (using Mcopy, since the Kodak(c) Picture Disk is a DOS/'doze thingee), they were upside-down (and I later found *were* left to right), and that I couldn't figure out how gimp worked. I use RH 5.1.
One of the replies suggested I try 'xv', so I looked in my RH5.1 manual, and found on page 6 that it had been replaced. I checked out my 5.1 CD (I bought the 'official box') and guess's there! I tried it and it not only flipped the images 'rightsideup', but can also flip 'em right-to-left, and much more. Now here's the kicker: about two weeks ago I put another roll of film in and requested the disk when it was processed. When I got the pix and disk back, I stuffed the disk into FRED and called up 'xv' so that I could flip the pix again.
They were all set up correctly on the disk! I didn't have to do anything with them. Do you think maybe someone from Kodak reads Linux Gazette, too?

lil2cent-1046095 ANSWER: Installation problems

Tue, 10 Aug 1999 17:13:27 +0200

From: Michael Planes
Hi, I hope you already had an answer from the net. Otherwise, I just got last week the very same problem with a quadri Xeon and 1GB of RAM:
scsi : 0 hosts
scsi : detected total
Partition check
VFS: Cannot open device 08:21
Kernel panic: VFS: Unable to mount root fs on 08:21
 Many reboots later (and many configuration changes) I finally succeeded
when I added an option when booting linux kernel:
   linux mem=128M expert
I checked on the web that other people already had this problem and fixed it (removing memory, adding boot option, etc...) It would have been nice if such an information had been clearly available at RedHat. I hope it will be. bye,

lil2cent-1046095 ANSWER: DNS on the fly

Tue, 10 Aug 1999 17:13:27 +0200

From: Jim Bradley -- Maryville, MO USA
I have my laptop configured to plug into the network of my employer. At home, I plug my laptop into my home network, and dial out from another machine setup for dial on demand. Unfortunately, if it takes forever waiting for the two timeouts when trying to connect to the employer's DNS servers from home, and if I change the DNS order, it takes just as long for the timeout error when attempting to connect to my ISP's DNS from my employer's network. Is there an easy way to change the DNS servers when needed? It's easy enough to change IP addresses with the ifconfig command, is there a similar means for changing the DNS? Or, should I just bite the bullet and setup BIND on the laptop?
My apologies if it doesn't - I've made enough changes to my setup that I could have automated it myself. I don't keep multiple copies of /etc/resolv.conf yet get the correct DNS server. I know for certain that DHCP makes the update.
The only change I _remember_ making that's related to this is I generate the hosts file at bootup, since the only thing I keep in my hosts file is localhost and the hostname. Primarily because the long hostname can change based on which network I'm connected to (or even not connected at all).
C Ted Wise replies:
Your DNS server(s) are defined in the /etc/resolv.conf file. If you're using DHCP or PPP, this should be updated automagically with the correct server. If you're defining everything by hand, you'll need to modify this file to reflect the correct DNS server. Changes to the file may not be reflected in already running programs (daemons).
If you're not running a DHCP server on your home network, consider one, it will greatly ease the pain of moving the laptop between locations.
The Linux Gazette Editor writes to Ted:
Since when did Linux PPP start automagically updating the DNS server? Windows does this, but in my experience Linux does not. You have to have several /etc/resolv.conf files, and use a symbolic link to point to the "current" one. You can have a shell script that does this and calls pppd.
Ted responds:
I've been using the KPPP dialer under KDE and that one definitely makes changes to the /etc/resolv.conf file. When it makes a connection, it modifies the file - commenting out the existing lines and adding ones applicable to the PPP connection. When you exit the application, it restores the original file.
From the comments in the file, it looks to be behavior specific to KPPP. This is where my confusion came in. My home server is running DNS and masqs through to the PPP interface so the /etc/resolv.conf file doesn't change based on the PPP connection. It's only my laptop that needs this and I was making the assumption (I know, I know) that KPPP was just a pretty face on PPPD.

[Conclusion: pppd knows nothing about /etc/resolv.conf. KPPP rewrites it on the fly. DHCP does the Right Thing somehow automatically. Any more comments? -Ed.]

Ernst-Udo Wallenborn suggests:
i use the SCHEMES facility of the PCMCIA package to solve a related problem: how to use a laptop in two LANs with different IP addresses, different domains, and (naturally) different DNS servers.
Basically you set up a file /etc/pcmcia/network.opts which contains all network options, esp. something like
case "$ADDRESS" in
Then, when booting with lilo you can append SCHEME=home or SCHEME=work, or better write this into /etc/lilo.conf directly. and type 'home' or 'work' at the lilo prompt.
The whole procedure is described in detail here:
and the PCMCIA package is available here:
hope this helps
-- Ernst-Udo Wallenborn Laboratorium fuer Physikalische Chemie
ETH Zuerich

lil2cent-1046095 ANSWER: ipchains

Tue, 10 Aug 1999 15:19:38 -0600

From: Warren Young
"Martin L. Ferguson" wrote:

I saw your « $0.02 Tip » response in Linux Gazette (copied below), but the URL for the « scipts » section was not included. Could you send it to me – I would like to look at a comprehensive ipchains configuration. Thanks.


From the Gazette:

I think perhaps you are missing a few important rules, such as rules to allow DNS replies. My own script for enabling masquerading and firewalling is available at the URL below, in the « scripts » section.

The URL my message mentions was in the signature. It is apparently the policy of the Linux Gazette to chop signatures from messages, so it didn't appear in the Gazette. (I'm Cc'ing this message to the Gazette's editor, in case they want to fix that page.)
The URL is
The scripts I refer to in my original message are "firewall-enable" and "firewall-disable".

[Added the URL to the previous article. The directory also contains some other scripts to tar a directory, replace tabs with spaces, do a hex dump, etc. And yes, I do chop off signatures. 🙂 -Ed.]


lil2cent-1046095 ANSWER: gcc will not work

Fri, 13 Aug 1999 00:25:55 +0200 (CEST)

From: Roland Smith
I saw your e-mail in the Mailbag section in the Linux Gazette.
I think you have not installed the binutils package. This contains some programs that gcc needs to make executables out of a bunch of object files.
Hope this helps.

lil2cent-1046095 ANSWER: DHCP

Fri, 13 Aug 1999 00:33:38 +0200 (CEST)

From: Roland Smith
Concerning your question of adding a Linux workstation to a network that uses DHCP:
You probably have a mini-HOWTO available (if you have installed them, which is wise): /usr/doc/HOWTO/mini/DHCPcd.gz
You'll need the DHCP client. Check if it is available in your distribution, or get it at from the directory /pub/PC-UNIX/Linux/network/dhcp
If you're using Red Hat you can use the control-panel to set up eth0 for DHCP.
Hope this helps!

lil2cent-1046095 ANSWER: ppp connection

Fri, 13 Aug 1999 00:43:42 +0200 (CEST)

From: Roland Smith
You wrote:

I have an interesting problem. I have configured ezppp, kppp, and gnome-ppp to connect to my mindspring account, and all three seem to be doing so just fine. However, when I startup netscape or any other internet application, I can’t access the internet. It just sits there trying to lookup the host. No error message. No nothing. I am completely stumped. Any help would be appreciated.

Some things you could look at:
  1. Do you actually make a connection with ppp before starting netscape? You’ll need additional software if you want to be able to dial in automagically every time you try to reach the internet.
  2. Have you added your ISP’s name-server to /etc/resolv.conf?
  3. he /etc/host.conf file configured correctly? It should consist of these two lines:
    order hosts,bind
    multi on
Hope this helps!

lil2cent-1046095 ANSWER: ASCII to speach

Fri, 13 Aug 1999 01:34:06 +0200 (CEST)

From: Roland Smith

From your mail in the Linux gazette it is not clear what you’re looking

Your subject line says you're looking for ascii to speech conversion. For that you could try "rsynth" or "festival". (look at for URL's)
Voice recognition software for Linux is something else altogether. I think IBM has released some software for this.

[Thanks, Roland, for all your answers. -Ed]

Jimmy O'Regan adds:
ASCII to speech and speech recognition are complete opposites, but you can find most software available for Linux for either purpose at the BLINUX site - or at

lil2cent-1046095 ANSWER: 2GB Limit in LINUX

Thu, 19 Aug 1999 16:08:23 -0700

From: Greg Morse
This limit does not apply even if the BIOS does not support the large drive. I recently added an 8GB drive to an old Compaq prolinea 133. the DOS fdisk could see the drive but not use it. Linux (RH6.0) however happily created an 8GB filesystem on the drive.
Niels Elgaard Larsen writes: 1. It is _not_ down to the BIOS. You can just give the geometry as arguments to 'fdisk' 2. Do not trust the information from the maker of the disk. I installed a 10 GB IBM disk. The geometry printed on the disk and shown on IBM's web-side was identical to the geometry of their 8GB disk. I think they rely on special software to make it work on Windows. I assumed sectors and # of heads were correct and computed # of cylinders from the capacity and fed it to cfdisk. It works.

lil2cent-1046095 ANSWER: Windows 98 inside Linux

Sat, 21 Aug 1999 08:39:45 -0400

From: Brian
Dear Markus,
If you'll visit, you'll see their product VMWare - written up in the July 1999 issue of Linux Journal, or for subscribers
VMWare will allow you to run a number of different Virtual Machines on top of your Linux box. See the web page for the details. Oh - the price is $299, I'm considering it so that I can test Java on a Windows platform without actually having Windoze in control of my hardware. :)

lil2cent-1046095 ANSWER: Distributions

Wed, 25 Aug 1999 01:18:59 -0400

From: Steve Wolfe
Someone more knowledgeable than I could probably tell you the exact differences between Suse and Red Hat. There is more activity on Red Hat.
A more important question is, "What Distribution are people around you using?"
Unix/Linux is not too hard to learn - but it is different than windows. Try to find a User's group and/or computer store that has Linux around and then you can see it and talk to people. I liked the book "Life with Unix" to give a good grounding on what to expect. The O'Reilly books are invaluable. I also like the printed collections of the Linux Documentation project containing the System's Administrator's Guide and the Network Administrators Guide and the How-tos.
I used to the idea of a dual boot system - so you can use either Linux or Win xx, but not at the same time. This works for a while. The drawback is that you cannot use both at the same time. The best order of events (briefly) is 1) partition, 2) install Winxx 3) install Linux and Lilo.
Two machines are better yet. With a small LAN you can then telnet or use an X-windowing program to use both machines - This is what I do now. Several X-server programs exist for Windows. Hummingbird's Exceed, Reflection's X-windows suite, and StarNet's (x-win32) are three good ones and I have used all three.
I have heard some use of virtual machines (vmware makes one) in which you can use two operating systems at the same time on the same machine - but I have not tried it.
After reading the documentation you can mount a FAT partition from Linux and use it as a way to transfer data back and forth between machines. If you have two machines the network takes care of the file transfers. Remember that a Unix/Linux text file has only linefeeds and a PC-DOS text file has Carriage return and Linefeed.
Steve Wolfe

lil2cent-1046095 ANSWER: WORD to Postscript

Thu, 01 Jul 1999 14:14:54 -0400

From: Reno Derosier
In regards to the .prn file you might try downloading Adobe's Postscript drivers for windows at
Reno Derosier

lil2cent-1046095 ANSWER: g++ and including files that use templates

Wed, 4 Aug 1999 00:13:59 -0700 (MST)

From: Rachael A. Ludwick jac writes:

Hello, my question is about the g++ compiler.I want to know if is able to link files that use templates and then aren’t included in the main program (they are in different files, and only the header files are in the main program). I have try as:

         gcc main.cxx libro.cxx
        * main: #incude "libro.h"...
        * libro.cxx: #include "libro.h"...

But the compiler of Red Hat 6.0 gives me an error. Could you help me? Thanks.

Juan J.Alejandro ( Girona (Spain)

I'm not sure if this will help, but here goes...
An annoying thing about C++ is that templated classes require that both the declaration and the implementation be in the same file. Instead of actually putting both in one file, often the header file will have the line:
#include ""  // or whatever the implementaion file is called
 near the end of the file (after the declaration of the class). In this
case though, the implementation usually goes in a file called
"class.template" and #include "class.template" will be put in "class.h"
somewhere near the end of the file (after the complete declaration of the
Also, don't forget to guard your class from multiple include-ing by putting something like this as the first two lines:
#ifndef MYCLASS_H
#define MYCLASS_H
 and something like this as the last line: 
#endif // MYCLASS_H
Anyway, if you have the implementation and declaration in separate files, and you don't have this yet, than this may be your problem. Assuming this will fix your problem and you have a "" and templated "class.h" and "", you should be able to compile with:
g++ -I.
(of course assuming has #include "class.h").
Tell me if this helps...
Rachael Ludwick
"Go Ye Lemmings into the World and Propagate!"
This page written and maintained by the Editor of Linux Gazette, Copyright © 1999, Specialized Systems Consultants, Inc.

Published in Issue 45 of Linux Gazette, September 1999
indexnew-4754845 homenew-6964751 back2-9849208 fwd-8727977