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

More 2¢ Tips!


Send Linux Tips and Tricks to gazette@linuxgazette.net


How to Extract the Hardware address of Ethernet card in Linux.,

Mon, 5 Feb 2001 11:31:22 -0800
Dan Wilder (The Answer Gang)

Vinayaka.B.S. wrote:
Dear Sir.,
Can u please guide me in the issue of extraction of Hardware address of Ethernet card in Linux by providing a code for the above., I'm using Linux 6.0 Hedwig Edition.,

Thanking You.

If you can get the card detected by the kernel at all, and successfully ifconfig'ed, ifconfig can then show you the hardware address:
root@dilbert:/proc/net$ ifconfig
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:3924  Metric:1
          RX packets:3295144 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3295144 errors:0 dropped:0 overruns:0 carrier:0
          Collisions:0

eth0      Link encap:Ethernet  HWaddr 00:60:97:9D:36:98
          inet addr:192.168.1.3  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:744305466 errors:40 dropped:0 overruns:2 frame:67
          TX packets:760536636 errors:0 dropped:0 overruns:0 carrier:365
          Collisions:11443106
          Interrupt:10 Base address:0xe000

-- Dan Wilder


Reading Tapes From Another Operating System

Mon, 05 Feb 2001 02:35:29 -0600
Jim Dillon (jdillon from maxbaud.net)

If the tapes were created on an AS/400 they are probably in EBCDIC whereas your PC is probably using ASCII. I have successfully used the "dd" command to read tapes from an IBM mid-range computer. Depending on how the tape was created it may have "header records" in front of the data. One way to proceed would be to take the tape to an AS/400 and print a "VTOC" (volume table of contents). This would show the block size, etc. Try the "dd" command to read the tape. Also, try the "non-rewind tape option" (look in the /dev directory for your tape drive device, if it is "mt0" the non-rewind device is probably "nmt0". The non-rewind device allows you to position the tape read/write head to a particular file on the tape, rather than each read or write request re-winding the tape back to the start). It would be something like this "dd if=/dev/nmt0 of=myfile ibs=32768 obs=32768 cbs=512 conv=ascii".


if = input file
of = output file
ibs = input block size
obs = output block size
cbs = convert block size (This is the record length of the records coming in from the tape, so you need to know the record length.)
conv = ascii (This tells the "dd" program to convert the data to ascii).

Using nmt0 instead of mt0 will cause the tape head to not re-wind so you can read the next file on a subsequent "dd" command.


Mon, 05 Feb 2001 12:09:38 -0500
Joe St.Clair (ksimach from ksimachine.com)

This is in response to a question from Layton Davis in the Feb., 2001 issue about reading tapes from other OS'.

The first question I would ask is how (software - command) is Layton attempting to read the tape? I often read tapes from Sun, AIX, HP, and others on my Linux box. The tapes have all been created using "tar".

I set the block size for all tapes to "0" -
mt -f /dev/st0 setblk 0

I have to do this every time I load a new tape.

I have 3 tape drives. The first uses old QIC-6150 tapes, very old but still works great. The second is a 4mm DAT tape drive. The third is a 8mm DAT drive, but I don't believe the type of drive will matter.

I have been using Linux to read CAD data from the different flavors of Unix for about 4-5 years and have had to use the same method of setting the block size from the start. Some tapes may not need to have the block size set in this way but by setting it I can read anything that doesn't have a problem on the tape.

Joseph St.Clair - KSI Machine & Engineering


A bit of help for Ling Ling

Sun, 04 Feb 2001 23:40:10 -1000
Ben Beeson (beesond001 from hawaii.rr.com)

Hello Answer Guys,

I was catching up on your column recently and I noticed the below in the January edition (edition 61)of Linux Gazette.

Ling Ling asked,

... I have a RH 6.2 server running as FTP server. Upon customer response, I will have to send certain syslog message to their LAN account, like say admin@system.com.

