[ Prev ][ Table of Contents ][ Front Page ][ FAQ ][ Next ]

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


More 2¢ Tips!


Send Linux Tips and Tricks to gazette@linuxgazette.net


2cent-tip: sendmail configuration

Sat, 26 Aug 2000 13:00:28 +0200
From: Matthias Arndt <matthiasarndt@gmx.net>
Dear Editor,
I've got another 2cent tip for the Linux Gazette.
Many people have problems with the configuration of sendmail. As far as I have learned about it yet, you can use the file genericstable in the folder /etc/mail (or where your sendmail config files are) to map local email adresses to email adresses on other servers.
#format of the file:
#<local email adress> <real email adress>
marndt@jerry.aknet.de matthiasarndt@gmx.net
My file looks like the one above: all email written under my local account (marndt) appears to come from my Internet email.
A nice feature in sendmail..... and it makes things easier to set.
hope this one helps, Matthias


2c tip followup

Fri, 11 Aug 2000 19:28:04 -0400 (EDT)
From: Matthew Willis <matt@optimus.cee.cornell.edu>
Tip: 2up printing in netscape
In the last 2c tip, Sudhakar Chandra (thaths@netscape.com) is indeed correct about
psnup -c -n 2 | lpr -pprinter
working as well as
pstops -q -w8.5in -h11in -pletter "2:0L@0.7(8.in,-0.1in)+1L@0.7(8.in,4.95in)" | lpr Both will 2-up output from netscape.
The only difference is in size of the output. In the former, the pages are 50% as large as the original, whereas in the latter the pages are 70% as large. I find the larger print (70% scaling) more readable than the 50% one, but your mileage may vary.
Thanks,
Matt Willis


vim tip

Thu, 27 Jul 2000 11:04:59 PDT
From: Adam Monsen <meonkeys@hotmail.com>
This is straight outta the vim manual, but is buried enough to possibly warrant a 2 cent tip.
Dos files have <CR> <LF> at endlines,
Mac files have <CR> at endlines,
Unix files simply have <LF> at endlines.
So who cares? Vim automagically understands any file upon loading. But... You're using UNIX. When you have to send a colleague a text file (and they have a mac or Windows box), first issue the following command... :set fileformat=x where "x" can be "mac" or "dos". then save the file.
-Meonkeys


256 is real

Tue, 22 Aug 2000 08:16:35 -0400
From: David Meyer <dlmeyer@pop.mindspring.com>
You published the following: On Tue, Jul 18, 2000, James Strong wrote:
In studying ip addressing I come across the reference of 255 and 256. if all ones (11111111) = ? if all 0s (00000000) = ?
How does one come up with 256 sometime and 255 other times?
-confused
There are no "256"s in valid IP addresses.
IP addresses are 32 bits, and are written in 4 octets of 8-bit numbers expressed in decimal form. The biggest possible 8-bit number is 255, which is 2^7 + 2^6 + ... + 2^1 + 2^0.
A good explanation of IP addresses is in the Linux Network Administrator's Guide, available in your favorite Linux distribution or from linuxdoc.org.
-- Don Marti
You have gone way overboard to create a convoluted explanation where a simple one would do. There ARE 256 possibilities for an eight bit number. Not all are 'valid' for an IP address, but that is another question. The reason the highest number is 255 is because the lowest is -0- (ZERO), not -1- (ONE). When you start counting with zero, the amount of numbers counted is one more than the number reached. SO, you could do the 2^7+2^6+... bit, or you could reach the same valid answer with a simpler 2^8-1.


Syslog for Linux

Tue, 1 Aug 2000 19:22:17 +0200
From: Anthony E. Greene <agreene@pobox.com>

I am running Red Hat Linux 6.2 & am trying to get a syslog server running.

I have limited Linux knowledge & just want to get it working to log messages from cisco devices. Do you know of the commands to get it working.

Edit your init script (/etc/rtc.d/init.d/syslog) so that syslodgd starts with the option to allow remote logging. See syslogd man page for details.


Windows Rescues Linux?!

