
|
Table of Contents:
|
||||||||
|
TWDT 1 (gzipped text file) TWDT 2 (HTML file) are files containing the entire issue: one in text format, one in HTML. They are provided strictly as a way to save the contents as one file for later printing in the format of your choice; there is no guarantee of working links in the HTML version. | |||
,
http://www.linuxgazette.com/This page maintained by the Editor of Linux Gazette, gazette@ssc.com
Copyright © 1996-2000 Specialized Systems Consultants, Inc. | |||
Write the Gazette at gazette@ssc.com
|
Contents: |
Answers to these questions should be sent directly to the e-mail address of the inquirer with or without a copy to gazette@ssc.com. Answers that are copied to LG will be printed in the next issue -- in the Tips column if simple, The Answer Gang if more complex and detailed.
This section was edited by Heather Stern <star@tuxtops.com> aka. "Starshine".
Before asking a question, please check the Linux Gazette FAQ to see if it has been answered there. The AnswerGuy "past answers index" may also be helpful (if a bit dusty).
Rock Linuxhttp://e-zine.nluug.nl/hold.html?cid=59
I've been reading a bit about this Rock Linux distro. Has anybody used it? It's worth some coverage in LG just because it's so different.
Free Linux ISPs RevisitedSome time ago I posted a question asking about free Linux ISPs. Lots and lots of folks were kind enough to write back telling me about FreeWWWeb, a free OS-independent ISP here in the continental USA (THANKS!).
Well, FreeWWWeb just went belly up and is trying to transition its customers to Juno.
That leaves Linux users up a creek since Juno (like all other free ISP software that I'm aware of) is Windows only.
So, once again I ask the question:
"Anyone know of any free LINUX-FRIENDLY ISP's in the continental USA?" A wide variety of access numbers would be ideal since I do travel with my Linux laptop but beggers can't be choosers, as they say. Thanks, all.
can't connect to ISPi have Debian 2.0 and can't connect to ISP though i can connect in Win95. Below is output of plog:
Jun 30 11:47:50 debian pppd[223]: Serial connection established. Jun 30 11:47:51 debian pppd[223]: Using interface ppp0 Jun 30 11:47:51 debian pppd[223]: Connect: ppp0 <--> /dev/ttyS2 Jun 30 11:47:51 debian pppd[223]: sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x7bc2> <pcomp> <accomp>] Jun 30 11:48:18 debian last message repeated 9 times Jun 30 11:48:21 debian pppd[223]: LCP: timeout sending Config-Requests Jun 30 11:48:21 debian pppd[223]: Connection terminated. Jun 30 11:48:21 debian pppd[223]: Receive serial link is not 8-bit clean: Jun 30 11:48:21 debian pppd[223]: Problem: all had bit 7 set to 0 Jun 30 11:48:30 debian pppd[223]: Terminating on signal 15.
[ This would make a great article. There are a fair handful of ppp-connection apps like wvdial and kppp, but no clear documentation or wizard in the form of "The windows user would do ... need to ask ISP 'blah blah blah' ... fill them into <whatever files or dialogs>". Most especially one that would have the user able to successfully beat the "you're using linux? we can't help you then" gantlet at their ISP. (My advice for those: vote with your wallet.) Probably the tech support of every major distro gets asked this sort of thing a dozen or more times a day.
It appears that the ISP-Hookup-HOWTO hasn't been updated since early 1998. The Linux world has changed a lot in the last two years; perhaps someone should become its new maintainer. -- Ed.]
TV-out SupportDear Sir,
I have Asus AGP TNT34000 display card with TV out/in support. It works absolutely fine in Win9x. It also works fine in X-windows. But I am unable to get TV-out support in Linux.
Finally I have change the display card to SiS 6326 (with has direct output feature to tv). I am able to get the command line output to TV. But when I try to run X-Windows, I am unable to see any thing. There can be some errors in XF86Config file regarding PAL/NTSC resolution and frequency settings. Can anyone point me to some web-sites (or documentations) for TV-out support or software.
Can you suggest some other cards, which can give tv-out support. I am using 21" Color AIWA TV.
I would like to see some articles on Tv-in/out(Video in/out) support.
Regards
Santosh Kumar Pasi
A parallel connection.Hi there, My name Sergey, I use Slackware 7.0. I have read a document about serial connection between Win95 and Linux, but never have seen about paralel. Help me, tell me how can I use my parallel NULL modem. Is lp0 the LPT1 port?
Thanks,
Sergey
[ There's a PLIP-install-HOWTO but not one for connecting to Windows, nor even between two Linux boxes that are in a normal installed state. Anyone got something for him?
Oh, and it can't be a null modem, modems are serial. A crossover parallel cord is sometimes called a "Laplink" or "Commander Link" cable, after those popular apps for a certain non-Linux platform. -- Ed.]
'to be cleaned' State of DAT DrivesRequest status of DAT TAPE's 'tape to be cleaned' using a.e. mt (magnet tape) command.
Is it somehow possible to detect the state 'Cleaning required' remotely. The only sign I know is the blinking LED in front of of DAT-Tape. But we have distributed Server and I 'm not happy with the idea to ask the users 'is there some kind of LED blinking in a strange way' while they are in front of allover blinking LEDs and beeping computer speakers. I am shure THEIR answer will never be the answer according MY question.
Thanks
H.Ahrens
CB Radio Internet ConnectionDear answerguys.
My name is Wayne. I work at an ISP in South Africa. The network administrator here told me that it was possible to use a short distance CB two way radio to be able to transfer data between two machines. Is it at all possible u ppl could be so kind, as to mail a way of connecting one of these things to my machine.
Thank you very much
SWAT
Hi Answerguy-
Can you tell me what the PASSWORD page on the SWAT
does? I have some familiarity with Samba, and I have
been to the samba.org site but I still nedd help with
this.
-Doug
Accessing a web server behind a Linux firewallHi there.
I have set up a linux firewall, but one of the things I would like to do with it (which I have so far been unable to accomplish) is access use port forwarding to access a web server situated behind the firewall from a client on the public internet.
I am using ipchains as my firewall mechanism, and have used redir and ipmasqadm with no luck.
I am convinced that the problem lies somewhere in my ipchains scripting, but I am not sure what to look for. I have looked through various howto's and webpages and am stuck.
What I was wondering is if you had a basic ipchains script that works in conjunction with ipmasqadm to forward port 80 through to a web server behind a firewall.
Any help that you can offer would be great!
Darren Hutchings
[ In this case there are almost too many HOWTOs ... which are difficult to read for a complete novice to networking. Numerous tools exist but they expect you to know what logic you want to apply, rather than what results you would like. If one of you gentle readers knows about a useful "wizard" style tool for making sensible ipchains, or a similar one for the up-and-coming netfilters, reviewing it for us would make an excellent article. -- Ed.]
Linux Distros Install ProgramsJames,
I would like to create a Linux distribution from scratch and integrate with it an installer program using my native language. I was wondering if you could assist me in finding installer programs for existing Linux distros ( GUI, cli or curses-based, and whatever language -- shell script, Python, GTK, etc). BTW, are the installer programs of Mandrake, or Red Hat like Anaconda or their curses/text-based programs/scripts GPL'ed too?
Thanks,
Botong San Beda
serial consoles, install, boot, etcOne thing that is really great about Sun hardware is that you can get rid of the monitor, mouse, and keyboard all together and do everything from install the operating system to change EEPROM settings via a serial console. While Intel hardware was never designed this way, I cannot find much information about setting up Linux on Intel to approximate this. Is it possible to install and boot Linux over a serial console? Log-in in this way is easy, but to be able to completely administer a system the install and boot functions are critical, especially the Lilo prompt would be nice.
Re-installing Windows 98 on a Linux (Mandrake 7.0) OS.I have Mandrake 7.0 installed on my IBM compatible PC. I want to take tech. classes with Manpower over the Internet. They told me that they don't support Linux OS, only Microsoft Windows 95, 98, and NT. Do I install Linux Prep Tool and follow the steps to create a dual boot system over Mandrake 7.0? I'd appreciated any help you can give me!
Georges Train
Connection to XServer and sendmailHi,
I got stuck with 2 problems:
1) tried to dump screen content using a cron job. It basically is using ImageMagick command import:
import -display 192.9.101.16:0 -window root fru.tif
However command fails (when run by crond, otherwise it runs from xterm just fine) with following message:
Xlib: connection to "192.9.101.16:0.0" refused by server. Xlib: Client is not authorized to connect to server. import: Unable to connect to X server (192.9.101.16:0).
It should be noted that 192.9.101.16 is localhost. It fails no matter if I'm root or not. What sort of authorization do I need to connect to XServer from cron?
2)My sendmail daemon takes ages to startup. When I checked the log it says few times: May 29 08:52:03 piii sendmail [24126]: My unqualified host name (piii) unknown; sleeping for retry.
It should be noted that piii is the localhost defined in hosts file. Furthermore when I tried to check the mail as a user it says it cannot find the spool file. I can create it manually but is it going to work? What sort of configuration I need to do for sendmail when I need send and receive mail only locally (mail exchange among local users only)?
Thanks in advance,
Jan
procmail arguement listhi,
Ive been able to use procmail when I send the mail to &myuserid+keyword.
Where I assign a variable (say PLUSARG=$1).
I can use the variable PLUSARG to base some procmail recipes.
So what's the question??? well it seems if I us and alieas set up for me and the "+keyword" syntax that procmail doesn't pass the "+keyword" in as the $1 parameter. E.G. $1 is found when I use myid+keyword but not with alieasId+keyword.
thanks,
Scott Lowrie
kppp dialer.Hello Mr. Dennis!
I have had a problem writing a login script for compuserve in kppp dialer
The compuserve login procedure requires that the port bits be set initially to 7 bit and later to 8 bit.
Also, it requires the setting of parity bit.
The kppp dialer help section on login scripts indicates there is a MODE command that make it possible to set the port bits to 7 or 8 bits. But, the problem it is not in the program in the section where you type in the login script. They totally omitted this command. Also, how do you send a ^M(I think this a control M) in the kppp login script? Also, how do handle the parity bits? I am connecting to compuserve but I am getting an error message on the setting of the 8bits.
I AM ATTACHING TO THIS EMAIL THE COMPUSERVE LOGIN SCRIPT IS USE IN WINDOWS 98. THE FILE NAME IS CIS.TXT. THIS IS A TEXT FILE.
I did check with compuserve and Red Hat Software and neither one could help me. I am using Red Hat 6.2. I am using the kppp dialer that came with the Red Hat 6.2.
If you could help me with this, I would appreciate it very much. I look forward to your comments in your Answerguy column.
Thank you.
Andy Andrianos
-- attachment follows --
; ; This is a script file that demonstrates how ; to establish a PPP connection with Compuserve, ; which requires changing the port settings to ; log in. ; ; Main entry point to script ; proc main ; Set the port settings so we can wait for ; non-gibberish text. set port databits 7 set port parity even transmit "^M" waitfor "Host Name:" transmit "CIS^M" waitfor "User ID:" transmit "your user ID" transmit "/go:pppconnect^M" waitfor "Password:" transmit "your password" transmit "^M" waitfor "One moment please..." ; Set the port settings back to allow successful ; negotiation. set port databits 8 set port parity none endproc
MAC Address Direct ConnectionGreetings. I am going crazy trying to figure out how to do what seems like a simple task. In VMS I was able to change into the NCP (Network Control Program) shell and connect to another device over layer 2 on a flat network. I believe the syntax was:
NCP> connect via ewa-0 physical address 00-c0-75-00-21-00
ewa-0 being the nic of the localhost, and the final number being the destination MAC address. I could establish what was basically a telnet session, but the device did not have to be configured with a correct IP address for my subnet. This is a much quicker way to configure a device than hooking up a console to it. When I was remote, I was able to telnet to VMS (when I had a VMS box) and NCP to a device on that local net.
Is there any way to accomplish this same end in Linux? I don't want my boss tauting VMS over against Linux you know!
Thank you for your efforts.
Sincerely, Scott A. King
Swapping ega for vga+Hi.
I've got an old Compaq Prosignia with onboard graphics "card". The problem is that the parallel port is located at 0x3bc, irq 7. For the console monitor, I use an HP VGA mono monitor. The problem with this is that Linux decides that it's going to use ega rather than vga+. ega then tramples over my parallel port resources so that I can't use it.
If I boot the box without a monitor, or with a colour SVGA monitor, vga+ is then used, which uses different resources, hence allowing the parallel port to work.
I've already tried to compile certain things in and out of the Kernel before I realised that simply taking unplugging the monitor lead fixed it. My question is: is there any way that I can either alter the resources (io and IRQ) that the ega driver uses, or force it to use vga+ ? The monitor I use for it is VGA anyway - and it's console only - not used for X.
Thanks.
Using Hindi in EmacsHi,
I have a computer at home that has Linux (RH) 6.0 on it.. In my emacs I can set the coding to Devnagri. But I wonder how can I get anything to type on the screen. I am sure that I need to use a different inout system. But what? Additionally, what do I have to do if I want to install support for more languages.
Any pointer on this direction.
Thanks,
Aseem.
swapoff swaponDear Sir:
I had heard that there is some advantage in clearing server swap space each night, by running swapoff followed by swapon as a cron job.
What's your thoughts on this ?
Thanks,
Robert Dalton
pop over sshHi Jim and Heather,
This ought to be an FAQ, or, at least, fodder for your Answer Guy column:
I've been trying to set up pop over ssh. It isn't working.
To test it, I've been trying to retrieve e-mail which steadily accumulates on my new server, running qmail and it's pop daemon. I've also been trying to retrieve an e-mail sent to your antares.starshine.org, since I have great confidence that your pop server works.
I'm following the directions in the pop over ssh mini-HOWTO. It still doesn't work.
First, it isn't retrieving the mail. Second, it asks me for the passwords every time. I thought the idea was to automate this so I wouldn't have to type in the passwords every time.
At this point, I'm fairly dazed and confused.
I've run ssh-keygen on both machines and copied the keys back to the authorized_keys file on my laptop to which I'm trying to retrieve the e-mail. When I do ssh-agent getmail, it asks for the passphrase. Okay, that much I expected.
Then, as I said above, it asks for the password for each server I'm connecting to. That would be fine, if it never asked again. But, five minutes later, it's forgotten the passwords and I have to type them in again. And so it goes, on and on.
-- David Benfell
FTP restart QHello Jim, Heather and the new Answer Gang!
One of my clients has "seen the light" and is installing a rather heavy-duty Linux box (PIII 600 Mhz, 256 Meg RAM, and five 9 Gig hard drives configured as RAID 5) as their main server. Two of their requirements are secure ftp (I'm leaning towards sftp even if it is commercial) and, this is the kicker, the ability to restart a failed (unattended) ftp transfer.
After hitting Freshemat and Google/linux, I've found that the RFC for ftp loosely defines a restart mechanism using a marker, but I've yet to find an ftp client/server that actually implements it. The FAQ for ssh/sftp does not mention this capability.
Anyone in the Answer Gang have a brilliant answer/solution?
xdmHi Answerguy James T. Dennis,
I was pointed to your site through the linuxdoc site.
Perhaps I cna be so bold as to ask a question. I have Debian 2.1, and xdm 3.3.?.
I reinstalled fvwm95 the other night using dselect, and now xdm will not launch any windows manager. The xserver is up and running, I get the login screen. When I type my name and password, it tries to launch a windows manager, and then, not being able to, reverts to the login screen again.
I am able to launch a windows environment by killing xdm under su, and then as user, executing xinit, and launching fvwm95 through a bash shell from the grey root screen. This is a bit of a kludge, really.
I think that it has to do with file permissions, as fvwm works fine (apart from the keyboard mappings).
There is no report of errors in .xsession-errors, or of problems in /var/log/xdm.log, other than a report of me killing it.
I am sure the problem is very simple to you.
Regards,
John Langley,
England.
HELP: Crontab not running nested executableFirst of all, I am sorry if it shouldn't come to you like this. Could you let me know who to send this email to, if there is a dedicated address?
Thanks.
I have two executable files that work when called manually. File2 is called from within File1 so that when I run File1, File2 gets called as well.
When I set a CRONTAB job to run File1 (with the nested call to File2) , File1 runs, but File2 doesn't.
That's the simplified version.
The detailed version is that File1 dials out to an FTP server and downloads File2 which is then supposed to run. I stress that when I manually run File1, File2 is downloaded and runs correctly. When within a crontab job, File1 runs, but doesn't appear to activate File2.
Is there something I am missing. My only thoughts lie in the fact that perhaps I need to chmod the file in a different way, for it to be called from within a crontab job successfully.
Any thoughts or Pointers?
Mick
Gnome panel left me! I want it back.Dear Answerguy(s),
I'm a complete Linux newbie. Just installed LinuxPPC2000 on my imac. Partitioned fine, installed fine. Got the penguin, then logged into Gnome. Felt great. Went to create NewUser. Made big mistake. I created new Gnome Icon in the panel. I don't want two. So I remove the panel. But, and I'm in root of course, it removes the whole panel, not just the icon. I go to new shell and type in shutdown commands. Re-login, but Gnome has lost it's panel. How do I get it back?
I hope this mail doesn't clog up your mailbox unnecessarily, but I thought you could help.
Thanks for your time
Mike
Netware login in without IPXHi,
The company I'm working for is using Netware 4.1. And it is the company policy not to use IPX protocol. So, all Windows clients login into the server using IP protocol.
Is there any netware client for linux that uses IP to talk to the server? So far if I have not mistaken, all (ncpfs,nwclient and mars) uses IPX to talk to the server.
If there's no available software that I can use. Is there a work around it? Can I modify some settings on those client which makes them uses IP instead of IPX?
Is there anyway for me to make Linux login to NDS without sepcial clients?
Please tell me as soon as possible. I need the answer urgently. Thank you in advance.
Best Regards,
Kheng Teong
ISDN and PPPI can't seem to find any detailed information on this and wondered if you might have some ideas. Normally I deal with large ethernet/atm/etc type networks. This is my first small time network that uses
First some information. I have a server that uses PPP with an ISDN modem. I am using diald to connect. I use this server to provide network service for an internal network. Right now, everything works, but I need to have the ISDN modem drop its connection when not needed and then re-connect when someone tries to use the interent.
Here is my connect script information
fifo /usr/lib/diald/diald.ctl mode ppp connect "sh /etc/ppp/connect" device /dev/ttyS1 speed 115200 modem lock crtscts local xxx.xxx.xxx.xxx <--- static IP remote xxx.xxx.xxx.xxx <--- static IP defaultroute pppd-options noauth include /usr/lib/diald/standard.filter ip-up /etc/firewall.rules ip-down /etc/firewall.reset
Any idea on how to this or where I can find any information? Thank you for your time.
Well known Port numbersDear Mr. AnswerGuy...
Can you provide me with a good list of well known port numbers for TCP and UDP? I am trying to decipher another netguy's packet filters and am stumped by a few. Is there an all-inclusive list somewhere???
Can't find info on the following ports:
TCP: 27, 109, 139, 1547, 7777
UDP: 67, 137, 138, 5631, 5632, 7648, 7649
Any assistance would be greatly appreciated.
Thanks.
Deane
i740 - OpenGL?? Possible ?Gidday after readin your colum and coming across your previous post in regards to the i740 i was wondering to what extent does linux have 3d support. I have heard rumors in regards to later kernels supporting other 3d features.
To be more to the point to what extent am i likely to get linux running 3d progams on my i740? and if it is possible how whould I be likly to do this ... as you can tell Im very new to linux and have so far been astounded by it... a truly wonderfull os for the peoples .. i hope that some day gnome etc will come with afeature set for the truly dumb user (with out loosing the advanced userset!) so we can kick microsoft off its high chair.
anyway thank you for your time.
Andrew Nye
Syslog for LinuxJames,
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.
Thanks in advance,
Domenick Villamagna
Network Engineer
Linux DEVFSHello! Excuse the beginner question, but I was wondering how in the heck to install and run DEVFS in my RedHat 6.2 linux OS?
I never saw the option under menuconfig, and whenever I try to do something like "mount -t devfs none /devfs" it says that the kernel doesn't support it.
thx in adv!
-ion
web upload w/PerlHi James:
Here is my question, I could not get a satisfactory answer from any of the newsgroups: comp.lang.perl.misc, comp.os.linux, etc.
I want the user to be able to upload a file via the browser's file form object. The file would go to /cgi-bin/docs directory, for about a second where it will be read into mySQL and then deleted from that directory.
Anyway, this cgi runs on Linux with Apache 1.3.9. I even downloaded the latest, 1.3.12 and compiled it with mod_put.c into it. THe docs directory has 777 permissions temporarily. The script is written in Perl. After executing the CGI script I have a 0K file created in the docs dir but the file is empty.What is going on? How could I get this working?
For reference I include the code Perl here. THanks for the help.
############################
#!/usr/bin/perl
use CGI;
$q = new CGI;
$upload_file = $q->param("upload_file");
$upload_file =~ s/^.*(\\|\/)//;
print "Content-type: text/html\n\n";
print "<html><head><title>Upload</title></head>\n<body
bgcolor=\"\#ffffff\">\n";
print "<h2>File Upload</h2>\n";
###########################
if ($upload_file) {
open(UPLOADED, ">/var/lib/apache/cgi-bin/docs/$upload_file") || print "Couldn't open $file :: <b> $!</b>";
binmode UPLOADED;
while ($size = read($upload_file, $buffer, 1024)) {
print(UPLOADED $buffer)
} # end while
close(UPLOADED);
print "$upload_file\n";
} # end if
##-----------
print "<p>\n<b>Files in upload directory:</b><br>\n"; $path = "docs";
opendir (DIRHANDLE, "$path") || print "Can't open directory $path <b>$!</b><br>\n";
while (defined ($files=readdir(DIRHANDLE))){
print " $files<br>\n" if ($files !~ /^\.{1,2}$/); } # end while
closedir(DIRHANDLE);
print "</body></html>";
Chat serverI need information regarding chat server on linux.
Mon, 3 Jul 2000 15:55:47 -0400 (EDT)
From: Karl Pena <karl@tux.org>
Subject: Linux Bike Project
Hello Linux Gazette!
Today (July 3, 2000) I found your kind posting of a requested comment I sent a long time ago (August 1999). You could not imagine my heartfelt glee (goosebumps) when I saw it (at the URL below).
Thank you so much for putting that up, or even responding to it. Reactions to the Linux Bike Project have been extremely positive across the board, and a few wonderful open-source community players have taken interest in participating. I am still brainstorming and drafting out ideas and details for the epic bike ride, and would love to speak with you if possible (even just to say 'thank you' directly).
You can reach me at the following email address now: karl@tux.org
THANK YOU again, and have a wonderful day!
Yours sincerely,
Karl G. Pena
[Karl is planning a bicycle ride across the US to promote Linux. He promises to send updates to LG during the ride. He is looking for sponsors for his trip. If you'd like to help, contact him at the address above. -Mike.]
Sun, 2 Jul 2000 17:46:21 +0200 (MET DST)
From: Jan-Hendrik Terstegge <webmaster@linuxgazette.de>
Subject: German LG translation needs web hosting
Do you know a website hoster which is free and without advertisement? We have a problem with the German translation of the Gazette in that we don't have any space on a web server so we have to use free web space offers. Do you know if one of your sponsors can offer us an account where we can upload up to 10 or later 20 MB?
Sun, 2 Jul 2000 17:46:21 +0200 (MET DST)
From: Werner Gerstmann <101.234011@germanynet.de>
Subject: translations of LG
Hallo there,
LG#55, general Mail, translations of LG.
I think, it is a nonsense to translate English written computer texts: it is a
matter of general education to read English just as to be able to read and
write in your own language or to know some basic mathematics. Regards Werner
Gerstmann
While it may be true that university-educated people in a technical field should be able to read computer articles in English, I don't think that's a reasonable expectation for everybody in the world. One of the advantages of Linux over other OSes is that it's more international, so people are on more of an equal footing than with some other OSes whose corporate headquarters is in an English-speaking country. Another advantage is that it's accessible to people who can't afford to spend a month's salary on one copy of Windows 2000. These two facts alone mean Linux will be (and is being) used in non-English speaking countries in ways that, um, No Other Operating System Has Been Used Before... <Star Trek music in background> This means that people in those countries will eventually contribute (and are contributing) Linux software that wouldn't otherwise exist.
Some of these contributions will be by people whose day job is not in the computer industry. Thus, they may have less of a reason to study English. Or, maybe they can read the English Gazette but prefer not to. Or maybe they're willing to read the English version, but would also like to share the articles with family and friends who aren't computer nerds and maybe don't speak English either. What's wrong with that? If it's making their use of Linux "just a little bit more fun", then Linux Gazette is reaching its goal, no matter what language it's in.
Thank you for your mail on the translation issue, even though I wont change my opinion !
What we need, or better, what I consider desirable, is a special online dictionary on certain new terms, not too simple, in English, of course, like the Jargon File.
Take e.g. the articles in the Linux Journal: what regards language, they are of very different level, beginning with What is Linux up to the sophi sticated papers of Doc Searls and Stan Kelly-Bootle. Especially Mr. Kelly-Bootle seems to invent new word combinations and, of course, you have to think about such compositions as beyond-the-soggy-pale or cosource-sweet-value-added, even if your mothers tongue is English, I suppose. If I looked into my large Pons dictionary, I didnt find words like kludgy or to shrink-wrap. These words I found in the excellent online dictionary of Munich University at www.leo.org.
Sat, 15 Jul 2000 08:38:59 +0400
From: "Felipe E. Barousse Boue" <firaisankina@dts.mg>
Subject: Spanish translation
[I asked Felipe Barousse how his new Spanish translation of LG is going. I was surprised to discover it's going much better than I expected, even though it's been in operation only two months! I couldn't wait to share the news. -Mike.]
Hi Mike:
Well, I have not counted all emails. But we have had many many emails with congratulations about the site. There are around 70 registered translators and about 25 of those have actually done translations; the rest either are in the process of translating something or said they will do so.
With every new issue and announcement, traffic goes up very high and slowly starts fading out during the course of the month, unless some new announcement -kind of kick out everyone's curiosity- is made.
La Gaceta de Linux is being linked from several linux related sites (Spanish speaking most of them) and we are in a couple of search engines now.
In short, I guess that for two months online this is doing well. What is your opinion about it ?
Actually a great effort from volunteers within the company has been put out to build, install and manage the site.
Hola!!! Seria una buena idea que la revista estubiese traducida a otra lengua, por ejemplo al Español, por poner un ejemplo. Saludos desde España.
[He said, "Hi. It would be a good idea if the magazine was translated into other languages; for example, Spanish. Greetings from Spain." -Mike.]
Hola Luis:
Recibí copia de tu mensaje del editor de Linux Gazette. Te invitamos a que visites la traducción de la revista Linux Gazette en http://gaceta.piensa.com/ Aqui tenemos traducción de los últimos número de la revista y con serías intenciones de seguir traduciendo los número anteriores.
Trabajamos con voluntarios de todo el mundo para realizar las traducciones al Español.
Te esperamos en La Gaceta de Linux.
Saludos desde Ciudad de Mexico
Felipe Barousse
[He said, "Hi Luis. I received a copy of your message from the Editor of Linux Gazette. I invite you to visit the translation of the magazine Linux Gazette at http://gaceta.piensa.com. Here we have a translation of the most recent issues, and we seriously intend to translate the previous issues also. We work with volunteers from all over the world to do the translations. We await your visit to La Gaceta de Linux. Greetings from Mexico City. Felipe Barousse." -Mike.]
Sun, 9 Jul 2000 04:19:02 -0400
From: Dean Maluski <dean@mail.n0ety.com>
Subject: Windows Partitions
I work at a TV station as System Administrator. This week a hard drive failed in a computer, a very important computer. It controls 7 satellite dishes, the azimuth and elevation can be adjusted from this machine. Also the 7 receiver frequencies can be adjusted from this windows machine. Without it we get no video feeds and have to order shows on tape, which costs the station a great deal of money.
Now that I've given you the basics let me tell you how Linux saved the day. When this hard drive failed windows could no longer determine what type of partitions the drive had. I tried setting it up as a slave drive so I could salvage our satellite software, windows couldn't see it so I booted with Slackware rescue disks, ran fdisk and set the partitions to be Windows FAT 16. Rebooted win98 in dos prompt mode and managed to copy ini files off it. With those ini files I was able to reconstruct another system. After that I made several backups of the ini files. Linux gained a great deal of respect within Tribune Broadcasting this week!!!
Questions on LinuxI'm a Newbie.
I saw some of your answers in the Linux Gazette. Is this still active, if yes how do I subscribe.
The Linux Gazette is published at the beginning of every month, on the website http://www.linuxgazette.com.
After that, with volunteer effort, it is mirrored to locations throughout the world, translated, and added into most major distributions as part of the Linux Documentation Project. Back issues may be in your /usr/doc/ directory right now... The LDP's home is http://www.linuxdoc.org.
You could probably use a website page-checking service to advise you when the Front Page changes to list new issues.
Is there a simple way to change the font type & size that EMACS uses. For example in some type of resource file?
For this part, one of our readers or the Answer Gang will have to help.
TIA, Allen Grayson
You're welcome.
Career or Job Board SoftwareSSC's webmaster was asked:
Hi, I am looking for an open source job center management program. Is the one you use in your jobs section open source? Can you recommend one? We are starting a small site in Phoenix and would like to integrate something useful for careers.
Thanks, Steve Hasz
I'm at work, you can reply to the above address or steve@hasz.com
The Career Center on the Linux Journal site is not open source at present. Linux Gazette's "Help Wanted" section is not about job offers, but about people seeking help with different aspects of Linux. Since you're seeking help about an aspect of Linux, we've put your letter here. (Actually, in the "General Mail" section, but at least it's the same page.
We build this page, as well as 2-Cent Tips and The Answer Gang, with the aid of some hand-crafter Perl and Python scripts. We sort the letters into standard Unix mailboxes with particular filenames, and the scripts convert them to HTML. However, we also post-process each column by hand to do things the scripts can't.
Freshmeat.net is a canonical site for looking for open-source software; the CPAN project (a perl script archive at cpan.org) may also be useful.
For examples of other functioning job centers--or to find a developer to write one for you--see www.cosource.com and www.sourcexchange.com . There are also a few other companies offering a similar service.
Perhaps you can adapt one of Linux's general "trouble ticket"-tracking applications like gnats and jitterbug for your purposes.
-Heather and Mike
Thanks for your response! We decided to just have one of our open source developers write something, which turned out quite well. We actually created our entire site and run it using only modified open source.
In case you are interested, we are in public beta at http://www.aztechbiz.com/.
Wed, 5 Jul 2000 20:40:47 +0100
From: Ed Brown <edbrown@go-britain.com>
Subject: Ventura under Linux
I noticed that you mentioned that you use Ventura for some of your work. Is this a beta of the Linux version due in a few months?
[Are you talking about Warren Young's letter in http://www.linuxgazette.com/issue41/lg_mail41.html?You can write to him and ask what he knows. Corel has ported several of their applications to Linux, and just released Corel PHOTO-PAINT for Linux. I don't use graphics programs except for basic retouching in the Gimp, so I don't know much about Corel's products. -Mike.]
Sun, 9 Jul 2000 17:59:39 +0900
From: Lance Lindley <hagakure@yahoo.com>
Subject: Hi folks
Thanks for some great information. However, here's my suggestion:
PROBLEM: Not much point in having terrific information if nobody knows it is there!
SOLUTION: Add a few two-or-three word synopses of what is in each issue to your Table of Contents. Big time investment initially, but very useful in the long run and easy to maintain once you've got it in place.
Tue, 11 Jul 2000 14:05:37 +0200 (CEST)
From: Christoph Lange <langec@gmx.de>
Subject: Separate all-in-one version?
could you please offer the all-in-one version of the Linux Gazette (HTML as well as text) as a separate download? I don't understand why I have to download these two files with every issue. Separating them from the standard package would decrease it by ~ 1/3 of its size without any loss of information.
[The all-in-one version requires some of the other files anyway (e.g., images, program listings, HTML files not part of the main article page). The decision to not make separate packages for the all-in-one versions was made by the former Editor (hi Margie!), because we already offer the Gazette in a variety of formats and we can't customize it to everybody's liking.We have a new Editor coming on board next month, Don Marti, so I'll leave him the decision whether to change things. -Mike.]
Tue, 25 Jul 2000 13:50:50 -0600
From: Doug <doug@springer.net>
Subject: Please remove bogus Posting!
Hello, Can you please remove the posting with the following header:
Fri, 2 Jun 2000 11:48:21 -0600
From: "Tom Russell" <doug@springer.net>
Subject: How to run Windows programs on Linux
at this location: http://www.linuxdoc.org/LDP/LG/issue55/lg_mail55.html
I do not know who Tom Russell is or why my email address is listed under his name, but I am tired of people sending me emails about WINE!!!! I know all about WINE, and I don't want or need a hundred people telling me to check it out!
Please remove this for me! Please!!
Thank you,
Doug Springer
[OK, I removed the e-mail address. It must have been a formatting error when the column was made, that caused your e-mail address to leak through from your letter onto that one. -Mike.]
Sat, 1 Jul 2000 20:15:58 +0100
From: David Andrew Williams <andy.d.williams@btinternet.com>
Subject: linux cad programs
Dear Editor,
Your roundup of cad programs for Linux misses a program called LinuxCAD mentioned as far back as issue 30 and in some more recent issues as well so it seems to be popular.
I'm sure some of the other programs mentioned in the recent issue can also be found mentioned in older issues.
Andy
Sat, 15 Jul 2000 08:38:59 +0400
From: Mr. Mamodaly <firaisankina@dts.mg>
Subject: subscribe
[Subscribe to what?For the lg-announce mailing list, send "subscribe lg-announce my_address@site.com" in the message body to majordomo@ssc.com.
Linux Gazette itself is not available via e-mail. For the reason why and other options, see the LJ FAQ, questions 2-4, at http://www.linuxgazette.com/faq/index.html . -Mike.]
Wed, 5 Jul 2000 10:28:16 -0700
From: Mike Orr <mso@mso.oz.net>
Subject: Trivia for the day
$ tm bash: tm: command not found
I guess the computer doesn't do Transcendental Meditation.
Greetings from Heather SternHi everybody! Wow, it was a lot more work than I expected... but then, I also handled the Mailbag and Tips this month. It's all part of our new team effort to make Linux a little more fun!
We got a fair handful of questions about statistics, none of which went answered. I'm the statistician among us, and I've been hacking web pages and perl scripts all month. I didn't even manage time to whip up a cool new logo for The Answer Gang yet.
But I'll say this, and you can all percolate on what you think of it: stattistics developed by someone else aren't terribly useful to you - the situation they studied will be different, every difference is a statistical skew, and it doesn't take much variance to make it not only notuseful, but actually a waste of time and effort.
As contrasted with benchmarking done in-house, in your own controlled environment... where you know that the situation being tested is something you really can apply and show to your boss. But you have to have a "control" - at least one case that is not part of the experiment, but allowed to run "naturally", whatever that means. The larger the sample the more likely that you do not have a big bad skew like an observer's opinion sway their observation, or hardware problems corrupting a software test, or something like that.
By the way, the Benchmarking HOWTO over at the LDP homepage may be dusty, but it's actually still very readable, I recommend that people who care about serious comparison of systems, distributions, and OS' check it out, and apply its methodology when making their comparisons.
The smaller the sample the sillier it is. If we used the methodology of "letters that came to LG this month" why, MS Windows is still popular, but Linux outsells it by at least 4 to 1 (dual boots and crossover issues counted in favor of WIndows), maybe more ... and there were almost as many as people who submitted questions that did not involve Linux. (pant stains? car CD players? Where do these people come from?) Oh yeah, and there's my final note. Look out for subjectifying words like "almost" "nearly" "overwhelming" and other such vague quantifiers. If they aren't numbers, they're not useful. If they are numbers, they're only as useful as the correlation between how they were gotten, and your particular real life use for them.
9 out of 10 of my donuts are gone, with a 60% chance of the rest disappearing within the next 15 minutes. See you next month!
Danish Translated: Overclocking.Translator: Aron Felix Gurski
Well, we got about a dozen people who came forward with our solution. Not that we here at the Gazette have any better answer for tthe original querent. So, if you know some useful sites that Linux folk might enjoy for overclocking and other hardware hackery, submit them to linux-questions-only@ssc.com they will be published next month to finish this thread.
And a big hand for Aron, who sent in a very early reply that also helped me learn something, plus an offer of future help!
Hi!
I just began looking over the July issue and found that you needed some help in translating a question from Danish. Please do not call the user "hilsen kaspar";"hilsen" is just a friendly way of ending a letter (literally it means "greetings") -- the user's name is Kaspar, a male first name. Kaspar really *does* repeat himself at the end of the message. (He also has made not a few typos...)
Good luck at answering him. (For future reference, I can translate Danish, Norwegian and Swedish for you [email address ellided])
Dav jeg syntes at det er en gode side du har med en masse gode brugbare råd .
men det er ikke det jeg vil , je har et problem som du måske kan hjælpe mig med
. Jeg har en 450 mhz p3 cpu som jeg gerne vil have overclocket jeg har et asus
bundkort model :p2b/f1440bx agp atx. Jeg ved ikke om at jeg skal have noget
extra køling på når det kun er til 500 mhz da mit bundkort ikke kan tage mere.enanden ting er at jeg ikke ved hvordan jeg gør så jeg håber at du vil hjølpe mig.JEg håber at du vil hlælpe mig med mine spørgsmål.
hilsen kasper
Dav[e?], I think that you have a good page with a lot of good, useful advice. But that's not what I want, I have a problem with which you may be able to help.I have a 450 MHz P3 CPU that I would like to overclock. I have an ASUS P2B/F14440 BX AGP ATX motherboard. I don't know if I need extra cooling for 500 MHz (my motherboard cannot go any higher). Another thing is that I don't know what to do, so I hope that you will help me. I hope that you will help me with my questions.
Best wishes,
Kaspar
Regarding #36: Plug and Pray Problems.AnswerGang: RazorBuzz, Jim Dennis
From RazorBuzz on Fri, 07 Jul 2000
Here's a comment on a question from a while back. I don't remember that question (but it was about a year and a half ago). I see that this was the same month that I write a 26-page guide to "routing an subnetting" and answered about a hundred other questions. No wonder some of them weren't complete!
Andswer Dude,
Your response to Tony Grant on the Plug and Play board problems (#36) can
be overcome in Linux itself. You can manually set rc.S to run a config' for the IRQ5 (Which, if memory serves, is Com3). If you add this line:setserial /dev/ttyS3 uart 16550A port 0x2e8 irq 10
to the /etc/rc.d/rc.S file it'll be run on every boot (duh) and correct the problem. Of course the IRQ and IO need to be changed. The chipset of 16550A is pretty much standard and most likely won't need changed...but if it does, you can always grab it easily. All that command line does is force's the box to accept the comport and recognize that it can in fact be used. Dammed defaults tend to only recognize Com1-Com3...Hopefully the next RH, Caldera OL, or Debian should have that fix (since Slackware is just..well....lacking....nobody has hopes for that to ever get itself in gear.)
- -=Razor=-
- -=Buzz=-
Then again, looking at Tony's original question (http://www.linuxgazette.com/issue36/45.html) I see that the it wasn't clear that setserial would be the right tool for the job. It was a question about a conflict between an ISDN TA (terminal adapter) and a ethernet card. I have no idea how the setserial command would change the IRQ on the actual device. As far as I know all it does is configures the kernels serial driver --- to inform it of what IRQ the hardware is using.
So I stand by my original answer (in this case).
(I understand that the ISDN TA was probably acting like a modem, and thus probably had a UART of some sort --- probably a 16550A since a 16450 or an 82xx series would be WAY too old and obsolete for any sort of ISDN equipment. I don't see any evidence in the message that the user had any way to manually set hardware jumpers to specify non-conflicting IRQs for these devices).
I wonder whatever happened to this correspondent? Have they long since switched to DSL? Is that old ISDN TA a doorstop somewhere?
Regarding #55: "Simple Shell and Cron Question"AnswerGang: DUDU, Jim Dennis
From dudu on Fri, 07 Jul 2000
You answered in LG55 the following question:
Simple Shell and Cron Question
From Amir Shakib Manesh on Thu, 08 Jun 2000
Dear ANswer Duy, I want to write a shell script, in which every 15 minutes it run a simple command, let say 'top -b'. Would you help me?
Well one way would be to make a cron entry like:
*/15 * * * * top -b
... which you'd do by just issuing the command: 'crontab -e' from your shell prompt. That should put you in an editor from which you can type this command.
But, when the cron job runs it has now default environment variables like PATH. So shouldn´t one include the full path to the top binary in order to run it properly?
Rgds. DUDU
Of course cron runs it its own environment with its own PATH and other settings. However, on most Linux systems 'top' is going to be located in /usr/bin --- which really should be in cron's PATH.
So I think the example I gave was good enough for the common case and I think I did go into more detail later in that response.
Of course I have a tendency to refer to programs and scripts by their full path in my configuration files and scripts, but by shorter names in examples and on the command line.
Checksum ScriptAnswerGang: Mike Orr, Jim Dennis
From Mick Faber on Fri, 07 Jul 2000
Hi
I have written a script that automatically connects my machine to an FTP server and downloads a set of files that I need nightly. The client downloads a file which is my indicator to any changes. In effect, if this downloaded txt file has changed, then I need to download the other files.
That part is ok. I can automatically download the check file, so I have two files (current and new dir) called the same but in different directories.
I have written a script that says
> Set a=cksum file1 > Set b=cksum file2 > If a=b > Then ... > Else ...
My problem seems to be even though the CKSUM results are differently when done manually, in the script they ALWAYS are equal. Is SET the wrong term to use to set a variable. Is there another way to do this altogether.
[Mike] We need to know what language this script is written in. From the "set" statement, I'd assume it's csh or tcsh, although what you wrote appears to violate the rules for (t)csh syntax. (Capital letters, no " around "chksum file1", etc.)
Anyway, if the language is similar to C, the "a=b" expression should be "a==b" to test for equality. "a=b" means set a to the value of b.
[Jim] The code fragment you've included doesn't specify what scripting language you're using. It isn't a valid fragment of bash, PERL, or even csh. For one thing, the common UNIX scripting languages are case sensitive. Thus your capitalization of "If" and "Then" are enough to cause this fragment to fail under most interpreters.
Of than that there isn't enough context or code here to guess what scripting language you're trying to use. However, the 'set' command isn't used in most Linux scripting languages (at least not for "setting values to variables"). csh, TCL (and 'expect', a TCL derivative) and the MS-DOS batch language, use the "set" command for variable assignments.
This leads me to suspect that your code sample is in "MS-DOS batch" or some sort of psuedo-syntax.
To do this with bash (or Korn shell or any similar interpreter) you'd use something like:
#!/bin/sh
a=$(cksum $1)
b=$(cksum $2)
if [ "$a" = "$b" ] ; then
...
else
...
fi
...assuming that you were calling the script with two parameters, the names of the two files. Note: the $( ... ) expressions are the key here. They "capture" the output from the enclosed command(s) and substitute those result into the expression in which they $(....) expressions have appeared. This is called "command substition" (traditionally rendered as `...` using backticks). This "command substitution" feature is one of the shell's most powerful and useful scripting mechanisms and it allows us to seamless assign the output from any normal command (internal, or external) to shell variables.
(Note: Some very old Bourne shells might not recognized the
$(...) form and thus may require the backtick form. However, all UNIX shells should be able to do command substitution. I've never heard of one that didn't. csh/tcsh also requires the backticks, and can't use the more legible $(...) form).
Actually this is an oversimplification. The GNU 'cksum' command prints output of the form:
2839321845 1516 /path/file.name
Obviously if I take the output of two of these commands, with DIFFERENT FILENAMES the full text of each output will be different even if the checksums are the same. I need to extract just the checksums, or at least filter out the differences in the filenames.
My first thought was that the cksum command might have some switches or options to suppress the extraneous output. It seems like the need to get just the numeric checksum value would be pretty common. However, it appears that the FSF maintainer for this utility doesn't agree with me. So we have to isolate it ourselves. That's only a minor nuisance (taking far less time for me to do than to explain).
There are a couple of ways I can do that. Here's the first that comes to mind. Just insert the following at the top of the script.
function cksum () {
command cksum $1 | {
read a b x
echo $a $b
}
}
This creates a local shell function which over-rides the output of the external cksum command. The "command" command forces the shell to execute the command (bypassing the shell functions and aliases --- and prevent a recursion loop).
All I do here is pipe the output into a command that reads the first and second fields (the part I want to keep). I read the rest of the output into a "throwaway" variable (which I expediently call "x"). Then I just echo out the two pits of info I cared about (the checksum and the size) leaving off the "rest." This trick of using the read command to filter out fields that I want from lines of input is pretty handy. It's a reasonable advantage over using the external 'cut' command because read and echo are internal commands. Also 'cut' defaults to using tabs as delimiters while I usually want to "cut" on any whitespace (any number of tabs or spaces).
The advantage of writing this little shell function into our script is that I can leave the rest of the script alone. I don't have to re-write it. Of course it's better to avoid the name collision. I could name my function "checksum" (and avoid having to use the "command" command). Even if I do rename the shell function I can leave my "command" command as is. It doesn't hurt anything.
Naturally I could have also just piped the output of each of these cksum command through cut like so:
a=$(cksum $1 | cut -d" " -f 1-2 )
... which works fine. Of course it is a little less maintainable. Even though I'm only calling this expression twice --- it's still better to consolidate it into a shell function so it really works the say way in both invocations. Otherwise a slight difference to one of the invocations could silently cause the later comparison to always and erroneously fail.
Note that we don't have to use "if... then ... else .... fi" in most shell scripts. We can shorten this script to:
[ "$(checksum $1)" = "$(checksum $2)" ] && .... || ....
(assuming I made my checksum shell function as before).
... where the command after the && is the same as you'd put after the "then" token in the earlier script. The command after the || operator is similar to the "else" block, but it would be execute if the checksums didn't match or if the if the command in the && clause returned a non-zero value (an error). This is frequently what you actually want in shell programming; though the differences can be subtle and important.
Note: the && and || operators take a single command. If you want to perform a block of commands under those conditionals you'll want to use command grouping or possibly a subshell --- using the {...} (braces/grouping) or (...) (subshell) syntax.
One "gotchya" that crops up in bash 2.x when using "grouping" is this:
{ foo; bar }
... was accepted under bash 1.x and is an error under bash 2.x --- it's because the closing brace is being taken as an argument to the bar command. This is technically correct for the parser (it was a bug in bash 1.x that allowed the command to work).
So, good shell scripting requires that we us this syntax:
{ foo; bar; }
(or simply put the braces, particularly the closing brace, after a line end, perhaps on its own line).
That's basic shell scripting.
Any assistance appreciated. Email preferred, but will keep checking this
here to check for any legendary solutions...
Mick
[Jim] I don't know that my answers are "legendary" but I hope they help anyway.
[ Maybe most aren't but some are. The length of this particular thread is about to rival some of your own longer missives, but I think it will still be shorter than your legendary "Routing and Subnetting 101" (issue 36, plus it had a floowup. Some people are teaching clasess based on it. Rah Rah Rah, Go LDP!) Of course it's an unfair comparison; there's two of you ganging up on the question this time so your relative portion is even shorter. --Heather ]
BTW: When posting questions about scripting --- include a syntactically complete and semantically relevant portion of the code. Try to keep that under 25 lines. Often the process of isolating a testing a chunk of code that clearly illustrates the problem, leads you to an understanding and a solution or work around.
... he replied ...
Thanks so much for the reply, I have written this using VI on Redhat6.1 -
I don't know if that is the answer you need - I'm only a 2 week novice with
Linux and programming of this level for that matter ... Does this answer
your question?
The actual command line I want to use is
if cksum /usr/local/c_drive/batm/video/current/pod001.avc = cksum
/usr/local/c_drive/batm/video/new/pod001.avc; then
I also want to verify that the downloads are successful and not corrupted. I figured CKSUM is the best for that as well - that problem is to get tackled yet ....
[Mike] Vi is the editor you're building the file with. What we need to know is the program that's running the file. From the "actual command line below", it looks like a shell script, so I assume it's running under the default Linux shell, bash. Do you have a "#!" line at the top of the file? If so, what does it say?
The following script works when I try it comparing one file with itself, then comparing it with a different file.
if [ "$(cksum /usr/local/c_drive/batm/video/current/pod001.avc)" = \ "$(cksum /usr/local/c_drive/batm/video/new/pod001.avc)" ] ;then echo "They're the same." else echo "They're different." fi
"if" takes a single command. If the command's exit status is 0, the "then" part is run. If the command's exit status is non-zero, the "else" part is run. The brackets "[ ... ]" imply the "test" command, which runs a test (in this case, a string comparision) and exits 0 if the answer is true.
[Jim] Actually the [ .... ] doesn't "imply" the test command. [ is really a built-in alias for 'test' (and it generally also exists as a symbolic link to the /usr/bin/test command, for those shells which don't implement it as a built-in).
When the command 'test' is called under the name '[' then it requires the ']' as a delimiter. That's actually a bit silly, since the shell is still doing it's own parsing, and the shell "knows" when the command ends quite independently of this "]" marker (which the shell ignores as it's just another argument to the '[' command.
However, these are just syntactic anomalies. It's really better for beginning shell scripters to use the 'test' command (so that the really internalize that it is really just a command like any other Unix command. It is not a "feature of the language" --- it's just a command that processes a list of command line arguments and returns and exit value. (This is as true of '[' but it's less obvious to people who've been exposed to any other programming languages.
[Mike] "$( command arg1 arg2 )" returns the output of the specified command-- what it would have printed on the screen. This is different from its exit status. The double quotes keep the output together even if it contains spaces; otherwise the output would be misinterpreted.
Bash allows either "=" or "==" for string comparisions. Another operator "-eq" does numeric comparisions, but we don't want that here since "cksum" returns more than just a simple number. Some other languages would require "==" instead of "=", as I said yesterday, but bash isn't one of them.
[Jim] Although bash allows this, the external 'test' command requires that we use the = and will give an error if we try to use ==
So, depending on bash' permissiveness is less portable.
Incidentally, another approach we could have used (given the original problem) is to do something like:
pushd $(dirname $1) a=$(cksum $(basename $1 )) cd $(dirname $2) b=$(cksum $(basename $2 )) popd ....
... this relies on the fact that the files being compare have the same names but reside in different directories. However, it seems really bad to impose that constraint on our shell script even though this particular application/situation allows it. It would make the resulting script useless for most other situations. However, the approach I recommended (filtering out the filename with and read/echo pair or a 'cut' command) gives us a more general script that we can re-use for similar purposes.
This example does show the use of the very handy 'basename' and 'dirname' commands. It also shows that the $(...) form of command substitution can be nested (which overcomes a limitation of the older `...` backtick form).
[Mike] Please cc: linux-questions-only@ssc.com on subsequent e-mails about this issue. This is a mailing list which is used to build the Answer Gang/Answer Guy column in Linux Gazette, and several people read it who may be able to help read it.
[Jim] Once you have local copies of the file, why not just use the 'cmp' command. The cksum command is already going to read the whole file. You've already burned up the bandwidth (transfer the whole files to the local machine).
So what's wrong with:
if cmp -s /old/path/file1 /new/path/file1
then
...
else
...
fi
That seems quite a bit simpler.
Also, let's assume that you have two directories. A script to compare corresponding files in them would look something like:
for i in $1/*; do cmp -s $i $2/$(basename $i) && # they're O.K ... || # Ooops: corrupt file done
(This assumes that you're call it with just two parameters, the names of the old and new directories).
Alternatively you can have a script take a directory name (the "new" directory for argument's sake) and a list of files as probably provided by a "wildcard" (globbing) pattern.
That would look something like:
d=$1
[ -d "$d" ] || exit 1
shift
for i; do
if cmp $i $d/$( basename $i )
then
....
else
....
fi
done
... Here again I'm using the basename command. I could also use the "parameter substitution" feature of the shell instead of basename: ${i##*/} However, I find that form to be almost unreadable. If performance where an issue I might hide the ${1##*/} in a shell function that I'd name "basename" (and I'd toss in ${1%/*} as "dirname"). That would be a bit quicker for large directories since basename and dirname are external commands. So using them entails quite a bit of fork()'ing and exec()'ing. Naturally the ${...} parameter substitution features are always internal if they are supported at all.
... he replied ...
Hi, I am using the default program bash (have also tried sh as other
information I downloaded had this in it - are they significantly different?
I ran this command:
if [ "$(cksum /usr/local/c_drive/batm/video/current/pod001.avc)" = \
"$(cksum /usr/local/c_drive/batm/video/new/pod001.avc)" ] ;then
echo "They're the same."
else
echo "They're different."
fi
and found the following results:
when the file is compared to itself, it works. When compared to a file of the SAME NAME in another folder, if doesn't work. It's almost as if the folder is taken into account, but when I run cksum filename on the two files they give me the same CRC, no. bits and file name as they should. I would expect then that this command should work.
[Jim] Of course the "folder" (directory name) is part of what's being compared. The "$(.....)" are expressions that evaluate to text strings. The contents of those strings are set to the output of the commands that are included in the parentheses. The [ (test) command takes a list of arguments and operators. In this case the arguments are two strings (substitutes by the $(...) expressions) and the = operator. Note that the "=" sign here is just an argument to the test command --- which is also know as the '[' command. The closing ']' is just an argument that the 'test' command requires when it is called under the '[' name.
Now, if you think about it you'll see that the '[' command has no reasonable way of "knowing" that you only care about the checksum values of the two strings. It was give a couple of strings and an argument (the "=" sign). So it (the test command) will return a value (exit code, errorlevel) based on whether the two strings are identical.
I am interested only in the CRC value - perhaps we could use the -eq if we
can only extract the CRC value as a result instead of the other info CKSUM
give us....?
[Jim] I don't recommand that. The 'test' command will probably emit an error about the format of the operands to the -eq option/operator.
Feeling so close now.... Thanks again for your patience....
[Jim] See my long response of a few minutes ago. The answer is simple, we include a bit in the $(....) expressions that filters out the irrelevant text. I do this by over-riding the cksum (external) command with my own shell function, but the concept is the same.
Note: I dove into that message and my earlier response before seeing that others had tried to help you with your question.
Regards,
Mick Faber
[Mike]
~% cksum ksc.txt /tmp/ksc.txt 3082533539 2180 ksc.txt 3082533539 2180 /tmp/ksc.txt
It looks like the difference is only in the path and not in the checksum. I tried it both with the two filenames being hard links to the same file, and with them being copies of each other. To get the checksum only, run:
~% cksum ksc.txt |cut -f 1 -d ' ' 3082533539
Or to be verbose:
cksum ksc.txt | cut --fields=1 --delimiter=' '
3082533539
Here's a script:
---------cut here----------
#! /bin/bash
FILE1=that
FILE2=/tmp/that
cksum $FILE1 $FILE2
if [ "$(cksum $FILE1 | cut -f 1 -d ' ')" -eq \
"$(cksum $FILE2 | cut -f 1 -d ' ')" ] ;then
echo "They're the same."
else
echo "They're different."
fi
---------cut here----------
$ /tmp/checkit 3558380555 93104 that 3558380555 93104 /tmp/that They're the same.
Out of curiosity, what do you think of the difference between cksum and md5sum?
Bash has more features than sh and is larger. Exactly what the differences are, you'd have to consult the manuals. I use zsh for my interactive shell, and zsh or bash for scripting.
... he replied ...
Thanks heaps for your help. I have resolved the issue.
FYI: I am using the command "if cmp -e file1 file2" and not using the cksum at all anymore.
Thanks again - you guys are lifesavers!!!
Mick
Accessing an NT FileserverAnswerGang: Jim Dennis
From Stephen Richard Levine on Fri, 07 Jul 2000
I cannot find a reference which would show me how to access data sitting on an nt server (version 4.0) in multiple directories. I want to use linux as the o/s, apache as a web-server, but the content all resides on nts as pdfs in separate subdirectories. each user has their own nt subdirectory. Any assistance would be appreciated.
You could use the Linux SMBFS. You'd have to compile support for that into your kernel and use the 'smbmount' command.
SMBFS is similar to Samba (and based on the same free sources and work). However, it is the client side (Linux access SMB filesystems) rather than the server. (Samba is an SMB server).
When you're accessing files via an MS-Win '95 "share" it's using the SMB (server message block) protocol. Likewise for NT, Windows for Workgroups, the old OS/2 Lan Manager, and for printing and some of the MS Windows "popup" messages. Samba is a free package written by Andrew Tridgell (and others). It runs on most forms of UNIX, where it allows any UNIX or Linux system to emulate an NT server. This allows all those MS Win '9x and NT workstation clients to access files on Linux and UNIX systems using their "native" protocols. No special software has to be installed on the clients. (That's a big win for two reasons: MS Windows clients don't offer very robust remote administration facilities, so installing software on them is expensive and time consuming; and MS Windows systems are frequently plagued with DLL and other software conflicts which makes manually installing software on them difficult, frustrating and time-consuming).
Anyway, you're trying to do the opposite of what Samba offers. You're trying to use your Linux system as a "client" to your NT fileserver. Personally I think that this is a backwards way to do things. I'd suggest installing Samba on the Linux system (along with Apache and any other requisite tools) and let the clients post their files directly to the Samba shares on the Linux host. It's possible to configure Samba to listen on a specific interface and to limit the IP address ranges with which Samba will interact. Thus you can configure a system so that only local users can access the Samba shares while it's still publicly accessible as a web server.
(In the "belts and suspenders" philosophy it's also possible to use ipchains to block SMB traffic from even reaching the public interfaces on your Linux box. And of course you do that blocking on the host itself and on a separate border router).
Another approach would be to house primary copies of these files on the NT server, and write some sort of replication script that would periodically be executed (task scheduler?) to create an archive of the user files and push them over to the Linux box. Probably that would be most easily done using the 'rsync' command (another UNIX/Linux tool, written by Andrew Tridgell). You can run many freeware UNIX tools under Interix (formerly called "OpenNT" by a company formerly called Softway Systems, now owned by Microsoft) or under the Cygwin32 (Cygnus' package for supporting UNIX APIs and libraries under on Win32 systems).
rsync is very efficient (sending only the "diffs" of large files that have changed, rather than whole copies). It is the most popular replication tool on Linux these days.
However, if you have some other constraint that really mandates the use of NT for the fileserver, then I suppose you can use Linux' smbfs. You can read more about it at the Samba web site (http://www.samba.org/samba/smbfs).
... he replied ...
Many thanks for the assistance and setting me straight on which part of the
client/server I should access.
Steve
FIPSAnswerGang: Jim Dennis
From ajshields on Tue, 04 Jul 2000
gday
how are you, I am new to Linux and am trying to install it as dual boot on my new 10gb seagate diskdrive i have already got windoze installed. My bios doesn't support a 10gb drive so i downloaded seagates boot manager that allows me to use the hdd full potential. When i tried to run fips it said that the last bit of it has files on it (it doesn't). And doesn't want to run anymore than that.
Can you help
Andrew
Did you read the FIPS.DOC file that comes with the FIPS package? (FIPS is the "free internet partitioning software"). It discusses this in the doc file, in the FAQ and in the ERRORS.TXT file:
Last cylinder is not free Since the new partition is created at the end of the old one and contains at least one cylinder, the partition can not be split if not at least the very last cylinder is completely free. Probably there is a hidden file like 'image.idx' or 'mirorsav.fil' in the last cylinder - see the doc.
(That's from ERRORS.TXT). In the doc and in the FAQ it describes what you should do about this:
But before starting FIPS you _must_ now defragment your Harddisk. All of the space that will be used for the new partition must be free. Be aware that the Windows Swapfile will not be moved by most defragmentation programs. You must uninstall it (in the 386enhanced part of the Windows Control Panel) and rein- stall it after using FIPS. If you use IMAGE or MIRROR, the last sector of the hard disk contains a hidden system file with a pointer to your mirror files. You _must_ delete this file before using FIPS (it will be recreated the next time you run mirror). Do 'attrib -r -s -h image.idx' or 'attrib -r -s -h mirorsav.fil' in the root directory, then delete the file. If FIPS does not offer as much disk space for creation of the new partition as you would expect it to have, this may mean that a. You still have too much data in the remaining partition. Consider making the new partition smaller or deleting some of the data. b. There are hidden files in the space of the new partition that have not been moved by the defragmentation program. You can find the hidden files on the disk by typeing the command 'dir /a:h /s' (and 'dir /a:s /s' for the system files). Make sure to which program they belong. If a file is a swap file of some program (e.g. NDOS) it is possible that it can be safely deleted (and will be recreated automatically later when the need arises). See your manual for details. If the file belongs to some sort of copy protection, you must uninstall the program to which it belongs and reinstall it after repartitioning. I can't give you more aid in this - if you really can't figure out what to do, contact me directly.
Also Arno Schaefer, the author/maintainer of FIPS, suggests that you create a debugging report with the -d switch and that you include the resulting FIPSINFO.TXT file with any questions that you mail to him.
The other approach would be to backup your data, check your backups (restore the critical data to another drive, another system, or at least a different subdirectory) and then do an old-fashioned re-partition, re-install (of MS Windows) and then do your Linux installation.
I realize that this sounds dull, tedious, time consuming, etc. However, think of the advantages. First, you'll have a backup! Also, your new installation of MS Windows may be much cleaner than the existing one (since their OS seems to gather cruft at a frightening rate).
I've only used FIPS a couple of times (on other people's systems, at their insistence). I prefer the old-fashioned approach. Actually I prefer to wipe out the old OS and give Linux the whole system. Failing that I prefer to add an extra hard disk and use LOADLIN.EXE to run Linux off of that (non-primary) drive. So repartitioning is third on my list of preferences; and using FIPS is fourth. That would be followed quite distantly by using Partition Magic (which I've never tried).
Of course I have no idea what files FIPS is complaining about. It might be some sort of hidden/system driver that was installed by that Seagate boot managed you mentioned.
Incidentally I have no idea if Seagate's boot manager (software disk driver?) is compatible with LILO. The LILO technical documentation describes their success in operating with a variety of partitioning drivers (like Ontrack's Disk Mangler^H^H^Hager, and Maxtor's (??) EZ-Drive). However, I don't have the time to hunt down information about Seagate's software (particularly since you give no details about it --- not even the name of the package).
As I said: my preference is to give Linux a whole hard drive. If you can get a cheap little 1 or 2 Gb drive that your BIOS does support --- make that the master, install MS-Windows "C" drive on it; and give Linux the other drive (or most of it. Of course you could also look at upgrading your BIOS, replacing your motherboard (getting a new BIOS along with that, of course), or installing a smarter IDE controller (with its own BIOS).
Of course you can just try to do the installation. It might just work with no fuss. However, when novices try to install Linux, and they include these little constraints (wants dual boot on a big drive, on a system that doesn't support big drives, and wants to non-destructively resize and repartition that drive) they naturally complicate their initial experiences.
You're likely to get an unduly dim view of Linux "ease of installation" by trying an installation with all of these constraints. (That isn't to say it can't be done just as you want --- it's just to point out that the process is often more complicated than it needs to be).
So, consider alternatives as I've suggested. Ultimately some hardware upgrades might save you enough time to offset the cost.
... he replied ...
gday again
All that i can say is welll sooooooooorrrrrrrrryyyyyyy
it came up with 54h as it can't recognize this operating system
Removing Linux PartitionsAnswerGang: Jim Dennis
From Rajan Karwal on Mon, 03 Jul 2000
i recently read your cooments about LI on a web newsgroup. My problem is this. I was running lunix on my machine but didnt like it so i want to go back to windows. I deleted the several partitions that linux reated and formatted the drive. Now all i get if i start my machine is "LI".(not at this point i have installed ms dos on the machine) The only way i can get to a C:/ prompt is to use a boot disk. Can you shed any light on this?
Thanks for your time
Raj
Boot from an MS-DOS floppy and run FDISK /MBR
One component of LILO is a "boot loader" (a bit of code that is stored on your primary hard drive in the "master boot record" (MBR) along with your partition table. The LILO boot loader code stores some additional code beyond the 446 bytes that are available in the MBR (the other 66 bytes are the primary partition table and a "signature" that marks the drive as "formatted"). Usually that additional code is stored on one of your Linux filesystems (/boot, or the /, root filesystem, depending on how you've laid out your systems).
When you removed your Linux filesystems, you also removed the additional boot loader code (the "secondary boot loader"). The reason that the boot process stops at: LI is that Werner Alsmesberger used a clever bit of programming to fit some diagnostics into the 446 of code. The letters L, I, L, O are printed at different points of the boot process.
So, if the boot loader hangs part way through the process, you have some idea of how far it got. There are many reasons why a system might stop at LI and not get to the second L in LILO. All of them amount to "I couldn't load the second stage boot loader." (Which makes sense in your case since you DELETED THEM).
Note: I've heard of cases where people have removed partitions and/or kernels and were still able to boot from them. That's because LILO stores the raw disk addresses of these files (this refers to the data in a way that is "below" the filesystem level). Removing the things from the partition tables or from a filesystem marks space as "unallocated" --- but it doesn't generally actually overwrite or affect the data. It just changes the way that the space is accounted for and make it available to be used by other partitions/files. So it makes since that LILO can still be used to be boot the system from an out-of-date mapping; until the data blocks that those files and partitions are actually used by something else.
Running the /sbin/lilo command updates those mappings, of course. The /sbin/lilo command is a program that uses the /etc/lilo.conf file to build a set of boot blocks and maps. I like to think of /sbin/lilo as a "compiler" for the "/etc/lilo.conf" program; that makes the boot records and maps analogous to the "program" and "libraries" that a compiler generates from your source code. This analogy makes perfect sense to programmers --- but it seems to sink in for quite a few non-technical users as well.
Looking for a 'dump'AnswerGang: Jim Dennis
From Gillian Bennett on Sun, 02 Jul 2000
Hi James,
I guess that in all likelihood this is the wrong forum for this question, but there are so many mailing lists for linux that I wasn't sure which one to post to. I am reasonalbly new to linux after being an admin for sun, dec etc for a few years.
I was wondering if there is a tool that will dump filesystems (similar to ufsdump or some other dump tool from other unix flavours) on RH linux 6.X. The filesystems are ext2 type filesystems and are currently backed up using cpio (SHUDDER).
I appologise for the inconvenience, Regards, Gillian
What have you got against cpio?
Anyway there is a Linux 'dump' (and 'restore') package. You should find it on your installation CD or on any good archive site.
Of course it's version number is only 0.4b16 or so. In a rational world that would suggest that the author things it is roughly 40% "feature complete" to version 1.0. However, some programmers in the Linux world don't like simple, rational versioning schemes so I have no idea what that version number is supposed to imply.
MMDF Anti-Relaying?AnswerGang: Jim Dennis
From Jaris Visscher on Thu, 06 Jul 2000
mars.ncn.net is a Linux server which is having problems emailing us. We are having trouble with mars.ncn.net emailing us at mtc1.mtcnet.net. = They seem to think it is our MMDF mail server.
We have checked all of their reverse DNS info and it is correct.
They are gettting the error
Connections reset by mtc1.mtcnet.net
Message could not be delivered for 5 days
Message will be deleted from queue
This has been going on for 2 months. Here is the exact message as it comes to our MMDF server in our log file. /usr/mmdf/log/chan.log As you will see we get a fetch of mars.ncn.net failed
I'm not at all familiar with the MMDF mail transport system. So I don't know what sort of "fetch" is going on here. However, it looks like:
6/23 10:16:02 smtpsr8272: h2chan ('mars.ncn.net', 1)
6/23 10:16:02 smtpsr8272: h2chan table 'local'
6/23 10:16:02 smtpsr8272: tb_fetch: dbminit
6/23 10:16:02 smtpsr8272: fetch (mars.ncn.net)
6/23 10:16:02 smtpsr8272: fetch of 'mars.ncn.net' failed
6/23 10:16:02 smtpsr8272: h2chan table 'list'
6/23 10:16:02 smtpsr8272: h2chan table 'smtpchn'
6/23 10:16:02 smtpsr8272: ns_fetch (21, mars.ncn.net, 1)
6/23 10:16:02 smtpsr8272: ns_fetch: timeout (0), rep (0), servers (0)
6/23 10:16:02 smtpsr8272: ns: key mars.ncn.net -> 38
6/23 10:16:02 smtpsr8272: ns_getmx(mars.ncn.net, 805db9c, 8068b58, 10)
6/23 10:16:02 smtpsr8272: ns_getmx: sending ns query (30 bytes)
6/23 10:16:02 smtpsr8272: ns_getmx: bad return from res_send, n=3D-1, =
errno=3D114, > h_errno=3D0
6/23 10:16:02 smtpsr8272: nameserver query timed out
... you're getting a name resolution failure while looking for MX records?
Does mars.ncn.net have a valid MX record? It doesn't look like it (from my own 'dig' commands).
It sounds like ncn.net hasn't created MX records for you. I don't know if you're MMDF installation has been configured for anti-relaying. It may be that the anti-relaying (anti-spam) configuration that you used is requiring that the sender/relayer have an MX (mail exchanger) record rather than just an A (address record.
Anyway, I'm sure that you know more about MMDF than I do. However, it occurs to me that it may be best to point you at the the canonical MMDF resources page (http://www.ivine.com/~mmdf) and let you read through the FAQ (http://www.ivine.com/~mmdf/mmdf.html)
Hopefully that will make more sense to you, since you've configured some of these programs and channels. There's also an searchable archive the mailing list. I saw one message there that seemed to assert that MMDF won't fall back to A records when MX lookups have failed (searching MX). I would expect that to apply to SENDING mail, which is why I'm wondering if your MMDF is trying to use a similar mechanism in an anti-spam measure while it's recieving messages.
Anyway, that should help. Having your postmaster subscribe to that list and post MMDF questions there will also probably be much better than posting them to more general fora. MMDF is a bit of a niche, so you really want to talk to its specialists.
Making CDsAnswerGang: Jim Dennis
From Henry White on Thu, 29 Jun 2000
Please point me to a place I can read on how to create an .ios file. I want to make a CD from this file.
Thanks Henry White
My guess is that you mean an ".iso" (as in International Standards Organization) which is a filename extension commonly used with IS0 9660 (the formal specification on the formatting for data CD-ROM).
Assuming that this is the case you want to get the mkisofs and the cdwrite and/or the cdrecord utilities. The mkisofs man page will help a bit. However, you should also look at the CD-Writing HOWTO at http://www.linuxdoc.org/HOWTO/CD-Writing-HOWTO.html
That is quite detailed.
... he replied ...
You are right I was asking about iso.
Thanks for your help. I am on my way now.
Henry C. White
HELPAnswerGang: Michael Williams, Heather Stern
From WwSHADOWMASTERwW on Thu, 29 Jun 2000
Listen. I just installed RedHat Linux 6.2 and I cannot get my modem to
work. I did the test and modem test on the set up manu and is does detect it
but stays at the initializing Modem prompt.. What do I Do I can t find anyone
who can answer this for me HELP.....I am using the KDE work station
setup..please tell em Step by Step on how to do this I would appreciate it
very much
PS I am not using Gnome!
[Michael] Is your modem internal? If it is, then there's a fair chance it's a 'WinModem'. These are modems designed to work within MSWindows. Since they use drivers written for MSWindows to work, it is very difficult [currently impossible] to get them working under Linux. If this is the case, then your best bet is to buy a new external modem. They're reasonably priced, and will work with all OS's.
[Heather] While it is very much in the cumudgeonly spirit of the Answer Guy to tell someone that their "lose"modem is not a big winner, it is no longer quite accurate to say that they just don't work.
PCTel models work, because a different corporate entity is maintaining their binary driver. How well they work, I wouldn't knowThey aren't the most common softmodem variety.
Lucent "56kFlex" modems work, because they (somewhat quietly) released a binary driver (it's been updated once, even though the party line is "we don't have a Linux, some outsiders did that, ask your modem manufacturer, we just design the controllerless cores". Sure. The drivers have to be modem specific, that's why Lucent has only one "Windows" driver posted on your i website. I have to laugh). Their corporate confusion aside, Lucent's have a fairly fine chance of becoming something much better than a modem as well, since some folks are working on different aspects of real software for it to be used as a phone line diagnosis tool and sampler. Depending on your needs for that, it might already be better than a modem ... but it's not usable as a modem that way; the open source software can't do PPP yet. Whereas the binary driver is flawed as regards unloading, and often requires shoe-horning into place.