Cramsession Linux Newsletter

Cramsession.com Linux News Archive

Please note that I've stopped writing the Linux News as of January 30, 2003, as Cramsession has cancelled most of their newsletters. You can send any questions or comments about this content to me (sean at ertw . com)
People have been asking for a downloadable version of the archives. [My mbox (one big file, 1.4MB)] [Individual files, text, tarball] [Individual files, html, tarball]
If you're looking for more Linux content, you might like my blog.
Jan 30, 2003
  Linux News - Issue #117
Jan 23, 2003
  Linux News - Issue #116
Jan 16, 2003
  Linux News - Issue #115
Jan 9, 2003
  Linux News - Issue #114
Jan 2, 2003
  Linux News - Issue #113
Dec 19, 2002
  Linux News - Issue #112
Dec 12, 2002
  Linux News - Issue #111
Dec 5, 2002
  Linux News - Issue #110
Nov 28, 2002
  Linux News - Issue #109
Nov 21, 2002
  Linux News - Issue #108
Nov 14, 2002
  Linux News - Issue #107
Nov 7, 2002
  Linux News - Issue #106
Oct 31, 2002
  Linux News - Issue #105
Oct 24, 2002
  Linux News - Issue #104
Oct 17, 2002
  Linux News - Issue #103
Oct 10, 2002
  Linux News - Issue #102
Oct 3, 2002
  Linux News - Issue #101
Sep 26, 2002
  Linux News - Issue #100
Sep 19, 2002
  Linux News - Issue #99
Sep 12, 2002
  Linux News - Issue #98
Sep 5, 2002
  Linux News - Issue #97
Aug 29, 2002
  Linux News - Issue #96
Aug 22, 2002
  Linux News - Issue #95
Aug 15, 2002
  Linux News - Issue #94
Aug 8, 2002
  Linux News - Issue #93
Aug 1, 2002
  Linux News - Issue #92
Jul 25, 2002
  Linux News - Issue #91
Jul 18, 2002
  Linux News - Issue #90
Jul 11, 2002
  Linux News - Issue #89
Jul 4, 2002
  Linux News - Issue #88
Jun 27, 2002
  Linux News - Issue #87
Jun 20, 2002
  Linux News - Issue #86
Jun 13, 2002
  Linux News - Issue #85
Jun 6, 2002
  Linux News - Issue #84
May 30, 2002
  Linux News - May 30, 2002
May 23, 2002
  Pearl In The Shell
May 16, 2002
  Linux Filesystems - Part Two
May 9, 2002
  Inside The Linux Filesystem
May 2, 2002
  CD Burning Under Linux
Apr 25, 2002
  Star Office Vs. Open Office
Apr 18, 2002
  Surfing With Mozilla
Apr 11, 2002
  "We Don't Support Linux..."
Apr 4, 2002
  Visit The UNIX Library
Mar 28, 2002
  Linux and World Domination
Mar 21, 2002
  Working With Keyservers
Mar 14, 2002
  A Look At Public Key Cryptography
Mar 7, 2002
  Monitoring Systems With "vmstat"
Feb 28, 2002
  Star Office 6 Not to be Free for Linux?
Feb 21, 2002
  How Can Programming Benefit a Systems Administrator?
Feb 14, 2002
  Alias: It's Not Just a TV Show
Feb 8, 2002
  Using The diff and patch Utilities
Jan 31, 2002
  How To Detect Cracks
Jan 24, 2002
  Using Razor to Shave Away Spam
Jan 17, 2002
  Stomping Spam
Jan 10, 2002
  Sair Linux Courseware Review
Jan 3, 2002
  2002: The Year of the Penguin!
Dec 27, 2001
  UNIX Apps on a Windows Box?
Dec 20, 2001
  Directory Assistance
Dec 13, 2001
  How Do You Kill Zombies?
Dec 6, 2001
  Using Hard and Soft Symlinks
Nov 29, 2001
  Change Terminal-Based Apps Into Network Apps
Nov 22, 2001
  Adventures In Booting
Nov 15, 2001
  Getting To Know PAM
Nov 8, 2001
  Know Your Enemy
Nov 1, 2001
  Do Mulder and Scully Use X-Windows?
Oct 25, 2001
  A Quick Look at the RHCE Certification
Oct 18, 2001
  What's Up With Linux Certification?
Oct 11, 2001
  Express Yourself Regularly
Oct 4, 2001
  Advice For Lazy Penguins?
Sep 27, 2001
  NVIDIA Jumps On Linux Bandwagon
Sep 20, 2001
  Understanding DNS in a Linux Environment
Sep 13, 2001
  Be Careful With Binaries
Sep 6, 2001
  Party Like It's 999,999,999
Aug 30, 2001
  Rooting Out Memory Hogs