Tue, 22 Aug 2000 19:07:16 -0700
From: Mike <10ram@888.nu>
Dennis,
Somehow, while flailing about in a kernel upgrade, I managed to corrupt the boot.p? file. After 2 days of struggling and 8 hours of searching, I was finally able to correct the odious "hangs at LI" problem only by booting from a Windows 95 diskette and using 'fdisk /mbr' and then booting from a linux diskette and running 'lilo'.
In the meantime I read through dozens of posts on the subject and worked all kinds of strong ju-ju:
-I used 'linear' -I set the BIOS to 'AUTO' and then back to 'LBA', -I put 'disk=/dev/hda <tab> bios=0x81' in my lilo.conf -I ran linux 'fdisk' and rewrote the partition info -on and on and on.
I had seen the '/mbr' fix earlier, but discounted it because the instructions didn't mention that it could be used even if you're not dual-booting. I finally found the tiny bit of info I needed at
https://www.wzz.org.pl/~lnag/en/FAQ.htm#LILO_stops
Thanks anyway for all of your help and I hope you pass this on.
Is there really no other way to fix a corrupt mbr?
eek. Don't tell Linus. ;)
MjM

The debian package "mbr" is an MBR only, which defaults to booting your active partition, but press SHIFT and you can choose a partition, or to boot from floppy. Sweet -- Heather


Well known Port numbers

Mon, 31 Jul 2000 22:37:45 -0400 (EDT)
From: Steven W. Orr <steveo@world.std.com>
All services are listed in the /etc/services file. There's a man page for it and it's the datafile which provides the basis for the getservbyname(3) and the getservport(3) calls.
Specifically, port 109 is pop2 and port 139 is netbios-ssn. The other ports are not listed in my services file.


Memory Holes ??

Wed, 16 Aug 2000 21:49:25 +0200
From: Kees van Veen (kvv@casema.net)
Hello there, I allready read in an earlier posting, that somebody also had problems with memory holes. I have a compaq proliant 2500 with 256 MB and it only reads the first 16 MB. If you know alittle about linux you proberbly would say add a kernel parameter with the amount of RAM and the job is done. But this doesn't work, the machine works fine for half an hour and later when the memory use increases the machine trips over the hole and crashes.
I heard that there would be some kind of patch .. Does anybody know something..??

Thanx, greetinx,

Someone proposed a kernel patch to allow Linux to deal with bad memory because of damaged SIMMs. Check the Kernel Traffic (kt.linuxcare.com) archives for that. A great place to look for patches is linux-patches.rock-projects.com but I didn't see it there. -- Heather


Palm Desktop

Wed, 16 Aug 2000 18:37:53 -0700
From: Dennis Andrews <oligarch_one@yahoo.com>
Is there, or is anybody working on, a poting of Palm Desktop to Linux. I will be switching to Linux on my new system then converting my old one to Linux (both Red Hat), but I can't get by without my Palm. What to do?

There are lots of utilities to link to Palm Pilots, but if it's Palm's Desktop you definitely want to use, check out jpilot, and you should feel right at home. -- Heather


sendmail/fetchmail Caldera 2.4 problem

Wed, 02 Aug 2000 08:25:17 -0400
From: Robert Findlay <fcsoft@attcanada.ca>
My Caldera 2.4 installation is going to be used to test (all bash scripts) a web application which transmits a confirmation email. This Caldera 2.4 is a citizen on a Microsoft Exchange email network. For sake of argument lets say the relevant info is:
hostname: caldera24.mydomain.com Microsoft mail server: 10.0.0.2 DNS server: 10.0.0.18
At present I can send a test email to bfindlay@mydomain.com using the text based mail program. When I view the /var/log/mail file I see that sendmail has correctly sent this mail on to the Microsoft Exchange Server at 10.0.0.2. I then want to use fetchmail to bring the mail back to my test box (I want to ultimately script the whole test so I need to stick with text based programs).
However fetchmail and the log both report the following error:
SMTP error: 451 bfindlay@mydomain.com Sender domain must resolve
Any ideas are welcome. Thanks.

This is an antispam feature. If a machine's number does not resolve in what is called "reverse DNS" and thus map to a name, it may not be a real host on the internet at all, so Exchange is ignoring the mail. Lots of companies have hosts that they don't want the whole world to know about, though they might want their inside servers to know them this way - for this, use an inside DNS server that contains more information for your zone than the one outsiders are allowed to see. It's often called "split DNS" because the early implementations of it involved hacking on the DNS software a bit.

