...making Linux just a little more fun!

next -->

The Mailbag


HELP WANTED : Article Ideas
Submit comments about articles, or articles themselves (after reading our guidelines) to The Editors of Linux Gazette, and technical answers and tips about Linux to The Answer Gang.


Bash Scripting

Sat, 07 Jun 2003 20:01:53 +0530
Robin Chhetri (robinchhetri from fastmail.fm)

Hi Gang, I asked another question around one month ago and even though I could not come up with a answer I decided to come up here again.(Incidentally I tried it also in linuxquestions.org). What would be the equivalent to the zsh script given below in bash

$echo ${${(z) $(whereis libcrypto)}[2]}

if the output of $(whereis libcrypto) is

libcrypto: libcrypto.so libcryto.a
it returns libcrypto.so only.

Now I could come up with

$robin=($(whereis libcrypto)); echo ${robin[1]}

But can it be done in one go using some construct? I am not a shell guru so I wonder if it can be done!

Robin


Article suggestion - Clustering (formatting correction)

Wed, 31 Dec 2003 04:05:55 -0800
Dave Bechtel (kingneutron from yahoo.com)
Answered By Heather Stern, Ashwin

Dear God, yahoo really b0rked that one. All because I wanted to underline .net... Sorry 'bout that.


--I've been vaguely interested in clustering for a while, but really don't know what I could do with it. I have 3 machines:

--I can't recompile a kernel intended for the slow Intel machines on the fast AMD, it just doesn't work. However, I could go out and buy some cheap machines at a computer show for ~$30-$40 apiece, or get some loaners from a friend.

--My question is, what are clusters good for besides graphics / animation / video editing / number crunching (none of which I'm interested in)? Can I gzip/ bzip2 compress a 4-8GB tar file on a distributed cluster and save time? Can I recompile a 2.4 kernel that way so it doesn't take an hour and a half? (Yes, even using "make -s -j 3".)

--I've heard of OpenMosix, but haven't looked into it very far. Just a note, my network is 100MBit Ethernet. Any info the LG.net folks could provide would be welcome, TIA.

===== Contents above ThisLine (C)ThisYear KingNeutron Ltd.

[Heather] We'll need permission to publish your message and responses related to the thread for the world wide webzine Linux Gazette, it you want a decent chance at an answer.
This is clear enough to post as a Wanted if none of the Answer Gang want to take a pop at it, but we're past deadline for the current issue; it'd end up in February.
And of course, he did grant that, and here you have it. But it's worth noting to folks who copyright their usenet posts, we need your intent to be public or we can't publish it :) And if we can't publish it, we often won't answer it either.

===== Check out KNOPPIX Debian/Linux 700MB Live CD: ===== http://www.knopper.net/knoppix/index-old-en.html "C00K13 M0N573R 0WNZ J00!! PH34R C00K13 M0N573R 4ND 0SC4R 4ND 3LM0 4ND 5NUFFL3UP46U5 4ND 7H3 31337 535AM3 57R337 CR3W!!" .dotgoeshere.

[Heather] To the tiniest portion of an answer: there's a mosix aware variant of Knoppix. Check out LWN's Distributions page. (lwn.net/Distributions) If you get things going, I agree wholeheartedly -- this could make a really fun article by you about getting your cluster going. Are you suggesting that you could write this, or that you would like to see the topic come up?
As such I've changed the gazette@ (main editor) cc to articles@ (article ideas and submissions)
[Ashwin] Have you tried Cluster Knoppix?
http://bofh.be/clusterknoppix


RV: Sendmail Help

Sun, 25 Jan 2004 17:52:44 -0500
Juan Carlos Diez (jdiez from eluniversal.com)
Answered By Thomas Adam, Mike Orr (Sluggo)

Dear Ben, hello.

My name is Juan Carlos Diez, a novice Unix Sysadmin with no experience at all with sendmail, who needs desperately your kindly help :-)

I read your sendmail notes on http://www.linuxgazette.com/issue58/okopnik2.html and I thought maybe you could help me.

Currently we have a Red Hat v6 server with sendmail v 8.9.3 running. We have set a new server with Red Hat 7.3 and sendmail 8.11.6 in order to migrate all of our services from the current server to the new one.

My question is: May I use the current sendmail.cf and sendmail.mc files in the new server to avoid manually configuring sendmail again? I mean, to copy such files to the new server and restart sendmail, do you think it will work fine?

Thank you very much.

[Thomas] Why have you not tested it yourselves? You certainly have nothing to loose by doing so :) To answer your question though, you will have no problems using the configuration files. They're based in a rather interesting scripting language called m4 which is a separate entity to sendmail.
[Sluggo] He may not know what TAG is, Thomas. :)
TAG is The Answer Gang, the group of volunteers at Linux Gazette that answers tech-support questions. All questions and answers are considered for publication in a future issue. Please address follow-ups or future questions to tag@lists.linuxgazette.net. More information about The Answer Gang is at: http://linuxgazette.net/tag/ask-the-gang.html

Thank you all for answering, I really appreciate it.

Best regards,

JCD.


GENERAL MAIL


Jython article

