...making Linux just a little more fun!

<-- prev | next -->

More 2 Cent Tips!

See also: The Answer Gang's Knowledge Base and the LG Search Engine


Pushing Files To Multiple Hosts

Sun, 07 Mar 2004 20:46:45 -0500
Sean Johnson (sean from gutenpress.org)

While it might be overkill for your situation, this is a perfect place to use cfengine ( http://www.cfengine.org ).

Perhaps I should write up an article for Linux Gazette? :)

Cheers,

Sean

[Thomas] You're more than welcome to do so. Author submission guidelines can be found in the FAQ, found here:
http://linuxgazette.net/faq/author.html


Connecting Mac OS9/10 to a Linux Samba Domain

Thu, 05 Feb 2004 12:22:12 +0300
Thomas Adam, Breen Mullins (The LG Answer Gang)
Question by JG Nasser Olwero (jgnasser from mpala.org)

I run Samba 2.2.3a on RH Linux 7.3 as the Domain Controller. I have all my Windows clients connecting fine to it but have trouble with Mac clients, no idea how to log them on. I also attempted to have the Mac client connect to the Linux POP3 and SMTP server (Sendmail) to no avail probably because the Mac is not welcome on the network. I am connecting the Mac using wired ethernet to a Network switch.

[Thomas] You need to ensure that you're using the 'appletalk' protocol. This has to be enabled in the kernel. There are also userspace programs that are needed for this.
http://ftp.linux.org.uk/pub/linux/appletalk
might be of interest.
Hope That Helps
[Breen] You don't use AppleTalk to connect to a POP or SMTP server. That's pure TCP/IP.
If we're talking about a Mac OS X client, that comes with Windows filesharing built in. Classic Mac OS is of course a different problem.
Actually, MacOS X knows how to speak Samba/mswin sharing now too; their client side tool is called DAVE, and it used to be third party software for MacOS 9. If you want to install Mac style sharing on your Linux box, the app you're looking for is called netatalk. I used it years ago and it was a breeze to setup - had 'em working faster than their mswin cousins in the same office. -- Heather
[Breen] If you're using OS X you can call up a connect dialog with Cmd-K and enter the address smb://<ip_of_server>. You'll need an IP address, of course -- check your network preferences pane to make sure.
Beyond that, you're probably looking at a Mac client issue. You might try asking for help at a Mac specific site. (I recommend http://forums.macosxhints.com, if you're using X.)


CDROM not seen by RH9

Thu, 11 Mar 2004 16:29:46 -0500
Thomas Adam (The LG Weekend Mechanic)
Question by Joseph Lalingo (ah300 from torfree.net)

Hi,

I installed RedHat Linux 9 via the cd-rw, successfully, but the cdrom was not seen. I know the cdrom is still connected internally as I haven't interfered with the system's insides (which came with a a cdrom and cd-rw) internally. The cd-rw is understood to be the cdrom and there is now NO /mnt/cdrom1 but there IS a /mnt/cdrom.

The cdrom door does not open, yet the light of the cdrom is on.

Joe

[Thomas] "The lights are on but there's no one home". /mnt/cdrom is the mount-point location of your cdrom drive. It is arbitrary and you can use anything you like. These are defined (or should be) in /etc/fstab.
If you look in that file, you should have a line similar to:
/dev/cdrom      /cdrom          iso9660 ro,user,noauto          0       0
Here, /dev/cdrom is in turn a symlink that points to my main cdrom device: /dev/hdd. This then gets mounted to /cdrom, when I issue the command:
mount /cdrom
I suspect your troubles come from you missing an entry in /etc/fstab. If you wanted to mount the second drive as /mnt/cdrom1, then look at the existing line in the /etc/fstab file, and modify it to reflect the new drive.
The device name (/dev/xxx) can be got from viewing:
dmesg | less


In Short, Dig This

Wed, 31 Mar 2004 01:45:38 -0800
Jim Dennis (the LG Answer Guy)

Possibly there's not a sysadmin around who hasn't needed to do a host lookup now and then, to make sure they know what addresses are really being found when a DNS lookup is made.

nslookup is deprecated, host can be confusing, dig is the nice tool for the job - regardless of attempts to claim it is old too, it will be around a long time. But who really wants to get a long listing full of semicolon comments and things?

; <<>> DiG 9.2.3rc4 <<>> linuxgazette.net
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 605
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2

;; QUESTION SECTION:
;linuxgazette.net.		IN	A

;; ANSWER SECTION:
linuxgazette.net.	86400	IN	A	64.246.26.120

;; AUTHORITY SECTION:
linuxgazette.net.	86400	IN	NS	ns1.linuxmafia.com.
linuxgazette.net.	86400	IN	NS	ns1.genetikayos.com.

;; ADDITIONAL SECTION:
ns1.linuxmafia.com.	61864	IN	A	198.144.195.186
ns1.genetikayos.com.	61864	IN	A	64.246.26.120

;; Query time: 153 msec
;; SERVER: 216.240.40.162#53(216.240.40.162)
;; WHEN: Wed Mar 31 01:39:18 2004
;; MSG SIZE  rcvd: 144

Unless I'm tracking the path of authority rather than just checking the address, I don't care either.

(jimd@phobos) ~$ dig +short a linuxgazette.net
64.246.26.120

Short, sweet, and to the point. Replace "a" with "mx" or "ns" as you please, but this is a lot handier for scripting; I don't have to invoke my talent for awk and grep one-liners on DNS checks anymore.


DNS proxy/cache (Tip)

Tue, 16 Mar 2004 00:11:33 +0100
Karl-Heinz Herrmann (kh1dump from khherrmann.de)