Or, much easier, you could send your test mail from a host which really reverse resolves correctly. -- Heather


network and broadcast addresses

Thu, 24 Aug 2000 15:03:56 -0400
From: tarun pahuja <tpahuja@guesswho.com>
If someone gives me an ipaddress and a subnet mask, what would be the easiest way to calculate the network and the broadast address for that subnet.
thanks

First apply the mask. The idea is that the mask is a binary number that results from having 1's all the way down to a certain point. If it's a normal class A, B, or C, it's easy - everywhere that the mask says 255, use the number from the IP address. Where it says 0, no bits are allowed to leak through, so use 0.

The result is your network value. Your gateway is often the next address (1 greater than the network number). However you should check - some places swap broadcast and gateway (the broadcast is usually the highest legal address in the range). -- Heather


overclocking

Fri, 11 Aug 2000 23:43:22 +1000
From: Greg Hand <greghand@tpg.com.au>
Hi! These sites will give you more than you need.
www.arstechnica.com bxboards.com www.overclockers.com www.overclockers.com.au www.tomshardware.com
Regards
greg

This concludes our recent Danish translation thread. Thanks everyone! -- Heather


ftp to restart failed transfers

Mon, 31 Jul 2000 22:26:52 -0400 (EDT)
From: Steven W. Orr <steveo@world.std.com>
Get hold of lftp. (I happen to be running lftp-2.2.4-2mdk) It's a great improvement over regular ftp. But note that the regular ftp client would also solve your problem. The reget command will fetch a file from where a current version was left off. As far as what the RFC provides, the only thing that I am aware of that the regular ftp client does not provide is the ability to transfer a file from one remote machine to another remote machine.
But once you use lftp you'll never go back. It uses the readline library, it does filename completion, it will background transfers, plus a lot more.

I use ncftp. It automatically tries to recover the partial download if you issue the "get" command again. Start ncftp and type "help get" to see the options. -- Mike


Common Modem Problem

Tue, 8 Aug 2000 15:22:17 -0500
From: "Jonathan Hutchins"

The point here, is a solution for problems that look like it may be a winmodem, but it's not. -- Heather

