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
                http://www.Cramsession.com
              November 7, 2002 -- Issue #106
===========================================================

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

1) Sean's Notes

2) Linux News

	Red Hat Announces New Certification
	GNOME Foundation Board Elections
	A Bug or Two... Or Six
	Missing Chapter From Mitnick's Book

3) Linux Resources

	Everything You Ever Wanted to Know About LDAPv3
                           (But Were Afraid to Ask)
	Enterprise Snort Installation
	Securely Speaking
	Fighting Spam
	Python Resources

4) App o' the Week


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

Gain study time and enhance your learning! Hear hundreds of
certification exam questions on audio CDs or cassettes.
Learn while you commute to and from work, exercise, or walk
the dog. Ideal for those times when you can't read. 90-day
money back guarantee if you're not happy.

http://ad.brainbuzz.com/?RC06&AIW49

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

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

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

Like many people with a Linux box on a cable modem, I've got a
web server.  Nothing fancy, but one of the things it does is let
my brother and I post pictures of our kids for our family to
see.  So, we scan in the pictures, create a directory, and
upload the files.

However, what you end up with is a pathetic looking directory
listing that Apache gives you.  What I'd rather have is a page
of thumbnails, each linked to the full sized picture.  In shell,
this is pretty easy:

echo "My pictures <br>" > index.html
for i in `ls *.jpg | grep -v ^tn_`; do
  convert -interlace NONE -geometry 133x133 $i tn_$i
  echo "<a href=$i><img src=tn_$i></a><p>" >> index.html
done

Basically, that iterates through each .jpg that doesn't begin
with tn_, and uses the ImageMagick "convert" command to make a
133x133 thumbnail of it called tn_imagename.jpg.  The rest is
some simple HTML.  It's not too much from there to make this
iterate over some directories.

Ick.  Each time I re-run this script, it has to recreate the
thumbnail from the original file, even if the original file
hasn't changed.  Then, even if none of the files have changed,
the index file has to be recreated.  What a waste.  This was
fine for a while, but my brother is some sort of scanning freak,
and updating his page became a 10 minute job.

What we need is some sort of dependency system.  Developers have
had this for ages, it's called "make".  Make's job is to take a
config file that describes the relationship between files, and
to execute the proper commands to bring everything up to date.

For example, a programmer might have 100 source files.  Each
file is compiled into an object file, and all the object files
are linked together into an executable.  If one source file is
updated, then only one object file has to be recreated and the
linking step redone to get the final executable.  It saves a lot
of time.

Makefiles are pretty simple.  If we had two .c files that we
wanted to build into an executable called "program", we could do:

program: file1.o file2.o
	gcc file1.o file2.o -o program

%.o: %.c
	gcc -c $< -o $@

Call it "Makefile", and all you have to type is "make" at the
command line.  This makefile has two stages.  Each stage
consists of:

target: dependencies
	instructions for creating target
	more instructions
	note that there are no blank lines, and it is tab indented

The first target is for the "program" executable itself.  It
says that "program" needs "file1.o" and "file2.o".  If either
are newer than program, then program has to be rebuilt.  You
rebuild it by invoking gcc.

The second stage is what is called an implicit rule.  Since the
commands to build file1.o are the same as building file2.o, I
use an implicit rule to say "to build a .o file from a .c file,
do this".  $< is expanded to the name of the original (or
dependency) file, and $@ is the name of the target.

If you don't specify which target to make, the first target is
built.  Thus, "make", or "make program" are the same.  Likewise,
to rebuild file2.o, you could run "make file2.o".

Back on to the pictures.  Makefiles sound like a great fit.
Nothing says that my makefile has to use a compiler!  I'll use
some basic shell scripting to build the HTML, and good old
ImageMagick to make the thumbnails like I did in my original
script.

At the beginning of my Makefile, I defined some variables (note
the use of := to define a variable, and the "shell" command to
insert the results of a shell command).

INDEXFILE := index.html
# Precompute the names of the thumbnails
# sed is used to prefix each filename with tn_
THUMBS := $(shell ls *.jpg | grep -v "^tn_" | sed 's/^/tn_/')

Next, I state that index.html depends on all the thumbnails.
To build the index file, I iterate through all the thumbnails,
and make a table with five columns.

$(INDEXFILE): $(THUMBS)
        @echo "Building index"
        @n=0
        @echo "<table>" > $(INDEXFILE)
        @for i in $(THUMBS); do \
                if [ "$$n" == "" ] ; then  \
                    echo "<tr valign=top>" >> $(INDEXFILE);  \
                fi;  \
                PIC=`echo $$i | sed 's/^tn_//'`; \
echo "<td><a href=$$PIC><img src=$$i></a></td>"  >> $(INDEXFILE) ; \
                if [ "$$n" == "4" ]; then \
                        echo "</tr>" >> $(INDEXFILE); \
                fi; \
                n=$$((n+1));  \
                n=$$((n % 5));  \
        done
        @echo "</tr></table>" >> $(INDEXFILE);