Depending on what Ling Ling needs mailed from from the log file, "Logcheck" from http://www.psionic.com may be just what Ling Ling needs. I use this tool to selectively e-mail to myself at home and at work certain logfile entries from /var/log/messages and /var/log/secure. The logcheck utility can be trained to parse the logfiles for messages of various formats. That way, you don't have to send the complete logfile, only the entries you need to worry about. For my case, I am now aware of ftp connections, ftp file transfers, and various questionable connection attempts against services that I do not run, or otherwise reperesent signatures for possible attacks. I even get the source IP address and hostname logged from some other utilities that I run to try and keep up with my system's status. All this shows up in my e-mail at preselected intervals and sure beats wading through the complete log file everyday.

Hope this helps,
Ben Beeson


REF: The Answer Gang - issue 63 - 5-linux anti virus

Fri, 23 Feb 2001 01:44:36 -0500
Ed Wiget (ewiget from rhpstudios.com)

I just came acrossed an article in which a person asked about antivirus software being used on a mail server to check mail destined for Windows machines. One that I have tried, used, and recommend for just that is made by Kaspersky Labs/Central Command. The link is http://www.avx.com You can use gui or command line virus scanning, and it can be configured using cron jobs to scan individual folders, times, frequency. In my personal evaluations of more than 30 antivirus software packages for various operating systems and network topologies, the AVX line always ranks right up at the top. The Windows version has network scanning built-in, and the linux version can also scan NFS/Samba shares. The cost for full version is less than $50.00. They also have a trial version too for evaluation.

--
Thank You for Your time,
Ed Wiget
Senior Network Security Adviser


$0.02 tip: tab width toggling in vim and emacs

Thu, 15 Feb 2001 08:25:19 -0700 (MST)
Theodore Roth (troth from verinet.com)

When reading code written by other people, I often have to change my tab width setting in vim and emacs to make everything indent like the original author intended. To make this a simple, single key operation, I added the following to my .vimrc and .emacs files.

Here's the .vimrc addition:

See attached misc/tips/tabstops.vimrc.txt

Note that the ^M is a single character (generated in insert mode with CTRL-V<return> ; ).

Here's the .emacs version:

See attached misc/tips/tabstops.emacs.txt

Both of these use the F1 key, but it should be obvious how to change it to another key.

Enjoy.

Theodore Roth


Looking for packages ...

Mon, 12 Feb 2001 22:57:29 -0600
Chris Gianakopoulos (The Answer Gang)

Antonio Sindona wrote:
Hi,
I'm actually looking for the following packages:
1) An application performance analisys tool, to understand the load for each process in terms of CPU, mem and so on.
2) A simulation tool (something better than the SIMULA67 language ...)
3) A network monitoring tool (possibly with graphic interface ...)

May You suggest something to me (possibly free software) ?

Thanks

Hey Antonio,

I cannot answer your first two questions. As far as a network monitoring tool is concerned, do you only need packet sniffer functionality. For LInux, there is a tool called ethereal. It collects packets and can dissassemble those packets.

If a packet sniffer (for IP traffic) is not your desired goal, I will venture to guess that you really want a network monitoring tool which determines the health of your network. An example would be an SNMP (Simple Network Management Protocol) manager. An example of this would be HP OpenView. HP OpenView costs lots of money, and I am only citing this tool as an example of a network manager. SNMP network managers (the software) can display graphs of data throughput and all kinds of other stuff by retrieving variables from an abstract database called a MIB (Management Information Base). Is this what you desire?

You can also monitor network traffic (in a kind of raw form) by using tcpdump. See the man page for tcpdump for its usage. I use tcpdump when I am doing network troubleshooting.

I performed a search on www.google.com (a wonderful search engine) and got lots of hits. One interesting site that it found was at:
http://rak.isternet.sk/win/linux-netman/monitoring.html

I hope that this stuff helps you, Antonio.

Good luck, Chris Gianakopoulos


2c tip: universal X server and X on tv

Sun, 11 Feb 2001 08:24:57 -0800
Reiner Hammerschmidt (reiner.hammerschmidt from web.de)

hello,