Aug 23, 2001
  Spin Your 'Top'
Aug 16, 2001
  Keeping Time With NTP
Aug 9, 2001
  Supporting True Type Fonts
Aug 2, 2001
  Getting Perl To Fetch
Jul 26, 2001
  Who's The Man?!
Jul 19, 2001
  Adobe Cracks The DMCA Whip
Jul 12, 2001
  Due Processes
Jul 5, 2001
  Going Adobe Free
Jun 28, 2001
  Don't Send Mixed SIgnals
Jun 21, 2001
  Everything is a File. (almost)
Jun 14, 2001
  Know Your Partitions
Jun 7, 2001
  Where it's "at"!
May 31, 2001
  A Sneak Peek at RedHat 7.1
May 24, 2001
  Scheduling Tasks With cron - Part 2
May 17, 2001
  Scheduling Tasks With cron
May 10, 2001
  Open Source - Seeing Through The FUD
May 3, 2001
  A Look At Ximian's New Release
Apr 26, 2001
  Rev Up Your X-Windows Session
Apr 19, 2001
  Wrangling With GNU Cash
Apr 12, 2001
  Tame the syslogd Daemon
Apr 5, 2001
  Test Your Admin Skills At Honeynet
Mar 29, 2001
  Software RAID on Your Linux Box
Mar 22, 2001
  Prevent Disasters: Back It Up
Mar 15, 2001
  Notes From Underground!
Mar 8, 2001
  SuSE 7.1 - A First Look
Mar 1, 2001
  Certification Boot Camp
Feb 22, 2001
  Understanding Runlevels
Feb 15, 2001
  What Are The Advantages of Joining a LUG?
Feb 8, 2001
  Diving For Perls
Feb 1, 2001
  How To Secure Your Linux Installation
Jan 25, 2001
  Linux Problem Solving
Jan 18, 2001
  Stand up and Be Counted!
Jan 11, 2001
  2.4.0 is Here!
Jan 4, 2001
  When will Mom use Linux?
Dec 28, 2000
  The Year in Review
Dec 21, 2000
  The SourceForge Solution
Dec 15, 2000
  How to Compile and Install the New Kernel
Dec 7, 2000
  Put Your E-mail Into A Blackberry Basket
Nov 30, 2000
  Using Perl With Linux
Nov 23, 2000
  Working With MP3's Under Linux
Nov 16, 2000
  Apache 2.0 alpha 4
Nov 9, 2000
  Dell loves Linux!
Nov 2, 2000
  What's Up With RedHat 7?
===========================================================
                        LINUX NEWS
            RESOURCES & LINKS FROM BRAINBUZZ.COM
                  Thursday, October 4, 2001
        Read By Over 7,000 Linux Enthusiasts Weekly!
===========================================================

-----------------
TABLE OF CONTENTS
-----------------

1) Sean's Notes

2) Linux News

 	World's Greatest Editor
	Time to stand up to Microsoft
	Star Office 6.0 beta Released
	The Freedom to use Codes

3) Linux Resources

	Programming Linux Games
	SQL Databases for Linux
	Information Warfare: How to Survive Cyber Attacks
	Say Hello to PAM
	Three Minutes With Security Expert Bruce Schneier

4) App o' the week


~~~~~~~~~~~~~~~~~~~~~~ ADVERTISEMENT ~~~~~~~~~~~~~~~~~~~~~~~

We GUARANTEE you will pass your exam or you get your money back!

Win2K Titles         Only $99.95 each   (normally $149.95)
A+ Core & Elective   Only $99.95        (normally $249.95)
INET+ or Network+    Only $79.95 each   (normally $149.95)
Cisco 2.0 titles     Only $149.95 each  (normally $249.95)

Add our Audio Quizzer for only $19.95 for each cassette or CD.
CALL (800) 845-8569 FOR MORE INFORMATION OR VISIT US AT
http://ad.brainbuzz.com/?RC06&AI70

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

For information on how to advertise in this newsletter
please contact mailto:adsales@BrainBuzz.com or visit
http://cramsession.brainbuzz.com/marketing/default.asp

===========================================================
1) Sean's Notes
===========================================================

If there is something you find yourself doing often, it's
probably worth scripting.  Even if it's a matter of running
a couple of other scripts, the goal is to save some time.
It may seem like a waste of time at first, but add up all the
time you spend doing the task, and think of what else you
could be doing in that time.  If it's work-related, then
wrapping it up in a script (well commented, of course), lets
you get away with not having to explain it to everyone who
does the task themselves, or has to fill in for you on
vacation.  It's all part of our nature as Unix jocks to be
lazy.  Not "slacker lazy", but "work smarter, not harder
lazy".

The more you learn about scripting, the more places you'll
find it to be handy.  An example will help here.

