JavaScript Inform 6 & 7 Falcon Sleep Enlightenment PHP
THE STATE OF LINUX
AUDIO SOFTWARE
Since 1994: The Original Magazin
OCTOBER 2008 | ISSUE 174
Inform 7
Don’t Get Eaten
by a Grue!
Managing
PHP Code
J
m
\
Guido van Rossum on \
PYTHON
REVIEWED
» HP Media
Vault 5150
» Scalent's
Virtual
Operating
Environment
Get Your
Sleep from
Java
+ Martin Messner
Insights from SUSE’s
Security Team Lead
Enlightenment E17
Lightweight Alternative
to KDE and GNOME
\
www. li nuxjou rna l.com
S5.99US $5.99CAN
o 09281 03102 4
THE QUIET
REVOLUTION
32 processor performance in your desktop
HiPerSTATION 8000
System Highlights:
• Optimal multi-threaded application performance
utilizing (8) eight native Quad-Core AMD Opteron™
processors
• Up to 256GB of DDR2-667 memory
• Next generation dual xl 6 PCIe technology offers scalable
graphic bandwidth
• 2TB of storage
• Designed to be quiet enough to utilize in an office
environment; Vi the noise of server version
• Ideal for usage in Computer Aided Designs,
Visualization, and Digital Content Creation
AliDkl
GSA
GS-35F-G596R
Contract Holder
SBA
www. h pcsystems .com
888-725-3472
8(A)
CERTIFIED
I
MULTIPLY ENERGY EFFICIENCY
AND MAXIMIZE COOLING.
■r THE WORLD'S FIRST QUAD-CORE PROCESSOR FOR MAINSTREAM SERVERS.
THE NEW QUAD-CORE INTEL® XEON® PROCESSOR 5300 SERIES DELIVERS UP TO 50% ^
MORE PERFORMANCE 1 THAN PREVIOUS INTEL XEON PROCESSORS IN THE SAME
POWER ENVELOPE. BASED ON THE ULTRA-EFFICIENT INTEL® CORE " MICROARCHITECTURE,
j IT'S THE ULTIMATE SOLUTION FOR MANAGING RUNAWAY COOLING EXPENSES. LEARN
WHY GREAT BUSINESS COMPUTING STARTS WITH INTEL INSIDE. VISIT INTEL.COM/XEON.
f
r
RELION 2612
( Penguin
Computing
www.PenguinComputing.com
501 2nd Street, Ste. 310
San Francisco Ca 94107
1-888-PENGUIN (736-4846)
Quad-Core Intel® Xeon®
processor
2U server with up to 12TB
Ideal for cost-effective File/DB
applications
RAS—Reliability, Availability,
Serviceability
f»TAnTniri «t cto/ioo nn
RELION 1670
• Quad-Core Intel® Xeon®
processor
• Intel 5400 (‘Seaburg’) chipset
with 1600MHz front side bus
• Up to 128GB RAM in 1U—class
leading memory capacity
• Management features to support
large cluster deployments
STARTING AT $1969.00
Penguin Computing provides turnkey x86/Linux clusters for high
performance technical computing applications. Penguin's Relion line of rackmount
servers is based on the latest Intel chipsets and processors. Relion 2612 and
1670 are just a few examples of our complete product line. We offer a full range of
rackmount servers, interconnect fabrics, storage solutions, Scyld cluster management
software, and integration services. Please visit our Web site or contact our sales team
for further details.
Intel is not responsible for and has not verified any statements
or computer system product specific claims contained herein.
L2J
1 .Performance measured using SPECjbb2005*, SPECjbb2005*/SysWatt, comparing a Quad-Core Intel® Xeon® processor E5345-based platform to a Dual-Core Intel® Xeon® processor 5160-based platform,
© 2008 Intel Corporation. All rights reserved. Intel, the Intel logo, Intel. Leap ahead., the Intel. Leap ahead, logo, Intel Core, Xeon, and Xeon Inside are trademarks of Intel Corporation in the U.S. and other countries.
*Other names and brands may be claimed as the property of others. © 2008 Penguin Computing and Relion are registered trademarks of Penguin Computing, Inc. Linux is a registered trademark of Linus Torvalds.
OCTOBER 2008
Issue 174
FEATURES |
54 INTERVIEW WITH
GUIDO VAN ROSSUM
The new Python 3000 is
bounding beyond Python 2.
Python creator Guido van Rossum
explains why you've got to try it.
James Gray
60 A TALE OF
TWO LANGUAGES
Not all programming languages
are created for automating
spreadsheets and device drivers—
some, like Inform 6 and 7,
were created specifically for
making games.
Daniel Bartholomew
Ji
'Jm
64 SHELL SCRIPTING
WITH A DISTRIBUTED
TWIST: USING THE
SLEEP SCRIPTING
LANGUAGE
A language for practical extraction
and reporting with mobile agents?
Raphael Mudge
72 THE FALCON
PROGRAMMING
LANGUAGE
IN A NUTSHELL
Messages can carry anything,
including methods or whole
Sigma sequences for remote
execution in foreign objects.
Giancarlo Niccolai
ON THE COVER
• The State of Linux Audio Software, p. 78
• Inform 7—Don't Get Eaten by a Gruel, p. 60
• Managing PHP Code, p. 86
• Guido van Rossum on Python 3, p. 54
• Get Your Sleep from Java, p. 64
• HP Media Vault 5150, p. 46
• Scalent's Virtual Operating Environment, p. 50
• Martin Messner—Insights from SUSE's Security Tee m Lead, p. 30
• Enlightenment E17—Lightweight Alternative to KDE and GNOME, p. 92
2 | October 2008 www.linuxjournal.com
SR2461
CORAID
PJ^Excellenc^jW
Winner
hmixWoRm
Best Storage
^Solutiori^-
EtherDrive® Storage has a
field-proven track record and
is 1000+ large data storage
customers strong.
To learn more about this and Coraid's other products, go online or call
+1.706.548.7200 (toll free: 877.548.7200)
by the high cost of
Fibre Channel
or iSCSI Storage >
OUTRAGED
The Linux Storage People
Coraid's EtherDrive® Storage with AoE is fast,
reliable disk storage that's easy to use. And it's
much more affordable than iSCSI or Fibre Channel!
Coraid Offers a Complete Line
of Clustered Modular Storage Products:
Coraid products use open AoE (ATA-over-Ethernet) block storage
protocol, for high performance without the TCP/IP overhead
With AoE, your shared storage capacity is infinitely scalable -
at a fraction of the cost of iSCSI or Fibre Channel storage
We provide a 3-year warranty and free firmware upgrades on
all our products, as well as support from first-rate engineers
trained in our technology
High Performance EtherDrive® SATA+RAID Storage
Appliances with 1 GigE or 10 GigE Connections
Clustered VirtualStorage™ Appliances
(a Revolutionary Logical Volume Manager)
Scalable NAS Gateways
(File Sharing with EtherDrive® Storage)
CONTENTS Em"
COLUMNS
8
SHAWN POWER'S
CURRENT_ISSUE.TAR.GZ
10 PRINT "Hello World"' 20
GOTO 10
REUVEN M. LERNER’S
AT THE FORGE
Unobtrusive JavaScript
MARCEL GAGNE'S
COOKING WITH LINUX
Imaginary Languages
♦ ' O ft *J ft * Q-
28
DAVE TAYLOR'S
WORK THE SHELL
Movie Trivia—Finally!
MICK BAUER'S
PARANOID PENGUIN
Interview with Marcus Meissne
KYLE RANKIN'S
HACK AND /
Wii Will Rock Linux
96
DOC SEARLS'
EOF
Why We Need Hackers to Fix
Health Care
IN EVERY ISSUE
i -n~ r -
14
UPFRONT
40
NEW PRODUCTS
42
NEW PROJECTS
81
ADVERTISERS INDEX
jNDEPTH
78 STATE OF THE ART: LINUX
AUDIO 2008, PART II
Dave Phillips weighs in on the
production side of music and soi
_ software for Linux. _
Dave Phillips
86 THE WELL-TEMPERED
PHP DEVELOPER
PHP developers can get a comforta Die,
powerful environment with Eclip ;e
plus some well-chosen plugins.
Federico Kereki
92 ENLIGHTENMENT—THE
NEXT GENERATION OF
LINUX DESKTOPS
Discover E, and unlock the secrets
of Enlightenment.
Jay Kruizenga
REVIEWS
46 LOAD ME UP. LOAD ME DO\
Dan Sawyer
50 REVIEW OF SCALENT'S
VIRTUAL OPERATING
ENVIRONMENT
Logan G. Harbaugh
46 HP MEDIA VAULT 5150
Next Month
HIGH-PERFORMANCE
COMPUTING
High-performance computing
means a lot more than fast
CPUs in your desktop. If you
want to do some serious number
crunching, you need some serious
processing power. Next month
is our HPC issue, and we tell
you all about the Roadrunner
supercomputer, massively parallel
computing with CUDA and even
squeaking some extra oomph from
the GPU with general-purpose
programming languages.
If petaflops and clusters are your
bread and butter, November will
be an issue that will make your
mouth water. Add in our regular
cast of columnists and product
reviews, and it will be an issue
you won't want to miss!
USPS LINUX JOURNAL (ISSN 1075-3583) (USPS 12854) is published monthly by Belltown Media, Inc., 2211 Norfolk, Ste 514, Houston,
TX 77098 USA. Periodicals postage paid at Houston, Texas and at additional mailing offices. Cover price is $5.99 US. Subscription rate
is $29.50/year in the United States, $39.50 in Canada and Mexico, $69.50 elsewhere. POSTMASTER: Please send address changes to
Linux Journal, PO Box 980985, Houston, TX 77098. Subscriptions start with the next issue. Canada Post: Publications Mail Agreement
#41549519. Canada Returns to be sent to Bleuchip International, PO. Box 25542, London, ON N6C 6B2
4 | October 2008 www.linuxjournal.com
The Straight Talk People \
SINCE i y y
ABERDEEN
MIRROR MIRROR
IN THE RACK
Up to 4TB Capacity
• Dual-Core Intel® Xeon® Processor
• 2GB DDR2 Memory
• 300W Power Supply
• From 1TB to 4TB
Up to 8TB Capacity
• Dual-Core Intel Xeon Processor
• 2GB DDR2 Memory
• 500W Redundant Power
• From 2TB to 8TB
Starting at
'2,495
Starting at
s 3,995
16-DRIVE 3U ABERWAS |24-PRIVE 5U ABERNAS
Up to 16TB Capacity
• Dual Quad-Core Intel Xeon Processors
• 2GB DDR2 Memory
• 650W Redundant Power
• Quad LAN and SAS Expansion
• From 8TB to 16TB
Starting at
$ 7,995
Up to 24TB Capacity
• Dual Quad-Core Intel Xeon Processors
• 2GB DDR2 Memory
• 950W Redundant Power
• Quad LAN and SAS Expansion
• From 12TB to 24TB
Starting at ^ 10,495
32-DRIVE 6U ABERNAS
Up to 32TB Capacity
• Dual Quad-Core Intel Xeon Processors
• 2GB DDR2 Memory
• 1350W Redundant Power
• Quad LAN and SAS Expansion
• From 16TB to 32TB
Starting at
*13,495
Up to 40TB Capacity
• Dual Quad-Core Intel Xeon Processors
• 2GB DDR2 Memory
• 1350W Redundant Power
• Quad LAN and SAS Expansion
• From 20TB to 40TB
Starting at
s 15,995
Features & Benefits:
• With available NAS-to-NAS Mirroring
and Auto-Failover over LAN
• Native Linux-based OS featuring iSCSI
• Supports SMB, CIFS, NFS, AFP FTP
• DOM-based (Disc-On-Module) OS
• Independent Data Drive RAID
• RAID 0,1, 5, 6 Configurable
• Convenient USB Key for Recovery
• NAS-2-NAS Replicator
• PCBackup Utility
• iSCSI Target Capable
• All 3U+ models support expansion via
cost effective JBODs
Xeon*
inside ™
"Aberdeen surpasses HP ... markedly higher scores ...
AberNAS 128 boasts outstanding features"
Network Computing—Aberdeen AberNAS 128
Quad-core.
Unmatched.
Intel, Intel Logo, Intel Inside, Intel Inside Logo, Pentium, Xeon, and Xeon Inside are trademarks or registered trademarks of Intel Corporation or its
subsidiaries in the United States and other countries. For terms and conditions, please see www.aberdeeninc.com/abpoly/abterms.htm. Ij027
888 - 297-7409
www.aberdeeninc.com/lj027
LINUX
JO URN L
Since 1994: The Original Magazine of the Linux Community
Digital Edition
Now Available!
Read it first
Get the latest issue before it
hits the newsstand
Keyword searchable
Find a topic or name
in seconds
Paperless archives
Download to your computer for
convenient offline reading
Same great magazine
Read each issue in
high-quality PDF
Try a Sample Issue!
www.linuxjournal.com/digital
LINUX
JOURNAL
JUURNAL
Executive Editor
Jill Franklin
jill@linuxjournal.com
Associate Editor
Shawn Powers
shawn@linuxjournal.com
Senior Editor
Doc Searls
doc@linuxjournal.com
Art Director
Garrick Antikajian
garrick@linuxjournal.com
Products Editor
James Gray
newproducts@linuxjournal.com
Editor Emeritus
Don Marti
dmarti@linuxjournal.com
Technical Editor
Michael Baxter
mab@cruzio.com
Senior Columnist
Reuven Lerner
reuven@lerner.co.il
Chef Fran^ais
Marcel Gagne
mggagne@salmar.com
Security Editor
Mick Bauer
mick@visi.com
Contributing Editors
David A. Bandel • Ibrahim Haddad • Robert Love • Zack Brown • Dave Phillips • Marco Fioretti
Ludovic Marcotte • Paul Barry • Paul McKenney • Dave Taylor • Dirk Elmendorf
Proofreader
Geri Gale
Publisher
Carlie Fairchild
publisher@linuxjournal.com
General Manager
Rebecca Cassity
rebecca@linuxjournal.com
Director of Sales
Regional Sales Manager
Laura Whiteman
laura@linuxjournal.com
Joseph Krack
joseph@linuxjournal.com
Circulation Director
Mark Irgang
mark@linuxjournal.com
System Administrator
Webmistress
Mitch Frazier
sysadm@linuxjournal.com
Katherine Druckman
webmistress@linuxjournal.com
Accountant
Candy Beauchamp
acct@linuxjournal.com
Linux Journal is published by, and is a registered trade name of, Belltown Media, Inc.
PO Box 980985, Houston, TX 77098 USA
Reader Advisory Panel
Brad Abram Baillio • Nick Baronian • Hari Boukis • Caleb S. Cullen • Steve Case
Kalyana Krishna Chadalavada • Keir Davis • Adam M. Dutko • Michael Eager • Nick Faltys • Ken Firestone
Dennis Franklin Frey • Victor Gregorio • Kristian Erik • Hermansen • Philip Jacob • Jay Kruizenga
David A. Lane • Steve Marquez • Dave McAllister • Craig Oda • Rob Orsini • Jeffrey D. Parent
Wayne D. Powel • Shawn Powers • Mike Roberts • Draciron Smith • Chris D. Stark • Patrick Swartz
Editorial Advisory Board
Daniel Frye, Director, IBM Linux Technology Center
Jon "maddog" Hall, President, Linux International
Lawrence Lessig, Professor of Law, Stanford University
Ransom Love, Director of Strategic Relationships, Family and Church History Department,
Church of Jesus Christ of Latter-day Saints
Sam Ockman
Bruce Perens
Bdale Garbee, Linux CTO, HP
Danese Cooper, Open Source Diva, Intel Corporation
Advertising
E-MAIL: ads@linuxjournal.com
URL: www.linuxjournal.com/advertising
PHONE: +1 713-344-1956 ext. 2
Subscriptions
E-MAIL: subs@linuxjournal.com
URL: www.linuxjournal.com/subscribe
PHONE: +1 713-589-3503
FAX: +1 713-589-2677
TOLL-FREE: 1-888-66-LINUX
MAIL: PO Box 980985, Houston, TX 77098 USA
Please allow 4-6 weeks for processing address changes and orders
PRINTED IN USA
LINUX is a registered trademark of Linus Torvalds.
ZT Systems delivers something different:
a unique
BALANCE
of world-class server performance and cost advantage
joined with extensive flexibility in delivery and support.
ZT Systems combines the design and manufacturing prowess of a worid-dass server manufacturer
with layers of flexibility to give you the customized server solutions you need fast - ail at very competitive prices.
•Advanced high-performance servers with outstanding reliability
• Platform customization that meets your exact hardware and imaging needs.
• Extensive customized programs that support your ever-changing mission
without being over-engineered.
ZT Systems 14G1Ti-84 Twin Node Datacenter Server
featuring the Intel® Xeon® Processor 5400 Series
Scalable, Customized Data Center Serve r Solutions
www.ztsystems.com/inteldatacenter
Xeon'
inside ' "
Powerful.
Efficient.
Intel, the Intel logo, Xeon, and Xeon Inside are trademarks or registered trademarks of Intel Corporation in the U S. and other countries.
Current_lssue.tar.gz
A
SHAWN POWERS
10 PRINT "Hello
World"; 20 GOTO 10
here is a particularly cheesy scene in the
movie The Core, in which the geeky dude
claims to speak one language: one zero one
zero zero. He also claims to require Hot Pockets in
order to do any serious coding. Thankfully for us,
our programming choices (along with dietary
options) include much more than pure binary. This
month, we tackle the subject of languages—
specifically, programming languages.
In every issue of Linux Journal, we try to give
you some useful tips and timely information on
the programming scene. This month, we look at
a few different languages to give you a better
feel for some of the options out there. Although
there is never just one way to solve a problem,
some languages are a better fit for specific needs.
The trick is picking the right tool for the job.
If scripting is your secret sauce, you might
find Reuven M. Lerner's article on JavaScript
event handlers useful. Or, for that matter, Dave
Taylor's continuing series on scripting the Internet
Movie Database might prove insightful. Because
it's the programming issue, we have several other
scripting articles as well. Raphael Mudge teaches
us about the Sleep language, which uses Java
and was inspired by Perl. Giancarlo Niccolai walks
us through using Falcon, which is a language he
wrote to fit a specific need. Thankfully, he's
released it to open source, so we can all benefit.
Sometimes scripting just doesn't fit the bill,
and here at Linux Journal, we're sensitive to such
things. Federico Kereki shows us a great way to
keep track of our code in PHP using Eclipse, an
Integrated Development Environment (IDE).
When it comes right down to it, some of us
have very little interest in learning to program.
That's fine too. James Gray interviews the Python
creator, Guido van Rossum. Whether you are a
coder or not, it's pretty exciting to learn about
the changes in version 3.0 of the extremely
popular Python language. Heck, it's not even
backward compatible! You won't want to miss
the reasons why.
If you're not a programmer, that doesn't mean
you have to use this issue for spit-wad ammuni¬
tion, however. Maybe Kyle Rankin's column on
integrating Rock Band controllers into your Linux
machine is more up your alley. Combined with
the open-source game Frets on Fire, you can
take advantage of the Rock Band Wii controllers
without even owning a Wii. Using the drum
set, you can play a synthesized drum kit with
Hydrogen. The amazing part is that Linux recog¬
nizes the controllers right out of the box! Thank
you, Nintendo, for using standard USB ports.
We also have an interview with the SUSE
Security Team Lead Marcus Meissner. You think
you're worried about security exploits? Marcus
worries for a living. His work helps protect our
systems from unwelcome visitors. Speaking of
which, what issue would be complete without
Marcel Gagne's column? He does indeed stay
true to the issue focus and discusses languages—
specifically, Klingon. If that's too geeky for you,
perhaps Pig Latin or even Swedish Chef-ese is
more interesting. Marcel has it all and shows you
how to translate for yourself.
If you really want to talk to your computer,
you have to teach it how to interact with you.
Daniel Bartholomew teaches us how to create our
own Zork-like game using the Inform language.
He includes instructions on using both Inform 6
and Inform 7. In fact, a downloadable version of
the program he wrote for the article is available
on our FTP site (see the article for details). If
phrases like, "You're likely to be eaten by a Grue"
spark some nostalgia, you won't want to miss it.
And, as we do every month, we have our
regular cast of columnists, reviews and indepth
articles. We hope that whether you're a pro¬
grammer, a hacker or just a Linux enthusiast,
you'll enjoy this issue. I know I sure have.
010100110110010101100101001000000111100
101101111011101010010000001101110011001010
111100001110100001000000110110101101111011
0111001110100011010000010000 !■
Shawn Powers is the Associate Editor for Linux Journal. He’s also the Gadget
Guy for LinuxJournal.com, and he has an interesting collection of vintage
Garfield coffee mugs. Don’t let his silly hairdo fool you, he’s a pretty
ordinary guy and can be reached via e-mail at shawn@linuxjournal.com.
Or. swing by the #linuxjournal IRC channel on Freenode.net.
8 | October 2008 www.linuxjournal.com
STARTING
AT
SDR-S1208-T00
• Supermicro Mini 1U Rackmount Server with
260W Power Supply
• Supermicro Server Board w/lntel® 946GZ Chipset
• Support up to a Dual-Core Intel® Xeon® 3000
Series processor
• TPM Support
• lx 3.5" Internal Drive Bay
• 2x Intel® 82573 PCI-e Gigabit LAN Port
STARTING
AT
SDR-C2205-T00
2U Rackmount Server with 300Watt Power Supply
Supermicro Server Board w/lntel® 3200 + ICH9R
Chipset
Support up to a Quad-Core Intel® Xeon®
3300/3200 series processor
Up to 8GB unbuffered ECC / non-ECC DDR2
800/667 SDRAM
4x 3.5" Internal Drive Bay
Dual-port Gigabit Ethernet Controller
SDR-C2300-T06
• 2U Rackmount Server w/600W Power Supply
• Supermicro Server Board w/lntel® 5000P chipset
• Dual Intel® 64-bit Xeon® Quad-Core or Dual-Core
• Support up to 16GB DDR2 667 & 533 FB-DIMM
• 6x3.5" Hot-swap Drives Trays
• Dual-port Gigabit Ethernet Controller
SDR-S1305-T04
• Supermicro 1U Rackmount Server with 520W Power Supply
• Supermicro Server Board w/lntel® 5000V Chipset
• Dual Intel® 64-bit Xeon® Quad-Core or Dual-Core
5400/5300/5200 sequence
• Support up to 16GB DDR2 667 & 533 FB-DIMM
• 4 x SATA Hot-swap Drive Bays
• Dual-port Gigabit Ethernet Controller
SDR-S1330-T04
• Supermicro 1U Rackmount Server with 650W High-
efficiency Redundant Power Supply
• Supermicro Server Board w/lntel® 5400 Chipset
• Dual Intel® 64-bit Xeon® Quad-Core
or Dual-Core 5400/5300/5200 sequence
• Support up to 64GB DDR2 667 & 533 FB-DIMM
» 4 x SATA Hot-swap Drive Bays
• Dual-port Gigabit Ethernet Controller
SDR-S2301-T08 ” llrfilil
• 2U Rackmount Server w/700W High-Efficiency
Redundant Power Supply
• Supermicro Server Board w/lntel® 5000P chipset
• Dual Intel® 64-bit Xeon® Quad-Core or Dual-Core
• Support up to 64GB DDR2 667 & 533 FB-DIMM
• 8 x 3.5" Hot-swap Drives Trays
• Dual-port Gigabit Ethernet Controller
servers' direc
MORE PRODUCTS, BETTER SERVICE, GUARANTEED
RELIABILITY WHEN YOU NEED IT. IN OTHER WORDS,
With ServersDirect® Systems based on the Intel® Xeon® Processor, you can count on high
availability for your business-critical computing solutions.
GO STRAIGHT TO THE SOURCE! 1.877.727.7887 | www.ServersDirect.com
SDP-CP200-T04 SIAR "«H:t!UM
SDR-IP300-T06 JrMlimi
SDP-C5300-T24
Pedestal Server with 600W Power Supply
Intel® Server board with 3000 Server Chipset
Support up to a Quad-Core Intel® Xeon®
3300/3200 series processor
Up to 8GB unbuffered ECC / non-ECC DDR2
800/667 SDRAM
4x 3.5" Internal Drive Bay (Hot-swap Optional)
Dual-port Gigabit Ethernet Controller
• Intel Pedestal Server with Redundant (1 +0)
650W Power Supply
• Supermicro Server Board w/lntel® 5000V chipset
• Dual Intel® 64-bit Xeon® Quad-Core or Dual-Core
• Support up to 16GB DDR2 667 & 533 FB-DIMM
• Support up to 6 x 3.5" Hot-swap Drives Trays
• Dual-port Gigabit Ethernet Controller
• 5U Rackmount Servers with Redundant 1350W
Power Supply
* Supermicro Server Board w/lntel® 5000P chipset
1 Dual Intel® 64-bit Xeon® Quad-Core or Dual-Core
* Support up to 32GB DDR2 667 & 533 FB-DIMM
• Support up to 24 x 3.5" Hot-swap Drives Trays
1 Dual-port Gigabit
Ethernet Controller
SERVERS DIRECT CAN HELP YOU CONFIGURE YOUR NEXT HIGH PERFORMANCE SERVER SYSTEM - CALL US TODAY!
Our flexible on-line products configurator allows you to source a custom solution, or call and our product
experts are standing by to help you assemble systems that require a little extra. Servers Direct - your direct
source for scalable, cost effective server solutions.
1.877.727.7887 | www.ServersDirect.com
Intel, Intel logo, Intel Inside, Intel Inside logo, Intel Centrino, Intel Centrino logo, Celeron, Intel Xeon, Intel SpeedStep, Itanium, Pentium,
and Pentium III Xeon are trademarks of Intel Corporation or it’s subsidiaries in the United States and other countries.
Xeon*
inside™
Dual-core.
Do more.
letters
A
Learn to Fake a Wiimote Linux
UFO Landis Video I nlerface H 0W-TO
E“fok +
Gumstix
Perfect
Match?
How To;
16 Terabytes in One Case
More Hardware
I gave renewing a lot of thought this time
around. You see, it used to be automatic, but
you folks seem to be catering primarily to the
software crowd. That's okay, but spread your¬
selves a bit more freely, please. I am a hard¬
ware engineer and would appreciate some
more from that side of the house. After
thinking long and hard, I decided to give you
one more try for one year. You see, I actually
found that I am looking forward to my issue
each month; it's just that the programming
stuff is hard to get exited about after many
years in hardware. I'm sure I am not alone.
Des Cavin
We greatly appreciate your feedback , and
we will keep your request in mind. — Ed.
Linux Everywhere
In the Letters section of the last few issues,
there has been mention of Linux being
used in different consumer products. Today,
while surfing the Web looking for a new
car stereo, I came across the SoundStream
VIR-4100N, which is listed on the Web site
as a "4.3"-wide Touch Screen, Din Size,
In-Dash, Fully Motorized TFT Monitor, with
Navigation/DVD/AM/FM". The third bullet,
in a long list of features, says "OS 2.6.x
Linux-based software, 400MHz processor
for fast recalculation times".
David Baldock
Correction
Regarding Dan Sawyer's review of the
Cradlepoint PHS300 [titled "Hot and
Bothered at Starbucks"], in the August
2008 issue: the CTR350 does not come
with a battery, which is what separates it
from the PHS300.
SATA RAID Problems
In response to the article "One Box. Sixteen
Trillion Bytes" by Eric Pearce in the August
2008 issue of Linux Journal: I also was
excited about the prospects of using larger,
cheaper, SATA RAID solutions to cut costs
on our ever-growing storage needs. I'm not
saying it's a bad idea, but there are problems
that are not apparent until after you make
the investment. These problems can be dealt
with, and I dare say that a niche market is
waiting on someone to do this, but I've seen
other companies fail to do it in the past.
The key problem that does not show up until
later is that of SATA drive firmware compati¬
bility. We had eight 400G drives in a box that
got turned into the file server for the compa¬
ny. At first, we had a RocketRaid card. Some
research suggested the problems we were
There's Always Another Way
Reading Dave Taylor's excellent article on extracting movie
information from IMDb for a Twitter movie trivia game [LJ,
July 2008], I could not help but think, "why doesn't he ...",
on several occasions. To put my money where my mouth is,
I rewrote his code snippets as a—IMHO—more readable bash
script using more concise code snippets. Here it is:
#!/bin/bash
# imdb-top-250-movies.sh
#
# Felix C. Stegerman
# 2008-07-12 [14:15]
#
# --
#
# Output "title | year" for each of the top 250 movies at IMDb.
#
# --
#
# Usage: imdb-top-250-movies.sh > IMDB-TOP-250-MOVIES
#
# --
PREFIX^ 1 http://www.imdb.com 1
CHART="/chart/top"
TITLE='/title/tt[0-9]+/'
function get_top_250_chart ()
{
wget -0 - "$PREFIX/$CHART" \
| grep -E -o "$TITLE" \
| sed 's! A !'"$PREFIX"' ! '
}
function get_movie_and_year ()
{
wget -0 - "$1" \
| grep '' \
| sed -r 's! A .*>(.*)<.*!\1!' \
| sed -r 's!\(([0-9]{4})(/(I{1,3}|I?V|VI{1,3}|I?X))?\)$!| \1!'
}
for URL in $(get_top_250_chart); do
get_movie_and_year "$URL"
done
# vim: set ft=sh tw=70 sw=2 sts=2 et:
Also, this version correctly parses—for example, "Crash (2004/1)"
is changed to "Crash | 2004".
Felix C. Stegerman
10 | October 2008 www.linuxjournal.com
[LETTERS]
having were due to the drivers and the card
being substandard. So, we invested in an
eight-port, 9000 series 3ware card.
It turns out that 3ware has to test every
firmware revision of every SATA drive with its
cards, because many perform very poorly.
After losing three drives, we tried to replace
a bad one with a 500G drive, because we
couldn't get a 400G drive at local stores, and
performance fell through the floor. I updated
the firmware, researched on 3ware.com and
called 3ware. It came down to poor quality
control on the part of SATA manufacturers,
and there was nothing we could do about
the drives we had. In summary, if you use
SATA RAID, make sure you check 3ware's
compatibility list.
The bad news is that you probably don't
know the firmware revision until after you
open the drive and use it. Refunds get
really tricky after that, so you'll probably go
through a few drives trying to find good
ones. It's probably a good idea to have mul¬
tiple hot spares in your system and to have
some pretested drives lying around.
JT Moree
Try Hyperic HQ
I'm writing in response to Jeremiah
Bowling's article on Zenoss in the August
2008 issue of LJ. Although I'm sure it is a
good product, there is another one that
provides the same, if not more, capability
with less setup time: Hyperic HQ. I believe
Linux Journal mentioned it in the New
Products section a while back.
Hyperic uses XML over HTTPS, using agents
installed on hosts to provide metrics back to
the HQ Server. It can monitor 10s of 100s of
different metrics across different platforms,
and it is open source. The process of adding
devices and services is performed by the
agent through its detection capabilities,
which are reported back to the server auto¬
matically when the agent is registered. SNMP
isn't even needed unless desired. It is open
source, but Hyperic sells an enterprise version
that comes with support. The only thing it
seems that Hyperic doesn't have that Zenoss
does have is the geographic mapping capa¬
bility. Hyperic provides all the metric charts,
alerting, roles and monitoring that Zenoss
does. I urge those who try out Zenoss to take
Hyperic for a spin also. I'm using it at work,
and it makes monitoring systems a breeze.
One final note, Jeremiah discusses the
setup of SNMP and the use of community
strings. Although specifying a custom
community string is better than the
default, anyone still can sniff the network
to determine what the string is, so it really
doesn't provide much security. As I men¬
tioned above, Hyperic agents communi¬
cate with the Hyperic server using HTTPS,
1 2 3 4 5
H PC Your Way
Intel or AMD. Ethernet or InfiniBand. Linux or Microsoft
Windows HPC Server. Now you can have a uniform set of HPC compilers
and tools across all of your x64 clusters. PGICDK compilers and
tools are available directly from most cluster suppliers.
Take a free test drive today at www.pgroup.com/reasons
PGI CDK Cluster Development Kit
The Portland Group, Inc. is an STMicroelectronics company. CDK is a trademark or registered trademark of STMicroelectronics. PGI, Cluster Development Kit, and PGPR0F are trademarks or registered trademarks of The Portland Group, Incorporated.
Other brands and names are the property of their respective owners.
[LETTERS]
which we all know really is secure.
I appreciate Jeremiah's article, despite my
mention of a similar product. I wasn't
aware of Zenoss and always am glad to
have my awareness expanded.
Brandon McCombs
Look for an article on Hyperic HQ in an
upcoming issue. — Ed.
Failed to Mention the Cost
I was interested to see an article about
building E-Ink devices in the August
2008 issue of LJ. I acknowledge that the
article involves a clever bit of engineer¬
ing, but you fail to mention that display
you used, AM200, costs $3,000 US
(store.nexternal.com/shared/StoreFront/
default.asp?CS=eink&StoreType=BtoC&
Countl=555858790&Count2=472999215).
It's disappointing this fact was left out
to make the project sound more reason¬
able. Normally, I've found your articles
are more honest about the costs.
Jim Putman
It's a Small World
Although I always enjoy reading about
scientific applications for Linux, "One Tale
of Two Scientific Distros" by Doc Searls in
your August 2008 Upfront section, hit
particularly close to home. My cousin,
David Auty, is an astrophysicist, currently
researching neutrino oscillations at
Fermilab. Here's a link to a brief descrip¬
tion of his work: www.sussex.ac.uk/
physics/profile104724.html.
James Knott
More on SATA
The article "One Box. Sixteen Trillion
Bytes" [August 2008] showed the
use of a 3ware utility to interrogate
performance of the RAID-connected
SATA disks. Having some systems
with problematic hard disks, that
got me wondering what general
utilities are available to support
SATA disks—for example, what
goes beyond hdparm?
I discovered that the newer sdparm
utility is designed to support SATA
disks. However, despite extensive
Google searches, other than one
good overview, there is a dearth of
how-to guides that highlight what
one can safely change, or the likely
or possible implications of changing
the various parameters.
I'm sure a future article in Linux Journal
by an sdparm expert would be of great
interest to many since most systems are
now using SATA or SAS drives rather
than PATA.
David Cartwright
LINUX
JOURNAL
Fit Your Service
MAGAZINE
PRINT SUBSCRIPTIONS: Renewing your
subscription, changing your address, paying your
invoice, viewing your account details or other
subscription inquiries can instantly be done on-line,
www.linuxjournal.com/subs. Alternatively,
within the U.S. and Canada, you may call
us toll-free 1-888-66-LINUX (54689), or
internationally+1-713-589-3503. E-mail us at
subs@linuxjournal.com or reach us via postal mail,
Linux Journal, PO Box 980985, Houston, TX
77098-0985 USA. Please remember to include your
complete name and address when contacting us.
DIGITAL SUBSCRIPTIONS: Digital subscriptions
of Linux Journal are now available and delivered as
PDFs anywhere in the world for one low cost.
Visit www.linuxjournal.com/digital for more
information or use the contact information above
for any digital magazine customer service inquiries.
LETTERS TO THE EDITOR: We welcome
your letters and encourage you to submit them
at www.linuxjournal.com/contact or mail
them to Linux Journal, 1752 NW Market
Street, #200, Seattle, WA 98107 USA. Letters
may be edited for space and clarity.
WRITING FOR US: We always are looking
for contributed articles, tutorials and real-
world stories for the magazine. An author's
guide, a list of topics and due dates can be
found on-line, www.linuxjournal.com/author.
ADVERTISING: Linux Journal is a great
resource for readers and advertisers alike.
Request a media kit, view our current
editorial calendar and advertising due
dates, or learn more about other advertising
and marketing opportunities by visiting us
on-line, www.linuxjournal.com/advertising.
Contact us directly for further information,
ads@linuxjournal.com or +1 713-344-1956 ext. 2.
ON-LINE
WEB SITE: Read exclusive on-line-only content on
Linux Journal's Web site, www.linuxjournal.com.
Also, select articles from the print magazine
are available on-line. Magazine subscribers,
digital or print, receive full access to issue
archives; please contact Customer Service for
further information, subs@linuxjournal.com.
FREE e-NEWSLETTERS: Each week, Linux
Journal editors will tell you what's hot in the world
of Linux. Receive late-breaking news, technical tips
and tricks, and links to in-depth stories featured
on www.linuxjournal.com. Subscribe for free
today, www.linuxjournal.com/enewsletters.
r
PHOTO OF THE MONTH
Have a photo you'd like
to share with LJ readers?
Send your submission to
publisher@linuxjournal.com.
If we run yours in the
magazine, we'll send you
a free T-shirt.
Hannah C. Bigrigg, five years old,
Canton, Ohio. Submitted by
Travis Bigrigg.
12 | October 2008 www.linuxjournal.com
"Company WCthA Vtiton/'
GNS 2450 tfreen Storage Appliance
R
\
Green
► Hardware & Software ► Features & Benefits
Scalable
Reliable
Performance
Plug & Play
One or two Highly Efficient dual-core
AMD Opteron™ processor-based
platform
•Administration:
Powerful, secure and easy intuitive
GUI for configuration and remote
management
8GB RAM (Expandable to 64GB)
Dual GbENICs (Optional 10GbE)
* Network Management:
Along with standard Netwo
4r
Genstor Systems gns 2450
is built on fully optimized Highly Efficient
• 2U rackmount chasis with
m
HDD bays with redundant power
dual-core AMD Opteron™ processor supplies
model 2214 HE running Open-E® DSS T
(Data Storage Server).
• Open-E® DSS™
Gateway support, the GNS 2450
also supports DHCP Client,
Multiple NIC, Adapter Fault
Tolerance (AFT), Adaptive Load
Balancing (ALB), Proxy Settings,
IP-Sec, etc.
GNS 2450 is an all-in-one IP-Storage with
\S^nd iSCSI (both target and initiator)
NAS and iSCSI (both target an
functionality. Excellent price performance value,
enhanced management and superiorjgliability
is great for organizata
(Data Storage Server) with NAS
and iSCSI functionality
I
ss.
• Flexibility & Scalability:
The GNS 2450 storage appliance
is highly scalable and flexible to
take care of your future
expandability needs
Price: $5200 (for 6TB raw storage)
GEN TOR SYSTEMS, INC
780 Montague Expresswa;
San Jose, CA95131
Phone: 408-383-0120
-ax: 408-383-0121
#604
AMD
Opterorr
&
Please contact Genstor sales@genstor.com for your custom hardware
1-877-25-SERVER •
Open-E, Open-E DSS and the
www.genstor.com • sales@genstor.com
Open-E logo are registered tradedmarks of Open-E, Inc.
AMD, AMD Arrow logo, and AMD Opteron are trademarks or registered trademarks of Advanced
FRONT
NEWS + FUN
WHAT'S NEW
IN KERNEL
DEVELOPMENT
Keeping firmware in
[ “ U the kernel is a some¬
what controversial
issue, because it
means keeping binary
blobs of data in an
open-source project.
But removing it, as David Woodhouse
is trying to do, turns out to be controver¬
sial also. Folks like David S. Miller are
violently opposed to the idea on the
grounds that it would break certain
drivers (like tg 3) or make them much
worse. Also, it takes a part of the kernel
that essentially had been approved by
Linus Torvalds —even in binary form—
and puts it in the hands of someone
else. Unlike GCC, libc and other projects
on which the kernel depends, this
external firmware project would not be
anything like a universal tool; it just
would be a key part of the kernel that
was stored and maintained outside the
official source tree.
But, now that the effort actually is
underway, it may be unstoppable. A lot
of folks find the problem interesting on a
technical level, which generally means
they'll eventually find solutions that satisfy
everyone. For now, it seems as though
firmware definitely will be relegated to
its own little spot in the kernel sources.
From there, it could end up getting a
separate git tree altogether.
Willy Tarreau has adjusted the 2.4
release schedule, based on the results
of an informal survey of existing 2.4
users. He found that about 80% of
current users didn't upgrade, because
a lot of their employees or customers
would be inconvenienced by any hiccups
in the upgrade path or by the downtime
required to do the upgrade successfully.
The rest of the users could upgrade easi¬
ly if they wanted to or if they knew how,
but they either were running it on their
home systems and simply didn't need
the benefits of 2.6, or they were running
it on firewalls, routers and so on, and
the folks maintaining them didn't have
a clearly defined upgrade path—
although Willy reckoned it wouldn't
be too hard to do.
From all this, Willy concluded that
he would put out stability fixes more
frequently, so people could get what
they needed to fix whatever small
problems remained on their 2.4 systems,
but that he'd slow down on putting
out major releases, and do that only
for versions with new PCI IDs, big
driver updates, compiler support changes
and so on. Willy also suggested that
someone write up a complete descrip¬
tion of the differences between 2.4
and 2.6 and how to address all the
problems of upgrading.
It's useful to be able to write to
files under CramFS, SquashFS and
even mounted CDs, knowing that the
changes will not be permanent and will
go away after a reboot. Arnd Bergman
has recently implemented this kind of
temporary write support for CramFS,
and Phillip Lougher also is planning to
write a similar feature for SquashFS. A
lot of folks objected to Arnd's approach
though, saying that this kind of thing
should be accomplished by using
UnionFS to stack something like TmpFS
on top of CramFS. But, it turns out that
UnionFS is kind of a mess and not really
able to do the job well. Some folks, like
Phillip, also feel that stackable filesystem
USER FRIENDLY by J,P. Frazer
ts THAT. .SOME KIND OF
ALTERNATE MUSIC?
I ITS ^HORDSTATS*
/ A PERL SCRIPT THAT
MONITORS A SYSTEM
AND RETURNS MACHINE
GENERATED MtiSlG
N (r^\ t>UM
£>OOP
DUM
OH...THAT'S
INTERESTING,,*
/ BOOP DE DOOP DOOP
/ ,.,DUHDUH
...I THINK ITS
PLAYING THE
THEME FROM
"JAWS." p| TR/QU |T
/ Mlu TeAstMS ™e
support should go right in the VFS,
instead of clunking around in a filesys¬
tem of its own.
The uproar against writing one-offs
for each affected filesystem (CramFS,
SquashFS and so forth) subsided when it
became clear that CramFS and SquashFS
would be the only two filesystems to do
this, except for perhaps ISO9660. At
least with a small number of filesystems,
the amount of duplicated effort would
not be too great. But, the people inter¬
ested in making UnionFS the canonical
method of accomplishing this sort of
thing apparently have redoubled their
efforts. So, it may be that both groups
will get what they need soon enough.
Geert Uytterhoeven asked when
SquashFS would be accepted into the
kernel tree, and Phillip Lougher said that
he actually was making some major
changes, after which it would presum¬
ably take some time for the code to be
reviewed by users and any remaining
sizable bugs shaken out. Among the
changes, Phillip is considering changing
the on-disk data layout, which would
solve certain problems but break back¬
ward compatibility.
The venerable AdvFS filesystem
has been released by Hewlett-Packard
under the terms of the GPL version 2.
This filesystem has been around since
the 1980s, supports journaling and file
undeletion, and is very fast in general.
Nowadays, there are plenty of journaling
filesystems, but this release represents a
solid and excellent body of code—and a
really terrific body of documentation—
available to the Open Source world for
the first time. The AdvFS release is not,
as Linda Knippers from HP has pointed
out, a port of the filesystem
to Linux. HP sees this release
as providing a lot of cool
stuff for open-source devel¬
opers to use in any various
projects where they might
be useful. But, it's also likely
that some kernel folks
will want to do a real
port. So, we probably can
look forward to seeing
AdvFS in the main kernel
tree at some point.
— ZACK BROWN
LNMRIMniDN
14 | October 2008 www.linuxjournal.com
[UPFRONT
New Videos on LinuxJournal.com
As some of you may have noticed, there have been a
number of new videos on LinuxJournal.com. If you haven't
noticed, well, get over to LinuxJournal.com to learn some¬
thing new in one of our new tutorial screencasts. When you
are not enjoying Shawn "Gadget Guy" Powers' antics, you'll
surely find something interesting and useful in our new series
of videos. Visit www.linuxjournal.com/video to check out
the selection. Perhaps you'll learn how to edit video with
FFmpeg or something else to add to your bag of tricks.
As always, Shawn will continue to bring you reviews
and commentary from his Gadget Guy studio, so keep
watching those too. There's so much to enjoy!
— KATHERINE DRUCKMAN
They Said It
Our passion is about Linux for human beings, it's not
Linux for Linux specialists, or Linux for anything other
than the people who we care about.
...our goal, very simply, is to make sure the free
software ecosystem can deliver a Mac OS-like experi¬
ence, or an experience that will compete with the Mac
OS. We see Apple as the gold standard of the user
experience. We believe that, while it can be a challenge,
the innovation inherent in the free software process can
deliver an experience that is comparable and in many
ways superior.
Proprietary drivers are a horrible kludge; they're a
little bit like introducing a cast iron pot into a titanium
machine. You have something that is inherently brittle
and therefore reduces the value of the whole.
—Mark Shuttleworth, itmanagement.earthweb.com/osrc/article.php/
12068_3757246_2
For every artificial scarcity, there's an equal and opposite
artificial abundance.
—JP Rangaswami, a talk reported at Rebootl0, twitter.com/dweinberger/
statuses/844937650
If you provide your customer with solutions, you'll have a
well-defined market. But if you provide your customer
with the opportunity to create new solutions, your cus¬
tomer will create new markets for you.
—Bob Frankston, private e-mail message
Communications tools don't get socially interesting until
they get technologically boring....a tool...has to have been
around long enough that most of society is using it. It's
when a technology becomes normal, then ubiquitous,
and finally so pervasive as to be invisible, that the really
profound changes happen....
—Clay Shirky, from his book Here Comes Everybody, page 105
ASA
COMPUTERS
Want your business to be more productive?
The ASA Servers powered by the Intel Xeon Processor provide the
quality and dependability to keep up with your Rowing business.
Hardware Systems for the Open Source
Community - Since 1989.
(Linux, FreeBSD, Net BSD, Open BSD, Solaris, MS, etc
1U Server-ASA1401i
- 1TB Storage Installed. Max -3TB.
- Intel Dual core 5O30 CPU (Qiy -i)„ Max-a CPUs
- 1GB 667MGZ FBDIMMS IIIstalled,
. Supports 16GB F BO I MM.
. 4X25GGB ntswap sata -II Drives insta lied.
4 port SATA-11 RAID controller.
2X1O/1OO/1OO0 LAN onboard.
2U Server -ASA2121i
- 4TB Storage Installed. Max - 12TB.
- mtoi Dual core5Q50 CPU,
. igb 6G7MGZ fbdimms installed.
Supports 16GB FBDIMM.
-16 port SATA II RAID controller.
- 16X25QGB htswap sata-II Drives installed.
-2X10/100/1000 LAN onboard.
-600W Rod PS.
3U Server-ASA3161i
4TB Storage Installed. Max - 12TB.
Intel Dual core 5050 cpu.
. 1 GB E67MGZ FBDllVMs Installed.
. Supports 16GB FBDIMV1
16 port 5ATA-II RAID controller,
. 1GX25QGE htswap SAT At) Drives Installed.
. 2X10/100/1000 LAN onboard.
BOOw Red PS.
5U Server-ASA5241i
. 6TB Storage Installed. Max - 13TB,
Intel Dual core 5050 CPU,
. 4GB 667MGZ FBDIMMs Installed.
Supports 16GB FBDIMM.
. 24 X250GB Inswap SATA.II Drives Installed.
24 port 5ATA-II RAID. CARD/BBU,
. 2X10rlOO/1000 LAN onboard,
93Ow Red PS.
8U Server-ASA8421i
10TB Storage Installed. Max - 30TB.
- Intel Dual core 6050 CPU-
- Quantity 42 Installed.
- 1 GB 66TMGE FBDIMMs.
- Supports 32GB FBDIMM.
. 40X250 GB htswap SATA-II Drives installed.
-2X12 Port SATA-II Multilane RAID controller.
- 1X16 Port SATA-II MuEtllane RAID controller
-2X10/100/1000 LAN onboard.
. 1300 w Red Ps.
All systems installed and tested with user s chilce ol Linux
distribution [free). ASA Gallocatlon—$75 per mnnth
A
2354 Calle Del Mundo,
Santa Clara, CA 95054
www.asacomputers.com1
Email: sales@asacomputers.com
P; 1-800-RE AL-PCS | FAX; 408-654-2010
Xeon
inside ‘
Intel®, Intel® xeoiT", Intel inside®, Intel® lie mum® end the
Intel Inside® togo are trademarks or registered Uademanks of
Intel co rpa rai ion or its subsidiaries. in trio united stales and
other countries.
Prices and availability subjecl io change without notice.
Not responsible lor typographic errors.
Powerful.
Efficient.
[UPFRONT
It's All Like...What?
Google phrase searches can produce
results that seem like random
answers to a Rorschach test—only
more amusing. Here are the top
results (on a day in July 2008) for
"The Internet is like...":
■ "a vast uncataloged library"
■ "a vagina"
■ "Joey Bishop"
■ "a series of tubes"
■ "Microsoft"
■ "alcohol in some sense"
■ "a newspaper"
■ "going down the Chinese road"
Closer to home, "Linux is like...":
■ "switching from a car to
a motorcycle"
■ "a pizza"
■ "ice cream—too many flavors
to choose"
■ "a fixed-wheel bicycle"
■ "turning on your first computer
and figuring out what all those
weird boxes did"
■ "a common cold"
■ "a whole new species"
■ "Ubuntu, only different"
Our hat tip for this observation
goes to reader Mike Warot. (See
"What They're Using?" on page 17
for more about Mike.)
— DOC SEARLS
Laundering Blog Layouts
for Mobile Devices
Whenever I run across something
new, cool and Web-based, I check
Netcraft's "What's that site using?"
to see whether the site's servers are
running on Linux. You can't always
tell, and the results can be misleading,
but it's a good first sniff test.
That's what I did with MoFuse
(www.mofuse.com), and it
passed. "Linux Apache/2.0.63 (Unix)
mod_ssl/2.0.63 OpenSSL/...", it said.
What's cool about MoFuse is that
it launders the layout complexities
out of blog posts and turns them
into simple lists of linked headlines. It
does this free if you like, or you can
pay for extra services, such as adver¬
tising revenue sharing and URLs that
don't have "mofuse.mobi" in them.
MoFuse isn't alone, of course.
Mippin (www.mippin.com) has
been doing similar stuff for a while,
and Netcraft shows them running
Linux too (Red Hat, in this case).
And Google, naturally, also has
an interface that can turn any blog
into "mobile, blog name, whatever".
Of course, that's Linux too.
In any case, the percentage of Web
surfing via mobile devices is going to
skyrocket—especially after the next
generation of unlocked, uncrippled
Linux-based devices start hitting the
market. Formatting for the hand
screen will shift from exception to rule.
— DOC SEARLS
LJ pays $100 for tech tips we publish. Send your tip
and contact information to techtips@linuxjournal.com.
Did you know Linux Journal maintains a mailing list where list members discuss all things
Linux? Join LJ's linux-list today: http://lists2.linuxjournal.com/mailman/listinfo/linux-list.
LJ Index,
October 2008
1. Number of Firefox 3.0 downloads in 24
hours starting June 17, 2008: 8,002,530
2. Position of the above download number
among Guinness World Records: 1
3. Minimum millions of Firefox users: 180
4. Minimum number of countries in which
Firefox is used: 230
5. Millions of dollars in VC funding for
open-source vendors in 2007: 328.5
6. Millions of dollars in VC funding for open-
source vendors in first half of 2008: 321.3
7. Percentage increase in VC funding in first
half of 2008 over 2007: 62
8. Total billions in open-source funding
through first half of 2008: 2.80
9. Age in years of a reported bug in BSD
discovered in May 2008: 25
10. Linux's market share percentage of counted
browser visits in January 2007: 35
11. Linux's market share percentage of counted
browser visits in January 2008: 64
12. Linux's market share percentage of counted
browser visits in June 2008: 80
13. Linux year-over-year percentage growth in
server sales in Q1 2008: 8.4
14. Linux server revenue in billions of dollars
for Q1 2008: 1.8
15. Linux-based server percentage of all server
revenue: 13.7
16. Number of Linux-based laptops to be
distributed to students in the Tamil Nadu
state of India: 100,000
17. Price in dollars for Ubuntu Hardy Heron
(8.04) in ValuSoft boxes at Best Buy and
Amazon: 20
18. Number of Linux distros listed on
DistroWatch's Page Hit Ranking: 100
19. Position of Ubuntu among top distros in
the six months ending July 16, 2008: 1
20. Position of OpenSUSE among top distros
in the six months ending July 16, 2008: 2
Sources: 1-4: SpreadFirefox.com
5-8: 451 Group j 9: Thelnquirer
10-12: NetAppLications.com
13-15: International Data Corp (IDC)
16: LinuxWatch 117: DesktopLinux.com
18-20: DistroWatch.com
16 | October 2008 www.linuxjournal.com
[UPFRONT]
What They're Using
Mike Warot
Linux converts don't always come in
groups. Among IT folks, they tend to
come one by one. Case in point, Mike
Warot, a reader I knew for insightful
comments and fun ideas (for example, see
"It's All Like...What?" on page 16). Mike's
experience is a good sample of what
must be happening in countless shops,
even though each is different. Now, here's
Mike's description of "what he's using":
I'm a one-man IT staff in what
used to be a Windows shop.
Today I have two machines on
my desk. The one I just let run is
Ubuntu. It just runs, 24x7, and
it's there when I need it.
The change came once it became
apparent that we were going to
have to put our Windows servers
behind a firewall. I decided to
use Linux to make a firewall. I
used Red Hat and EBtables to
create a transparent bridge to
avoid having to re-address our
servers and let everything keep
its public IP address. This was
nice, because it still wasn't neces¬
sary to have a firewall, it was just
an extra precaution at the time.
That worked well for about a year,
until I got worried I wouldn't be
able to restart it. That's when a
friend told me about IPcop in his
work with nonprofits. IPcop is a
very easy to configure and main¬
tain Linux-based firewall, which
does a great job in almost all cir¬
cumstances. I used IPcop for a year
or so, until problems with multiple
Internet connections forced me to
seek a better solution.
At the same time I put in the
IPcop box, I learned (eventually)
two very important facts about
Windows 2000 Servers and the
Internet. First, if your domain
controllers have multiple subnets
from which to choose, they will
get confused and not be able to
find each other (meaning users
might not be able to log in).
And second, if you followed
common sense and used your
real domain name for your
Windows domain name, you
were FUBAR, because active
directory then puts all of your
local addresses in the DNS, and
you can't remove them (or the
domain stops working again).
This required another Linux box,
for DNS services to the world.
It's running Fedora Core 5, but
I'm about to replace it, because
I don't know how to update the
DNS to fix the current exploit.
It'll get replaced with a VMware
virtual machine running Ubuntu
(more about VMware below). I
now have an Ubuntu box with
iptables (or ipchains, I always
forget), which connects us to
our three Internet connections.
With the proliferation of servers,
VMware's offer of the free
VMware Server was a godsend.
And, I've since learned that Linux
makes a far better host than
Windows does. So, I've got some
of my VMware servers running
on Ubuntu, with Windows and
other things inside them.
Ubuntu has made it pretty easy
to set up a new machine—not
that Red Hat was very hard.
But with apt-get, installation
of almost any program is trivial.
I use an editor called joe to do
editing when I don't have the
X Window System set up (on
some of the older servers), and
it's just sudo apt-get install
joe, and I'm up and running.
I'm not a guru, but I've learned
enough over the years to get
around. Linux offers a wider set
of tools than Windows ever
could. Bottom line: Linux is
amazing, and it's getting better
all the time.
— DOC SEARLS
'Finalist Best Management Tool'
Programmable Linux Based
Console Server Solutions
Service Processor Network UPS Tools
Management Secure Tunneling
DRAG Port Forwarding
iLO Nagios Checks
ALOM Embedded IPMI
RSA Flexible Pinouts
opcngcor.com
COLUMNS
AT THE FORGE
Unobtrusive JavaScript
Remove JavaScript event handlers from HTML files using Prototype
and Lowpro.
REUVEN M. LERNER
JavaScript has gone through a number of changes
in the past few years. Implementations have
become faster, more standardized and more stable.
The development and growth of open-source
JavaScript libraries, such as Prototype and Dojo, has
helped mask many of the remaining differences
between JavaScript implementations, such as with
AJAX and event handling. The final change has
occurred in the minds of developers (including
myself), who now approach JavaScript as a serious
application development language, rather than as a
toy for highlighting images or doing simple effects.
Most JavaScript is executed not when it is initially
read into a browser window, but rather when a
particular event takes place. The easiest, and most
common, way to assign event handlers is inside the
HTML itself. For example, we can create a submit
button for an HTML form as follows:
With the onclick handler in place, the button
now opens a JavaScript alert box (saying "hello").
Moreover, because our event-handler definition
returns false, the form will not be submitted.
Of course, we don't have to put our JavaScript
literally in the event handler. We could define a
function somewhere else—in the document's
or perhaps in an external JavaScript file altogether:
Unobtrusive JavaScript
Unobtrusive JavaScript
A paragraph of text.
A hyperlink
to The New York Times.
Now, none of this is new. But, there are
problems associated with setting event handlers
in "on_" attributes. For one, it becomes difficult
to assign more than one handler to the same
event on an object.
A second and more significant reason is that our
HTML becomes full of JavaScript. Until a few years
ago, it wasn't unusual for HTML to be mixed in with
code and style information as well, but the growth
of strictly separated MVC frameworks have removed
most code from the HTML, and style information
now is put in external CSS files.
A growing movement during the past few
years has pushed for "unobtrusive JavaScript".
Proponents of unobtrusive JavaScript argue that
by placing JavaScript in a separate file and by
defining event handlers in a separate file, the code
becomes easier to read and understand and is
cached by the browser. By using JavaScript unob¬
trusively, we also have the opportunity to make
our HTML pages degrade gracefully, continuing to
work with browsers that don't support JavaScript.
18 | October 2008 www.linuxjournal.com
$('hyperlink').onclick = show_x_and_y;
Notice that our assignment is to show_x_and_y
(that is, the name of a function), rather than to
show_x_and_y() (that is, the result of executing the
function). This is a particularly useful technique if
we want to assign the same function to handle
multiple events.
We can handle a number of different events. For
example, the onmouseover and onmouseout events
let us execute a function based on when the mouse
This month, we look at unobtrusive JavaScript
and the unobtrusive approach to defining functions
and event handlers. We also examine the Lowpro
library that works with the popular Prototype
JavaScript library, allowing us to write JavaScript
that is unobtrusive, clean and easy to read.
Observing Events
Above, I showed how to assign a piece of JavaScript
(called "do_something") to an event on a particular
HTML element. A fuller version of this HTML form,
as well as some more content and tags, is shown
in Listing 1 (test.html). This file contains a simple
hyperlink, as well as our form.
I've already discussed how to handle an onclick
event by setting the onclick attribute. However,
there are at least two other methods for setting this
event handler. One is to set the onclick attribute
through JavaScript, treating onclick as a property of
the DOM element associated with the hyperlink or
button. Using Prototype's $() function, we can write:
$('hyperlink 1 ).onclick =
functionO { alert(' clicked!'); return false; }
Notice how the event handler is an anonymous
function, similar to "lambda" in Ruby and Python
or an anonymous subroutine in Perl. The event¬
handling function can take an optional argument,
whose value will be an event object. For example:
$('hyperlink').onclick =
function(event) { alert(event); return false; }
With this alternate code in place, the alert (in
Firefox, at least) indicates that the event was an
"object MouseEvent". This object, like all objects in
JavaScript, then has a number of properties we can
query. For example, the pageX and pageY proper¬
ties indicate the X and Y coordinates of the mouse
cursor when the event took place. We can see these
by specifying the following:
$('hyperlink').onclick =
function(event) { alert(event.pageX + ", " +
event.pageY); return false; }
Each click on the link will give a slightly different
result, depending on the coordinates of the mouse
cursor at the time of the click.
Of course, we also can define non-anonymous
functions as our event handlers:
function show_x_and_y(event) {
alert(event.pageX + ", " + event.pageY); return false;
}
Listing 2. test-2.html, with Event Flandlers Defined in
Unobtrusive JavaScript
A paragraph of text.
A hyperlink
to The New York Times.