here's a 2c tip for all who are lookin for a appropriate X-server: for a long time I was looking for a working X-server for my ATI rage fury card. But then i have heard of the wonderful framebuffer device which makes it possible to get nearly every graphics card to speak X. So I added fb device to my 2.2.14 kernel, made the devices and the magic began. In addition both 640*480 and 800*600 sizes appeared on my tv screen also :-) And all color depths are selectable. Detailed description can be found on the SuSE faq pages. Now I'm very happy i can also play (sound) with Tux in the living room.

Cheers, Reiner


Deleting directories with invalid names

Mon, 29 Jan 2001 15:41:21 -0800
Steve Johnson (steve from bbdltd.com)
Mike Orr and
Heather Stern (The Answer Gang)

To delete the directory, just specify the entire path;

rmdir /home/-h

Or use option "--" to signify no more options. Many GNU commands follow this convention.
rmdir -- -h

-- Mike

You don't have to remember to run pwd to figure out where "here" is. ./-h (dot slash dash h) would also get rid of the annoying -h filename, by referring to the current directory (dot).

-- Heather


Baffled & A Rather Unique Query in January 2001 Issue

Wed, 31 Jan 2001 18:48:14 -0700
Claude baker (cabaker from home.com)

Baffled - When I first connected a Linux (RH 5.1) to a cable modem 18 months ago I experienced the same "problem" logging on - no password required. I formatted and reloaded 5 times in a month before I built a firewall. The requirement for a password has remained intact since I put a firewall between me and the Internet. By the way, the "experts" recommend reformatting to fix a compromised system unless you have a clear picture of precisely what happened.

A Rather Unique Query (I hope) - I recently upgraded from RH 6.1 to RH 7.0 on one of my systems and had no graphics after the upgrade. After a bit of exploration, I found that RH 7.0 has switched to XFree86 Version 4.0. Version uses a new driver model and there aren't yet many drivers available. With a visit to XFree I found Version 4.0.2 which included a driver for my old Trident 9660.

Claude Baker


FreeSCO: "Free Cisco"

Tue, 06 Feb 2001 17:22:32 -0800
taylor864 (taylor864 from yahoo.com)

First, let me comment that I think TAG is exceptional. I stumbled upon it by accident, and ended up reading every question and answer, and after this email, will be going to look for previous months.

Glad you like it. I take it you have a passing interest in Linux. Would you like to join The Answer Gang and see questions as they are received throughout the month, and help us hash out answers to them?

(This model won't scale past a couple of dozen gang members --- but we're O.K for now).

Actually, getting folks their answers individually scales great! We get a lot more people their answers than we used to. But I'd need an Editor Gang after a while. -- Heather