Thu, 13 Nov 2003 22:09:46 -0500
Rob Tougher (robt from robtougher.com)

BTW, thanks for your comments on the article. Your editorial
efforts make LG a better magazine.

Editorial oversight does matter. People will see that in the magazine's quality.

- Rob


Windows Defectors

Mon, 5 Jan 2004 16:32:06 +0000 (GMT)
Tony Dearson (ajdearson from lycos.co.uk)

I would disagree with a softening of the advise never to log in as root. Respectively, I would remind that there are two types of Linux/Unix Administrators --

1. Those who have trashed the entire system by mistake.

2. Those who will trash the entire system some time in the future.

Personally, I avoid logging in as root as much as possible, preferring to su for a brief perioed when necessary.

Kind regards
Tony Dearson

[Sluggo] I don't see much difference between logging in as root vs su'ing. Root is root.
[Ben] Ever dip your finger in liquid nitrogen, Mike? It's a geek thing, FSVO "geek" (e.g., radars and black-body targets.) In-and-out, no problem. Keep it there for a full second or so, and you'll have frostbite that may require amputation. (Five seconds or so, and you'll be able to shatter it like glass.) When you log in as root, everything you do - and the chain of consequences that proceeds from it - is done as root, and you must consider that consequence tree for every single command you type including "ls". When I type a command, then realize that I need root privs for it, I just hit the up-arrow, type:
"<Ctrl-A>su -c "
think about the effects, and press 'Enter'. Somehow, typing 10 characters (7 if I know it beforehand) does not seem to me to be the Sysyphus' burden (with a bit of Prometheus thrown in for effect) that you insist it is.
[Sluggo] I hate typing "su[Enter][password][Enter][command][Enter][ctrl-D]" all the time, or even worse, "su -c 'command in quotes'[Enter][password][Enter]".
[Ben] [shrug] Everyone has their pet hates, of course. This does not in any way correlate to what makes for reasonable system usage.
[Sluggo] I love the fact that konsole has a "Root console" menu option, so I can get a root session any time without using the arcane su syntax.
[Ben] In what way is it arcane? Is "-c" in some way connected to the Norse Edda and the Boghaz-keuy Babylonian tablets? I wasn't aware. Molehill -> mountain requires a sufficient amount of dirt, and I'm afraid there just isn't enough.
[Sluggo] (You do have to type the root password, of course.) Even with that, I usually leave the session open in the background for a while in case I need it again.
The most important thing I ever learned (from sysadmin Pann McCuaig if he's reading) is, sit on your hands before pressing [Enter] after any potentially destructive command like "rm -rf", "rsync", etc.
[Ben] [grin] I prefer to use my other end to control my hands when using root privilege, thanks.
[Sluggo] Make sure you're the right user, on the right system, and in the right current directory. (Actually sitting on your hands is optional, but the metaphor is good so you don't forget it.)
If all that information doesn't appear in your shell prompt, read the manpage for your shell and set PS1 or PROMPT accordingly. My favorite prompt strings for zsh are:
PROMPT="%S%n@$HOST_:%~%#%s "
PROMPT2='%S%_>%s '
For root I use bash with these lines:
export PS1='ROOT@`hostname`:`pwd`$ '
export PS2='> '
[Ben] I've done the following in my "~/.bashrc":

See attached ben.bashrc.txt

Whenever I'm root, my text is all in red. Makes for a decent clue, hard to miss.
[Sluggo] (Normally people use '#' to distinguish their root prompt, but I find that too easy to miss. I also need '$' to show it's bash rather than zsh (whose conventional symbol is '%').
Another important thing to remember is that "su -" gives you root's (or anybody's) full shell environment,
[Thomas] ...so that $SHELL, and other ~/.profile files, etc are sourced, as well as various other exported $VARIABLES are updated.
[Sluggo] while "su" alone gives you a partial environment that doesn't include all their environment vars. E.g., "echo $USER" (or "echo $LOGNAME" in some shells) shows your login rather than root's. That may cause some programs to do the Wrong Thing; e.g., 'mutt' will read your mail rather than root's.
[Thomas] Will not change $SHELL, and other variables.
This can be negated with the:
su -m
switch.
[Sluggo] (No, you still shouldn't read mail as root anyway! Put those dark classes back in your pocket, Ben.)

Mike,

That's a good tip, thanks. A small detail I've never come across before

Tom


About solving priblem of /bin/bash access denied

Wed, 7 Jan 2004 20:56:46 -0500
sameer sonaikar (sonaikar from yahoo.com)
Privately sent to Ben, and forwarded to the Linux Gazette for publication. -- Heather

Dear sir,

I am using Red Hat 7.2 and facing same problem after installing sendmail. Might I have made mistake while confugering Sendmail. But I am trying to find the mistake.

I got a lot Encouragement from ur efforts.

Thanking you.

With Regards,
Sam

[Thomas] Are you saying that you followed Ben's article (http://linuxgazette.net/issue52/okopnik.html) and that after you installed sendmail the problem arose that /bin/bash access denied? That being the case I would either do:
rpm -qilp sendmail
to generate a list of files belonging to that package, and check the perms for each (assuming you're using an RPM-based distro), or under debian:
dpkg -L sendmail
I am deliberately being vague here.
Your question as it stands lacks structure, information and meaning. I suggest you look here:
http://linuxgazette.net/tag/ask-the-gang.html
for further information.
-- Thomas Adam

GAZETTE MATTERS


Clear writing

Thu, 1 Jan 2004 21:29:08 -0500
Ben Okopnik (the LG Answer Gang)

I'm not sure where this should be shoehorned into our FAQs, but - having just read this excellent 25-page paper, I think it should be required reading for prospective authors (or anyone who wants to write a technical paper). "Clarity in Technical Reporting", which had a long run as an underground publication at NASA, was officially published by The Powers That Be once they caught on (thus proving that they were worthy of their positions. All hail, etc.)

http://techreports.larc.nasa.gov/ltrs/PDF/NASA-64-sp7010.pdf


stylesheet problem??

Fri, 02 Jan 2004 10:39:15 -0700
Bob van der Poel (bvdpoel from kootenay.com)

Hi all. Just grabbed the #97 and am having some problems reading it on Mozilla 1.6b on Mandrake 9.0. The navigation box overlays the first several lines of each article. I played a bit with lg.css (which I don't know anything about) and got it readable by outcommenting the line:

	position: absolute;

at line 53.

Now, the article text overlays the nav. box. Not what you intended, but it is readable... a real fix would be appreciated. Hey, this bug might even spur me on to learn how to use stylesheets :)

And: keep up the great work!

[Mike] Thanks. Our stylesheet editor, Rob Tougher, is away on family business, and I have only a rudimentary knowledge of CSS. Are the menu links showing up one per line with a black bullet left of each? And the breadcrumbs (=Yahoo bar) too? That was something I specifically fixed yesterday, because our stylesheet fixes this month (for Netscape 4 and Phoenix) broke compatibility with issue 97. If you do "View Source" on an offending page and scroll to the bottom, the menu links should not have <li>...</li> around them. If they do, your browser is caching an obsolete version of the page.
I tried your solution but it breaks in my Galeon: it moves the menubar to the very top, covering part of the logo and Tux. While this is readable, it's not acceptable. Thanks for letting us know anyway, and for any other ideas you might have later.
A new problem we have is that after I added the "Contact Us" link, the menubar is extending too far to the right past Tux. I couldn't figure out how to prevent that. Do you have any ideas?

Well, problem is solved. I dl'd the version on the site just now and it works just fine. Guess I grabbed while you were putting, or something. Thanks!


Linux Gazette

Sat, 3 Jan 2004 10:16:33 +0000
Martin J Hooper (martinjh_linux from blueyonder.co.uk)

Heather,

Been reading for a while and lost the site when you started having problems. Nice to find it again!

Keep up the good work. :)

Martin

Thanks, Martin, I'm glad you like how we've kept it. Happy New Year :) -- Heather