Every week when I write this newsletter, I start off with a
file called template.txt, which has placeholders for every
news and resource item, plus the headers and footers.  I
copy it into a file called YYYYMMDD.txt, and begin my work
on it.  Once I've written the article and added the links
in, two things remain before I submit it, namely spell
checking, and filling in the "Table of Contents" section.

The latter is a real pain, and is the first thing that has
to be fixed.  After the first two weeks of cutting and
pasting, I knew it had to be scripted.  I came up with a
simple solution -- a Perl filter that extracts the headlines
from the .txt file, leaving me with only two cut and pastes
to do (versus nine plus a lot of scrolling).  It's actually
a pretty simple script:

#!/usr/bin/perl
while(<STDIN>) {
  if (/^-+$/){
    $a=<STDIN>;
    print "\t$a";
    $a=<STDIN>;
  }
}

The outer loop reads in input from the standard input.
Perl is a pretty relaxed language, so when I get the current
line from the <STDIN> statement, it stores it in a special
variable called $_  (that's a dollar sign, followed by an
underscore).

Next, I want to perform a regular expression search on the
current line, to see if it is beginning the title of one of
my links.  Everything between the /'s is called the pattern,
or a regular expression.  In this case, the pattern begins
with a carat, meaning "beginning of line".  Next is a dash
followed by a plus sign.  The plus sign means "match one or
more of the preceding".  The final dollar sign means end of
line.  So, my regexp will only match a line that starts with
a dash, ends with a dash, and has nothing but dashes in
between.  Since I already have the current line in $_, I
don't have to explicitly tell Perl where to look because
it's the default.  Otherwise, I'd have to tell it to do a
regular expression search with the =~ operator:

if ($_ =~ /^-+$/) {

Once I've found the line in question, I read the next line
with my title, and print it (with a tab in front for easier
pasting):

$a = <STDIN>;
print "\t$a";

And then, because the next line is also full of dashes, I
do a fake read to advance the file to the next line.

This week, it looks like this:

$ cat 20011004.txt | ./makecontents.pl
	TABLE OF CONTENTS
	World's Greatest Editor
	Time to stand up to Microsoft
	Star Office 6.0 beta Released
	The Freedom to use Codes
	Programming Linux Games
	SQL Databases for Linux
	Information Warfare: How to Survive Cyber Attacks
	Say Hello to PAM
	Three Minutes With Security Expert Bruce Schneier

A few clicks, and I'm done.  Is that lazy enough for me?
Not anymore.  It's been almost a year of cutting and
pasting; it's about time I had the script make the changes
directly.

The template I start off with has the phrase "Headline"
where I'm supposed to put the headline (shows how smart
my editor thinks I am).  I'm going to use that to my
advantage now.

What I came up with (after several tries) is:

#!/usr/bin/perl -w
use strict;

# Need a filename to function
$ARGV[0] || die "Gimme a filename\n";

# Open one for reading, and a backup stream for writing
open FILE, "<$ARGV[0]" or die "Error opening $ARGV[0]\n";
open BACKUP, ">$ARGV[0].bak" or die "Error opening backup\n";

my $newsletter;

while(<FILE>) { # Run through the file
   print BACKUP;  # Write to the backup file
   $newsletter .= $_;  # All that we've read so far goes here
   if (/^-+$/){    # We found the beginning of a header
   my $a=<FILE>;  # read it in
   print BACKUP $a;  # Write to the backup file
   $newsletter .= $a;
   unless ($a =~ /TABLE OF CONTENTS/) {
	# Substitute the first "Headline" for the real one
	$newsletter =~ s/[ \t]+Headline\n/\t$a/;
   }
   $a=<FILE>;  # Read next line
   print BACKUP $a;  # Write to the backup file
   $newsletter .= $a;
	}
}
close BACKUP;
close FILE;

# Good work... update the original file
open FILE, ">$ARGV[0]" or die "Error opening $ARGV[0] for writing\n";
print FILE $newsletter;
close FILE;

I've added a lot of comments, but it's basically the same
thing as before, just not written as a filter (ie it reads
and writes the files by itself).  You'll notice I write a
backup copy as I go along, it's just good practice!  I'm not
perfect, so I don't expect my scripts to be.  Everything is
pretty basic, except the real smarts of the script:

unless ($a =~ /TABLE OF CONTENTS/) {
	# Substitute the first "Headline" for the real one
	$newsletter =~ s/[ \t]+Headline\n/\t$a/;
}

Here, I'm skipping over the header for table of contents.
Since I have the entire document up until the current line
in memory, I can perform a substitution on it, replacing
the placeholder headline, with what I actually read in.
This is a handy thing in Perl:

$variable =~ s/old/new/;

substitutes "old" for "new" in $variable.