Anyhow, in reference to one of the questions asked about a firewall (Firewall for a SOHO From Tom Bynum), you suggested a 3 legged Linux box to do his routing / Firewalling. There is a free router / firewall called FreeSCo (stands for FREE ciSCO) (http://www.freesco.org) that is essentially a firewall on a floppy, with support for a DMZ. I uses (I believe) masq and IPChains. Runs a mimumum of services, etc. You most likely already knew about it, but I thought I'd pass this along (since the guy lives by your mom and all). Have a good 'un.

-Ray

I'd heard of FreeSCO and read a bit of their material over a year ago. I have to say that (reviewing their new site now) they seem of have come a long way. I'm also familiar with LRP (Linux Router Project) and it's derivative, Coyote --- which are listed on the the distributions pages at Linux Weekly News (http://www.lwn.net)

I hadn't realized that FreeSCO was specified designed for three legged firewalls.

-- Jim Dennis


LILO problems

Tue, 06 Feb 2001 10:30:25 +0000
Shane Kennedy (skenn from indigo.ie)

This may well be irrelevant, but I spend a lot of time swapping drives around on embedded systems, and the usual cause for the "LI" crash is that I haven't changed the system bios to match the drive currently connected.

Keep up the good work

Shane Kennedy


Wanted Firewall Access, a script

Wed, 07 Feb 2001 19:00:18 -0600
Brad Felmey (bradf from i-vic.net)

http://linuxgazette.net/issue62/lg_mail62.html#wanted/1

You need to be root for all of this.

Firstly, get a copy of ipmasqadm if it isn't already on the machine. Not sure?

rpm -qa | grep ipmasqadm

It's either there or it isn't. If not, RPMs are available for those who don't do source. http://rpmfind.net is your friend.

Now then, we need to make a script that runs on bootup. I generally put all my firewall rules in a file /etc/rc.d/rc.firewall. First, a bit of security:

chown root:root /etc/rc.d/rc.firewall
chmod 755 /etc/rc.d/rc.firewall

My machine doesn't need this next part, but in case yours doesn't run it automatically, open up /etc/rc.d/rc.local with the text editor of your choice, and put at the bottom:

/etc/rc.d/rc.firewall

Now, on to the script itself. This only covers the portforwarding stuff, since it appears you have NAT working just fine otherwise.

See attached misc/tips/portforward.sh.txt

Hope this helps, and hope I didn't misunderstand or misread the question. Good luck. -- Brad Felmey


renaming ethernet devices - Feb 00 issue

Thu, 8 Feb 2001 22:47:10 -0800
Greg Nash (greg.n from cybereps.com)

I had the same problem with 2 ne2000 compatible cards in the same machine - my solution (I think under RH5.2 at the time - don't know if it's still relevant) was to add the following to my conf.modules

alias eth0 ne
alias eth1 ne
options eth0 -o io=yxyyy irq=zz
options eth1 -o io=yxyyy irq=zz

the -o was the part that took some researching

Greg Nash



Sat, 10 Feb 2001 00:00:41 +0100
Eduardo Perez (eduperez from retemail.es)

I was reading this article of your column, when an idea hit me: what about the mac address?

You can read the mac address from each card to identify them, and use that information to configure them properly (I have not tried this, as I do not have any ethernet card around here).

I hope this helps.


NTPDATE binaries for solaris 6

Thu, 22 Feb 2001 09:41:06 -0800 (PST)
Heather (The Answer Gang)

Hi,

I have a question of where can I get the solaris version of this binary.

This is the Linux Gazette. Unless Solaris has added Linux binary compatibility (and it might have, we dunno) we probably aren't the right place to be asking this.

We do have Linux for Sparc if you think it would help... including boxed sets from a couple of vendors.

Your cooperation will be greatly appreciated.
Art.S

I think there's an archive of toys for Sun at:
http://www.sunfreeware.com

...but I don't know any more about it than that. Good luck.

-- Heather Stern


Trying to build a crash course...

Tue, 13 Feb 2001 08:06:45 +0000
Kevin Matthews (kevin.matthews from panasonic.co.uk)

Hi Matt & TAG

If you purchased the Mandrake as a packaged distro, then you should have their included books, which are a good kick off. If not look at:

http://63.209.80.231/en/72doc.php3

However there are 4 titles I have found very good for solving problems and overcoming the obstacles (sp?) of the adventure that is Linux:

Linux for Windows NT/2000 Administrators: the Secret Decoder Ring
Sybex International
ISBN: 0782127304
Running Linux
O'Reilly UK
ISBN: 156592469X
Linux in a Nutshell
O'Reilly UK
ISBN: 0596000251
RHCE Linux Exam Cram
Certification Insider Press
ISBN: 1576108287

The first is a good all round tour for windows savvy people. the second two are virtually the standard refernce works ( I tried several other introductory titles before 'Running Linux' but they were not as good ) and the last is a good reference to test your progress and point out areas to investigate.

Regards

Kevin Matthews


SGID Directories

Sat, 10 Feb 2001 04:43:02 -0800
Jim Dennis (The Answer Gang)

Jim,

Sorry to bother but one of your postings brought a question to my mind...

"Any directory that is SGID will automatically set the group ownership of any files created in that directory to match that of the directory. This means that your webauthors can just create or copy files into the directory and not worry about using the chgrp (or chown) commands. "

Does that further affect its subdirectories?

Regards,
Terry Lee

Yes. Creating an SGID directory under Linux will normally make that group association of the directory become the default group assigment on new files that are created thereunder (if the user making creating the files or making those directories is a member of the associated group). In addition subdirectories below that point will also "inherit" the group association and the SGID setting.

BTW, although it would be silly to create SGID directories that were world writable it does work. Users who are not members of the associated group can create files and directories but they will be associated with their primary group (as normal) and their subdirectories will not "inherit" the SGID setting).