how to join the TAG mailing list?

Wed, 31 Dec 2003 17:29:51 -0800
sanjaya singharage (sanjayas from opensource.lk)
Answered By Mike Orr (Sluggo), Breen Mullins, Ben Okopnik, Thomas Adam, Heather Stern

This is a multi-part message in MIME format.

You'd think that if Sanjaya had been on this list before that he would have remembered that none of us appreciate MIME encoded e-mails.... oh well...
I guess a beneficial reading of:
http://linuxgazette.net/tag/ask-the-gang.html
is in order. -- Thomas
I used to be on the tag mailing list some time ago. Does it still exist? How can I join it? thanks.
[Mike] http://linuxgazette.net/mailman/listinfo/tag
We couldn't carry the subscribers over from the old linux-questions-only list because SSC wouldn't give us the member roster. Now the list is fully under our control.
[Breen] By the way, I'm back too. It's been pretty busy IRL, but I finally got around to moving here.
Cheers and Happy New Year,
doesn't seem obvious to find http://linuxgazette.net/mailman/listinfo/tag on the home page of http://linuxgazette.net Did I miss something?
Wishing all a happy new year!
sanjaya.
[Ben] It's not supposed to be obvious; you were just shown a shortcut. If you want to join, the what you're really supposed to do is read the TAG FAQ at:
http://linuxgazette.net/tag/members-faq.html
which will direct you to the subscription address, etc. after explaining the necessary facts of life - such as, you do not need to subscribe to TAG in order to ask a question. Subscriptions to TAG are for those who are willing and able to answer Linux questions.
Good point - we should update the "About TAG" blurb on the mailman link given above to include this concept, give the hotlink to member policy, and advise querents to read ask-the-gang and then just send mail. -- Heather


bum link

Thu, 15 Jan 2004 10:01:22 -0800
Carla Schroder (carla from bratgrrl.com)

Thanks. We've been debating how much to change the back issues. Plus it's a big job, and we can't change the mirrors that don't resync back issues.

Hello Mike,

No worries. :) Just letting you know, what you do about it is up to you.

"The Wonderful World of Linux 2.6" is absolutely incredible. What a great article.

cheers


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 99 of Linux Gazette, February 2004

next -->
Tux