One common problem with Modems when migrating to Linux is IRQ conflicts. Many ISA Network Cards default to IRQ3, commonly used by the modem. Under DOS/Windows, this shows up as a non-working Network card, or may be overcome by a plug-and-play configuration utility for the network card.
Under Linux, the Network card comes up first, and it's the modem that won't work. This can be very frustrating for a new user, since "everything works fine under Windows", and nothing indicates what the problem is with the modem (usually Linux utilities will just report that it's "busy").
Make sure that the Modem and NIC are hard-configured or at least have their ROM permanently set to different IRQ's, and the light will begin to dawn.


True Modems

Sun, 06 Aug 2000 22:05:00 GMT
From: carl smith <kershawsmith@hotmail.com>
Just read a reply about a true modem. I've been searching for one ever since a friend mentioned it to me. He has an ISA True modem. And wouldn't you know it mine is not. It's a PCI and so far no luck finding a PCI True modem. Any ideas on where I might score one?
Hoping for the right answer,
KershawSmith

There's a HOWTO on Winmodems!!! https://www.ssc.com/mirrors/LDP/HOWTO/Winmodems-and-Linux-HOWTO.html --Mike

All the thing says is, "buggy proprietary drivers exist for _two_ modems. Any others, you're SOL." -- Ben

That's less than exciting news; there's better and _far_ more informative info at https://www.linmodems.org and https://www.o2.net/~gromitkc/winmodem.html - and they provide links to quite a bit of very creative software that lets you get a number of other uses out of winmodems (e.g., DTMF enc/decoder). --Ben

Okay, so maybe it should have been an Answer Gang thread, but it is rather short. The Gromitkz site has an excellent set of guides about buying real modems in chain stores. It appears there may be support for 3 of these incomplete modems now, but it remains to be seen if any of them will port their efforts to the 2.4 kernel.

The state of the art in forcing Lucent's modems to work is

In short, yuck. -- Heather


re: HELP: Crontab not running nested executable

Fri, 11 Aug 2000 09:44:59 -0500
From: John McKown <JMckown@healthaxis.com>
One question. In "file1", do you specify the entire pathname to "file2" in order to run it? The reason that I ask is the quite often "cron" does not have the PATH that you expect. This generally results in a "file not found" type error.
Hope this helps some,
John McKown


And on the same topic, but a different tip...

Crontab not running nested executable

Wed, 2 Aug 2000 12:30:52 -0400
From: Pierre Abbat <phma@oltronics.net>
The most likely reason is that the path is different or something else in the environment. Stick an env command in File1. The output should be sent to you by email from the cron job. Compare it to the env when you run File1 yourself. I usually write full paths in cron scripts for this reason.
phma


Port numbers

Wed, 2 Aug 2000 22:34:46 -0400 (EDT)
From: Kurt <khockenb@linux.cc.stevens-tech.edu>

The proper place to find port numbers is the Internet Assigned Number Authority, at https://www.iana.org/

The page you are looking for is https://www.isi.edu/in-notes/iana/assignments/port-numbers

Chris Gianakopoulos <pilolla@gateway.net> adds:

There exists a good list of well known port numbers for TCP and UDP. It is called (of course!) The Assigned Numbers RFC. Here's the easiest way to find it. Go to a site such as www.excite.com, and search for: RFC1340

You will get lots of hits that reference RFC1340.html. This RFC (an acronym for Request For Comments -- I know, I know, you probably already knew that!) has your information and a ton of other assigned numbers such as protocol numbers, magic numbers, ........


Rawrite script

Thu, 3 Aug 2000 13:52:38 -0400
From: <APeda@INTERPUBLIC.COM>

I've been coming across those boot (raw) images quite a bit lately, and as I move toward an all GNU/Linux solution, I find that saving images of certain DOS formatted diskettes is quite useful. So, in part as an exercise in using getopt (1) , I decided to write a script wrapper around dd.

Here it is, for what it's worth: rawrite.sh


255 or 256 IPs?

Thu, 3 Aug 2000 12:05:20 -0700 (PDT)
From: James Blackwell <jblack@insyncla.com>

While you are of course correct regarding the fact that an octet can not exceed 255 for obvious reasons, what I think he was referring to is that some texts (particularly newer ones) refer to 256 possible values.

While you are correct in stating 255 is the maximum, I think you forgot that the minimum isn't 1, it's 0. This leads to 256 possible numbers per byte.


Reading Word files

Fri, 4 Aug 2000 17:18:10 -0400 (EDT)
From: Matthew Willis <matt@optimus.cee.cornell.edu>

Tip: How to view microsoft word files

You can use several programs to translate microsoft word "doc" files to some other format. There is word2x (which works for word 6) or mswordview (which work for MS Word Version 8, i.e. Office97). Or, you can download the free version of WordPerfect which can read many Word files. Another option is to download abiword, which can read microsoft word files. I have automatically configured pine to call abiword on ms word files by editing /home/matt/.mailcap and having this line in it:

application/msword;abiword %s


Windows Install over Linux

Fri, 4 Aug 2000 16:53:39 -0700 (PDT)
From: adh math <adh_math@yahoo.com>

Dear Mr. Train,

This advice may be quite late (your original message is nearly a month old), but I hope you haven't had any problems...

Typically, Windows overwrites the master boot record when it is installed, and I've had worse things happen (like the Windows installer corrupting the partition table). The standard advice is to install Windows before installing other operating systems. It sounds like this isn't an option for you, but please be aware that by installing Windows on top of Linux you're likely to have frightening (or infuriating, if you prefer) problems which may or may not require re-installing Linux and restoring all your user data.

Best of luck, in any case!


Linux-friendly ISPs

Fri, 4 Aug 2000 17:02:27 -0700 (PDT)
From: adh math <adh_math@yahoo.com>

You posted to Linux Gazette about looking for ISPs that allow Linux connections. This isn't much (in fact, probably little more than moral support), but in the Pacific northwest, FreeI.net is Linux friendly, as is nocharge.com. I strongly prefer the former, because 1. They run FreeBSD (instead of Windows NT) and 2. Their modems are better configured (e.g., they answer without ringing four times, and are not always busy).

I'm sure there are counterparts in other parts of the country...


Passwords and SSH

Fri, 4 Aug 2000 17:36:57 -0700 (PDT)
From: adh math <adh_math@yahoo.com>

Dear Mr. Benfell,

Can't help you with POP over SSH, but can perhaps explain why you keep getting prompted for passwords (and why you should be *happy* about it:).

If you're not prompted to enter a password to authenticate a connection, it's because your password is stored on a machine somewhere, often as plain text. In other words, storing your password is like writing your PIN on your ATM card. If you care about privacy enough to encrypt network transmissions with SSH (and you should, with good reason), you probably also care enough not to leave your password written on a scrap of paper next to your computer, or sitting unencrypted on a hard drive (possibly on a publically-accessible server, or on your laptop, where a thief could get access to it by booting with a rescue disk, thereby granting themselves root).

Hope that makes the password annoyance more tolerable, and sorry I can't help you with POP/SSH.
David Benfell <benfell@greybeard95a.com> replies: This problem was solved a long time ago. And I'm well aware of the security issues.

What you can do is run ssh-keygen on each machine that you want to be able to communicate in this way. This produces two files: identity and identity.pub. identity.pub from each machine must be copied into the authorized_keys file of each of the others.

The authorized_keys file can hold multiple keys. Each key takes one line. So you copy the identity.pub file from each machine with commands something like:

ssh-keygen
 scp .ssh/identity.pub user@remote-machine-1:.ssh/1.identity.pub
 cat .ssh/1.identity.pub >> .ssh/authorized_keys

Remember that for this to work, each machine must have a copy of the other machines' keys. So, you then log in to the remote machine and do something similar:

ssh user@remote-machine-1
(enter the password on the remote machine)
ssh-keygen
scp .ssh/identity.pub user@local-machine:.ssh/1.identity.pub
cat .ssh/1.identity.pub >> .ssh/authorized_keys

Why bother?

So you won't have to type the password every five minutes for every POP account you're accessing this way. I have four e-mail accounts and collect several hundred e-mails per day. So I prefer to leave fetchmail more or less continuously running.

I used to do this with fetchmail's daemon mode. But for pop via ssh, this won't work.

So I need to change my .fetchmailrc so it looks something like this (for only one e-mail account):

 defaults
 protocol POP3
 is localuser here
 fetchall
 forcecr
poll remote.server.org port 11110 via localhost user username pass ********
 preconnect "ssh -C -f username@remote.server.org -L 11110:remote.server.org:110 sleep 5"

It needs the password in the .fetchmailrc file but if you have a reasonably secure system, this isn't a tremendous worry. .fetchmailrc cannot be world-readable (fetchmail will reject it if it is). I'm not that worried about people gaining access to my system as long as they can't sniff the password in plain text off the internet (which they can do with normal POP usage, and in my case, it was getting transmitted every five minutes, so the bad guy wouldn't even have to have been terribly patient).

