SLUG Pearls #4 For 25 Jun 2000 By Jeff Waugh SLUG Logo Check out the Sydney Linux User Group (http://www.slug.org.au/) ! Table Of Contents * Standard Format * Text Format * XML Source * Introduction * Threads Covered 1. 18 Jun 2000 - 19 Jun 2000 (7 posts) No pussyfooting around 2. 18 Jun 2000 (1 post) Superblocks found! 3. 20 Jun 2000 - 22 Jun 2000 (10 posts) When Men are Men: Uptime 4. 20 Jun 2000 - 22 Jun 2000 (34 posts) The Distribution Question 5. 21 Jun 2000 - 22 Jun 2000 (5 posts) Bash Precedence 6. 21 Jun 2000 (1 post) Machine Safety in the Workplace 7. 24 Jun 2000 (4 posts) Don't Cache My Images! Introduction Welcome SLUGgers and Kernel Cousin readers! This edition of SLUG Pearls is the first written for both our website, and Linuxcare's Kernel Cousins page. We hope readers far, far away from Sydney can enjoy the ongoing ramblings of our mailing list as much as we do. Thanks aplenty to Terry Collins of Wombat Outdoor Adventures (http:// www.woa.com.au/) , who saved #1 and #3 with his copy of the SLUG mailbox. - Jeff Announcements: * InstallFest 2000 (http://linux.org.au/installfest/) Currently in planning, InstallFest 2000 will be a round-the-continent series of advocacy and installation days, beginning with LinuxSA (http:// www.linuxsa.org.au/) in Adelaide. SLUG is planning to take part on August 26th at Macquarie University. Supporters and voluteers welcome! * linux.conf.au Call for Participation (http://www.progsoc.uts.edu.au/lists/ slug/2000/June/msg00853.html) * New Kernel Cousin: SLUG Pearls! (http://www.progsoc.uts.edu.au/lists/slug/ 2000/June/msg00915.html) * Book Review: Linux Desktop Starter Kit (http://www.progsoc.uts.edu.au/lists /slug/2000/June/msg01088.html) 1. No pussyfooting around 18 Jun 2000 - 19 Jun 2000 (7 posts) Archive Link: "split and join?" People: We'll start off with a quick one this week: Ben Donohue had split a file for transfer on floppy with the split command, and found that join wasn't the command for joining the pieces back together. DaZZa provided a quick and easy solution with "cat xaa xab > zzz" (cat is short for concatenate). 2. Superblocks found! 18 Jun 2000 (1 post) Archive Link: "Superblocks and lost mp3" People: Simon Rumble, Simon Rumble kindly posted a solution (http://www.progsoc.uts.edu.au/lists/slug /2000/June/msg00771.html) to his problem (http://slug.org.au/ pearls-20000618.shtml#2) from last week. The findsuper command allowed him to do an fsck on the partition, but the recovered files were a mess, if anything. "No idea if these are recoverable but since I have a cable modem, recovering all these legal mp3s that I own the original CDs for shouldn't be a problem. Erm. ;)" 3. When Men are Men: Uptime 20 Jun 2000 - 22 Jun 2000 (10 posts) Archive Link: "9:52am up 368 days, 17:37, 1 user, load average: 1.02, 1.01, 1.00" People: Ian Ward, Howard Lowndes, Aravind Naidu, , Angus Lees, Conrad Parker, Matt Allen, Tony Cook Someone has to start these things. Ian Ward: What a great OS! [root@gateway /root]# cat /etc/redhat-release Red Hat Linux release 5.2 (Apollo) [root@gateway /root]# uptime 9:52am up 368 days, 17:37, 1 user, load average: 1.02, 1.01, 1.00 [root@gateway /root]# Howard Lowndes, seeing through the whole size of a man's... charade commented that, "You might be able to keep it up, but are you sure that you have got it properly covered. (8-)" Nyuk, nyuk, nyuk. Matt Allen (who was too embarrased to show his uptime) wondered why Ian's load average was up at 1.00. Tony Cook (who didn't have a very good uptime, but felt obliged to tell) commented that his dual processor machine stays at 2.00 due to the obligatory distributed.net client. Aravind Naidu felt the need to blame someone else for his uptime, then standing at 262 days. Of course, "it would have been easily >400 odd days otherwise" . CaT: [root@box /root]# uptime 10:21am up 396 days, 8:46, 1 user, load average: 0.09, 0.02, 0.01 Mine's bigger then yours. ;) And then, "Here we go again..." Rodos: [rodos@digit rodos]$ uptime 11:29am up 456 days, 4:43, 4 users, load average: 0.01, 0.08, 0.08 [rodos@digit rodos]$ Gus, one of our resident Debian Weenies (who also omitted his own uptime), commented: "heh, now try and upgrade it to the latest redhat - keeping the uptime (if thats too easy, do it remotely ;)" Chiming in with veiled support, our president, Mr. Conrad Parker: "sheesh gus, next thing you'll be expecting people to do that in one command!" Thanks Ian... ;) 4. The Distribution Question 20 Jun 2000 - 22 Jun 2000 (34 posts) Archive Link: "Distributions" People: Jon Biddell, Terry Collins, Jim Hague, , Aravind Naidu, Jim Clark, Jeff Waugh, Chuck D There must be something in the water. Jon Biddell said, "Not wanting to start another Religious War (which this probably will), but who is using which distro for what ? What is "the best", if this can be quantified ?" After a quick conversation, Terry Collins offered these tips: If YOU are going to support the box, go with what you know best/find easiest. If there is stiff resistance, go with something with the name, like, sigh, RedHat. If you have a very specific job in mind, then ask on the list for people's experience with distro's and apps, e.g. network monitor, etc. It is usually the apps you want to know, rather than the distro, Jeff Waugh posted a lengthy Debian recommendation (http:// www.progsoc.uts.edu.au/lists/slug/2000/June/msg00879.html) , which Jon was interested in. Jim Hague posted his personal guide: * Debian. For the hardcore Linux user. I must get to know it better. * Mandrake. Nice desktop. * RedHat. Installed base. * SuSE. Does ISDN proper. Install doesn't ask about NIS. All the rest do. I needed to set up NIS. Some quick recommendations included: * Mandrake, for being bleeding-edge fresh (Tom Massey) * Mandrake, for being compatible with RedHat, and thus with many commercial applications (Aravind Naidu) * Mandrake, for being more polished than RedHat (Jim Clark) * RedHat, for at least having the Linux kernel (John Zantey) * OpenBSD, for having the "cat" command (a meddling Chuck Dale, who really uses just about anything he can get his hands on) Thankfully, there were no flames directed at anyone on the list, but RedHat got a bit of a grilling, as per usual. 5. Bash Precedence 21 Jun 2000 - 22 Jun 2000 (5 posts) Archive Link: "bash" People: Minh Van, Herbert Xu, Cameron Simpson, Minh Van posed a teaser: given the expression: 1. if [ -n $dirname ] && [ \( -d $dirname \) -a \( -x $dirname \) ]; then in bash, i don't understand why it is any different and less tedious from: 2. if [ -n $dirname ] && [ -d $dirname ] && [ -x $dirname ]; then could somebody explain the reason or need to have embedded boolean constructs and escaped parentheses in the first expression ? Herbert Xu: Use the second form whenever you can. && is guaranteed to short circuit while -a never does. Also, to use -a safely you have to put in those ugly brackets :) And if you shell doesn't have test built-in, well, dump it :) Cameron Simposon disagreed: "Not so. They're only needed if you have precedence issues, which don't obtains in the examples cited." Herbert gave an example showing why "it's a good habit to use &&/|| in place of -a/-o" : Consider "$dirname" := "=", and we had [ -d $dirname -a -x $dirname ] Since = has the highest precedence among all operators, this becomes [ \( -d = -a \) -d = ] which causes an error. This can be avoided by either using brackets or &&. 6. Machine Safety in the Workplace 21 Jun 2000 (1 post) Archive Link: "Look mum, no hands (writing)." People: Rodos posted a helpful recipe for anyone using a single-purpose Linux machine in a hostile environment. A summary: Well I have been trying to make a read-only system that in theory can't get a file system corruption. I have a box that runs one application only. It is headless so if someone turns it off and on (likely, its in a factory mounted on a pilon) I want to be as sure as possible that it will restart without human intervention. Here's how he did it. (http://www.progsoc.uts.edu.au/lists/slug/2000/June/ msg00933.html) 7. Don't Cache My Images! 24 Jun 2000 (4 posts) Archive Link: "Automatic update of html pages" People: Matt Allen, Grahame Kelly's Wild Possum Cam (http://www.wildpossum.com/) was not being updated as the page refreshed, though he was using the correct meta tags. Matt Allen (who solves this one fairly regularly it seems), wrote: Another solution is, if the page is being parsed by any sort of server side scripting, tack a unique number on the end of the grahpic, ie in PHP it would look like That sould append the current unix time stamp on the end and ALL caches will reload it. Its a good little trick to know. Which worked perfectly. Sharon And Joy Kernel Traffic is grateful to be developed on a computer donated by Professor Greg Benson and Professor Allan Cruse in the Department of Computer Science at the University of San Francisco. This is the same department that invented FlashMob Computing. Kernel Traffic is hosted by the generous folks at kernel.org. All pages on this site are copyright their original authors, and distributed under the terms of the GNU General Public License version 2.0.