It's really much easier to see by experimentation than to convey by explanation.

The main purpose for this behaviour is to allow users to create shared project directories. In conjunction with the umask command/setting it's possible for users ensure that the other members of their team will be able to write to selected files and directories by default.

-- Jim Dennis


smtp

Mon, 5 Feb 2001 15:45:21 -0800
Don Marti (The Answer Gang)

Don Harvey wrote:
I am trying to setup a Linux IPChains firewall for an NT network. I can get everything working except SMTP mail from the Internet. It stops at the Linux box and is not forwarded to the Exchange Server. What should I use?

Run an SMTP bastion host on your "DMZ" network to handle all mail passing in and out. Don't expose your internal "full-featured" mail server to the outside. If you have one box filling both the roles of firewall and bastion host, this will work too.

Mick Bauer's explains in LJ:
http://noframes.linuxjournal.com/lj-issues/issue78/4241.html

-- Don Marti


Mandrake Linux and Cable modems - LG Feb 2001

Tue, 13 Feb 2001 07:52:38 +0000
kevin.matthews (kevin.matthews from panasonic.co.uk)

Hi Ian & TAG ,

Mandrake 7.2 has a utility to set up Internet sharing accessable via the DrakConf control panel. This would seem to be the easiest way to link the PCs to the net.

I have yet to use this myself as I am still investigating the other things included with the 7.2 distribution; however I think you will find the new DrakConf much better than the previous version, and easier to use.

The (very brief) Mandrake Documentation Page ref:
http://63.209.80.231/en/doc/72/en/user.html/drakgw.html

I couldn't find any more detailed info.

Hope this helps

Kevin Matthews


Memory mystery? lots of tips

Fri, 16 Feb 2001 15:54:42 -0400
Alberto Ortiz (tarlong from hotmail.com)

Something like this happened to me. I solve it by downloading a newer kernel and changing the lilo.conf like you did. Im also told that you may fix this by recompiling your kernel. This happened to me with Red Hat 6.2 (which, by that way, has kernel 2.2.14) so, i dont think it is an isolated problem. Good luck, hope this could help you out.

alberto ortiz
tarlong@hotmail.com



Sat, 17 Feb 2001 05:40:07 -0500
Sean (snmjohnson from iclub.org)

Hello,

Are you remembering to run lilo after editing lilo.conf? While this may seem like a silly question, I've done this very thing more times than I like to admit.

Also, you might want to consider upgrading your kernel to either 2.2.18 or 2.4.1.

Sean



Thu, 8 Feb 2001 17:34:40 +1300
Glenn (genright from paradise.net.nz)

I could be wrong as linux newbie myself but,

In my bios (Award) there is a setting for PNP OS under the PNP/PCI page. I set this to No and had no problems with installing either windoze or linux. I beleive it forces the OS to detect the system without relying on the BIOS settings.

Good luck :-)

This should not make any difference to memory detection - since IRQ and DMA are not involved in that process - but overall, this is a good tip that bears repeating. I've had problems with several machines, one with my own AMS TravelPro 150 laptop (Linux would not detect the ESS1688 sound card) until "Plug-and-Play-aware OS" was set to "No". In all the above cases, Windows, even though it was set up with the "PNP OS:On", had no problems with any of the installed hardware.

-- Ben Okopnik



Thu, 08 Feb 2001 17:39:21 +0100
Roman Delaveaux (Delaveaux from heagmedianet.de)

Hello Answer Gang,

probably I have the solution for Jan Jakubik with the memory problem. I was wondering when my linux-box detects only 12 MB of RAM in an 384MB-RAM-machine. I checked my BIOS-settings and disabled "Memory hole at 16MB" . Now everything is fine.

Mit freundlichen Gr&uuml;&Beta;en
Roman Delaveaux