A few things to note.  It's all shell scripting within the
action part, but since it's being executed under make, some
changes have to be made.  For one, if you want to reference a
shell variable, you need two dollar signs instead of one.
Otherwise, make tries to evaluate the variable itself (that's
why THUMBS only has one $ and i and n have two).  Secondly,
there are a lot of \ characters in there.  They mean "continue
this line".  In a normal shell script, you don't need them, but
if you want to do loops within a makefile, you do.  Finally,
most commands are prefixed with an @.  This simply means "don't
output the actual command".  Remove them, and you'll see what I
mean, as a lot of extra stuff will be spit out.

So, I've told make how to build index.html out of all the
thumbnails.  But how do I build the thumbnails?  With the
implicit rules, it's pretty easy.:

tn_%.jpg: %.jpg
        convert -interlace NONE -geometry 133x133 "$<" "$@"

So, if I add a new picture to the directory, I rerun "make" and
only one thumbnail is generated, along with the new index file:

$ touch 1.jpg
$ make
convert -interlace NONE -geometry 133x133 "1.jpg" "tn_1.jpg"
Building index

And, if I try to run it again:

$ make
make: 'index.html' is up to date.

Now I'm off to scan the latest batch of pictures!


Long live the Penguin,

Sean
mailto:swalberg@cramsession.com


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

-----------------------------------
Red Hat Announces New Certification
-----------------------------------

The Red Hat Certified Technician certification was just
announced by Red Hat. The RHCT is a half day, practical exam,
and is ideal for people moving over from other Unixes into Linux,
or those that want a stepping stone to the prestigious RHCE.

http://www.redhat.com/about/presscenter/2002/press_rhct.html


--------------------------------
GNOME Foundation Board Elections
--------------------------------

It's that time again... the GNOME Foundation has just closed
nominations for its board of directors. As of closing day, only
11 people had been nominated (the board is 11 strong), including
Richard Stallman. The list is announced with 23 people in the
running.

http://foundation.gnome.org/ballot-summary.html


----------------------
A Bug or Two... Or Six
----------------------

Yikes. Six serious security related bugs in Mozilla. It isn't
going to stop me from using this fantastic product, but you can
bet I'll be upgrading as soon as there is a fix.

http://www.theregister.co.uk/content/55/27934.html


-----------------------------------
Missing Chapter From Mitnick's Book
-----------------------------------

Kevin Mitnick, who made the news with his feats of social
engineering and subsequent legal troubles, wrote a book about
the ordeal. One chapter that was in the preview version of the
book never ended up in the final copy, presumably because of the
content.  Here's the chapter (sorry for it being in .doc format).

http://www.prognosisx.com/Images/bannedchapter1.doc


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

-----------------------------------------------
Everything You Ever Wanted to Know About LDAPv3
(But Were Afraid to Ask)
-----------------------------------------------

This slide show gets into the real details of LDAP, and the
improvements made in version 3. LDAP lets you build a central
directory for authentication or other information. It is highly
scalable, not to mention lightweight (guess what the 'L' stands
for?).

ftp://kalamazoolinux.org/pub/pdf/ldapv3.pdf


-----------------------------
Enterprise Snort Installation
-----------------------------

I've long been a fan of the Open Source Snort IDS, even though
enterprise management has been lacking. This document pulls
together many different software tools, and detailed
instructions, to build the system.

http://www.superhac.com/snort/snort_enterprise.pdf


-----------------
Securely Speaking
-----------------

Here's a relatively new site devoted to fostering security
related discussions. It's also run by Cramsession user
RobnHood, who is a regular on the Linux and Security boards.

http://www.securelyspeaking.com


-------------
Fighting Spam
-------------

I've passed along many links dealing with technical ways to
combat spam, but another effective approach involves changing
some of your behavior. The advice in this article is easy to
follow, and should do a bit to lower the number of junk emails
you get.

http://www.macdevcenter.com/pub/a/mac/2002/11/01/spam.html


----------------
Python Resources
----------------

Python is a scripting language, much like Perl, except much
cleaner and a better focus on objects. If you're looking to get
into some Python programming, here are a bunch of links to get
you started.

http://www.thinkspot.net/materdei/apcompsci/python/


===============================================================
4) App o' the Week
===============================================================

"Totem is simple movie player for the Gnome desktop based on
xine. It features a simple playlist, a full-screen mode, seek
and volume controls, as well as a pretty complete keyboard
navigation."

http://www.hadess.net/totem.php3


===============================================================
(C) 2002 BrainBuzz.com, Inc. All Rights Reserved.
===============================================================
_______________________________________________________

          This message is from CramSession

You are currently subscribed to the following list
   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 and many others visit
our site at:
http://newsletters.cramsession.com/signup/default.asp

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