So, in my quest for eternal laziness, I spent a bit more time
than usual on this article, but ended up with a script that
saves me some repetitive work that I dislike.  A few more
lines, and it could fill in the date at the top, and maybe
even run a spell check at the end.  If only the status
reports I have to write for my boss were as easy...Wait...
This article gives me an idea!

Long live the [lazy] Penguin,

Sean
mailto:swalberg@brainbuzz.com

Visit the Linux News Board at
http://boards.brainbuzz.com/boards/vbt.asp?b–2

===========================================================
2) Linux News
===========================================================

-----------------------
World's Greatest Editor
-----------------------
VIM, the King of all editors (or at least a clone thereof),
announces the release of 6.0. There's a whole whack of new
features added to make a great editor even greater.

http://www.vim.org/announce/vim-6.0

-----------------------------
Time to stand up to Microsoft
-----------------------------
This scathing attack on Microsoft's desktop operating systems
is too good not to pass along. The author calls on people to
jump on the Linux bandwagon, citing that Microsoft's new
policies are making it even more cost-effective.

http://www.zdnet.com/zdnn/stories/news/0,4586,2815189,00.html

-----------------------------
Star Office 6.0 beta Released
-----------------------------
This version of StarOffice purports to be easier on memory,
and doesn't take over your entire desktop. Two things I
immediately noticed were that setting up PDF output is very
easy, and that TrueType fonts can be used (an extra step, but
it is well documented). A vast improvement over 5.2...I'll
just hope it's as stable.

http://www.sun.com/staroffice/6.0beta/

------------------------
The Freedom to use Codes
------------------------
Linux is all about freedom, which is why many Linux enthusiasts
are also Cryptography buffs. In the wake of the US tragedy,
there are now calls for increased restrictions on Crypto.
A reporter reflects on the folly of such a plan.

http://news.cnet.com/news/0-1272-210-7320099-1.html

===========================================================
3) Linux Resources
===========================================================

-----------------------
Programming Linux Games
-----------------------
If you've got a bit of programming knowledge under your
belt, and wanted to try your hand at writing games for
Linux, this is the book for you. It covers the basics of
the SDL API, along with some other game writing APIs, and
develops a complete working game. Well written, and full
of useful information.

http://itresources.brainbuzz.com/tutorials/tutorial.asp?t=S1TU1475

-----------------------
SQL Databases for Linux
-----------------------
"So you find you need to store some data on your Linux
system, and are wondering what program to use... There are
a vast array of database systems available for use on Linux.
Some are simple, some sophisticated, some cheap, some
expensive. One of the first things you ought to do is ask
yourself what you need to do with the database, as that is
critical to bringing the number of choices down from
'stupendously bewildering' to merely 'astoundingly many'."

http://freshmeat.net/articles/view/305/

-------------------------------------------------
Information Warfare: How to Survive Cyber Attacks
-------------------------------------------------
With all the news about terrorism and viruses lately, this
book couldn't have come at a better time. A very interesting
read, "Information Warfare" covers the non-technical aspects
of Cyber Terrorism and other attacks.

http://itresources.brainbuzz.com/tutorials/tutorial.asp?t=S1TU1467

----------------
Say Hello to PAM
----------------
PAM, the Pluggable Authentication Modules, can be a great
thing if you know how to use them. This article from
O'Reilly Net has some great instructions on the format of
the configuration files, and the various modules available.

http://linux.oreillynet.com/pub/a/linux/2001/09/27/pamintro.html

-------------------------------------------------
Three Minutes With Security Expert Bruce Schneier
-------------------------------------------------
Any time Bruce talks, I'll listen. This time it's on
security (or lack thereof) in Microsoft products, and the
merits of full disclosure. He regularly speaks out on topics
close to the UNIX world, such as freedom and Open Source.

http://www.pcworld.com/news/article/0,aid,63806,00.asp

===========================================================
4) App o' the week
===========================================================
"2diskXwin" is a distribution of Linux that...guess what...
fits on two disks. It features a web browser and Internet
capabilities, so this could work as a very easy remote X
desktop device.

http://www.mungkie.btinternet.co.uk/projects/2diskXwin.htm

===========================================================
(C) 2001 BrainBuzz.com. All Rights Reserved.
===========================================================
_______________________________________________________

         This message is from BrainBuzz.com.

You are currently subscribed to the
   Hottest Linux News and Resources
   as: sean@ertw.com

To un-subscribe from this newsletter by e-mail:
   send a blank email message to:
   mailto:leave-linuxnews-3825955Y@list.cramsession.com

-------------------------------------------------------

To Subscribe to this newsletter by e-mail:
   send a blank email message to:
   mailto:join-linuxnews@list.brainbuzz.com
_______________________________________________________