distro version upgrade? (slackware)

Mon, 26 Feb 2001 18:37:09 -0800 (PST)
Heather Stern (The Answer Gang)

Dan Blazek wrote:
Hi,
I think I'm running Slackware 2.2 (kernel is 2.0.27 for sure

anyway). Is there some kind of cluster or patch bundle I can download to upgrade my box. Like a single package I can install to at least jump up to slackware 3? And if there is.. can you please tell me where to find it, and if there is there a special way to install it? Or am I going to be stuck installing a new image?

I thought there wasn't one, but rarely say so without looking. And what do you know, I found:

slackUp - The Slackware Auto-Upgrade Utility
http://xfactor.itec.yorku.ca/~xconsole/download.html

You should read its readme yourself, to check that it can handle your version. If it can't. get involved with the authors ... they haven't updated it in almost a year (or at least the webpage) and you may spark an entirely new round of development for the project.

-- Heather

Thanks, Dan.


script on linuxgazette.com

Sun, 4 Feb 2001 23:42:11 -0600
Chad Whitten (cwhitten from intop.net)

Chad Whitten wrote:

trying to get the script you put on linuxgazette.com to work on my linksys dsl/cable router

lynx -auth=\ :admin http://10.1.1.10/Status.htm -dump

when i do this, it doesnt connect i have a username/password for the linksys and i tried putting in

lynx -auth=admin:password http://...etc

per the man page for lynx but still get same error message:

Sending HTTP request.
HTTP request sent; waiting for response.
Alert!: Access without authorization denied -- retrying
Retrying with access authorization information.
Looking up 10.1.1.10.
Making HTTP connection to 10.1.1.10.
Sending HTTP request.
HTTP request sent; waiting for response.
Alert!: Can't retry with authorization!  Contact the server's WebMaster.
Can't Access `http://10.1.1.10/Status.htm'
Alert!: Unable to access document.

lynx: Can't access startfile

after some playing around, i got it with

lynx -auth=\ 'admin\:password' http://10.1.1.10/Status.htm -dump

Yep, those single quotes are really handy for preventing the shell from running off with your colons, alright. -- Heather


Makes Windows Explorer Choke - fix!

Sun, 4 Feb 2001 04:49:07 -0000
Man in a BOX @ Crosswinds (miab from crosswinds.net)

Had this problem myself when I partitioned my drive for Linux (fips). It's caused because doze uses its own timings for each drive and is stored in the IDE controler driver in your system / control panel - it assumes that the physical drive will never be paritioned so it never checks to see if the logical size has changed.

Just remove this from Control Panel prior to a Linux installation / re-partitioning - next time windows loads it will re-discover your IDE controller and install the relevant drivers - no more problem.

Hope this helps

Simon


FIPS is getting old, try Parted

Sat, 03 Feb 2001 00:33:34 -0800
Hugh Daniel (hugh from xisp.net)

Well after several serious skirmishes MS-stupidity lost today! It turns out that the new FSF/GNU parted (use freshmeat.net...) does a better quicker job of shrinking both file system (FAT32 in my case) and partition the FIPS, and all the MS-shit tools!

Note though that this is Mondays release of parted, but it works and quite cleanly. It's not a real end user tool, but it got the job done.

Yea.

So now I have RedHat-7.0 installing on my new laptop, it should be a very cool toy. Thanks for the support of just being there.

Jim, you might want to point out in Answer Guy that FIPS is dated, that most folks don't know what they are talking about and that parted soves the problem quite nicely.

Later.
||ugh

Okay. I've copied TAG on this reply. I haven't played with parted. However, I haven't been running Linux on mixed system recently either. All of my recent system have been pure Linux (or non-PC's).

I also haven't noticed any recent questions for which "FIPS" would have been an answer. So any old TAG issues that referred to FIPS are probably also quite dated.

-- Jim Dennis


This page edited and maintained by the Editors of Linux Gazette Copyright © 2001
Published in issue 64 of Linux Gazette March 2001
HTML script maintained by Heather Stern of Starshine Technical Services, http://www.starshine.org/