The password still has to be fed to the pop daemon, but this way, it isn't crossing the Internet in clear text for feeding.

Next, create a script like:

#!/bin/sh
ssh-add
while true; do fetchmail; sleep 5m; done

I call mine "getmail".

Then I can do:

ssh-agent getmail

It asks me for the passphrase once, then uses the keys to authenticate my access to the remote systems.


Missing/duplicated keystrokes

Sat, 5 Aug 2000 13:46:55 +0200
From: Tom <tom.mattmann@gmx.net>

after i work with my computer for about 20 minutes or so, i start missing keystrokes and sometimes keystrokes are duplicated

Seems that your Keyboard-Controller is overclocked. If you have an AWARD Bios, enter it pressing DEL when the computer is starting. Select:

-> Chipset Features Setup
 -> KBD Clock Src Speed
  -> 8 Mhz


Regarding Dual-Boot Windows/Linux

Sun, 6 Aug 2000 21:45:56 -0400
From: Robert Day <zarin@support.drlogick.com>

Well, your tips are helpful I have noticed, but I do know one thing about RedHat (In particulay, it's my chosen Distro)

Use FDISK (Windows version is fine) to create a partition LESS than the full drive (Or two hard drives) - leave whatever you need for Linux EMPTY... (Partition Magic to shrink the partition is fine as well) and install Win9x/NT/2k

Then, boot up with yer RedHat CD/Floppy, and install into the empty area... The LILo config will see the Windows install, and add it to LILO for you.. (Install LILO into the MBR - overwriting the DOS MBR) and voila, Dual Boot - It's simply simple..


CB Radio Connection

Tue, 8 Aug 2000 15:07:50 -0500
From: Jonathan Hutchins <hutchins@opus1.com>

You might be able to get a good idea of how to do this by studying the "Amateur Radio" guides for Linux.

In any case, I don't think it can be done with one CB radio, but it could be done with two (at each end).

Please note that doing this may be ILLEGAL. It also violates the FCC rule that requires you to include your license number in each transmission.

One problem with this is that while telephony and modems are "full duplex", which means that both ends can both speak and listen at the same time, CB's are "half duplex", which means when one is "talking", the other must be "listening".

First, you have to separate the "send" and "receive" or "mic" and "earpiece" channels. In a telephone, this is accomplished by having both mic and speaker "live", separated by a biasing transformer so that "your" mic is "louder" on the output to the phone line, and "their" mic is louder on "your" earphone. For CB purposes this would be easiest to accomplish with a modem that was set up for an acoustic adapter - one that you place the telephone receiver in so that it doesn't actually plug in to the phone but produces the equivalent tones through a speaker held next to the headset mic and vice versa.

The send output (or mic output for the coupler) goes to the mic in on one CB, set to say Channel 10, with the Transmit switch strapped "On". At the other end, a CB would be set to listen to Ch. 10, with the output of the speaker or headphone jack going to the earpice or receive circuit. Repeat the process in the other direction on channel 20.

You now have monopolized two CB channels for miles around with earsplitting noise which will bleed across adjacent channels (hence the large interval between send and receive), but you may have reached something close enough to a telephone connection that doing ATH1 on one end and ATA on the other may get you a connection.

If you had a couple of modems capable of doing a synchronous connection, it wouldn't be too hard to wire something up for single-channel use, but it would involve doing some interesting coupling between the sync signal or DSR/DTR pair and the "Send" switch.

On the other hand, there are lots of possible problems here. How do you get that "send" output isolated if you don't have an acoustic coupler? Can you be sure that the modems will sync? What do you say to the guy from the FCC who says he's traced the signal that's jamming everybody's CB's to your rooftop? And it's very likely you can't do more than 2,400 baud because of the limited quality of the connection.

You will find that unless you're a real handy electronics hacker who knows the guts of a telephone pretty well, this will be difficult enough that you'll want to buy the pieces ready made, which means buying the Amateur Radio gear if you can; which still means adapting it, and which means spending real money. Unless your time is pretty worthless, you and your boss would probably be better off purchasing a wireless networking solution from an existing vendor.


Tree script

Wed, 9 Aug 2000 12:49:30 +0200
From: Matthias Arndt <matthiasarndt@gmx.net>

This is a new version of the bash based tree utility which was published in the Linux Gazette about 2 years ago. I've added the feature to display the files inside the directories. This tool displays the whole directory tree below the PWD. You may supply an alternate starting directory on the command line. This is a bash script so it is not very fast. But obviously, it does its job.

tree

To use the script, just cut and paste the code to your favourite editor. Call it tree and make the script executable using chmod u+x. I suggest copying it to /usr/local/bin as root and do a chmod +x on it to make it available to all users on your system. The output goes straight to the stdout. This means you can use I/O redirection to capture the resulting tree to a file.

As on all of my releases of software for Linux, the GNU General Public Licence (GPL) applies to this utility.

[Matthias also wrote an article in this issue about window managers. -Mike]


This page written and maintained by the Editors of the Linux Gazette. Copyright © 2000, gazette@linuxgazette.net
Published in Issue 57 of Linux Gazette, September 2000
[ Prev ][ Table of Contents ][ Front Page ][ FAQ ][ Next ]