Hi,

I had an annoying little problem: My home network has grown to 3 PC's -- one directly on the phone line, the others connected via WLAN. Usually I would pick one dial-up provider and stick with that. Unfortunately the German ISP's are a big mess of call-by call providers with constantly changing tarifs.

The directly connected box is only the dial-in and firewall/NAT Router, the other two are my Laptop and desktop.

The annoying problem: Everytime I change the provider I had to change the resolv.conf on all systems according to the new nameservers as transmitted via [i]ppp protocol.

My solution: dproxy
http://dproxy.sourceforge.net

It serves as a proxy/cache for DNS lookups. It uses regular sys-calls for namelookups and reacts instantly (no kill -HUP or similar) to new entries in /etc/resolv.conf. This is on the router of course and everytime pppd changes the resolv.conf for the new provider it simply uses the new values.

The other two machines have the router as the nameserver and always get the correct information (even offline, so a connection is of course not possible). No manual changing anymore.

K.-H.


Making filenames lowercase

Wed, 31 Mar 2004 10:05:38 -0500
Ben Okopnik (LG Technical Editor)

Sometimes, despite our best eforts with "unzip -L", we end up with a bunch of files the names of which are ALL IN CAPS. The easy way to deal with these is with a simple utility that I call "lc". (Also, should you ever need such a thing, creating a complementary "uc" would be an obvious modification.)

#!/usr/bin/perl -w
# Created by Ben Okopnik on Fri Jul 25 09:13:22 EDT 2003

die "Usage: ", $0 =~ /([^\/]+)$/, " <FILE[S]_TO_LOWERCASE>\n" unless @ARGV;

rename $_, lc for @ARGV

Note that you can specify multiple files or even shell wildcards at the command line; it's perfectly happy to chew on whatever you supply.


measuring the temperature in your computer room

Wed, 17 Mar 2004 13:12:23 -0800
Yan-Fa Li (yanfali from best.com)

Hi,

I've found a useful side effect of running smartd on my drives at home which I've used for a while now to monitor the temperature in my apartment. A lot of newer IDE drives, especially IBM/Hitachi's and SCSI hard disks monitor the drive temperature. I've found this to be a useful way to figure out how hot it is in my computer room at home :D

Assuming you've already installed smartmontools, this was tested with version 5.26:

# smartctl -a /dev/hda | grep 194
194 Temperature_Celsius     0x0002   161   161   000    Old_age
Always       -       34 (Lifetime Min/Max 20/37)

As you can see the drive is a toasty 34 degrees celsius. Of about 5-7 degrees above ambient, it's about 27-29C or 80-85F in that room right now. Not great for the equipment but survivable. Anyway, not terribly useful, but interesting nonetheless :D

Yan


Troubleshooting mail delivery

Thu, 1 Apr 2004 22:33:59 -0500
Ben Okopnik (LG Technical Editor)

There are times when the mail just won't go through, for any of a host of reasons. Your ISP's server may be down, your own mail programs don't work, whatever - and of course, this happens at the most critical times, "when it absolutely, positively has to be there." Well, assuming that your recipient's mail server is working, you can bypass most of the chain - at least your end of it. This can also be a good testing tool. It lacks a few refinements (e.g., there's no subject and the address you supply is actually used as the normally hidden "From" header rather than the friendlier and visible "From:"), but it will at least get the content across.

ben@Fenrir:~/Docs$ telnet badabing.com 25
Trying badabing.com...
Connected to badabing.com.
Escape character is '^]'.
220 badabing.com ESMTP Postfix (Debian/GNU)
HELO myserver.net
250 badabing.com
MAIL FROM: [email protected]
250 Ok
RCPT TO: [email protected]
250 Ok
DATA
354 End data with <CR><LF>.<CR><LF>

Hi, Joe - it's me!

.
250 Ok: queued as D1F8F160B4
QUIT

To recap - I connected to port 25 (SMTP) at badabing.com, identified my server via HELO ("hello"), to which the server responded with its own name. I then told it who the MAIL was FROM: and who the recipient (RCPT) is supposed to be, and asked it to stand by for the actual DATA, which it told me to end with a return, a period, and a return. When I was done, I typed "QUIT" to exit.

This is not for everyday use, but can be a very handy tool for those times when you've just got to get your mail across despite problems.


vmlinuz from when and where?

Wed, 31 Mar 2004 01:45:38 -0800
Heather Stern (The Answer Gang's Editor Gal)

In my consulting I find myself running into an awful lot of systems booting off of 'vmlinuz' in the root directory. What kernel is that? How the heck would I know?

I'll tell you how I ask it :D

[root@somebox] /# strings vmlinuz | grep 200
2.6.0-test7-1-386 (herbert@gondolin) #1 Sun Oct 12 10:29:56 EST 2003

Why does this work? Because now that we're a few years into the century, nearly all the kernels contain something with a year 2000 or later, and we'll have 200n year numbers for a while yet. On an older system, try 199 - Linux isn't old enough to have kernels from 1980 unless someone is playing serious games with their clock. You could probably look for the @ sign, but chances are too good of finding one alone somewhere in the binary portion of the code.


This page edited and maintained by the Editors of Linux Gazette
HTML script maintained by Heather Stern of Starshine Technical Services, http://www.starshine.org/

 

Copyright © 2004, . Released under the Open Publication license unless otherwise noted in the body of the article. Linux Gazette is not produced, sponsored, or endorsed by its prior host, SSC, Inc.

Published in Issue 101 of Linux Gazette, April 2004

<-- prev | next -->
Tux