0% found this document useful (0 votes)
162 views

Linux Journal March PDF

Uploaded by

CopacianuLucian
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
162 views

Linux Journal March PDF

Uploaded by

CopacianuLucian
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 84

AL | KDE 4.

2 | GNOME Do | Adobe AIR | Xfce | jQuery


15
OF
N
UR
LINUX JOURNAL

S
AR JO ™

BROWSERS
YE

X
INU
L COMPARED
Opera, CrossOver
Chromium and Flock
DESKTOP

GNOME-Do
Launch Apps
Since 1994: The Original Magazine of the Linux Community Quickly
MARCH 2009 | ISSUE 179

THE DAY THE


EARTH STOOD STILL
KDE 4.2 | GNOME Do | Adobe AIR | Xfce | OpenSim | jQuery

LINUX DOES SCI-FI

Xfce
An Alternative
Lightweight
Desktop

Create Your Own


Virtual Reality
with OpenSim

Check Out
KDE’s Latest
Enhancements
MARCH 2009 ISSUE 179

w w w. l i n u x j o u rn a l . c o m
$5.99US $5.99CAN
03

PLUS:
Cross-Platform Apps with Adobe AIR 0 09281 03102 4
ZT Systems delivers something different: a unique

of world-class server performance and cost advantage


joined with extensive flexibility in delivery and support
From the small office to the mega-datacenter, ZT Systems
provides dependable, energy efficient server and client solutions
that maximize productivity and optimize your IT budget. An
established manufacturer celebrating our 15th anniversary, ZT
combines individualized attention to your requirements with the
experience and scalability you demand. All ZT Systems are
assembled and serviced in the USA.

Choose ZT Systems and get:


‡&XVWRP&RQILJXUDWLRQV
‡3URIHVVLRQDO*UDGH4XDOLW\
‡3HUVRQDOL]HG$FFRXQW6HUYLFH
‡6XSHULRU9DOXH

Systems

Systems

ZT Reliant SC1256i-40 ZT Systems 1105Ri-82 ZT Systems 1213Ri-84 ZT Systems 4202Ci-84


Small Business Server 1U Rack Server 1U Rack Server 4U/Tower Rack Server
Entry-level Single Entry-level file/web/email Data Center / Network Convertible Tower / Rack
Socket Solution Server Solution Infrastructure and Cluster SMB Solution
Solution
Starting at Only
$
749 Starting at Only
$
949 Starting at Only
$
1249 Starting at Only
$
1649
=76&L =75L& =75L& =7&L&

‡,QWHOŠ&RUHŒ4XDG ‡,QWHOŠ;HRQŠ3URFHVVRU; ‡6LQJOH,QWHOŠ;HRQŠ3URFHVVRU ‡6LQJOH,QWHOŠ;HRQŠ3URFHVVRU


3URFHVVRU4 ( GXDOFDSDEOH ; GXDOFDSDEOH
‡*%''50+](&&
‡*%''50+] 8QEXIIHUHG6'5$0 [*% ‡*%''5(&&5(* ‡*%''5(&&5(*6'5$0
6'5$0 [*% 6'5$0 [*%  [*%'XDO5DQN
‡  *%6$7$(QWHUSULVH
‡  7%6$7$,,0% +DUG'ULYHV 0D[ ‡  *%6$7$,,0% ‡  7%6$7$,,0%+RWVZDS
+RWVZDS+DUG'ULYHV 0D[ +RWVZDS+DUG'ULYHV 0D[ +DUG'ULYHV 0D[
‡;'9'520'ULYH
‡;'9'520'ULYH ‡6OLP'9'520 2SWLRQDO ‡['9'520 0%
‡5HG+DW(QWHUSULVH )ORSS\'ULYH
‡5HG+DW(QWHUSULVH 7ULDO9HUVLRQ ‡5HG+DW(QWHUSULVH ‡5HG+DW(QWHUSULVH
7ULDO9HUVLRQ ‡<HDU/LPLWHG:DUUDQW\DQG 7ULDO9HUVLRQ 7ULDO9HUVLRQ
‡<HDU/LPLWHG:DUUDQW\DQG [7HOHSKRQHVXSSRUW ‡<HDU/LPLWHG:DUUDQW\DQG ‡<HDU/LPLWHG:DUUDQW\DQG
[7HOHSKRQHVXSSRUW [7HOHSKRQHVXSSRUW [7HOHSKRQHVXSSRUW

Scalable Custom Server Solutions - Contact Us to Learn More


(866) 984-7687 corpsales@ztsystems.com
,QWHOWKH,QWHOORJR;HRQ,QWHO&RUH;HRQ,QVLGHDQG&RUH,QVLGHDUHWUDGHPDUNVRUUHJLVWHUHGWUDGHPDUNVRI,QWHO&RUSRUDWLRQLQWKH86DQGRWKHUFRXQWULHV
CONTENTS MARCH 2009
Issue 179

FEATURES
48 FAST APP LAUNCHING WITH
GNOME DO
Use GNOME Do and its many plugins to
extend desktop functionality.
Kyle Rankin

52 XFCE: THE THIRD MAN


The “other” desktop environment.
Federico Kereki 48

58 BROWSER BATTLES:
OPERA, CROSSOVER
CHROMIUM AND FLOCK
Stuck on Firefox? You may find fulfillment in
an alternative browser.
James Gray

64 AIR OUT YOUR DESKTOP


WITH ADOBE
Desktop apps for everyone.
Shawn Powers

52

ON THE COVER
• Browsers Compared: Opera, CrossOver
Chromium and Flock, p. 58
• GNOME Do: Launch Apps Quickly, p. 48
• The Day the Earth Stood Still—Linux Does
Sci-Fi, p. 72
• Xfce: An Alternative Lightweight
Desktop, p. 52
• Check Out KDE's Latest Enhancements, p. 22
• Cross-Platform Apps with Adobe AIR, p. 64

Cover image: TM and © 2008 Twentieth Century Fox


Film Corporation. 64

2 | march 2009 w w w. l i n u x j o u r n a l . c o m
CONTENTS MARCH 2009
Issue 179
COLUMNS INDEPTH
10 SHAWN POWERS’ 72 THE DAY THE EARTH
EDITORIAL STOOD STILL
Celebrating 15 Years of Visual effects with Linux.
Linux Journal Robin Rowe

18 REUVEN M. LERNER’S
AT THE FORGE 44 libdmtx
jQuery Plugins

22 MARCEL GAGNÉ’S
COOKING WITH LINUX
The Evolution of the Desktop—
How Far from the Pinnacle?
Next Month
SYSTEM
ADMINISTRATION
They say a picture’s worth a thou-
sand words, so if you use Munin,
you probably can stop talking for
a few years. With Munin, you can
graph anything you can monitor.
And, if you like monitoring,
we’ve got it covered, with
76 RUN YOUR OWN VIRTUAL monitoring from A to Zabbix.
REALITY WITH OPENSIM
Make your own reality, virtually. Of course, there’s not a lot to
Bill Childers monitor if you can’t get your
system to boot, so check out
FreeBoo. FreeBoo is a combina-
30 DAVE TAYLOR’S tion of open-source tools that
WORK THE SHELL provides network dual (multi)
boot with all the power of fat
Counting Words and Letters
clients and all the management
ease of thin clients. If you use
32 MICK BAUER’S Rembo, FreeBoo can save you
PARANOID PENGUIN some serious coin.
Mental Laziness and Bad Dogma
to Avoid With all the free time these
tools will give you, you’ll have
38 KYLE RANKIN’S IN EVERY ISSUE time to deal with the really
HACK AND / nasty problems, like bad Master
When Disaster Strikes:
10 FROM THE EDITOR
Boot Records. But don’t worry,
Hard Drive Crashes 12 LETTERS Kyle Rankin’s unofficial series
14 UPFRONT “When Disaster Strikes” will
80 DOC SEARLS’ 42 NEW PRODUCTS help you through the next time
EOF 44 NEW PROJECTS you hose your MBR.
The Most Personal Device 81 ADVERTISERS INDEX

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 mail-
ing 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 16476,
North Hollywood, CA 91615. Subscriptions start with the next issue. Canada Post: Publications Mail Agreement #41549519. Canada Returns to be sent to Bleuchip International, P.O. Box 25542, London, ON N6C 6B2

4 | march 2009 w w w. l i n u x j o u r n a l . c o m
Executive Editor Jill Franklin
jill@linuxjournal.com
Senior Editor Doc Searls
doc@linuxjournal.com
Associate Editor Shawn Powers
shawn@linuxjournal.com
Associate Editor Mitch Frazier
mitch@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 Gagné
mggagne@salmar.com
Security Editor Mick Bauer
mick@visi.com
Hack Editor Kyle Rankin
lj@greenfly.net

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

Sales Manager Joseph Krack


joseph@linuxjournal.com
Sales and Marketing Coordinator Tracy Manford
tracy@linuxjournal.com

Circulation Director Mark Irgang


mark@linuxjournal.com

Webmistress 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 818-487-2089
FAX: +1 818-487-4550
TOLL-FREE: 1-888-66-LINUX
MAIL: PO Box 16476, North Hollywood, CA 91615-9911 USA
Please allow 4–6 weeks for processing address changes and orders
PRINTED IN USA

LINUX is a registered trademark of Linus Torvalds.


MikroTik powered Hotspots around the world
MikroTik RouterOS powered hotspots are everywhere. From Internet cafes in desert towns of Africa,
to futuristic airport lounges in the US and five star hotels in the Mediterranean. Mikrotik can power
your systems too. Free evaluation installations are available in our download section.

www.mikrotik.com
CELEBRATING

15 YEARS
OF
LINUX JOURNAL
See the first issue of LJ, published in March
1994, at www.linuxjournal.com/issue/1.

SHAWN POWERS

[Shawn Powers was barely out of high of blunders too. Linux is here to stay. stand the test of time. Again, trust me.
school when the first issue of Linux The big news that comes along with The one thing I’m sad to report is
Journal went to press 15 years ago, but this maiden issue of Linux Journal is that in order to try all the awesome
we figured it would be fun to send him that the Linux kernel itself has matured programs available for Linux, you’ll
back in time to write a column for the to 1.0 status. Just because it’s no longer either have to download them very
first issue. Besides, how else could we beta doesn’t mean you’ll have to start slowly from FTP servers or spend some
claim a tax write-off on a time machine?] paying for it though. Linux is free—free money buying CDs. Installing from CDs
Wow, what a dream. I could have in several ways. Check out Arnold is much faster though, so it might be
sworn I was a 30-something-year-old Robbin’s “What’s GNU?” column for worth the investment. I’d give you the
geek with a family and a mortgage. But, more details. Ubuntu CD I brought with me, but I
here I am in 1994. Oh well, at least the Are you worried you won’t be able fear it might disrupt the space-time
Linux Journal gig wasn’t a dream. to run Linux on your existing hardware? continuum. And, I probably would get
What’s Linux Journal, you ask? That’s Well, admittedly, hardware compatibility in trouble for that.
easy. We’re the only magazine dedicated is a challenge, but if you’re looking to I’m so excited for everyone stuck
to the Linux and Open Source communi- install a basic Linux system, you should back here in 1994. You have years and
ty. What’s “Open Source”? Well, you’ll expect to have a computer with at least years of Linux Journal issues to read.
have to wait a few years for that one. 2MB of RAM and 15MB of disk space. Whatever your current plans are for the
Our publisher, Bob Young, brings us Also, the fancy 386 processor will give Linux operating system, keep subscribing
a great interview with Linus Torvalds. you amazing 32-bit speeds and fully uti- to Linux Journal, and we’ll keep you up
As I’m sure you know, Linus has quite a lize the power of the Linux kernel. With to date with the latest information, tech
bit to do with the Linux community. the 386 math coprocessor and its 32-bit tips, programming practices and industry
Bob Young also is someone you’ll want address space, I can’t imagine we’ll ever news for the next 15 years and beyond!
to keep an eye on—trust me on this need a faster processor. ::SNORT:: Now, if you’ll excuse me, I need to
one, and maybe think about investing One of the biggest announcements go find Linus. He hasn’t figured out
in red-colored headwear. We’ve also this month is the availability of a new what sort of mascot to choose for Linux,
got an awesome comparison of the Linux distribution called Debian. Ian and I’m a big penguin fan. If I start try-
three leading operating systems: Linux, Murdock, the creator and maintainer of ing to convince him now, maybe in a
Windows and OS X—er, I mean OS/2. Debian, tells us why his distribution is few years, he’ll decide my penguin idea
Sure, IBM is pouring a ton of money different and why the Linux community is a good one. Wish me luck!I
into marketing its operating system, needs something like it. He has the
while Linux doesn’t have any huge backing of the Free Software In 1994, Shawn was attending his first year of college
financial backing, but I think history Foundation and is making the entire at Michigan Tech University. He skipped his engineering
will prove it takes more than hype to operating system available as a free classes almost every day to sneak into the computer labs
compete. Looking through the vista of download to anyone who wants it— and play with Linux. At the time it seemed a waste of
time, Microsoft will have its fair share awesome stuff that will almost certainly tuition, but looking back, he wouldn’t change a thing.

8 | march 2009 w w w. l i n u x j o u r n a l . c o m
letters
Tech Tip Tuning
I like to read the Tech Tips, as I did with David S. Sinck’s tip “Treating Compressed and
Uncompressed Data Sources the Same” (LJ, December 2008, page 56). Here are some
remarks and suggestions.

I strongly recommend using double quotes. The presented solution silently misses all files
with one or more whitespaces in its name.

The only purpose of the line:

F=$(echo $1 | perl -pe 's/.gz$//')

is to remove the last file extension from the filename. This is done with Perl, an inter-
preter for a language much more powerful than Bash, a subshell and a pipe. There’s too
much effort to remove a few characters (in every loop cycle!). The first two lines of the
function could be replaced by a parameter substitution, which costs nearly nothing. So,
with quoting, we get the following:

function data_source ()
{
local F=${1%.gz} # remove file extension
Clarification from Damballa
This letter is in regard to Grzegorz Landecki’s if [[ -f $F ]] ; then
“Detecting Botnets” article from the January cat "${F}"
2009 issue of Linux Journal, from Paul Royal, elif [[ -f $F.gz ]] ; then
Principal Researcher at Damballa, Inc.—Ed. gunzip --stdout "${F}.gz"
fi
As the individual who discovered the Kraken } # ------- end of function data_source -------
botnet, I wanted to clarify some inaccuracies
that were stated regarding its discovery and for file in * ; do
handling. In addition to these clarifications, data_source "$file" | ...
I would welcome any conversations about done
Damballa, its processes and Kraken findings if --
Mr Landecki is interested in further discussion. Fritz Mehner

From the Linux Journal article:


botnet was not HacDef after it located a mal- TippingPoint (dvlabs.tippingpoint.com/blog/
“To simplify, Damballa discovered (proba- ware sample matching the network anomaly. 2008/04/28/owning-kraken-zombies).
bly during a security audit) a new malware That others in industry thought the botnet
with hard-coded addresses (URLs) for zom- was Bobax, an older botnet (and perhaps From the article: “Damballa registered those
bie control servers (CCs—computers that ancestor of Kraken), speaks to the general domains as its own and ended up control-
manage tasks for zombie machines and all difficulty of new botnet identification. ling quite a large botnet for research.”
infected computers report to them).”
From the article: “Damballa also found that Damballa never “controlled” Kraken;
Damballa first discovered Kraken through some of those hard-coded addresses were because Kraken malware generates
network anomalies observed on a DynDNS not registered in a DNS service (the botnet domains, the botmasters simply registered
provider’s network with which it collaborates probably was tested at that time, and the domains that would be subsequently
to shut down C&C servers. Damballa origi- authors were preparing to launch it later).” autogenerated (Damballa could not regis-
nally thought Kraken was HacDef (a well- ter them all) and resumed its operation.
known type of malware used by a botnet Kraken malware does not use hard-coded
documented in 2006; see www.avira.com/ domain names at all; it autogenerates From the article: “It hasn’t contacted any
en/threats/section/fulldetails/id_vir/0/ them. The algorithm used to generate security company about the methods of
bds_hacdef.fv.1.a.html) and did not have a domain names has been documented by infection it discovered.”
malware sample for Kraken until late March both ThreatExpert (blog.threatexpert.com/
2008. Damballa only discovered that the 2008/04/kraken-changes-tactics.html) and In early April 2008, Damballa released

1 0 | march 2009 w w w. l i n u x j o u r n a l . c o m
instructions for remediating Kraken
compromises (www.damballa.com/
At Your Service
downloads/brochures/
Kraken_Remediation.pdf) and a
technical whitepaper/industry response MAGAZINE
(www.damballa.com/downloads/
PRINT SUBSCRIPTIONS: Renewing your
press/Kraken_Response.pdf) that subscription, changing your address, paying your
included Kraken C&C domains that invoice, viewing your account details or other
companies/organizations could use to subscription inquiries can instantly be done on-line,
prevent compromised systems from www.linuxjournal.com/subs. Alternatively,
within the U.S. and Canada, you may call
talking to the Kraken control servers.
us toll-free 1-888-66-LINUX (54689), or
internationally +1-818-487-2089. E-mail us at
Damballa (who codeveloped and adminis- subs@linuxjournal.com or reach us via postal mail,
trates the malfease malware repository— Linux Journal, PO Box 16476, North Hollywood, CA
www.malfease.oarci.net) also shared 91615-9911 USA. Please remember to include your
complete name and address when contacting us.
malware samples (that could be downloaded
by researchers/practitioners) with SANS ISC DIGITAL SUBSCRIPTIONS: Digital subscriptions
(isc.sans.org/diary.html?storyid=4256) of Linux Journal are now available and delivered as
PDFs anywhere in the world for one low cost.
and OffensiveComputing
Visit www.linuxjournal.com/digital for more
(www.offensivecomputing.net/ information or use the contact information above
?q=node/699). for any digital magazine customer service inquiries.

LETTERS TO THE EDITOR: We welcome


From the article: “It hasn’t published your letters and encourage you to submit
any details of the exploits used to any them at www.linuxjournal.com/contact
bugtrack, nor has it contacted any or mail them to Linux Journal, PO Box 980985,
vendors to alert them of the issue.” Houston, TX 77098 USA. Letters may be edited
for space and clarity.
Kraken didn’t use any exploit to propagate; WRITING FOR US: We always are looking
there were no vendors to contact. Like for contributed articles, tutorials and real-
Storm, Kraken propagated through social world stories for the magazine. An author’s
guide, a list of topics and due dates can be
engineering (e-mail and instant message).
found on-line, www.linuxjournal.com/author.
--
Paul Royal ADVERTISING: Linux Journal is a great
resource for readers and advertisers alike.
Request a media kit, view our current
editorial calendar and advertising due
PHOTO OF THE MONTH dates, or learn more about other advertising
and marketing opportunities by visiting us
Have a photo you’d like to share with on-line, www.linuxjournal.com/advertising.
Contact us directly for further information,
LJ readers? Send your submission to
ads@linuxjournal.com or +1 713-344-1956 ext. 2.
publisher@linuxjournal.com. If we run
yours in the magazine, we’ll send you
a free T-shirt.
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
Tux and Tuxina cake, submitted by David and tricks, and links to in-depth stories featured
Backeberg, taken at his friend’s wedding. on www.linuxjournal.com. Subscribe for free
today, www.linuxjournal.com/enewsletters.
UPFRONT NEWS + FUN

diff -u
WHAT’S NEW IN KERNEL DEVELOPMENT
Much of the Linux kernel source tree is familiar Ethernet protocol. crypted filename with that prefix and that
taken up with the text of licenses under No one likes getting a kernel oops. format, you’re on your own. But the issue
which the code is released. There are Well, some folks actually do, and they probably will never come up.
plenty of GPL-compatible licenses, and spend lots of time trying to invoke them, The linux-next tree is continuing to
much of the kernel is released under a just so they can fix them and make the be fine-tuned. On the one hand, Stephen
dual license. As Jörn Engel points out, a world better. Arjan van de Ven has Rothwell wants the tree to be a place
lot of kernel source files also include the written a Perl script to take the raw oops where code migrates quickly into the main
full text of their licenses, causing about output, pretty it up, and also try to clari- kernel tree. He also specifically wants
3.5MB of duplication throughout the fy the part of the oops that’s actually rel- Andrew Morton to be able to base his
source tree, or something more than evant to figuring out what went wrong. own -mm tree releases on linux-next easily.
1% of the total size of the tree. Roland The script, called markup_oops.pl, still All of this means linux-next is intended to
Kletzing recently reported those num- is tethered to the i386 platform, thanks make sure that code merges well together
bers, suggesting that one way to reduce to some coding constructs that Keith and will not cause housekeeping problems
the size of the kernel would be to Owens pointed out to him. It also seems for any upstream maintainers (such as
replace all that duplication with simple that Perl is no longer the “language of Linus Torvalds and Andrew).
one-line pointers to a single copy of ascendancy”, so writing the script in Perl So, all code is expected to be unit-
each relevant license. may be another strike against it. tested and posted to the relevant mailing
Although completely rational, this Michael Halcrow, Tyler Hicks and lists. The folks submitting the code
may not be likely to happen. On the one David Kleikamp have added filename should know that if it doesn’t get
hand, as Jörn says, a lot of the duplica- encryption to eCryptFS. This has some dropped, it’ll be heading into the official
tion is done because corporate legal interesting issues that make the imple- tree. Any patches that conflict with the
departments want their engineers includ- mentation trickier than it might seem. tree will be dropped. Any code that
ing full licensing information with all For example, the encryption process can breaks the build will be dropped. In prac-
their contributions. Taking it out again make the filename slightly longer than tice, truly trivial breaks won’t get code
might pose problems for them. On the the unencrypted version, so if the unen- dropped from linux-next, if Stephen can
other hand, Chris Snook reminded folks crypted version is too close to the maxi- just eyeball the problem and fix it quickly.
that the kernel was distributed in com- mum length allowed by the filesystem, But, anything beyond that will require the
pressed form, and because the licenses the encryption process won’t work. folks submitting the code to fix it up and
were all duplications, they compressed Also, the eCryptFS folks want encryp- submit it again. In some cases, people
down to a very, very small size. Bodo tion to be optional—some files in the from different projects will have to work
Eggert’s objection—that even this small directory may be encrypted while others together to resolve whatever breakage
size, when multiplied by the number of aren’t. How do you tell the difference one of their submissions brought to light.
times the kernel actually was downloaded, between an encrypted filename and a file- The idea is that linux-next gives these
resulted in an immense waste of band- name that’s just really dorky? The answer projects the opportunity to identify and
width—was largely ignored, primarily is that the encrypted names all have a spe- work on those conflicts and other prob-
because shrinking the compressed cial prefix, and the rest of the name is in a lems, before trying to get it past Linus or
sources by such a small amount also special format. If you really want to mess Andrew and into their trees.
could be accomplished by doing actual with the filesystem and create an unen- —ZACK BROWN
coding work, which is more fun, more
sexy, and has the added benefit of actually
making the kernel run better.
Maybe someone will find a way to
keep the corporate lawyers happy and
reduce the amount of license duplication at
the same time, but this doesn’t seem likely
to become a high priority for anybody.
There’s a new driver out that connects
PCI devices called PCINet. It was written
by Ira Snyder, and it implements the
Ethernet protocol across the PCI inter-
face. Now folks can code up communica-
tion between two PCI devices, using the

1 2 | march 2009 w w w. l i n u x j o u r n a l . c o m
LJ Index, [ UPFRONT ]
March 2009
1. Average number of minutes it takes to read
an on-line privacy policy: 10
Fast Is Hot
2. Mean word count of privacy policies for the Last month, we reported here about Splashtop
Web’s most popular sites: 2,514 (www.splashtop.com), which starts a laptop in only a few seconds. Since then, Splashtop
3. Number of words in MySpace’s Terms and reportedly has found its way into the Lenovo IdeaPad S10e and the ASUS Eee PC.
Conditions: 3,868 Now there’s Cloud (thinkgos.com/press-release20081201.php), from Good OS,
which gave us gOS Linux and a cover story for Linux Journal in March 2008. Good OS calls
4. Number of words in the MySpace Terms and
Conditions paragraph that says, “It is therefore
Cloud “A New Operating System for 2009”. More specifically, the press release says Cloud
important that you review this Agreement “integrates a Web browser with a compressed Linux operating system kernel for immedi-
regularly to ensure you are updated as to ate access to Internet, integration of browser and rich-client applications, and full control of
any changes.”: 65 the computer from inside the browser” (thinkgos.com/press-release20081201.php).
5. Number of Web sites visited by the average The browser looks like Google’s Chrome, and most of the icons in the Mac-like dock
person per month: 119 on the bottom of the screen are for Google apps running in “the cloud”. One exception
is the Windows symbol. We won’t go there. Meanwhile, the fast-start race all goes
6. Number of hours it would take to read all
privacy policies for 119 Web sites: 20 to Linux.Cloud, launched in December 2008 at the Netbook World Summit in Paris,
demonstrated on a GIGABYTE Netbook.— D O C S E A R L S
7. Millions of Web users in the US: 121.667

8. Billions of hours per year that would be


spent if every US Web user read all Web site Find More at LinuxJournal.com
privacy policies: 44.3

9. Estimated time cost in dollars per year, per


US Web user, for reading all Web site privacy
policies: 3,000

10. Estimated billions of dollars in lost leisure


and productivity time that would be cost by
all US Web site users reading all privacy
policies: 365

11. Millions of Web sites in Google’s first index,


in 1998: 26

12. Billions of pages indexed by Google in 2000: 1

13. Trillions of pages indexed by Google in


2009: 1

14. Year in which lines of code in the Linux kernel


will pass 6.5 million: 2009

15. Millions of dollars it would have cost “by


conventional proprietary means in the US” to
have produced Red Hat Linux 6.2 in 2000: 600

16. Billions of dollars it would have cost to


produce Red Hat Linux 7.1 in 2002: 1

17. Those same billions in 2008 dollars: 1.2

18. Billions of dollars it would have cost to This month’s issue is all about Linux on the Desktop, and we have plenty more
produce Fedora 9 in 2008: 10.8 where this came from at LinuxJournal.com.
19. Billions of dollars it would have cost to How better to learn some new desktop tricks than checking out some of our
produce the Linux kernel alone in 2008: 1.4 videos at www.linuxjournal.com/video?
Elliot Isaacson demonstrates how to run your Windows partition without rebooting:
20. Estimated billions of dollars spent by
Microsoft on Vista client operating software, www.linuxjournal.com/video/run-your-windows-partition-without-rebooting.
Windows Server 2007 server software, You also may enjoy reading about Adobe’s Linux offerings for the Adobe AIR
Office 2007, Internet Explorer 7 and other Runtime: “An Introduction to AIR”: www.linuxjournal.com/content/introduction-air.
related software: 14
Have you ever wanted to run an old DOS favorite on your Linux desktop? Check
Sources: 1, 2, 5–10: Ars Technica, Carnegie Mellon out Mitch Frazier’s article “Running DOS Programs on Linux: Duke Nukem Lives!”:
CyLab, Out-Law.com, all sourcing “Cost of Reading www.linuxjournal.com/content/running-dos-programs-linux-duke-nukem-lives.
Privacy Policies” by Carnegie Mellon researchers Aleecia As always, Bruce Byfield brings a constant flow of new tips and tricks for using
McDonald and Lorrie Faith Cranor | 3, 4: MySpace
11–13: Jesse Alpert and Nissan Hajaj, Software OpenOffice.org: www.linuxjournal.com/content/openofficeorg-many-views-impress.
Engineers, Google Web Search Infrastructure Team Visit us at LinuxJournal.com often! There’s always a new tip, trick or how-to
14: Greg Kroah-Hartman | 15, 16: David A. Wheeler
17–19: Amanda McPherson, Brian Proffitt and Ron
to keep you busy.— K AT H E R I N E D R U C K M A N
Hale-Evans of the Linux Foundation | 20: Dennis Byron

w w w. l i n u x j o u r n a l . c o m march 2009 | 1 3
[ UPFRONT ]

They Said It WiMAXing Linux


(moblin.org), which calls itself “a
Linux-based platform optimized for
An avidity to punish is always the next generation of mobile
dangerous to liberty. It leads devices, including Netbooks, Mobile
men to stretch, to misinterpret, Internet Devices and In-vehicle info-
and to misapply even the best tainment systems”. On that last
of laws. He that would make his front, Intel is working with Wind
own liberty secure must guard River on a Moblin-enabled “auto-
motive infotainment stack”. Says
even his enemy from oppres-
LinuxDevices, “Wind River hopes
sion; for if he violates his duty
the latter will appear in products
he establishes a precedent that
from ’Tier 1’ automotive equip-
will reach to himself. ment makers, and it lists Bosch,
—Thomas Paine, BMW Group, Delphi and Magneti
www.brainyquote.com/quotes/authors/t/ Marelli among the companies
thomas_paine.html ’actively supporting’ its efforts to
Connect these dots: ’drive Linux’, so to speak, into the auto-
In the longer perspective, Linux motive infotainment market.” Intel
will become a serious alternative I After going through a complicated merger Capital is also putting $11.5 million into
for our high-end phones. with Sprint-Nextel’s wireless broadband Taiwan’s VMAX Telecom, which also plans
—Nokia VP Ukko Lappalainen, operation, Clearwire expects to add to roll out WiMAX data services.
headcount (in a down economy!) as it
www.reuters.com/article/internetNews/
rolls out WiMAX services across the I Linpus (www.linpus.com), also based in
idUSTRE4B16IO20081202
country (seattletimes.nwsource.com/ Taiwan, is joining the Moblin movement.
html/businesstechnology/2008457502_ Linpus is behind the Linux-based Acer Aspire
Coincident with the release of brier02.html). The new entity will be One Netbook. Chetan Sharma Consulting
this code I have concluded my called Clear. (www.slideshare.net/chetansharma/
agreement with Atheros whereby us-wireless-market-q3-2008-update-
I had access to information about I Clear expects “Mobile WiMAX” download nov-2008-chetan-sharma-consulting-
their devices. This means that in speeds to reach “10 to 15 Mbps” within presentation) says the ARPU (average
the future all fixes, updates for two years. revenue per user) for voice in the US is on
new chips, etc., will need to be a a downward trend, and “data ARPU will
community effort. Atheros states I The merger (gigaom.com/2008/11/28/ become a more dominant factor of the
the Linux platform will be the ref- the-iphone-and-the-ensuing-wireless- overall APRU mix by the end of 2009. The
broadband-boom) was supported by an percentage contribution from data is likely
erence public code base, so folks
investment of $3.2 billion by Bright House to exceed 25% by the end of 2008 and
wanting to add support for other
Networks, Comcast, Google, Intel and 30% by the end of 2009.” Sourcing a
platforms will have to scrape the
Time Warner Cable. report by Analysis Mason, Gigaom reports
information from there.
(gigaom.com/2008/11/28/the-iphone-and-
—Sam Leffler, maintainer of the I Google wishes to see Linux-based Android the-ensuing-wireless-broadband-boom)
binary HAL, also used in MadWifi devices work on the network. Says Ars that “By 2015, data will account for
releases, on release of source code for Technica (arstechnica.com/news.ars/post/ 94% of total wireless network traffic
his HAL (hardware abstraction layer) 20081201-future-of-wimax-is-clear-as- in developed regions.”
variant, lwn.net/Articles/308984 sprint-clearwire-close-deal.html), “Even
though Google partners with just a subset I BusinessWeek reports
Expect to see millions of Web of the industry, the availability of unen- (www.businessweek.com/magazine/
devices, even desktop Web cumbered devices with Google services content/08_49/b4111064905299.htm)
devices, in the coming years requires competitive moves toward open- that Netbooks are “cannibalizing PC
ness from other carriers.” The keyword is and laptop sales”.
that completely strip out the
“unencumbered”.
Windows layer and use the
That’s just a small sampling of the rum-
browser as the only operating
I Intel, maker of WiMAX chipsets, has blings where Linux and mobile data meet. But
system the user needs. been investing heavily in WiMAX device the photo above also shows how WiMAX
—Mike Arrington, development and network deployment. cells are actually being rolled out. For more
www.techcrunch.com/2008/09/01/ Recently, it joined the Ministry of Economic on the future of mobile data developments,
meet-chrome-googles-windows-killer/ Affairs (MOEA) in Taiwan to jointly see “The Most Personal Device”, on page 80.
comment-page-2 establish an “enabling center” for Moblin —DOC SEARLS

1 4 | march 2009 w w w. l i n u x j o u r n a l . c o m
Looking for a domain?
More ways to get the domain
name you REALLY want!
New!
Register
new domains …
When you search for a domain name, our
domain checker automatically gives you relevant
domain suggestions, ensuring that you find the
best domain name for your website.

... or buy a domain that has


already been registered.
If the domain name you want has already
been registered, you can use our FREE
domain auction service to search over
14 million domain names and make a bid
on the one you want.

FREE Private Domain


Registration
Your privacy is important to us. With free Save 25% on
private domain registration, your name, address
and phone number remain confidential. Stop
.com domain s!*
spammers, telemarketers, data miners and any-
ar y 28th!
Offer ends Febru
one else who might misuse your personal data.

*Offer valid through February 28, 2009. Discount applied to first year of a 2 year minimum contract
term. Visit www.1and1.com for full promotional offer details. Product and program specifications,
availability and prices subject to change without notice. 1&1 and the 1&1 logo are trademarks of
1&1 Internet AG, all other trademarks are the property of their respective owners.
© 2009 1&1 Internet, Inc. All rights reserved.

Call 1-877-GO-1AND1

Visit us now www.1and1.com


[ UPFRONT ]

I HP Pavilion zv5000 laptop with


What They’re the music on her iPod. I put Ubuntu on
my dad’s old Dell laptop about a year Ubuntu 8.10 (my primary devel-

Using ago. As he doesn’t have the root pass-


word or sudo rights, he can’t mess it
up. Because it is a lot harder to attack
opment PC).

I HP Pavilion dv6000 laptop with


Don Stokes Linux than Windows, I don’t worry Ubuntu 8.10 (wife’s kitchen PC).
about the security of his system. It’s a
When I started following Linux action great OS for him. My mom is next! I HP Pavilion ze4200 laptop with
on Twitter, one contributor stood out: Xubuntu 8.10 (games and KTurtle
mich_linux_guy. His tweets include, “Playing I ran Fedora until Ubuntu Feisty Fawn for my eight-year-old son).
with the Android SDK”, “Getting ready came out. Once in a while, I will boot
to install Fedora 10 on my son’s XO lap- a live CD of other distributions to see I HP Pavilion a1687 desktop with
top....Hope it’s a win” and “Bought an Acer what they are up to. I also have Damn Ubuntu 8.10 (hooked to our LCD
Aspire One at Costco for $350. Just installed Small Linux (DSL) running on a couple TV in the family room).
Ubuntu 8.10. Did require fiddling with of machines. It is amazing how much
wireless packages (Googled it). Works!” His functionality you can get using this I ASUS Eee PC running Xubuntu
name is Don Stokes. He’s a veteran hardware distribution on machines that most 8.10 (rides in my bag).
and software hacker living with his wife and people would leave on the curb for
three sons in Oakland County, Michigan, the garbage truck. I Acer Aspire One running Ubuntu
where he’s also pursuing an MS in Computer 8.10 (maybe a replacement for
Science at Oakland University. His startup is The best thing about Linux is that the Eee?).
stokesautomation.com. And his favorite its modular architecture makes it so
quote is from Spinoza: “Let every man think configurable/customizable. If I want I OLPC XO running Fedora, Sugar
what he wants and say what he thinks.” eye candy, I can run GNOME or and XFCE (toy for my four-year-old
What follows is plenty of both. KDE desktops. I can even run the X son—he loves hearing it say what
server with only a display manager, he types).
if I want to maximize efficiency. On
machines with low CPU or memory I IBM NetVista with 128MB of
resources, I can run with only a RAM running Xubuntu 8.10.
command line on a text display with
no graphical user interface. I Compaq Pressario, 166MHz
Pentium MMX, 16MB of RAM
Another reason I use Linux is the huge running Damn Small Linux (base-
repository of free software. Kids have ment machine—with the graphical
very short attention spans. Even the desktop up playing a CD, it is
best games won’t keep them content using only 8MB!).
Don’s Four-Year-Old Son on His OLPC for long. With Linux, I can simply go to
the Add/Remove option on the main I Six other PCs of varying CPU and
The first computer I purchased was a menu and choose from a gazillion free RAM running Ubuntu and DSL
TRS-80 model 1. I goofed around with applications—all installable with a few (acting as file/print/game servers).
some text-based adventure games mouse clicks. Many of these applica-
and played with BASIC programming. tions are very educational; it’s been a I Nokia n810 (replacement for my
The next computer I bought had an great experience for my kids. Because Palm TX, but replaced by G1).
Intel 80286 processor. It came with they don’t have administrator access,
MSDOS, but I bought a copy of IBM they can’t corrupt the machine. I T-Mobile G1 phone running Android.
OS/2 to run. Eventually, OS/2 died,
and I was forced to run Windows NT. I recently downloaded the Android All the software I use on a daily basis
I think it was in 1999 that a friend at SDK for the Eclipse IDE. It is amazing is free, and almost all of it is open source.
work (Ben—what happened to you? how easy it is to create applications I use OpenOffice.org for word processing,
Call me!) passed me a Red Hat Linux written in Java for Android. I got so spreadsheets, presentations and simple
CD. (It was actually labeled “Red Ass excited, I went out and bought a G1 databases. I use Mozilla Firefox and
Linux”.) It required a lot of tinkering the next day. (That’s how long it took Thunderbird for Web browsing and e-mail.
to get it to work, but for me, this was the local T-Mobile guys to get some Pidgin is my instant messenger. I use gcc
“fun”! Eventually, I decided to make stock.) I’m currently writing a simple for compiling my C/C++ source and Eclipse
it my primary OS. encryption application for storing pri- for my Java development. I also use Apache
vate information like passwords and Web servers and a MySQL database manager
For our anniversary, I bought my wife account numbers. Collecting devices for systems I have developed. I also use
an HP laptop with a gig of RAM and that run Linux has become kind of an Umbrello, Octave, Kino and VLC on a
put Ubuntu on it. She uses it for her obsession with my family (okay, me). regular basis. I love my freedom!
e-mail, Web browsing and to manage Here is our current collection: —DOC SEARLS

1 6 | march 2009 w w w. l i n u x j o u r n a l . c o m
Need a server for your
d
small business? Special offers en
u a r y 2 8 th!
Look no further. F e b r
All 1&1 Premium Servers include*:
Introducing 1&1 Premium Servers, a powerful new line of
dedicated servers specifically designed for high performance Q RAID
needs. Featuring energy efficient technology, these top-of-the-line Q Plesk 8 with 100-domain license
machines reduce costs and environmental impact with increased Q FTP backup space
Q Serial Console: Connect directly to the serial port
performance-per-watt.
of your server, even if the network is down.
Q Recovery Tool: Load rescue image and reboot server.
Q GeoTrust Dedicated SSL certificate (a $49 value!)
Q Easy-to-configure firewall and more!

1&1 BUSINESS SERVER II


Dual-Core AMD OpteronTM 1218, 2 x 2.6 GHz,
AMD 4 GB DDR RAM, 2 x 500 GB Hard Drive

99 3 mon*ths
Quad-Core
Server
$
199. per month

HURRY! Special offer ends February 28th.


FREE!

1&1 ENTERPRISE SERVER I


Quad-Core AMD OpteronTM 1352, 4 x 2.1 GHz,
4 GB DDR RAM, 2 x 750 GB Hard Drive

$
299. 99 3 months
per month
FREE!*
HURRY! Special offer ends February 28th.

1&1 ENTERPRISE SERVER II


Quad-Core AMD OpteronTM 1356, 4 x 2.3 GHz,
8 GB DDR RAM, 2 x 1,000 GB Hard Drive

$
399. 99 3 months
per month
FREE!*
HURRY! Special offer ends February 28th.

* Offer valid through February 28, 2009. Prices based on Linux servers. Discount applied to first 3 months of a 12 month minimum
contract term, $99 setup fee applies. See www.1and1.com for full promotional offer details. Certain features not available with
Managed Servers. Product and program specifications, availability and prices subject to change without notice. 1&1 and the 1&1
logo are trademarks of 1&1 Internet AG, all other trademarks are the property of their respective owners.
© 2009 1&1 Internet, Inc. All rights reserved.

Call 1-877-GO-1AND1

Visit us now www.1and1.com


COLUMNS
AT THE FORGE

jQuery Plugins
Learn how to use jQuery plugins, one of the secrets to this JavaScript
library’s success.
REUVEN M. LERNER
Last month, we began to look at jQuery, an invokes the foo() method on it.
open-source JavaScript library that provides a great What does $('#mybutton').foo() do? That’s
deal of functionality for Web developers, which is up to the author of the plugin. Typically, a plugin
increasingly popular for client-side application adds functionality to an element or class of elements,
development. We saw that jQuery’s use of CSS-style quite possibly modifying the HTML around that
selectors, combined with its “chaining” syntax, element—adding new elements necessary for the
makes it easy to get started with the library and to plugin to do its job or adding classes that cause one
attach behaviors to page elements. We also saw or more CSS declarations to be invoked.
that jQuery inherently is unobtrusive, with event Because a jQuery plugin typically modifies the
handlers being assigned via $(document).ready(), document’s HTML, it’s vitally important to look
rather than inline with the HTML. at a plugin’s documentation to understand what
At the end of the day though, jQuery does HTML structure it expects to receive. Perhaps it
many of the same things as Prototype, YUI and expects to have an unordered list (<ul>) with list
other JavaScript libraries. So, why have so many items (<li>) inside it. Perhaps it expects to have
developers moved to jQuery? What makes it <div> tags with <span> tags inside it. Perhaps
such an attractive choice? Speed and the API are it expects something else altogether. If a plugin
obviously two factors, but a major reason for devel- doesn’t seem to do what you expected, double-
opers to use jQuery is the huge library of plugins check that your HTML matches the example
that is available for it. Just as Perl programmers and/or what’s in the documentation.
can enjoy a massive library of modules known as jQuery plugins also rely in no small part on
CPAN, jQuery users can benefit from a large number the powerful visualizations that CSS provides.
of plugins for a variety of tasks, from UI elements to Installing a jQuery plugin often means not only
AJAX form submission. Installing and using a jQuery using JavaScript code, but also putting CSS styles
plugin is extremely straightforward, and it can be into effect—either by incorporating the plugin’s
installed (and evaluated) in minutes. CSS file into your application or by copying
This month, let’s look at a few of the many the declarations into an existing CSS file. Just
jQuery plugins that have been developed over the as many plugins require that your HTML be
last few years, and also at how to use plugins to structured a certain way in order to work, some
change our Web applications. require that you set certain classes or IDs on
your HTML elements.
Plugin Basics The fact that jQuery plugins modify the HTML
From a developer’s perspective, a jQuery plugin is and/or CSS means that you might need some
nothing more than an additional JavaScript file that extra tools to understand and debug what is
you download, install in your Web application’s happening in your browser. I normally develop in
JavaScript directory, include in your program with Firefox, and I have found the Firebug extension
a <script> tag and then invoke. Typically, a plugin to be a wonderful tool to identify issues and
adds one or more new functions to the jQuery experiment with alternatives, in both JavaScript
object, which means if you install a plugin named and CSS. Also quite valuable is the Web Developer
foo, you often can do the following: extension for Firefox, whose “view generated
HTML” does the same thing as “view source”,
$(document).ready(function() { but shows you the HTML as it currently exists,
$('#mybutton').foo(); not as it was downloaded originally from the
} server before JavaScript modified it.
Finally, some plugins come with images that
The above construct tells jQuery that when the enhance the way the plugin works.
HTML document has been downloaded enough to The way I’ve described it so far might make
start querying and modifying it with JavaScript, you it seem as though jQuery plugins are difficult to
invoke a function. That function, in turn, looks for use or that they will force you to change and
an HTML element with the ID mybutton and then contort your HTML in numerous ways. But, nothing

1 8 | march 2009 w w w. l i n u x j o u r n a l . c o m
is further from the truth. On the contrary,
the main problem I have had with jQuery Listing 1. table.html
plugins is the vast variety and scope of them,
forcing me to choose among 20 different <html>
menuing plugins or ten different modal-dialog <head>
plugins. Comparing and evaluating these <title>Testing tables</title>
plugins, many of which have borrowed code <script type="text/javascript" src="jquery.js"></script>
from one another, can be difficult. But, when <script type="text/javascript" src="jquery.dataTables.js"></script>
you find an appropriate plugin, it’s usually <script type="text/javascript">
quite easy to get started using it. $(document).ready(function () {
If you are trying to do something in jQuery $('#people-table').dataTable();
that others probably have tried before, you });
always should look through the main plugin </script>
repository first, at plugins.jquery.com. </head>
There also is a large library of user-interface
(UI) plugins at ui.jquery.com. And of course, <body>
large numbers of plugins are described, <h1>Testing tables</h1>
documented and downloadable from Web <table id="people-table">
sites outside jquery.com. <thead>
<tr>
DataTables <th>ID</th>
HTML tables have been around for many years, <th>Last Name</th>
and although they have gotten a bad reputation <th>First Name</th>
because of the way they were used and abused <th>City</th>
for layout purposes (even after the introduction <th>Balance</th>
of CSS), there are many times when a table </tr>
is the best and most logical way to present </thead>
data. If you are running an on-line store, for <tbody>
example, and you want to get a summary of <tr>
recent orders, it makes sense to structure the <td>1</td>
data in a table. <td>Lerner</td>
One of the most common things users want <td>Reuven</td>
to do with a table, once they see it, is sort the <td>Modi'in</td>
rows according to one particular column. To <td>100</td>
continue with our e-commerce example, per- </tr>
haps they want to sort the list by order number. <tr>
Or, perhaps they want to sort it by customer <td>2</td>
name, by price or by date. <td>Barack</td>
It’s not hard to do this kind of sorting on the <td>Obama</td>
server side. Set up the table headers to be click- <td>Washington</td>
able links, and when you get a request, you <td>750000000</td>
change the order of the rows before they are </tr>
output. But, if the data already is in your browser, <tr>
wouldn’t it be nice to be able to sort the rows <td>3</td>
in JavaScript? This might not be the fastest <td>Bush</td>
possible way to execute such a sort, but given <td>George</td>
small enough data sets, it’s acceptable for <td>Dallas</td>
most purposes, and it gives the user a sense <td>-1000000000</td>
of desktop-like control and response. </tr>
One nice jQuery plugin I’ve found to do this </tbody>
is called DataTable, written by Allan Jardine (see </table>
Resources). DataTable takes an existing HTML </body>
table and makes it sortable by column, as well </html>
as searchable.
To get this to work, you need an HTML
table. Listing 1 is an HTML file that will work presumably will want to use DataTable with
just fine for these purposes, although you a dynamic Web application.

w w w. l i n u x j o u r n a l . c o m march 2009 | 1 9
COLUMNS
AT THE FORGE

As you can see, Listing 1 contains a single table itself. If you put jquery.js and dataTable.js in the
with an ID of people-table. The table is defined as same directory as the file (which is probably not a
you might expect for an HTML table, with one pos- good idea on a production system), you can write:
sible exception (unless you’re extremely pedantic).
The headers for the table are defined with a <script type="text/javascript" src="jquery.js"></script>
<thead> section, while the body is in a <tbody> <script type="text/javascript" src="jquery.dataTables.js"></script>
section. These tags are optional according to the
HTML standard, but they are mandatory if you Now everything is ready, except one thing. You
want to use DataTable. need to connect the DataTable plugin to your table.
With the table in place, you now can add jQuery You do this by telling JavaScript that when the
and the DataTable plugin. Unlike other sorts of plugins, document is ready, you want to connect the two:
there’s nothing to install, except the JavaScript file
$(document).ready(function () {
$('#people-table').dataTable();
Listing 2. menu.html });

<html> If you aren’t familiar with jQuery already, you’ll


<head> soon learn that this is a common idiom when using
<title>Testing menus</title> the library. Define a function that is triggered on
<link rel="stylesheet" type="text/css" media="screen" $(document).ready and have that function execute
href="superfish.css" /> and/or define a number of other items, each of
<script type="text/javascript" src="jquery.js"></script> which fires on a different tag, ID or class.
<script type="text/javascript" src="superfish.js"></script> Once you connect DataTable to the table, you’ll
<script type="text/javascript"> see that the headers are now clickable and force the
$(document).ready(function () { table to be sorted, first in ascending and then in
jQuery('ul.sf-menu').superfish(); descending order. (The DataTable download includes
}); icons and CSS appropriate for seeing the sort order.)
</script> DataTable supports a large number of options,
</head> all of which are passed to the dataTable() function.
For example, DataTable shows ten rows of the
<body> current table by default, but it lets you choose
<h1>Testing menus</h1> from 10, 25, 50 and 100 rows. If you prefer to see
a different number, you can set the iDisplayLength
<div> property to a different default:
<ul class="sf-menu sf-navbar">
<li> $(document).ready(function () {
<a href="">Account</a> $('#people-table').dataTable({'iDisplayLength': 1});
<ul> });
<li><a id="checking-menu" href="#checking-div">Checking</a>
</li> I recently have used DataTable in a few projects,
<li><a id="savings-menu" href="#savings-div">Savings</a> and I’ve found it to be easy to use, stable and
</li> well documented. The biggest problems crop up
<li><a id="credit-card-menu" href="#credit-card-div"> when you have a large data set, but that’s not
Credit card unique to DataTable.
</a>
</li> Menus
</ul> Another common task people want to do in
</li> JavaScript is produce menus, including hierarchical
<li><a id="profile-menu" href="#profile-div">Profile</a> menus. Indeed, if I think back several years, menus
</li> probably are one of the things for which my clients
<li><a id="help-menu" href="#help-div">Help</a> have most commonly asked. One of the best-known
</li> methods for creating menus with CSS is known as
</ul> Suckerfish, because of the sample data that was
</div> used to show the technique.
</body> There are many jQuery-based menu libraries, but
</html> one I’ve grown to enjoy is called Superfish, because
it adds functionality to the Suckerfish style of menu.

2 0 | march 2009 w w w. l i n u x j o u r n a l . c o m
It handles submenus, adds shadows and even tries to be the hang of it, downloading, installing and using plugins
intelligent about when you plan to open the menu and becomes second nature. I’ve found it can be useful to
when your mouse is passing by, using a separate plugin create a simple, small HTML file with dummy data and use
known as hoverIntent. a jQuery plugin with that, just to understand the basics of
To use Superfish, you need to download and install the how to use a plugin.
plugin. Then, you need to create a menu using a combination There are times when plugins clash with one another, in
of <ul>, <li> and <a> tags. If you need a secondary hierarchy that they’re both trying to rewrite the HTML, sometimes in
of menus, you can create one with a nested <ul> in an <li> conflicting ways. For example, I recently used DataTable along
tag. In each <a> tag, the href identifies which div on a page with with a jQuery tab widget, and it took me a while until
should be displayed when that menu item is clicked on, hiding I could ensure that everything was visible on the page. As
all of the other divs by default. jQuery plugins become increasingly sophisticated, we might
You undoubtedly will want to start off with the Superfish have to worry about this more and more.
CSS file that comes with the plugin. You always can modify it For now, however, jQuery plugins are a fun and easy way
to suit your needs. There are large numbers of definitions, and to spruce up your Web application. Next month, I’ll explain
I’ve never been able to build the CSS file from scratch. Instead, how to design your own plugin, delving a bit deeper into
I’ve modified the existing one, changing it to suit my needs. jQuery’s plumbing and understanding how jQuery takes
As always in jQuery, you use the plugin by attaching it to advantage of JavaScript’s quirks to give us an extensible
an element of the HTML page. Instead of using the element’s platform for client-side programs.I
ID, as you did with DataTable, here you attach it to the <ul>
tag with a class of sf-menu: Reuven M. Lerner, a longtime Web/database developer and consultant, is a PhD candidate in
learning sciences at Northwestern University, studying on-line learning communities. He
<script type="text/javascript"> recently returned (with his wife and three children) to their home in Modi’in, Israel, after
four years in the Chicago area.
$(document).ready(function () {
jQuery('ul.sf-menu').superfish();
});
</script>

If there were more than one <ul> with that class, Superfish
would create menus on all of them. Remember, the jQuery
object can return any number of page elements: zero, one
or a large number. The full HTML for the example is shown
in Listing 2.

Conclusion
Plugins are the secret to jQuery’s success, and there are so
many plugins for jQuery, it’s impossible to describe them all
here. But, as you can see from these two examples, using
the plugin often requires very little effort. Once you get

Resources

The jQuery home page is at www.jquery.com, and it includes


a large number of links to tutorials and articles about the library.

The home page for the DataTables plugin is


www.sprymedia.co.uk/article/DataTables.

The original article introducing CSS Suckerfish drop-down menus


is at www.alistapart.com/articles/dropdowns. The Superfish
jQuery plugin is at www.alistapart.com/articles/dropdowns.

If you are a Ruby on Rails developer and are interested in using


jQuery (instead of the default Prototype and Script.aculo.us),
you can learn more by reading errtheblog.com/posts/
73-the-jskinny-on-jquery.

w w w. l i n u x j o u r n a l . c o m march 2009 | 2 1
COLUMNS
COOKING WITH LINUX

The Evolution of the


Desktop—How Far from
MARCEL GAGNÉ
the Pinnacle?
Rumor has it that 2009 is the year of the Linux desktop. With
KDE 4.2, the next step in the evolution of the popular desktop
environment, it may well be.
That is very impressive, François! I wasn’t expecting new desktop isn’t so much a desktop as a shell that
to see a series of murals when I walked in, but runs other applications. It’s called Plasma. Plasma
there they are. What exactly am I looking at? You runs small applications called plasmoids, though
want me to guess, do you? Well, if I had to guess, they also are referred to as widgets and even
I would say it looks like a series of tables from the gadgets. Each one of those plasmoids is, like the
prehistoric to the present, with place settings to Plasma shell, a container that can contain other
match. Thank you, François. I particularly love that plasmoids. Imagine turtles standing on top of
stone-age table with the bone utensils, but I still one another, and you’ll start to get the idea. One
don’t get the point. What made you do this? The of KDE 4.2’s enhancements is the sheer number
evolution of the tabletop theme of today’s menu? of widgets it can run and the different types of
Non, non, non, François. That’s evolution of the widgets that it includes.
desktop, as in a Linux computer desktop. Click the plasma cashew icon in the top right-
François, don’t look so sad. It’s still quite an hand corner of your desktop, and select Add
impressive oeuvre. Besides, our guests are arriving Widgets. When the Add Widgets window appears
and there’s no time to change things. Quickly, put (Figure 1), you can select widgets included with
a smile on your face and get ready. KDE 4.2. To install from other sources (including
Welcome, mes amis, to Chez Marcel, the home Mac OS X dashboard widgets, among others),
where fine wine is paired with delectable open- click the Install New Widgets button, and then
source software. Please sit and make yourselves choose Install Widget from Local File.
comfortable. While you find your tables, perhaps
François could make his way to the wine cellar.
Check the north wing, mon ami, and you’ll find a
few cases of 2005 Gessinger Zeltinger Sonnenuhr
Riesling from Germany. Vite!
There have been numerous improvements and
enhancements in this new version of KDE, too many
to cover them all in the space I have, so I’ll give you
a sampler of what you can expect. Think of it as a
KDE 4.2 buffet table.
Everyone (well, almost everyone) loves fancy
desktop effects. Flash and pizzazz are the order
of the day with modern desktops, and KDE 4.2
doesn’t lack there. To help with the seemingly
mandatory collection of desktop special effects, KDE
4.2 now detects your graphic card’s capabilities. If Figure 1. KDE 4.2 lets you install widgets from an amazing
the card supports the compositing effects, they are number of sources.
turned on automatically.
Let’s tour this new desktop and take a look While we are on the subject of plasmoids, I must
at a few of the more interesting changes. In the tell you about what was probably the most contro-
December 2008 issue of Linux Journal, I told you versial change to accompany KDE 4.0: the so-called
about those cool little desktop gadgets, or widgets, missing desktop icons. This became a controversy
called plasmoids. By way of a quick recap, KDE’s because desktop icons are simply files and folders in

2 2 | march 2009 w w w. l i n u x j o u r n a l . c o m
contents of the Desktop folder (or any folder for
that matter). It’s called Folder View (Figure 2).
Your plasma desktop can have multiple configu-
rations to help you with whatever work you might
happen to be doing. These are called activities, and
you can add new ones by clicking that cashew-like
icon in the top right-hand corner of your desktop
(Figure 3). Two of these activities are defined for
you by default. One provides the, ahem, classic
desktop view with the optional Folder View plasmoid.
The other is called Folder View. It provides the kind
of desktop view with which most people are famil-
iar, one where you can right-click to add icons and
Figure 2. Your old desktop icons, safely ensconced in the shortcuts to programs, files or URLs.
Folder View plasmoid. To switch from one defined activity to the other,
left-click on the plasma cashew icon in the top
a special folder called Desktop. To display the right, and select Appearance Settings. When the
icons on the desktop (or in the Desktop folder), you dialog appears, you can select a desktop theme,
would need a plasmoid whose entire job in life was change your wallpaper and, yes, switch activities
to display the contents of the Desktop folder. from desktop to Folder View (Figure 4). Incidentally,
A storm ensued. I personally don’t like icons running your desktop session in Folder View mode
on my desktop, but apparently, many (if not most) doesn’t preclude running the Folder View plasmoid.
people do, and the KDE team heard about it—a lot. Both can coexist quite happily, as you can see in
To calm this storm, they created the plasmoid I Figure 5. That’s because the Folder View plasmoid
just mentioned—the one that would display the isn’t only for your Desktop folder. It could be
COLUMNS
COOKING WITH LINUX

Figure 5. From the Desktop Settings dialog, you can switch


Figure 3. That little plasma cashew does so much, from desktop activities, along with the wallpaper, paint and so on.
changing your desktop theme to adding widgets (plasmoids),
and even switching between—and adding—different activities. Click on a program group, and the window slides
to the next level of application until you get a list
of the programs themselves. If you regularly traverse
the office menus to find OpenOffice.org’s Impress
program, you might want to add it to your Favorites
tab. Simply right-click on the application, and select
Add to Favorites.
Conversely, you also can remove applications
from the Favorites list in a similar way. Simply
right-click, and select Remove from Favorites.
Under the Computer tab, you can access the
System Settings—the master control from which

Figure 4. Getting your cake and eating it—icons on the desktop


and a Folder View plasmoid live together in perfect harmony.

anything you like.


All of this talk of activities is really just a means
to keep things organized in a way that makes some
kind of sense. In the bottom left-hand corner of the
panel, you’ll see a big K button. That’s KDE’s pro-
gram launcher, called Kickoff (Figure 6). Kickoff may
seem a bit alien at first, but you’re going to love it.
There are five animated tabs at the bottom of
Kickoff window. Favorites is just what it sounds
like—a list of favorite applications. By default, you’ll
see a small handful as provided by your distribution. Figure 6. Kickoff is the new program launcher, a place to
Under the Applications tab, applications are listed find your favorite applications, recently used files, system
under groups, such as Office, Games and so on. locations and a whole lot more.

2 4 | march 2009 w w w. l i n u x j o u r n a l . c o m
you can change just about anything having to do
with your system, from look and feel to sound,
printing, networking (including file sharing), display
settings and pretty much everything else. It also
provides quick access to system locations, including
your home folder, the root filesystem, network fold-
ers and so on. Recently Used covers both files and
applications. The Leave tab is more than merely a
way out. You can switch users, log out, shut down
or suspend your notebook computer to RAM.
Let’s look at another side of running applications.
If you know the name of an application, you can,
of course, just run it as a command. You also can
press Alt-F2, and call up Krunner, a super-powerful
program launcher that’s a whole lot more (Figure 7). Figure 7. Krunner seems to read your mind and offers a
Start typing the name of a command, and Krunner number of options as you type your command name.
supplies you with options, including program names
and icons, before you finish typing. If you see what Krunner can do math, look up recently used Web
you like, just click and go. pages, do a desktop search and run commands too.
On Krunner’s top right, there’s a wrench icon Click the squiggly line box, and you’ll fire up a
and a small rectangle with a wavy line running process monitor (Figure 8). At a glance, you can see
through it. Clicking the wrench provides you with a every process running under your desktop, including
means of configuring Krunner’s many plugins. Yes, the amount of CPU and memory it is using (both

METRO TORONTO CONVENTION CENTRE, CANADA


CONFERENCE & EXPO : 8 APRIL 2009

MAXIMIZE YOUR
BUSINESS SUCCESS
UNIFIED COMMUNICATIONS
VolP
SECURITY
DATA CENTERS

Calling all IT professionals and business executives


to experience the latest leading industry advancements

w w w . i t 3 6 0 . c a
PRESENTING: I N C O O P E R AT I O N MEDIA A STERISK & OPEN SOURCE
WITH: PA R T N E R : TELE PHONY CONFERENCE SPONSOR
ASTERISK AND
OPEN TELEPHONY CIO Ex
Executive Co
Counc
nciil
Leaders Shaping the Future of Business
CONFERENCE
COLUMNS
COOKING WITH LINUX

system and shared). Hover over a program name fond of the cover switch effect where windows
with your mouse to discover more information. You flip past you with the current choice facing you
also can kill a process from the same window. (Figure 10). It’s a little like flipping through albums
(remember vinyl?) or CDs at the music store.

Figure 8. Krunner also provides useful information on your Figure 10. The cover switch effect is one of many ways to
running processes. flip between applications.

If you are the sort of person who needs to build Doing many things at the same time, that old
a large list of program favorites, you’ll understand multitasking demon, can create quite the clutter.
the usefulness of what I’m going to show you next. Imagine you are copying a number of large files
Yes, some of us run an awful lot of applications from one folder to another or from one system to
simultaneously and have, historically, dealt with all another. Historically, you would see a number of
those applications by running eight or ten virtual little progress boxes telling you how each of those
desktops, as opposed to the default four that most copies was progressing. On the right-hand side of
distributions give us (some default to two). By the panel, KDE 4.2 now provides an enhanced
default, the top left-hand corner is a hot spot for system tray that multitasks as a notification area, so
the mouse. Assuming that you have the desktop you can check the progress of those events or just
effects turned on (true with a compositing capable hide them out of the way (Figure 11). The system
graphics card), your active applications will all fall tray also is configurable with a right-click so you can
flat, side by side, against the desktop background hide icons you rarely or never use.
(Figure 9). From there, you easily can see what you Now you’ve seen the right-hand side of the
have open and quickly switch to it. panel and the left. You might have noticed that
on the far left, there’s another one of those plasma
cashews ready for some action. If you don’t see it, it

Figure 9. Every application on your desktop is just a click away.

Pressing the keyboard shortcut Ctrl-F10 works


the same way. You also can choose to view only
those applications from your current virtual desktop
by pressing Ctrl-F9. Flipping between applications is
where you may be used to pressing Alt-Tab. This still
works under KDE 4.2, but you may want to select a Figure 11. The notification area can swallow all those progress
different behavior and a different effect. I’m rather windows, keeping your desktop clean while you multitask.

2 6 | march 2009 w w w. l i n u x j o u r n a l . c o m
Figure 12. The ultra-configurable panel can be pretty much
anything you want.

may be locked. Press Ctrl-L to unlock it and make


the cashew appear. Right-click on the cashew, and
you can add widgets (plasmoids) to the panel, Figure 13. Marble, the KDE desktop globe, in now fully
change basic settings and add or remove another integrated with OpenStreetMap.
panel. Left-click, and you now are able to change
the width and height of the panel. Click the More environment, but also a collection of applications.
Settings button, and a host of other settings can Some of those applications truly shine in KDE 4.2,
be changed—from auto-hiding to alignment to providing functionality like never before. One of
window/panel behavior (Figure 12). these applications is Marble, the desktop globe
KDE 4.2 is, of course, not only a desktop (which I wrote about in the February 2008 issue of
COLUMNS
COOKING WITH LINUX

Linux Journal). Marble was more of a toy than anything


else in its early days (albeit a very cool toy), but it too
has evolved. The current release is fully integrated
with the OpenStreetMap Project, which means you
can search for a location anywhere on the planet,
and if it is in the OpenStreetMap database, you can
zoom in on that location (Figure 13).
OpenStreetMap, in case you didn’t know, is a
collaborative project involving tens of thousands
of people worldwide whose goal it is to create
and maintain a free editable map of the world.
Although the project is considerably more complex
than this short explanation can provide, people
literally walk the planet with GPS devices, uploading
data to the project. There also are organizations
that contribute public domain map data, which
is then further enhanced by project volunteers. Figure 15. PowerDevil, a new power management system
Groups get together for mapping parties. It’s for mobile computing, is powerful and welcome.
great fun. But I digress....
Almost every application has been updated and clock, however, has other ideas. There are new
improved in sometimes subtle, but important ways games, new desktop effects, new configurations
in KDE 4.2. The task manager in the bottom panel and new everything.
now has a preview of the running applications. It’s easy to think of Linux desktop environments
Dolphin is the KDE file manager, and although it as consisting of only GNOME and KDE, but there
operates in much the same way that it has for some are many more. Those two, however, GNOME
time, the polish is noticeable there as well. The file and KDE, certainly are the most popular and
view now has a preview of the document or powerful. Both environments evolve with each
image with a slider along the bottom to increase new release. With the release of KDE 4.2, and
or decrease the size of the preview (Figure 14). the 4.X branch in general, the Linux desktop has
been dramatically re-imagined, re-engineered
and redesigned. Whether you decide it’s the
environment for you or not, this may well be
the pinnacle of Linux desktop evolution—at least
for now. Speaking of now, it most certainly is
closing time, and I see that François is refilling
your glasses a final time. Please, mes amis, raise
your glasses, and let us all drink to one another’s
health. A votre santé! Bon appétit!I

Marcel Gagné is an award-winning writer living in Waterloo, Ontario. He is the


author of the Moving to Linux series of books from Addison-Wesley. Marcel is also
Figure 14. Dolphin now has a cool preview in file mode with a pilot, a past Top-40 disc jockey, writes science fiction and fantasy, and folds a
mean Origami T-Rex. He can be reached via e-mail at marcel@marcelgagne.com.
a handy slider to define the preview size.
You can discover lots of other things (including great Wine links) from his Web
sites at www.marcelgagne.com and www.cookingwithlinux.com.
On the admin side, things have improved as
well. KDE now comes with PowerDevil, a new
power management console that makes mobile life
much more flexible (Figure 15). For instance, you Resources
can create profiles to define how power manage-
ment (such as screen blanking, suspend and so on) KDE: www.kde.org
behaves under different conditions. You might be
doing a presentation, for instance, and taking Marcel’s Web Site: www.marcelgagne.com
questions while your notebook sits idle. PowerDevil
would let you define a profile where the notebook Cooking with Linux: www.cookingwithlinux.com
wouldn’t just suspend or go dark while it is idle.
There are so many changes in this new KDE WFTL Bytes!: wftlbytes.com
that it’s difficult to know when to stop. The article

2 8 | march 2009 w w w. l i n u x j o u r n a l . c o m
COLUMNS
WORK THE SHELL

Counting Words and


Letters
DAVE TAYLOR Count the number of unique words in a document.
I know I have been writing about the basics of Here’s a quick heads up on the three:
working with variables in shell scripts, but I’m going
to diverge and address a recent query I received. $ wc *txt
Okay? (And, hey, write to me.) 16624 163798 874627 dracula.txt
“Dear Dave, I seek an edge when I next play 24398 209289 1332539 history-united-states.txt
Hangman or other word games. I want to know 13426 124576 717558 pride-prejudice.txt
what words are most common in the English lan- 54448 497663 2924724 total
guage and what letters are most common in written
material too. If you can show how to do that as a Okay, so we have 54,448 lines of text, represent-
shell script, it’d be useful for your column, but if ing 497,663 words and 2,924,724 characters. That’s
not, can you point me to an on-line resource? a lot of text.
Thanks, Mike R.”
Okay, I can tell you up front, Mike, that the Word Frequency
secret to playing Hangman is to ensure that you The key to figuring out any of our desired statis-
have sufficient guesses to get at least 30% of tics is to realize that the basic strategy we need
the letters before you’re in great peril. Oh, that’s to use is to break the content down into smaller
not what you seek, is it? The first letter to guess, pieces, sort them, and then use the great uniq
always, is E, which is the most common letter in the -c capability, which de-dupes the input stream,
English language. If you have a Scrabble set, you also counting frequency as it goes. As a shell pipe,
we’re talking about sort | uniq -c, coupled
If you analyze only Dracula, by the with whatever command we need to break down
the individual entities.
way, it turns out that the entire For this task, I’m going to use tr, like this, to
convert spaces to newlines:
book has only 9,434 unique words.
$ cat *txt | tr ' ' '\
can figure out the frequency of letters, because the ' | head
points for individual letters are inversely proportional The
to their frequency. That is, E is worth one point, Project
while the Q and Z—two very uncommon letters Gutenberg
in English—are worth ten points each. EBook
But, let’s work on a shell script to verify and prove of
all this, shall we? Dracula,
The first step is to find some written material to by
analyze. That’s easily done by going to one of my Bram
favorite places on the Web, the Gutenberg Project. Stoker
You can pop there too at www.gutenberg.org.
With thousands and thousands of books avail- Okay, so what happens when we actually
able in free, downloadable form, let’s grab only unleash the beast on all 54,448 lines of our
three: Dracula by Bram Stoker, History of the United combined text?
States by Charles A. Beard and Mary Ritter Beard,
and Pride and Prejudice by Jane Austen. They’re all $ cat *txt | tr ' ' '\
obviously a bit older, but that’s okay for our purposes. > ' | wc -l
To make life easy, I’ll download them as plain text 526104
and leave the geeky introduction to the Gutenberg
Project at the top of each file too, just for more That’s strange. Somehow I would expect that
word variation and, well, because I’m lazy. Okay breaking down every line by space delimiter
with you, dear reader? should be fairly close to the word count of wc,

3 0 | march 2009 w w w. l i n u x j o u r n a l . c o m
but most likely the document has punctuation like “the tr -d '[:punct:]' | grep -v '[^a-z]' |
end. The next” where a double space becomes two, not sort | uniq -c | sort -rn | head
one line. No worries, though, it’ll all vanish once we take 29247 the
the next step. 19925
Now that we have the ability to break down our docu- 16995 of
ments into individual words, let’s sort and “uniq” it to see 14715 and
what we see: 13010 to
9293 in
$ cat *txt | tr ' ' '\ 7894 a
' | sort | uniq | wc -l 6474 i
52407 5724 was
5206 that
But, that’s not right. Do you know why?
If you said, “Dude! You need to account for capitalization!”, And, now you know.
you’d be on the right track. In fact, we need to transliterate Next month, I’ll wrap this up by showing how you
everything to lowercase. We also need to strip out all the can analyze individual letter occurrences too, and finally,
punctuation as well, because right now it’s counting “cat,” I’ll offer a way to find some great Hangman words for
and “cat” as two different words—not good. stumping your friends.I
First off, transliteration is best done with a character group
rather than with a letter range. In tr, it’s a bit funky with the Dave Taylor is a 26-year veteran of UNIX, creator of The Elm Mail System, and most recently author
[::] notation: of both the best-selling Wicked Cool Shell Scripts and Teach Yourself Unix in 24 Hours, among his
16 technical books. His main Web site is at www.intuitive.com, and he also offers up tech support at
AskDaveTaylor.com. You also can follow Dave on Twitter through twitter.com/DaveTaylor.
$ echo "Hello" | tr '[:upper:]' '[:lower:]'
hello

Stripping out punctuation is a wee bit trickier, but not


much. Again, we can use a character class in tr:

$ echo "this, and? that! for sure." | tr -d '[:punct:]' Linux News and Headlines
this and that for sure
Delivered To You
Coolness, eh? I bet you didn’t know you could do that! Linux Journal topical RSS feeds NOW AVAILABLE
Now, let’s put it all together:

$ cat *txt | tr ' ' '\


' | tr '[:upper:]' '[:lower:]' |
tr -d '[:punct:]' | sort | uniq | wc -l
28855

So, that chops it down from 52,407 to 28,855—makes


sense to me. One more transform is needed though. Let’s strip
out all lines that don’t contain alphabetic characters to eliminate
digits. That can be done with a simple grep -v '[^a-z]'":

$ cat *txt | tr ' ' '\


' | tr '[:upper:]' '[:lower:]' |
tr -d '[:punct:]' | grep -v '[^a-z]' |
sort | uniq | wc -l
19,820

If you analyze only Dracula, by the way, it turns out that


the entire book has only 9,434 unique words. Useful, eh?
Now, finally, let’s tweak things just a bit and see the ten
most common words in this corpus:

$ cat *txt | tr ' ' '\ http://www.linuxjournal.com/rss_feeds


' | tr '[:upper:]' '[:lower:]' |

w w w. l i n u x j o u r n a l . c o m march 2009 | 3 1
COLUMNS
PARANOID PENGUIN

Mental Laziness and


Bad Dogma to Avoid
MICK BAUER Peer pressure is no substitute for common sense.

Gentle readers, I try not to rant at you, really I do. but rather it’s that dogma existing only for its own
You turn to my column for practical, reliable tips on sake is useless. If we can’t back up a policy, practice
getting complex security-related tools to work, and or other security requirement with compelling,
judging from the e-mail messages you send me, risk-based justification, we will fail.
most of the time I deliver that. This month’s column, therefore, is about some
But, I’m human, and now and then, I get really wrong ideas that have somehow ended up being
tired of dealing with mental laziness and dogma. It’s treated as immutable truth among some of my
not because I’m some sort of purist—quite the peers, but whose rationales are questionable and
contrary. Rather, it’s because it’s impractical. Each tend to cause more harm than good. And, because
of us security geeks has a limited amount of I don’t want anyone to think I’m unduly biased
energy and political capital, and we can’t afford against my colleagues, I’ll give equal time to the
to squander it on positions we can’t back up with aforementioned examples of end-user mental
compelling, plausible risk and threat drivers. laziness as well.
Similarly, although I’ve got tremendous sympathy
for nongeeks who strictly use computers as tools, and Bad Dogma 1: Changing All Your
who find it (rightly) unreasonable to have to know as Passwords Monthly Is Really Important
much as a system administrator just to be able to Consider hapless Hapgood, a typical corporate
print their spreadsheets, Internet use has its price. computer user. At work, Hapgood has to keep
If you’re going to comingle your data with that of track of six different user accounts, each with
practically the entire rest of the world, you need to slightly different password-complexity rules: system
think about risks now and then, and you need to A requires a minimum of eight characters containing
take the time to learn some simple precautions. uppercase and lowercase, punctuation and numbers;
So this month, I need to vent just a little bit system B allows only seven-character passwords,
about some nagging bits of information security doesn’t allow punctuation and so forth.
dogma to which security practitioners sometimes Due to corporate security policy, within any
cling, and some examples of mental laziness in which given 60-day period, Hapgood must change all six
end users (especially “power users”) sometimes passwords—a couple of them twice. If Hapgood
indulge. Your opinions may differ (widely) from starts choosing passwords that are easy for him to
mine, and if you take strong exception to any of remember but not very hard to guess (for example,
this, I encourage you to post comments to the Web his own name with a capital H and zeroes instead
version of this article or e-mail me directly. of Os), can you really blame him?
I wouldn’t. But, which do you suppose is
In Defense of Dogma more dangerous: choosing a bad password, or
Before I begin the rant proper, let me acknowledge leaving a good password alone for, say, 90 days
that to a point, dogma can be useful, in the same instead of 30?
way that a parent may now and then find it useful Naturally, that depends on what you’re worried
to tell a cantankerous child “the answer is no, about. If you’re worried about brute-force password
because I said so”. attacks in which an attacker cycles through all
Life is short, information security is complicated, possible passwords for a given user account, then
and we don’t always have the luxury of explaining the more randomized the password, the less likely it
every rule to every user’s satisfaction. Sometimes, will turn up in the password “dictionaries” many
it seems to me, it’s perfectly appropriate to say, attackers employ. In that scenario, short password
“You can’t do that because it violates corporate lifetimes will lower the chance that any given
security policy.” The real question is, “Is that a password will be cracked before it expires. But,
defensible policy?” the password shouldn’t be very easily cracked if it’s
So, perhaps my point is not that there is no sufficiently complex to begin with. So as it happens,
place in the world for information security dogma, enforcing good password complexity rules is a

3 2 | march 2009 w w w. l i n u x j o u r n a l . c o m
better protection against brute-force password attacks. logins or worse.
What if you’re worried about Hapgood being This worst-case scenario assumes two things. First,
fired, but connecting back into the network via if the certificate’s owner leaves your organization, it
a VPN connection and logging back in to his old may take a while for the certificate to be revoked
accounts, in order to exact revenge? Won’t a (and for news of that revocation to propagate to the
60-day password lifetime minimize the amount systems that use certificates). Second, it assumes
of havoc Hapgood can wreak? that the certificate’s passphrase can be guessed or
This question is best answered with two other brute-force cracked easily.
questions. First, why should Hapgood still have But, both of these are solvable problems. If
access for even one day after being fired? Second, you’re deploying a Public Key Infrastructure in the
if Hapgood’s accounts haven’t all been de-activated first place, you need to configure all systems that
within 60 days, what’s to stop him from simply use certificates either to download automatically
changing his passwords once they expire? and use Certificate Revocation Lists (CRLs) from
Obviously, in this scenario, password aging your Certificate Authority, or better still, configure
is the wrong control on which to fixate. The them to use the Online Certificate Status Protocol
terminated-employee conundrum can be addressed (OCSP). Many events can lead to a certificate’s need to
only by good processes—specifically, the prompt be revoked besides reaching some arbitrary expiration
and universal disabling of every terminated date, and managing your certificates diligently and
employee’s account. using CRLs or OCSP are the only reliable means of
There’s a third risk people hope will be mitigated reacting to those events.
by password lifetimes—that a password may be Regarding certificate passphrases, setting
eavesdropped over the network, read off the passphrase complexity requirements is generally
sticky note attached to someone’s monitor or no harder for digital certificates than for system
keyboard or otherwise intercepted. This risk is passwords. The situation in which it can be most
probably more credible than brute-force attacks challenging to protect certificate passphrases is
and user attrition combined. when machines use certificates (for example, Web
But even here, if attackers can abuse someone server SSL/TLS certificates), which usually requires
else’s access privileges for 29 days without fear of either a passphrase-less certificate or a certificate
detection, there’s probably something seriously whose passphrase is stored in clear text in some
wrong with how you’re doing things. Furthermore, file to which the certificate-using process has
it may be possible for such attackers to install a read-access privileges.
keylogger, rootkit or other malware that allows them The bad news is, in that scenario, renewing the
to intercept the new password, once the intercepted server’s certificate every year doesn’t solve this problem.
one expires and its rightful owner changes it. If it’s possible for people to copy a server’s certificate
Passwords should, of course, have finite once, it’s probably possible for people to do so every
lifetimes. User name/password authentication is a year, every six months or as often as they need or
relatively weak form of authentication to begin like. The solution to this problem, rather, is to protect
with, and requiring people to refresh their passwords the certificate at the filesystem/OS level, especially its
from time to time certainly makes the attacker’s passphrase file, if applicable.
job a little harder. But, compared to password Does that mean certificates shouldn’t have
complexity rules and good walkout procedures, expiration dates? Of course not! I’m simply saying
password aging achieves less and affects end-user that, as with password aging, if this is your only
experience more negatively. protection against user attrition or certificate
compromise, you’re in big trouble anyhow, so why
Bad Dogma 2: All Digital Certificates not employ a variety of protections that allow you
Should Expire after One Year to relax a little on expiration dates, as you ought
On a related note, consider the digital certificate, to be doing those other things anyhow?
which consists of a couple key pairs (one for
signing/verifying, another for encrypting/decrypting), Bad Dogma 3: E-Mail Encryption Is Too
identity information (such as your name and Complicated for Ordinary People to Use
organization) and various Certificate Authority For as long as I’ve worked on information security
signatures. Conventional wisdom says that every in large corporations, I’ve been told that e-mail
digital certificate must have an expiration date, the encryption is only for geeks, and that business users
shorter the better, in case the certificate’s owner lack the technical skills necessary to cope with it.
unexpectedly leaves your organization or the private I’ve always found this sort of amusing, given that
key is somehow compromised. The consequences of it’s usually us geeks who accuse business people of
either event could include bogus signatures, illicit having too-short attention spans.

w w w. l i n u x j o u r n a l . c o m march 2009 | 3 3
COLUMNS
PARANOID PENGUIN

But, is using PGP or S/MIME really that much data payloads of HTTP/HTTPS packets verbatim from
more complicated than using, say, LinkedIn? I one session to the other.
know which I would rather spend time on! (I am, This means the site you’re visiting may transpar-
however, an admitted geek.) ently push hostile code at your browser, such as
How much of the inconvenience in e-mail invisible iframe scripts, ActiveX or JavaScript applets
encryption really falls on end users? Nowadays, (depending on how your browser is configured), or
I would argue, very little, especially if your your data may redirected via cross-site scripting and
organization can support a PGP key server or request forgery.
can incorporate S/MIME certificates into an Firewalls are great at restricting traffic by
MS-Exchange Global Address List. application-protocol type and source and destination
In practice, key management tends to be the IP address, but they aren’t great at detecting
biggest headache with e-mail encryption—specifi- evil within allowed traffic flows. And nowadays,
cally, getting a valid/current digital certificate or RFC-compliant HTTP/HTTPS data flows carry
PGP key for each person with which you need to everything from the hyptertext “brochureware”
communicate. But, this need not be a big deal if for which the Web was originally designed to
you set things up carefully enough on the back remote desktop control sessions, full-motion
end and give your end users local settings that videoconferencing and pretty much anything
allow their mail client software to search for, else you’d care to do over a network.
download and update their local copies of other With or without a firewall, you need to be careful
people’s keys transparently. which sites you frequent, which software you install
One can go too far, of course, in coddling end on your system and which information you transmit
users. I’ve seen organizations issue keys without over the Internet. Just because your nightclub has a
passphrases, which makes those keys trivially easy bouncer checking IDs at the door doesn’t mean you
to copy and abuse. I’ve seen other organizations issue can trust everybody who gets in.
passphrase-protected keys, but then send people their
new key’s initial passphrase via unencrypted e-mail! Mental Laziness 2: Firewalls Need to
Obviously, doing things like that can defeat the whole Block Only Inbound Traffic
purpose of e-mail encryption. In olden times, firewalls enforced a very simple trust
My point, really, is that modern e-mail encryption model: “inside” equals “trusted”, and “outside”
tools, which typically support GUI plugins for popular equals “untrusted”. We configured firewalls to block
e-mail readers, such as MS Outlook and Squirrelmail, most “inbound” traffic (that is to say, transactions
are exponentially simpler to use than the command- initiated from the untrusted outside) and to allow
line-driven tools of old. Given a modicum of written most “outbound” traffic (transactions initiated from
documentation—a two-page instruction sheet is the trusted inside).
frequently enough—or even a brief computer- Aside from the reality of insider threats, however,
based-training module, nontechnical users can this trust model can no longer really be applied
be expected to use e-mail encryption. to computer systems themselves. Regardless
This is too valuable a security tool for so much of whether we trust internal users, we must
of the world to have given up on! acknowledge the likelihood of spyware and
There, I’m starting to feel better already! But, malware infections.
I’m not done yet. On to some mental laziness that Such infections are often difficult to detect (see
never fails to annoy and frustrate. Mental Laziness 3); and frequently result in infected
systems trying to infect other systems, trying to
Mental Laziness 1: Firewalls Protect “report for duty” back to an external botnet
You from Your Own Sloppiness controller or both.
Your DSL router at home has a built-in firewall Suppose users download a new stock-ticker
you’ve enabled, and your corporate LAN at work applet for their desktops. But, unbeknownst to
has industrial-strength dedicated firewalls. That them, it serves double duty as a keystroke logger
means, you can visit any Web site or download any that silently logs and transmits any user names,
program without fear of weirdness, right? passwords, credit-card numbers or Social Security
Wrong. numbers it detects being typed on the users’ sys-
In the age of evil-twin (forged) Web sites, cross- tems and transmits them back out to an Internet
site scripting, spyware and active content, you take Relay Chat server halfway around the world.
a risk every time you visit an untrusted Web site. Making this scenario work in the attacker’s favor
Your home firewall doesn’t know or care what your depends on several things happening. First, users
browser pulls, so long as it pulls it via RFC-compliant have to be gullible enough to install the software in
HTTP or HTTPS. Even Web proxies generally pass the the first place, which should be against company

3 4 | march 2009 w w w. l i n u x j o u r n a l . c o m
COLUMNS
PARANOID PENGUIN

policy—controlling who installs desktop software may nearly obviate the need for antivirus software.
and why it is an important security practice. Second, But, if none of that applies, and you simply
the users’ company’s firewall or outbound Web assume that in the case of infection, you simply can
proxy has to be not scanning downloads for re-install your OS and get on with your life, thinking
malicious content (not that it’s difficult for an you’ll notice the infection right away, you’re probably
attacker to customize this sort of thing in a way asking for trouble.
that evades detection). There was a time when computer crimes were
Finally, the corporate firewall must be configured frequently, maybe mostly, motivated by mischief and
to allow internal systems to initiate outbound IRC posturing. Espionage certainly existed, but it was
connections. And, this is the easiest of these three unusual. And, the activities of troublemakers and
assumptions for a company’s system administrators braggarts tend, by definition, to be very obvious
and network architects to control. and visible. Viruses, worms and trojans, therefore,
If you enforce the use of an outbound proxy for tended to be fairly noisy. What fun would there be
all outbound Web traffic, most of the other out- in infecting people if they didn’t know about it?
bound Internet data flows your users really need But, if your goal is not to have misanthropic
probably will be on the back end—SMTP e-mail fun but rather to steal people’s money or identity
relaying, DNS and so forth—and, therefore, will or to distribute spam, stealth is of the essence.
amount to a manageably small set of things you Accordingly, the malware on which those two activi-
need to allow explicitly in your firewall’s outbound ties depend tends to be as low-profile as possible.
rule set. A spambot agent will generate network traffic, of
The good news is, even if that isn’t the case, course—its job is to relay spam. But, if in doing so it
you may be able to achieve nearly the same thing cripples your computer’s or your LAN’s performance,
by deploying personal firewalls on user desktops you’ll detect it and remove it all the more quickly,
that allow only outbound Internet access by a finite which defeats the purpose.
set of local applications. Anything that end users So, most of us should, in fact, run and maintain
install without approval (or anything that infects antivirus software from a reputable vendor. Antivirus
their systems) won’t be on the “allowed” list and, software probably won’t detect the activity of
therefore, won’t be able to connect back out. malware it didn’t prevent infection by—there will
always be zero-day malware for which there is
Mental Laziness 3: If Your Machine Gets no patch or antivirus signature—but it will be
Infected with Malware, You’ll Know infinitely more likely to prevent infection than
Some of us rely on antivirus software less than wishful thinking is.
others. There are good reasons and bad reasons for
being more relaxed about this. If you don’t use Conclusion
Windows (for which the vast majority of malware Thus ends my rant. Now that I’ve got it out of my
is written), if you read all your e-mail in plain text system, next month, it’s back to more technical
(not HTML or even RTF), if you keep your system stuff. Until then, be safe!I
meticulously patched, if you disconnect it from the
network when you’re not using it, if you never double- Mick Bauer (darth.elmo@wiremonkeys.org) is Network Security Architect for
click e-mail links or attachments, if you minimize the one of the US’s largest banks. He is the author of the O’Reilly book Linux
number of new/unfamiliar/untrusted Web sites you Server Security, 2nd edition (formerly called Building Secure Servers With
visit, and if you install software that comes only Linux), an occasional presenter at information security conferences and
from trusted sources, all of these factors together composer of the “Network Engineering Polka”.

TECH TIP Watch Live Interrupts


To see the interrupts occurring on your system, run the command: 6: 3 0 IO-APIC-edge floppy
...
# watch -n1 "cat /proc/interrupts" NMI: 0 0 Non-maskable interrupts
LOC: 5806923 6239132 Local timer interrupts
CPU0 CPU1 ...
0: 330 0 IO-APIC-edge timer
1: 11336 0 IO-APIC-edge i8042 The -n1 option passed to watch causes the specified
4: 2 0 IO-APIC-edge command to be re-run every second.— C H I L A K A R A V I K U M A R

3 6 | march 2009 w w w. l i n u x j o u r n a l . c o m
lj029:lj018.qxd 12/12/2008 6:41 PM Page 1

The Straight Talk People


SM

S I N C E 1 9 9 1
ABERDEEN
VMWARE
CERTIFIED SOLUTIONS
ABERDEEN STIRLING 123 ABERDEEN STIRLING 229 ABERDEEN STIRLING 428T

1U Dual Xeon VMware Certified Server 2U Dual Xeon VMware Certified Server 4U Dual Xeon VMware Certified Server
• Up to two Dual-Core or Quad-Core Intel® Xeon® processors • Up to two Dual-Core or Quad-Core Intel Xeon processors • Up to two Dual-Core or Quad-Core Intel Xeon processors
• Up to 32GB 667/533MHz Fully Buffered ECC DDR2 SDRAM • Up to 128GB 800/667/533MHz Fully Buffered ECC DDR2 SDRAM • Up to 64GB 667/533MHz Fully Buffered ECC DDR2 SDRAM
• Up to 4 x Hot-Swap SATA or SAS Hard Drives • Up to 8 x 1TB (8.0TB) Hot-Swap SATA Hard Drives • Up to 8 x 1TB (8.0TB) Hot-Swap SATA Hard Drives
• Universal I/O allows for 3 expansion cards in 1U • Up to 7 x Low-Profile Expansion Slots • Up to 6 x Full Height Expansion Slots
• Pre-installed VMware® ESXi on Disk-on-Module • Pre-installed VMware ESXi on Disk-on-Module • Pre-installed VMware ESXi on Disk-on-Module
• 650W High-efficiency Redundant Power Supply • 700W High-efficiency Redundant Power Supply • 800W High-efficiency Redundant Power Supply
• 5-Year Warranty • 5-Year Warranty • 5-Year Warranty

Starting at
$
1,999 Starting at
$
2,425 Starting at
$
2,350
ABERDEEN STIRLING 132T ABERDEEN STIRLING 244 ABERDEEN STIRLING 444

1U Twin Node VMware Certified Server 2U Quad Xeon MP VMware Certified Server 4U Quad Xeon MP VMware Certified Server
• Up to two Dual-Core or Quad-Core Intel Xeon processors/node • Up to four Quad-Core or Six-Core Intel Xeon MP processors • Up to four Quad-Core or Six-Core Intel Xeon MP processors
• Twin Nodes allows for up to 4 processors & 16 cores in 1U • Quad Six-Core allows for 24 processor cores in 2U • Quad Six-Core allows for 24 processor cores in 4U
• Up to 64GB 800/667/533MHz Fully Buffered ECC DDR2/node • Up to 192GB 667/533MHz Fully Buffered ECC DDR2 SDRAM • Up to 192GB 667/533MHz Fully Buffered ECC DDR2 SDRAM
• Up to 2 x 1TB Hot-Swap SATA Hard Drives per node • Up to 6 x Hot-Swap SATA or SAS Hard Drives • Up to 5 x Hot-Swap SATA or SAS Hard Drives
• Pre-installed VMware ESXi on Disk-on-Module • Pre-installed VMware ESXi on Disk-on-Module • Pre-installed VMware ESXi on Disk-on-Module
• 980W High-efficiency Power Supply • 1200W High-efficiency Redundant Power Supply • 1200W High-efficiency Redundant Power Supply
• 5-Year Warranty • 5-Year Warranty • 5-Year Warranty

Starting at
$
2,880 Starting at
$
5,615 Starting at
$
6,625
ABERDEEN ISCSI XDAS ABERDEEN FIBRE XDAS

DAS VMware Certified Expandable Storage DAS VMware Certified Expandable Storage
• IP SAN Solution • Hardware RAID5 and RAID6 engine by dedicated ASIC400
• Single or Redundant Controller • Single or Redundant Controller
• Expandable up to 64TB in a single array • Expandable up to 64TB in a single array
• 2U/12 Bay and 3U/16 Bay Models available • 2U/12 Bay and 3U/16 Bay Models available
• SAS or SATA Hard Drive Support • SAS or SATA Hard Drive Support
• Fault-tolerant Modular Hardware Design • Fault-tolerant Modular Hardware Design
• 5-Year Warranty • 5-Year Warranty

Starting at
$
7,995 Starting at
$
8,495
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. VMware is a registered trademark or trademark of VMware, Inc. in the United States and/or other
jurisdictions. For terms and conditions, please see www.aberdeeninc.com/abpoly/abterms.htm. lj029
888-297-7409
www.aberdeeninc.com/lj029
COLUMNS
HACK AND /

When Disaster Strikes:


Hard Drive Crashes
KYLE RANKIN All is not necessarily lost when your hard drive starts the click of
death. Learn how to create a rescue image of a failing drive while it
still has some life left in it.
The following is the beginning of a series of Now that I’m done with my lecture, let’s assume
columns on Linux disasters and how to recover from that for some reason, one of your hard drives
them, inspired in part by a Halloween Linux Journal crashed and you did not have a backup. All is
Live episode titled “Horror Stories”. You can watch not necessarily lost. There are many different
the original episode at www.linuxjournal.com/ kinds of hard drive failure. Now, in a true hard
video/linux-journal-live-horror-stories. drive crash, the head of the hard drive actually
Nothing teaches you about Linux like a good will crash into the platter as it spins at high
disaster. Whether it’s a hard drive crash, a wayward speed. I’ve seen platters after a head crash that
rm -rf command or fdisk mistakes, there are are translucent in sections as the head scraped
any number of ways your normal day as a Linux off all of the magnetic coating. If this has hap-
user can turn into a nightmare. Now, with that pened to you, no command I list here will help
nightmare comes great opportunity: I’ve learned you. Your only recourse will be one of the foren-
more about how Linux works by accidentally sics firms out there that specialize in hard drive
breaking it and then having to fix it again, than recovery. When most people say their hard drive
I ever have learned when everything was running has crashed, they are talking about a less
smoothly. Believe me when I say that the follow- extreme failure. Often, what has happened is
ing series of articles on system recovery is hard- that the hard drive has developed a number of
earned knowledge. bad blocks—so many that you cannot mount the
Treated well, computer equipment is pretty filesystem—or in other cases, there is some dif-
reliable. Although I’ve experienced failures in just ferent failure that results in I/O errors when you
about every major computer part over the years, try to read from the hard drive. In many of these
the fact is, I’ve had more computers outlast their circumstances, you can recover at least some, if
usefulness than not. That being said, there’s one not most, of the data. I’ve been able to recover
computer component you can almost count on data from drives that sounded horrible and other
to fail at some point—the hard drive. You can people had completely written off, and it took
blame it on the fast-moving parts, the vibration only a few commands and a little patience.
and heat inside a computer system or even a
mistake on a forklift at the factory, but when Create a Recovery Image
your hard drive fails prematurely, no five-year Hard drive recovery works on the assumption that
warranty is going to make you feel better about not all of the data on the drive is bad. Generally
all that lost data you forgot to back up. speaking, if you have bad blocks on a hard drive,
The most important thing you can do to protect they often are clustered together. The rest of the
yourself from a hard drive crash (or really most Linux data on the drive could be fine if you could only
disasters) is back up your data. Back up your data! access it. When hard drives start to die, they often
Not even a good RAID system can protect you from do it in phases, so you want to recover as much
all hard drive failures (plus RAID doesn’t protect you data as quickly as possible. If a hard drive has I/O
if you delete a file accidentally), so if the data is errors, you sometimes can damage the data further
important, be sure to back it up. Testing your if you run filesystem checks or other repairs on the
backups is just as important as backing up in the device itself. Instead, what you want to do is create
first place. You have not truly backed up anything a complete image of the drive, stored on good
if you haven’t tested restoring the backup. The media, and then work with that image.
methods I list below for recovering data from a A number of imaging tools are available for
crashed hard drive are much more time consuming Linux—from the classic dd program to advanced
than restoring from a backup, so if at all possible, GUI tools—but the problem with most of them is
back up your data. that they are designed to image healthy drives. The

3 8 | march 2009 w w w. l i n u x j o u r n a l . c o m
problem with unhealthy drives is that when you time trying to read them instead of recovering all of
attempt to read from a bad block, you will get an the good blocks.
I/O error, and most standard imaging tools will fail The ddrescue tool (no underscore) is part of
in some way when they get an error. Although you the GNU Project and takes the basic algorithm of
can tell dd to ignore errors, it happily will skip to the dd_rescue further. ddrescue tries to recover all of
next block and write nothing for the block it can’t the good data from the device first and then divides
read, so you can end up with an image that’s smaller and conquers the remaining bad blocks until it has
than your drive. When you image an unhealthy tried to recover the entire drive. Another added
drive, you want a tool designed for the job. For feature of ddrescue is that it optionally can maintain
Linux, that tool is ddrescue. a log file of what it already has recovered, so you
can stop the program and then resume later right
ddrescue or dd_rescue where you left off. This is useful when you believe
To make things a little confusing, there are two ddrescue has recovered the bulk of the good data.
similar tools with almost identical names. dd_rescue You can stop the program and make a copy of
(with an underscore) is an older rescue tool that still the mostly complete image, so you can attempt
does the job, but it works in a fairly basic manner. to repair it, and then start ddrescue again to
It starts at the beginning of the drive, and when it complete the image.
encounters errors, it retries a number of times and
then moves to the next block. Eventually (usually Prepare to Image
after a few days), it reaches the end of the drive. The first thing you will need when creating an
Often bad blocks are clustered together, and in image of your failed drive is another drive of equal
the case when all of the bad blocks are near the or greater size to store the image. If you plan to use
beginning of the drive, you could waste a lot of the second drive as a replacement, you probably will

MAYBE ONE DAY SECURITY WILL BE EASY.


UNTIL THEN, THERE’S BLACK HAT.
Black Hat is a community that brings together security
professionals and visionaries from everywhere: government,
academia, corporate security and the underground. We exist
to promote and improve information security by facilitating the
timely sharing of accurate, actionable security knowledge.

Join us for a full slate of hands-on training sessions and four


exciting tracks of presentations from the best minds in the
information security space, all with a special focus on the needs
of government and infrastructure security. BLACK HAT DC 2009
FEBRUARY 16-19
ARLINGTON, VIRGINIA
REGISTER NOW AT BLACKHAT.COM
USE CODE BHDC9LJMAG TO SAVE $100 ON BRIEFINGS REGISTRATION
Platinum Sponsor Gold Sponsors

BlackHatAdFix_p39.indd 1 1/22/09 10:57:55 AM


COLUMNS
HACK AND /

want to image directly from one device to the next. this drive that I wanted to recover, I would repeat
However, if you just want to mount the image and this command for each partition and save each as
recover particular files, or want to store the image its own image.
on an already-formatted partition or want to recover As you can see, a great thing about ddrescue is
from another computer, you likely will create the that it gives you constantly updating output, so you
image as a file. If you do want to image to a file, can gauge your progress as you rescue the partition.
your job will be simpler if you image one partition In fact, in some circumstances, I prefer using
from the drive at a time. That way, it will be easier ddrescue over dd for regular imaging as well, just
to mount and fsck the image later. for the progress output. Having constant progress
The ddrescue program is available as a package output additionally is useful when considering how
(ddrescue in Debian and Ubuntu), or you can long it can take to rescue a failing drive. In some
circumstances, it even can take a few days,
depending on the size of the drive, so it’s good
As you can see, a great thing to know how far along you are.
about ddrescue is that it gives Repair the Image Filesystem
you constantly updating output, Once you have a complete image of your drive or
partition, the next step is to repair the filesystem.
so you can gauge your progress Presumably, there were bad blocks and areas that
as you rescue the partition. ddrescue could not recover, so the goal here is to
attempt to repair enough of the filesystem so you
at least can mount it. Now, if you had imaged to
download and install it from the project page. Note another hard drive, you would run the fsck
that if you are trying to recover the main disk of a against individual partitions on the drive. In my
system, you clearly will need to recover either using case, I created an image file, so I can run fsck
a second system or find a rescue disk that has directly against the file:
ddrescue or can install it live (Knoppix fits the bill,
for instance). $ sudo fsck -y /mnt/recovery/sda1_image.img

Run ddrescue I’m assuming I will encounter errors on the


Once ddrescue is installed, it is relatively simple to filesystem, so I added the -y option, which will
run. The first argument is the device you want to make fsck go ahead and attempt to repair all of
image. The second argument is the device or file to the errors without prompting me.
which you want to image. The optional third argu-
ment is the path to a log file ddrescue can maintain Mount the Image
so that it can resume. For our example, let’s say I Once the fsck has completed, I can attempt to
have a failing hard drive at /dev/sda and have mount the filesystem and recover my important
mounted a large partition to store the image at files. If you imaged to a complete hard drive and
/mnt/recovery/. I would run the following command want to try to boot from it, after you fsck each
to rescue the first partition on /dev/sda: partition, you would try to mount them individually
and see whether you can read from them, and then
$ sudo ddrescue /dev/sda1 /mnt/recovery/sda1_image.img swap the drive into your original computer and try
/mnt/recovery/logfile to boot from it. In my example here, I just want to
Press Ctrl-C to interrupt try to recover some important files from this image,
Initial status (read from logfile) so I would mount the image file loopback:
rescued: 0 B, errsize: 0 B, errors: 0
Current status $ sudo mount -o loop /mnt/recovery/sda1_image.img /mnt/image
rescued: 349372 kB, errsize: 0 B, current rate: 19398 kB/s
ipos: 349372 kB, errors: 0, average rate: 16162 kB/s Now I can browse through /mnt/image and
opos: 349372 kB hope that my important files weren’t among the
corrupted blocks.
Note that you need to run ddrescue with root
privileges. Also notice that I specified /dev/sda1 as Method of Last Resort
the source device, as I wanted to image to a file. If Unfortunately in some cases, a hard drive has
I were going to output to another hard drive device far too many errors for fsck to correct. In these
(like /dev/sdb), I would have specified /dev/sda situations, you might not even be able to mount
instead. If there were more than one partition on the filesystem at all. If this happens, you aren’t

4 0 | march 2009 w w w. l i n u x j o u r n a l . c o m
necessarily completely out of luck. Depending on $ sudo grep -C 1000 dolphin /mnt/recovery/sda1_strings.txt >
what type of files you want to recover, you may be /mnt/recovery/dolphin_paper.txt
able to pull the information you need directly from
the image. If, for instance, you have a critical term This would not only pull out any lines containing
paper or other document you need to retrieve from the word dolphin, it also would pull out the sur-
the machine, simply run the strings command on rounding 1,000 lines. Then, you can just browse
the image and output to a second file: through the dolphin_paper.txt file and remove
lines that aren’t part of your paper. You might
$ sudo strings /mnt/recovery/sda1_image.img > need to tweak the -C argument in grep so that
/mnt/recovery/sda1_strings.txt it grabs even more lines.
In conclusion, when your hard drive starts to
The sda1_strings.txt file will contain all of the make funny noises and won’t mount, it isn’t neces-
text from the image (which might turn out to be a sarily the end of the world. Although ddrescue is no
lot of data) from man page entries to config files to replacement for a good, tested backup, it still can
output within program binaries. It’s a lot of data to save the day when disaster strikes your hard drive.
sift through, but if you know a keyword in your Also note that ddrescue will work on just about any
term paper, you can open up this text file in less, device, so you can use it to attempt recovery on
and then press the / key and type your keyword in those scratched CD-ROM discs too.I
to see whether it can be found. Alternatively, you
can grep through the strings file for your keyword Kyle Rankin is a Senior Systems Administrator in the San Francisco Bay Area and
and the surrounding lines. For instance, if you were the author of a number of books, including Knoppix Hacks and Ubuntu Hacks for
writing a term paper on dolphins, you could run: O’Reilly Media. He is currently the president of the North Bay Linux Users’ Group.

SMALL, EFFICIENT COMPUTERS WITH PREǧINSTALLED UBUNTU.


3677 Intel Core 2 Duo Mobile System
Range of Intel-Based Mainboards Available
GS-L08 Fanless Pico-ITX System Excellent for Mobile & Desktop Computing
Ultra-Compact, Full-Featured Computer
Excellent for Industrial Applications

DISCOVER THE ADVANTAGE OF MINIǧITX.


Selecting a complete, dedicated platform from us is simple: Pre-
configured systems perfect for both business & desktop use, Linux
development services, and a wealth of online resources.
www.logicsupply.com
NEW PRODUCTS

Green Rack’s Eco Enclosures


Going green is becoming a well-worn path to saving green—greenbacks, that
is. In that spirit, green-IT specialist Green Rack Systems has announced Eco Enclosures, a new line of data-center
equipment designed to reduce IT budgets while reducing environmental impact. The turnkey Eco Enclosures
solutions, which can be customized to customer needs of any size, contain chassis that are made from recycled materials
and are fully recyclable. To save power, Eco Enclosures contain features such as “low-wattage multicore CPUs, low-voltage
memory, low-power hard drives and ultra-low consumption power supplies”. Green Rack also offers solar-powered Web
hosting and custom-built data centers upon request.
www.greenracksystems.com

GroundWork Open Source’s


GroundWork Monitor
GroundWork Monitor is a free, open-source, Nagios-based VMware virtual appliance
for network management. It runs on CentOS and ships with a wide range of additional
network tools. The new version 5.3 adds features such as updated Eclipse BIRT reporting
views, Nagios 3.0.5 and the ability to monitor more than 1,000 different types of
devices; automatic notifications of patches, updates and news; voluntary sharing of
usage statistics; autodiscovery functionality and increased scalability. The Community
Edition is available for download from GroundWork’s Web site.
www.groundworkopensource.com

TRENDnet’s TEW-635BRM NADSL 2/2+ Modem Router


Ditch one ugly black box by deploying TRENDnet’s new TEW-635BRM
NADSL 2/2+ Modem Router. The wireless-n device combines modem
and router functions and operates at 300Mbps, or 12x the speed and
4x the coverage of wireless g. The switch includes four ports. Key
features of the TEW-635BRM include one-touch synchronized Wi-Fi
Protected Setup (WPS), the latest in wireless encryption, a double
firewall and advanced antenna technology (MIMO) that delivers
broad coverage and minimizes dead spots. The device also sports
green credentials, such as ENERGY STAR and RoHS compliance—the
former related to power consumption and the latter to restricting
hazardous substances in electronic equipment.
www.trendnet.com

Mana Takahashi and Shoko Azuma’s


The Manga Guide to Databases (No Starch)
Learning databases can be fun? Such is the premise of Mana Takahashi and Shoko
Azuma’s new book The Manga Guide to Databases, published by No Starch Press. The
book uniquely fuses Japanese-style comics with serious educational content on databas-
es. It tells the story of Princess Ruruna’s challenges in managing the Kingdom of Kod’s
humongous fruit-selling empire. Tico the fairy teaches the princess how to simplify
her data management, and together they design a relational database. They cover
concepts such as the the entity-relationship model, basic database operations, SQL
statements, database tuning, security, concurrency and replication. Other features
include examples and exercises (with answer keys) and an appendix of frequently used
SQL statements.
www.nostarch.com

4 2 | march 2009 w w w. l i n u x j o u r n a l . c o m
NEW PRODUCTS

Wesley Chun’s Python Fundamentals


Video Training (Prentice Hall)
If you want to learn Python and your learning style is visual, offer up a gleeful shout for
Wesley Chun’s new instructional video Python Fundamentals. Part of Prentice Hall’s
LiveLessons series, the video course mirrors topics covered in its sister publication, Core
Python Programming, Second Edition. Covered are both Python fundamentals, such as
syntax basics and standard types and operations, and advanced topics, such as Python’s
memory model and object-oriented programming. The publisher states that both
new and experienced users will find the product useful. The companion booklet
contains review questions and coding exercises.
www.informit.com

Round Solutions’ AarLogic C10/3


Hot off the assembly line at Round Solutions is the new AarLogic C10/3, a
diminutive Linux-based breadboard covering a mere 104mm x 63mm of real
estate. The board sports quadband GPRS and SiRF3 GPS modules; interfaces
for USB, RS-232 and Ethernet; SD-card reader; 4MB of RAM and dual ARM
processors. The processor module is responsible for GSM functionality and
for applications executable under embedded Linux. Connectivity options
via the board’s 192-pin socket include not only keyboards, digital cameras
and reading devices but also WLAN, Bluetooth and GPS components.
Round Solutions adds that the AarLogic C10/3 can be easily coupled with a
camera or environmental sensors. Ideal applications include self-sufficient positioning
and monitoring systems due to the wireless provision of spatial coordinates.
www.roundsolutions.com

Opengear’s EMD 5000


From the “ounce of prevention” department comes Opengear’s EMD 5000, a new
environmental management solution for continuous monitoring of environmental
conditions at the rack level. The EMD 5000 protects critical data-center assets from
hazards, such as heat, humidity, smoke, water leaks, cabinet intrusion and other envi-
ronmental conditions, by providing facilities managers with extensive logging and alert
facilities. Users can view ambient temperature and humidity of the remote environment
and set the device to send progressive alarms automatically from warning levels to
critical alerts. The EMD also monitors the status of two external dry contacts that can
be connected to a smoke detector, water detector, vibration or open-door sensor.
www.opengear.com

IBM, Virtual Bridges and Canonical’s Virtual Desktop Solution


The trio of IBM, Virtual Bridges and Canonical have joined forces to offer a Linux-based virtual PC solution that the firms claim
halves the costs of licensing and maintaining a desktop. The solution hosts multiple virtual Linux desktops on a server, replacing
Microsoft Windows with Ubuntu Linux and Microsoft Office with open-standards-based alternatives, such as IBM Lotus
Symphony. The virtual desktop, called Virtual Enterprise Remote Desktop Environment (VERDE), is provided by Virtual Bridges.
IBM cites reduced TOC related to licensing, hardware upgrades, power consumption and support requirements. The solution
is a key component in IBM’s offerings for entities in financial services and in the public sector.
www.ibm.com/linux, www.canonical.com, www.vbridges.com

Please send information about releases of Linux-related products to newproducts@linuxjournal.com or New Products
c/o Linux Journal, PO Box 980985, Houston, TX 77098. Submissions are edited for length and content.

w w w. l i n u x j o u r n a l . c o m march 2009 | 4 3
NEW PROJECTS

Fresh from the Labs


Warsow—Fast- than a LEGO factory with clumsy control. unified package containing both
Warsow is an elegant title including Windows and Linux binaries. Download
Paced Cartoon great architecture, gameplay and feel, this, and extract it to somewhere con-
Combat with its own unique cards brought venient. Open the new folder either
to the table. Warsow has a unique with a file manager or a terminal if
(www.warsow.net)
approach to weapons with two types you’re the minimalist type. The solitary
In the multitude of first-person shooter of ammo: the stock ammo that comes inconvenience in this package is that
projects available comes a particularly with a weapon (weaker) and stronger you’ll have to flag two files as exe-
solid one: Warsow. Warsow is based on ammo once more is collected. Aesthetics cutable: the warsow script and the
the Qfusion 3-D engine (itself a modifi- also play a large part, in particular, a cell platform binary that suits your system.
cation of the Quake 2 GPL engine); shading look similar to manga and the For Linux users with an Intel-based
however, it runs as a completely stan- like, lending the game a feel of some- machine, you have the choice of
dalone package and has a solid feel, thing like a cross between Quake III warsow.i386 or warsow.x86_64, for
avoiding the tackier drawbacks of a and Nerf Arena Blast. Part of this cell 32- and 64-bit systems, respectively.
simple mod. For those of you about to shading ideal is to remove the ultra- If you’re using a file manager (I
say, “I’ve seen it all before”, hold on, realistic, gritty feel of most modern use Konqueror for this example, other
because this is a particularly solid outing shooters and to reduce the violent file managers should be similar),
with some fresh approaches to game content and feel with something more right-clicking on the script and the
dynamics in an already-stale genre. lighthearted with a comic inspiration binary, and choosing Properties and
(which is, indeed, a welcome relief). then the Permissions tab will show
you the options you need. Check the
box for Is executable, and you should
be ready to go simply by left-clicking
on the warsow script when you’re
done. For those using a terminal, this
should do the trick:

$ chmod u+x warsow warsow.i386

Once done, start the game by entering:

$ warsow
Warsow
Despite the old Quake 2 base, Qfusion’s Usage First things first, I’m afraid
Warsow has two elements in partic- modifications allow for some great architecture, that Warsow is a multiplayer-only
ular that make it stand out from the as seen in Warsow. affair—sorry. However, for those looking
rest: speed and motion. Warsow is all to refine their skills without other
about how you move around in the 3-D humans, in-game bots are available
world. It’s about fluidity, motion and (see the game’s documentation for
some interesting changes to game bal- more details). Before you jump head
ance. Particularly interesting are moves, on into the action, check out the
such as the “Wall Jump”, where press- available tutorials. These are clever
ing a special key when touching a wall presentations using the game itself,
allows you to rebound while jumping, but instead of you being in control, it
or probably the game’s main dynamic, puts the movement “on rails” so to
“Bunny Hopping”. Bunny Hopping has speak, and a voice-over guides you
been in first-person games since you through what is happening.
could first jump, but Warsow adds the Once you’re confident enough to
element of increased momentum and start the game itself, the controls are
speed, allowing for a slew of new Cell shading makes Warsow’s environment the standard FPS affair with WADS
gameplay tactics and design elements. much more colorful and lighthearted than controlling the movement, and the
Don’t be put off by seeing “Quake today’s standard grizzly fare of action games. Spacebar for jumping, steering and
2” either, Qfusion is not an old and looking around. Shooting is done
ugly engine destined to turn out some Installation Installing Warsow is with the mouse, as well as with the
clunky old game that looks blockier very easy. Available on the Web site is a “Special” button, which is used for

4 4 | march 2009 w w w. l i n u x j o u r n a l . c o m
dashing, wall jumping and the like. All
of the controls are re-assignable, how-
ever, and it’s well worth customizing it
to your own needs as well as checking
out the game’s other controls.
When you’re ready, choose join
game to search for an arena to play in,
or alternatively, you can host one your-
self. At first, join game probably will Data Matrix barcodes also can hold secret
come up with nothing, so you will have messages along with the usual barcode data
to click search down at the bottom to as shown here.
browse for new games. Choose the
server that sounds best for you (look every year.
for one with other players if you can, Data Matrix barcodes have been
obviously), and if you don’t have the around since the 1980s, but for years,
map installed, Warsow will download they were used only to mark electronic
it from that game’s server. components. More recently, they have
At the time of this writing, Warsow been adopted by a wide variety of
is at 0.40 status, yet the gameplay is industries in the US and Europe, and
seriously solid. There are a few problems they are becoming especially popular
here and there, such as the occasional with mobile phone developers due to
menu quirk and jolts with the sound, their affinity to work with small digital
but the level of problems in the game cameras. Most US readers instantly will
are normally what you’d associate with recognize Data Matrix barcodes, as they
something close to full release instead appear on most first-class mail delivered
of an early demonstration. I imagine by the US Postal Service. Curious readers
that Warsow probably will add things can snap a photo of their mail with a
like single-player skirmishes before it camera or Webcam and scan it with
gets to something like 0.9 status, but libdmtx without purchasing any special
it’s already a fantastic piece of work hardware (it also works well with faxed
even for the fussiest of players. Keep an and scanned images).
eye on this one, and any programming Installation Installing libdmtx is
houses, keep an eye on these coders! fairly straightforward with either a
Debian package available under the
name of libdmtx-utils or a source tarball.
libdmtx—Data For those installing via source, compiling
is basically the standard affair of:
Matrix Barcode
Scanning $ ./configure
$ make
(www.libdmtx.org)
I realise I tend to cover wacky things like And, as root or sudo: libdmtx has the ability to find and decrypt
molecule imaging, telekinesis and 3-D barcodes under a variety of trying conditions.
knitting software, but this is something # make install
that actually may be of genuine industrial
use in everyday life. libdmtx is an open- However, the configure script did Usage I cover only very basic
source project dedicated to providing tools come up with a dependency you prob- usage in reading barcodes for now,
for reading and writing 2-D Data Matrix ably won’t have installed by default, but libdmtx also will write barcodes
barcodes. The Data Matrix standard GraphicsMagick. GraphicsMagick is along with a bunch of other features
(en.wikipedia.org/wiki/Data_Matrix) in many distro repositories though, that make it worth checking the man
is gaining widespread popularity due and to get past the configure script, pages. First, grab an image to test.
to its impressive features, but it may I had to install libgraphicsmagick1 If you have a photo of a barcode
be of particular interest to the FOSS and libgraphicsmagick1-dev from around, great stuff, use that.
community because it’s unencumbered the Ubuntu archive. Otherwise, some test images are
by patents and royalty-free (thus, free Once you have libdmtx compiled, available from the source tarball
to use and distribute). Also, the exist- before you can run the program, you under the folder test/images_opengl,
ing proprietary solutions can be quite probably will need to run the following which cover a variety of different
expensive, and libdmtx now has command (as root or sudo): situations and tricky tests on libdmtx’s
reached a point where it realistically abilities. Once you’re ready to go,
can save some users six-digit savings # ldconfig use the following command:

w w w. l i n u x j o u r n a l . c o m march 2009 | 4 5
NEW PROJECTS

$ dmtxread nameofimage.png

And, that’s pretty much all you


need to do. dmtxread will spend a few
seconds analyzing the image you’ve
given it, and if it finds a matrix barcode,
it then outputs the contained text to
the terminal. Check the screenshot for
some of the hidden messages and
real-world codes that you can contain
within a barcode.
What really intrigued me about this
project is that you can recover barcode
data from old pictures that never would
have been meant for the purpose origi-
nally. And, the James Bond in me gets a
kick out of knowing you can hide a whohas makes finding obscure packages a breeze.
message in a barcode in a seemingly
unrelated picture as a covert method of Installation whohas is genuinely allows easy forwarding to the browser.
communication—neat! Although this very easy to install and is unlikely to And, as with most *nix command-line
has just a command-line utility for now, have unresolved dependencies on most programs of this nature, the results can
it’s really only a basic program on top systems. Compilation isn’t a worry be piped through to grep and the like
of a very clever and versatile library. either, as whohas is merely a Perl script for further refinement (and if you know
This project is begging for a GUI front that gets copied into your /usr/bin what that means, you don’t need me
end, at which point, it could make directory. To install whohas, grab the to explain how it works).
some serious inroads and savings in latest tarball from the whohas Web site, I’m hoping whohas will become an
the real industrial world. extract the contents, and open a terminal everyday tool the way we use something
in the new folder. Then, as root or sudo, like whereis or grep. whohas is a fantastic
enter the following command: little project that should have existed
whohas— years ago, and hopefully, it will make its
Package Finder # ./install.sh way into many distributions by default.I

(www.philippwesche.org/200811/ Usage Once whohas is installed, John Knight is a 24-year-old, drumming- and climbing-
whohas/intro.html) using the program is as easy as entering: obsessed maniac from the world’s most isolated city—Perth,
Finally, we have a tool that will end Western Australia. He can usually be found either buried in an
Audacity screen or thrashing a kick-drum beyond recognition.
some serious headaches, whohas. $ whohas nameofpackage
According to the project’s readme file:
You needn’t be super-
whohas is a command-line tool specific either. A simple On the Web, Articles Talk!
that allows querying several search like “quake”,
package lists at once—currently “audacity” or “chartr” Dual
supported are Arch, Debian, will do fine—no need for booting
Gentoo and Slackware. whohas entering something like is a
is written in Perl and was “chartr_0.16_i386.deb”. sometimes
designed to help package main- whohas then scans a necessary
tainers find ebuilds, pkgbuilds number of repositories evil
and similar package definitions and prints the results out and very
from other distributions to learn to screen one by one. If
inconve-
from. However, it also can be nothing comes up at first,
nient.
used by normal users who want don’t despair; it still might
What if
to know: what distribution has be searching. whohas
you could
packages available for apps also provides URLs to
upon which the user depends more details about the run your
and what version of a given package, so project Windows partition in a virtual machine, so you wouldn’t
package is in use in each maintainer Philipp have to worry about rebooting anymore? With VMware
distribution or in each release Wesche recommends Workstation, you can: www.linuxjournal.com/video/
of a distribution (implemented using a terminal that run-your-windows-partition-without-rebooting.
only for Debian). recognises hyperlinks and

Brewing something fresh, innovative or mind-bending? Send e-mail to newprojects@linuxjournal.com.

4 6 | march 2009 w w w. l i n u x j o u r n a l . c o m
Fast App
Launching with
GNOME Do
When your panel is littered with application shortcuts or you
press Alt-F2 every few minutes to launch a new program, check
out a better, faster way to launch your programs—GNOME Do.
KYLE RANKIN

here are many different ways to launch 3. Copy frequently launched applications to the panel and

T applications on a Linux system. For the


longest time, I would alternate between the
menu system that came with my window
manager and typing the application in a
terminal. Honestly, I found that half the time it was faster
to launch an application inside a terminal than it was to
navigate through a system of menus. At some point in
launch them from the panel.

4. Press Alt-F2 to bring up a command window where


you can type the command and press Enter.

I tried each of the four main ways, but I guess I’m a


creature of habit, because ultimately, I found myself back
to my old ways. When I wanted to launch a program, nine
my desktop use, I decided to give the default Ubuntu times out of ten, I just would go to an open terminal
GNOME desktop a try. GNOME presents at least four and type in the command from there. Every now and
main ways to launch applications: then, I would navigate the Applications menu. That was
my habit, until I discovered GNOME Do. Now I’ve found
1. Navigate the Applications menu at the top of the
I use GNOME Do when I launch the majority of my
screen and find your program.
applications and use a keyboard shortcut, or occasionally,
2. Copy frequently launched applications to the desktop the terminal, for the rest. I don’t really even need or use
and launch them from the desktop. the Applications menu anymore.

4 8 | march 2009 w w w. l i n u x j o u r n a l . c o m
Welcome to GNOME Do a number of other file operations.
GNOME Do is an application launcher Figure 3 also shows that depending
tool inspired by the Quicksilver and on the option you choose, GNOME Do
GNOME Launch Box applications. It is might open a third pane on the right
available either as a package in your with more options. This often is used
distribution or you can download the when you want to copy or move a file
program from the official project page so you can choose its new location.
(do.davebsd.com). You launch GNOME
Do in the background along with your Preferences
desktop environment, and then press GNOME Do has a pretty shallow learn-
Super-Space to open the GNOME Do ing curve. The interface is easy to grasp,
window when you want to launch an so before too long, you will find it easy
application (Super is the Windows key to launch programs and interact with
Figure 3. Alternate Actions
on many keyboards). After the window plugins and other features. Of course,
appears, type part of the name for to get to these features, you first need
an application; for instance, to open most-used choices. This means if you to go the Preferences window. In the
Firefox, type firefox. You will notice launch F-Spot more often than Firefox, top right-hand corner of the window,
that the moment you press the F key, F-Spot shows up first when you press F. you will notice a small triangle. When
GNOME Do chooses an application or GNOME Do also learns which actions you click on it, you’ll see a drop-down
other result and refines it as you type. (the items that show up in the right menu with About, Preferences and Quit
You might need to type only fi for pane) you have performed on particular options. Choose Preferences.
Firefox to be displayed (Figure 1). In objects and gives those precedence. The Preferences window is minimal-
most cases, there also are alternate The ultimate goal is to make it fast and ist (Figure 4) and divides its settings into
choices for your keyword, which you
can reveal and select with the up and
down arrows (Figure 2). The interface is easy to grasp, so
GNOME Do is a learning program,
and as you use it, you will notice that it
before too long, you will find it easy
selects results based on your favorite, to launch programs and interact with
plugins and other features.
simple to launch applications, open files three tabs. In the first tab, you can
and interact with different parts of your change basic settings, such as whether
computer via GNOME Do plugins (more GNOME Do starts at login, whether to
on plugins later in this article). show its notification icon and what
While the left pane in the GNOME theme to use. The second tab lets you
Do window lists objects, the right pane configure keyboard bindings used with
lists actions. An ordinary action for a GNOME Do in case you want to change
Figure 1. GNOME Do with Firefox Selected program like Firefox might be Run, but the defaults. The final Plugins tab is
if you press Tab you will highlight the
right pane. Then, you can use the up
and down arrow keys to cycle through
alternate actions. These actions vary
depending on the object, so for an
application like Firefox, you might get
only the option to copy your typed text
to the clipboard or assign an alias.
Different objects get a more complete
list of actions, so for instance, if the
Files and Folders plugin is enabled, it
indexes the files in a list of directories.
If I start to type a particular filename, it
locates matching files. I then can press
Tab, and when I press the down arrow
key, I will see a number of actions, as
shown in Figure 3. In this example, I
have the option to open the file, reveal
the file in the file manager, move the file
Figure 2. Alternate Keyword Choices to the trash, rename the file or perform Figure 4. GNOME Do Preferences Window

w w w. l i n u x j o u r n a l . c o m march 2009 | 4 9
FEATURE GNOME Do

probably the most interesting. GNOME number of other options on the files, as same functionality as the power button
Do ships with a number of plugins, and shown in Figure 3. at the top of the GNOME panel, so
additional third-party plugins extend In addition to the Files and Folders you can lock your screen, shut down,
GNOME Do’s functionality. plugin is the Locate Files plugin. This reboot and hibernate your desktop.
plugin uses the GNU locate command,
Plugins so instead of just searching through Google Tools
GNOME Do’s plugins are what move directories you specify, you can type a A number of plugins can query
this program beyond a replacement keyword and then select Locate Files Google services. The Gmail Contacts
for the Applications menu on your in the actions pane. GNOME Do then plugin indexes your Gmail contact list
desktop into a blend between a returns the list of results so you can and provides it as results to queries
launcher, desktop search tool and act on them (Figure 5). so you then can select actions, such
central interface for other desktop as e-mail. You also can interface with
operations. Most of the plugins prob- GNOME Tools your Google Calendar using the plugin
ably will be disabled by default, so to With a name like GNOME Do, you of the same name and search through
get this extra functionality, you need probably won’t be surprised to know and even create new events. The
to go into the Preferences window that there are a number of plugins Google Calculator plugin lets you
and enable the particular plugin. that extend into GNOME functions. perform the same calculations and
Below, I highlight a few particularly The GNOME Dictionary plugin pro- conversions you can perform on the
interesting plugins. vides a define action, so you can type Google Calculator site, only within
a word, choose define and get back a GNOME Do. Finally, with the Google
File Plugins definition. The GNOME Screenshot Maps plugin, you can type in an
A few different plugins turn GNOME Do plugin adds a Take Screenshot result address and select Map to submit
into a file browser and search tool. The if you start to type that phrase. Then the location to Google Maps.
Files and Folders plugin indexes directo- you can configure screenshots of the
ries of your choice (highlight the Files entire desktop, a specific window or Other Plugins
GNOME Do includes so many great
plugins, it’s difficult to choose which
You also can interface with your ones to list. Some other useful plugins
Google Calendar using the plugin of allow you to index all of your Firefox
bookmarks or Evolution contacts,
the same name and search through upload photos to Flickr or ImageShack,
update your Twitter status, search
and even create new events. through your Rhythmbox music col-
lection, index Tomboy notes and even
and Folders plugin in your Preferences even take screenshots after a timed connect to remote hosts over SSH.
window, and then click Configure to set delay. I used that particular plugin And, that’s just the list of official
which folders it indexes). As you type, quite a bit while writing this article. plugins. GNOME Do also has many
GNOME Do lists files it finds within The GNOME Terminal plugin extends third-party plugins that extend its
those directories as results. You then the traditional Alt-F2 command window functionality even further.
can copy, delete, browse and perform a in that you can not only run commands I have to say that after trying all
within the GNOME Terminal, you also sorts of different methods to launch
can select particular GNOME Terminal applications, GNOME Do has won me
profiles you have created. Figure 6 over. If I’m already in a terminal, I still
shows the result when I type mutt sometimes will launch an application
into GNOME Do. The Open Profile there, but I’ve switched to GNOME Do
action represents my mutt GNOME to launch most of my programs and
Terminal profile. even use it as a replacement for a file
Finally, the GNOME Session browser when I want to open a file
Management plugin gives you the quickly. If you find that you have a
number of key bindings set up to
launch programs for you, or if you are
tired of reaching for the mouse every
time you want to run a program or
open a file, I recommend giving
GNOME Do a try.I

Kyle Rankin is a Senior Systems Administrator in the San Francisco


Bay Area and the author of a number of books, including Knoppix
Hacks and Ubuntu Hacks for O’Reilly Media. He is currently the
Figure 5. Locate Plugin Results Figure 6. GNOME Terminal Profile Action president of the North Bay Linux Users’ Group.

5 0 | march 2009 w w w. l i n u x j o u r n a l . c o m
THE THIRD MAN
If you thought the only desktop options were KDE and GNOME,
think again. Xfce provides a full-featured desktop that’s lightweight
enough to run on old hardware. FEDERICO KEREKI

n the famous 1949 movie The Third Man, much hinges on scratch, substituting GTK+ for XForms, and was licensed

I a traffic accident and two men—and, it seems, a third man


also was involved. Investigation leads to all kinds of events,
until eventually the truth surfaces, and the key third man is
under the GPL. Version 4.0 saw yet another major upgrade,
changing to the GTK+ 2 libraries, also used for GNOME.
As its creator Olivier Fourdan said, Xfce is “designed for
found. But, go watch the movie for the details—no spoilers productivity”, so “it loads and executes applications fast, while
here. In the Linux world, whenever you talk about desktop conserving system resources”. With modern hardware, that
environments, everyone typically remembers only two (KDE and point may be moot, but Xfce can give new life to older, slower
GNOME), but there’s also an often-forgotten third one, Xfce. processors or RAM-challenged machines. However, even with
(There actually are multiple “third” desktops, but let’s pretend the latest CPUs, you might appreciate the extra speed.
there’s only one for the sake of my catchy intro.) All the standard packages included with Xfce (more on this
In this article, I cover Xfce’s main features and functions, below) were designed with speed and responsiveness in mind,
and why you shouldn’t merely dismiss it, because it’s a worthy and the rest of the selections also follow suit. For example,
contender to the other more-famous counterparts. Oh, and instead of other more resource-intensive suites, you get
while you’re reading, you might want to listen to the “Third Abiword and Gnumeric—less capable perhaps, but more
Man Theme”, with its distinctive zither sound (not that it has appropriate given Xfce’s goals, and for many users, they’re
anything to do with Linux, but it’s great music). more than sufficient.
Xfce started out in 1996, as a Linux version of CDE Xfce sports no fixed release plan, employing instead
(Common Desktop Environment), a commercial desktop still in the oft-used OSS method of “when it feels like it’s ready
use today. However, after a dozen years of development and to be released”. The focus is on quality rather than on
several major versions (Xfce currently is at version 4.4, with fixed timelines. Xfce’s maintainers also suggest, tongue
version 4.6 in the works), Xfce has diverged from CDE and in cheek, that they can be hired to produce new versions
stands on its own. The first versions were based on the propri- on demand, but it’s going to cost you. At the time of this
etary XForms library (see the What’s in a Name? sidebar) and writing, Xfce stands at version 4.4.3, but version 4.6 is
were not open source, but version 3.0 was rewritten from in beta and expected to be ready in early 2009.

5 2 | march 2009 w w w. l i n u x j o u r n a l . c o m
Customization, Customization, Customization
If you are used to KDE or GNOME, you’ll notice some differ-
What’s in a Name? ences, but nothing too dramatic. Right-clicking on the desktop
produces a menu with all your applications. Note, however,
When the project started in 1996, it was named that the menu is “shallow”—selecting an item in the menu
XFce (with an uppercase F), and the letters stood directly produces a list of possible applications, and there are
for XForms Common Environment. When XForms’ no more submenus. If you want a nicer, multilevel menu,
usage was dropped, the name didn’t change, but right-click on the menu button on the panel, and select Edit
the F became a lowercase f. Menu. You’ll see a line that looks like this:

Due to its leanness, Xfce also has been called the ---include--- system
Cholesterol Free Desktop Environment (but that
doesn’t quite fit the acronym). The Xfce Wiki site Right-click on it, and you can select the menu style you
suggests another possibility, X Freakin’ Cool want: Simple (a single level) or Multilevel. Click File→Save, and
Environment, which hasn’t caught on yet. So, Xfce then close the window. By clicking on the menu button and
is now an acronym that doesn’t stand for anything. selecting Properties, you can manage other changes; feel free
to experiment.
If you followed the steps in the above paragraph, you will
have experienced Xfce’s mouse-only style of configuration.
Almost all available options can be selected with only the
Getting Started mouse, providing a consistent and easy interface.
You can use Xfce with practically all modern distributions.
Some, such as Xubuntu or the Fedora Xfce Spin, come with
Xfce as the standard desktop environment. Many others,
Requirements for Xfce are
including OpenSUSE or Slackware, allow you to install Xfce meager—and well below those
instead of, or in addition to, KDE and GNOME. Generally,
you can use a standard package manager to install Xfce. of KDE and GNOME—meaning
For example, in Ubuntu, you would do sudo apt-get
install xubuntu-desktop, and in OpenSUSE, you would
you could run it comfortably
do sudo zypper in -t pattern xfce. As always with on a Pentium III at 133MHz,
open source, you can download, compile and configure
Xfce yourself; see Resources for more information. with 64MB of RAM.
Additionally, the os-cillation Software Center provides
a graphic installation wizard to help with compilation and Let’s move on to more customizations. In the main menu,
installation, but it can be a long process. You’re better off choose Settings (Figure 1), allowing you to change Xfce’s look
getting a binary package if you can. and feel. If you search the Net a bit, you’ll even find people
Requirements for Xfce are meager—and well below who have managed to make Xfce look like Windows.
those of KDE and GNOME—meaning you could run it com- Here are some of the items you might want to explore:
fortably on a Pentium III at 133MHz, with 64MB of RAM.
Of course, a more powerful processor and a larger amount I Appearance (or User Interface Preferences) lets you select
of RAM will enhance the performance. Some users report or install window and icon themes; see Resources for
running Xfce with even lower-end systems, including a more eye candy.
Pentium I or just 32MB of memory, but that’s probably the
absolute bottom. I Autostarted Applications lists the applications that will be
If you’re running Xfce with Xorg 6.8 or above and an started automatically whenever you log in. Note that all
appropriate video card, you can enable several graphic effects. applications you saved the last time you logged out also will
First, make sure you enable the Composite extension, by be started; take a look at Sessions and Startup for some
including the Composite option in the /etc/X11/xorg.conf options. Also, Preferred Applications lets you specify your
file, as follows: favorite Web browser, mail reader and similar programs.

Section "Extensions" I Desktop Settings and Screensaver let you select the desktop
Option "Composite" "Enable" background (solid colors or gradients, or an image) and
EndSection screensaver, along with some behavior aspects, such as the
meaning of a middle- or right-click (the defaults are showing
Then, log out and back in. the window list and showing the desktop menu, respectively)
You will be able to specify some visual effects, such as or what kinds of icons (if any) will be shown.
transparency for window decorations, window shadows
and so on (see below for details). Note that XFWM4, Xfce’s I Mixer Settings (or Sound) and Monitor Settings (or Display
own window manager, does the effects on its own, without Settings) deal with sound and screen and have relatively
requiring any further programs or modules. few options. For multimedia options, check Gstreamer

w w w. l i n u x j o u r n a l . c o m march 2009 | 5 3
FEATURE Xfce

Figure 1. Practically all configuration can be done with only the mouse. Figure 2. Thunar, Xfce’s Standard File Manager

Properties too.

I Keyboard Properties lets you define shortcuts and


accessibility features.

I Panel Manager lets you specify how many panels there


should be, at which positions (top- or bottom-centered) and
of what size. You can right-click on a panel and select Add
New Item in order to decide what should be shown. Here,
you can change the menu, windows bar and system tray.
Opting for a classic look, I configured just one bottom-
centered panel with a menu, several program launchers
(allowing access to a terminal, editor, file manager and
such), a task list (showing open applications), a few
applets, a clock and the lock and logout commands.
Figure 3. Custom Thunar Action
I Window Manager Settings lets you select the default style
for windows, keyboard shortcuts, several details on focusing You might have noticed there is no Fonts configuration
windows, opaque moves, resizing and the meaning of a option, and apparently, there won’t be one in Xfce 4.6
double-click on a window. You also should look at Window either. If you want to add or remove fonts, you have to
Manager Tweaks for similar items. In particular, go to the do it manually.
Compositor tab, which lets you specify transparency and
shadow parameters. Managing Files
Since version 4.4, the default Xfce file manager is Thunar (the
I Workspace Settings lets you choose how many desktops old Saxon name for Thor, the Nordic god of thunder), which
you want (the fewer the better, in terms of speed) and replaced the previous file manager XFFM (Figure 2).
some other working details. Thunar is fast and easy to use, and it’s similar to Nautilus,

Thunar Customization
Thunar provides extra customization possibilities, allowing you to define personal commands. Click Edit→Configure
custom actions, and you can create an action of your own. To test it, I added a “Count Words and Lines” feature
(Figure 3). I set Name to Count words and lines, and Command to:

zenity --info --text="`wc -l -w %N`

And, in the second tab, Appearance, I checked that this command should be applied to Text Files. Zenity shows a dialog
box. If you don’t use zenity, the output of the wc command won’t be shown. If you right-click on a text file and select the
Count Words and Lines action, you will get a dialog box showing the result of the wc command.

5 4 | march 2009 w w w. l i n u x j o u r n a l . c o m
Figure 6. Ristretto Image Viewer

Figure 4. Xarchiver, the Current Xfce Archive Manager For archived files, the default still is Xarchiver, but
Squeeze is set to be the next option (Figures 4 and 5).
Xarchiver supports most types of archive files (bzip2, gzip,
rar, rpm, tar, zip and so on), with password detection (for
reading) and encryption (for writing). You can preview, cut,
copy, paste, rename, and drag and drop files to or from
archives. Squeeze still is in development and offers only
add, extract and delete functions for now.
Finally, Ristretto (the name for a highly concentrated
espresso) is an image viewer. You can open a whole directory
at once and see all the images in a slideshow fashion (Figure

Instead of more resource-


hungry office suites like
OpenOffice.org or KOffice,
Figure 5. Squeeze, the Xfce Archive Manager Xfce provides GNOME’s
Dolphin or Rox-Filer. In terms of working with files and directo-
Abiword and Gnumeric.
ries, usage is quite similar to other file managers, and you’ll
likely feel at home quickly. 6). Ristretto lets you zoom and rotate images, and it also can
Thunar is a lightweight program by design, but you can be used via a Thunar plugin.
add functionality through plugins. Download plugins using
your package manager or directly from the Thunar Web site. Even More Programs
Among the possible extra functions are the following: If you want to play music, Xfce includes Xfmedia (Figure 7). It
provides basic playlist functions and is easy to configure. You
I Advanced Properties adds extra pages to the File Properties can randomize the playlist, set diverse “repeat” options as well
dialog. For image files, it displays only the image properties, as provide “visualizations” to accompany the music (not fully
and for .desktop files, it provides launching information, developed yet). Xfmedia also is touted as a video player,
allowing you to specify which program should be run. because of its Xine usage.
However, for DVD playback, it’s seriously lacking in com-
I Archive lets you create and extract files from .rar, .zip and mand options, such as menu navigation, choosing subtitles
similar archive files. and the like, so you’re better off sticking with Totem (Figure
8), which is the default application for DVDs.
I Renaming lets you rename several files at once and provides Xfburn provides CD and DVD creation with a simple
search-and-replace patterns, so you could, for example, interface (Figure 9). Xfburn still is in the early stages of
change all *TXT files to *txt with a single command. development, but you can burn ISO images or data to
CDs or DVDs. The ability to create audio CDs is currently
I Media tags also lets you rename media files (such as .mp3) lacking, but it’s promised for a future release.
by providing access to their tags. Instead of more resource-hungry office suites like

w w w. l i n u x j o u r n a l . c o m march 2009 | 5 5
FEATURE Xfce

Figure 8. Totem for Video

For messaging purposes, Pidgin also is provided. Pidgin is


Figure 7. Xfmedia a good choice, because it can work with multiple protocols
(AIM, Google Talk, ICQ, MSN, Yahoo and more), and it
OpenOffice.org or KOffice, Xfce provides GNOME’s Abiword integrates well with the desktop.
and Gnumeric. Of course, you can use the other suites if you Finally, as an agenda and calendar, Orage (previously
prefer. For simpler text-editing tasks, Mousepad is the standard known as Xfcalendar) provides a system-tray clock (right-
editor. It offers basic functionality, and in fact, I used it to write click on the panel to make it appear) and a personal
this article. agenda. You can store events and get alarms. You can

Resources

Xfce Official Web Site: www.xfce.org GTK+: www.gtk.org

Xfce Documentation Wiki: wiki.xfce.org Konqueror: konqueror.kde.org

Installation Packages: www.xfce.org/download Nautilus: projects.gnome.org/nautilus

Eye Candy for Xfce: www.xfce-look.org os-cillation: www.os-cillation.com

Abiword: www.abisource.com Totem: projects.gnome.org/totem

Gnumeric: projects.gnome.org/gnumeric Zenity: directory.fsf.org/project/zenity

Orage: www.xfce.org/projects/orage Distributions with XFCE:

Pidgin: www.pidgin.im Debian Xfce Group: pkg-xfce.alioth.debian.org

Squeeze: squeeze.xfce.org Fedora Xfce Spin: www.redhat.com/archives/


fedora-announce-list/2008-February/msg00005.html
Thunar: thunar.xfce.org/index.html
Linux Mint Xfce Community Edition:
Xarchiver: xarchiver.xfce.org www.linuxmint.com/edition.php?id=27

Xfburn: www.xfce.org/projects/xfburn Mandriva Xfce Live: wiki.mandriva.com/en/XfceLive

Xfmedia: spuriousinterrupt.org/projects/xfmedia OpenSUSE Xfce: en.opensuse.org/Xfce

CDE: www.opengroup.org/cde Slackware: slackware.com

Dolphin: dolphin.kde.org Xubuntu: www.xubuntu.org

5 6 | march 2009 w w w. l i n u x j o u r n a l . c o m
Figure 9. Xfburn provides CD and DVD burning, but it can’t create audio
CDs yet.

schedule repeating, periodic events and full-day events


(like birthdays or holidays). Orage even can work across
different time zones (Figure 10).

Figure 10. Orage provides clock and calendar functions with alarms
and notifications.

Summary
In the movie, finding the third man proved to be a disappoint-
ment to the main character, but with Xfce, that won’t be the
case. With low requirements, high performance and an easy
interface, you can be productive in little time. Although it’s
not quite as packed as KDE and not as simplified as GNOME,
it’s a balanced desktop environment in terms of power and
ease of use. No matter what kind of machine you use, you’ll
find it worthwhile.I

Federico Kereki is an Uruguayan Systems Engineer, with more than 20 years’ experience teaching
at universities, doing development and consulting work, and writing articles and course material.
He has been using Linux for many years now, having installed it at several different companies.
He is particularly interested in the better security and performance of Linux boxes.

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.
Firefox is the wunderkind of Linux browsers, but is it right for you? We
take a look at three competing browsers—Opera, CrossOver Chromium
and Flock—that may just give you more Webvergnuegen.

W
hat a relief we felt when Firefox was first good, recent releases have shown vast improvements, a wealth
released. It replaced “None of the above” as of smart features and a sleek Euro style. CrossOver Chromium
our favorite browser, and we finally were rid of is Google Chrome running on Wine. Though Chromium is
the monolithic dinosaur Netscape. Since then, betaware, it gives us a sneak peek into Google’s plans to
Firefox has been relatively unchallenged in its supremacy. re-invent the browser by going minimalist. Will Chrome do to
As of late, some new challengers are seeking to steal some Firefox what Firefox did to Netscape? Finally, Flock seeks effi-
of Firefox’s thunder. In this article, we take a closer look at ciency not in raw speed but in doing everything in one place
three of them: Opera, CrossOver Chromium and Flock. and integrating the Net experience in one “portal”. You may
Opera clearly has ambitions, because although always find that one of these browsers is a better fit for you.

JAMES GRAY

5 8 | march 2009 w w w. l i n u x j o u r n a l . c o m
The Opera Web Browser money. When I
Although Linux-friendly for ages, the dove into the new
Opera Web browser, which is based on Opera 9.6, I was
the proprietary Presto layout engine, has pleasantly surprised
failed to reach critical mass in the collec- at its features and
tive Linux consciousness. Lacking the ergonomically
massive community involvement and sound look and
open-source credentials of Firefox, most feel. From a style
of us don’t even register Opera. In the standpoint, I like
2008 Linux Journal Readers’ Choice Opera better than
Awards, less than 5% of respondents Firefox on Linux.
picked Opera as their favorite Web The Opera folks
browser (compared to Firefox’s 86%). clearly put much
Although I’d also love to see an thought into
open-source Opera, I somewhat under- design elements.
stand the company’s unwillingness to Opera makes
release its source code. I recently spoke up for its open-
with Opera’s CTO, Hakon Wium Lie, source “deficit”
who explained the company’s position with cool features
on open source: and customizability.
Although the
At Opera, we believe in open browser is speedy
standards, security, speed, per- enough, Opera is
formance and features—these about the features,
are values that we share with not leanness. Many
the Linux community....We’re features that are Figure 1. Summon a new tab in Opera, and up pops Speed Dial, a sort
very proud of our source code, Firefox extensions of home page with nine one-click links to your favorite sites.
and we’d like to show it to are already built in
others, but we haven’t found a to Opera. allows you to save user names and
business model that allows us to Here are some core features that dis- passwords and autofill them upon
do so while still charging for tinguish Opera from its rivals. The Opera subsequent site visits. Opera Link is a
commercial use. Ideally, I’d like browser has the most interesting startup service that synchronizes bookmarks,
to see an open-source license options of any Linux-based browser. the Speed Dial contents, browsing
similar to the Creative Commons First, upon opening a tab, Opera’s history and other elements across
noncommercial license. The default is Speed Dial, a sort of home computers or other devices that run
license would say, “here’s the page with nine customizable thumbnails Opera, including mobile devices that
source code, feel free to use and for your favorite Web sites (Figure 1). utilize Opera Mini, the mobile version of
reuse it, but we’d like a cut if Second, Opera lets you decide how to Opera. Furthermore, RSS (with label-able
you make money from it”. start each session—just as you left off, feeds), IRC, a mail client and BitTorrent
Anyway, on the Web, I believe your home page, a blank page, via dia- support are built in.
open standards are much more log or from a saved session. The built-in For those who appreciate aesthetics,
important than open source. session manager is a powerful feature, Opera goes well beyond its pleasant
given how many different tabs/windows default skin. Changing Opera’s skin is
Personally, I don’t see why an open- the typical user has open concurrently. easy, because a surprisingly wide range
source Opera could not only scale up its One can have saved sessions for differ- of skins are easy to preview, download
market share but also leverage that ent modes, such as home, work, and install with just a few clicks.
increased popularity to rake in a hefty finances, news, hobbies and so on. Besides the myriad built-in features,
share of revenues from partnerships I also found Opera’s “philosophy” of Opera also offers a range of widgets
with search engines, like Firefox does. default tab-oriented browsing pleasant, that collaborate with the browser.
However, I’ll leave that discussion for which I personally think is nicer than Widgets get their own tab from which
another day. The reality is that the Firefox’s tab mode. As you open new one can view, install and manage them.
Opera browser is good—surprisingly pages, Opera opens each substantial They can appear anywhere the user wants.
even as good as the Windows edition— (that is, non-squished) tab, complete Although numerous, useful widgets
which makes it worthy of our scrutiny. with mouse-over preview, across the top exist, Opera’s philosophy is to have
Let’s have a look. of the browser. Although you certainly more core features built in than does
can configure Firefox to act in a similar Firefox. The result is a heavier but more
The Opera Experience way, Opera feels more comfortable and immediately customizable browser.
Although I have used Opera on and off looks nicer in tab mode. On the negative side, though I didn’t
over the years as a backup browser, I A number of other built-in features find Opera to be noticeably slower than
never really gave it a hard run for its make Opera worth a look. The Wand its peers, I had some occasional page-

w w w. l i n u x j o u r n a l . c o m march 2009 | 5 9
FEATURE Browser Battles: Opera, CrossOver Chromium and Flock

source, written in find Chromium functional for loading


V8, Google’s Web pages, it feels a bit slow and
JavaScript virtual clunky. Furthermore, Chromium lacks an
machine and integrated non-Web-based RSS reader,
based on the which Firefox and Opera have right in
WebKit layout the address bar. It also lacks extensive
engine. bookmark management, which most
Furthermore, other full-featured browsers have.
installing Another core issue is privacy on
Chromium is a Chromium, because Google collects
snap, with a usage statistics and crash reports from
downloadable you as a default. Luckily, you can turn
binary in DEB (for this off by selecting Options from the
Ubuntu) and RPM “wrench” menu.
(for SUSE, In the future, Google says we can
Mandriva and Red expect currently absent features to
Hat) formats, as become available, such as better
Figure 2. Chromium well as a package bookmark management, an extension
with a one-click framework, a way to e-mail complete
rendering problems. On one site, the shell script for other distros. Web pages and links easily and more.
search box slid behind the main menu You’ll also like Chromium if you The take-home message on
and was completely unaccessible. prefer a lack of clutter over feature-rich Chromium is that it is a Spartan browser
Despite such problems, I’d argue functionality. I’ve been told that the with few bells and whistles whose post-
that Opera’s plethora of features makes Windows version is fast as lightning, as beta experience is slated to be lightning
up for the speed deficits and its render- reputedly shall be Chrome for Linux, but fast on the Linux platform. For now
ing problems. Of course, the trade-offs Chromium certainly is more like thunder though, CrossOver Chromium is a slug-
are yours to weigh, as well. than lightning. gish prototype held together by lots of
One unique feature our ilk will love virtual duct tape. We can only hope that
Google Chrome on Wine: on Chromium is the (for real) “Stats for the native Linux version of Chrome will
CrossOver Chromium nerds” function. When you call forth the be so blindingly fast that it gives us a
At the time of this writing, the recent task manager, you’ll get a list of open reason to consider leaving its bulkier
Google Chrome browser is available Web pages, complete with memory competitors behind.
natively only on the Windows platform status, CPU usage and network speed
with a Linux edition still in development. related to each page. On the task man- Flock
The idea behind Chrome is to remedy the ager, in addition to an option to kill the At the far opposite end of the philo-
past “mistakes” made by browser makers process for each open page, you also sophical spectrum from the slim
and provide a tool that also runs applica- can click on a Stats for nerds link, Chromium lies Flock, the Swiss Army
tions and not just displays Web pages. which pulls up a new tab complete knife of browsers. Flock takes the
Thanks to good ol’ Linux-geek inge- with additional information such as “portal” approach to browsing, adhering
nuity, however, we don’t have to wait for PID, memory utilization for both the to a philosophy that efficiency lies in
the Google folks to finish their project. entire browser and each tab. consolidation rather than raw page-load
Instead, CodeWeavers, makers of the I also like
CrossOver line of Wine-based applica- Chromium’s option
tions, has created CrossOver Chromium, to open a number
a Linux “port” of Google Chrome. of home pages
upon startup and
The Chromium on Linux not just one.
Experience Apparently unique
Although the situation may change by to Chromium is
the time you read this, the reality is another neat fea-
that CrossOver Chromium is betaware ture, incognito
and not yet ready for prime time. On browsing, which
Chromium’s status, CodeWeavers allows the user to
offers the warning that it is “just a leave no local trace
proof of concept, for fun, and to in the browser or
showcase what Wine can do”. cache of what’s
Should you decide to tinker with been viewed.
Chromium, you’ll find some things satis- On the
factory, and others frustrating. On the frustrating side, Figure 3. The Flock browser seeks efficiency via tight integration with
plus side, Chromium is thankfully open although you’ll popular sites like YouTube and Facebook.

6 0 | march 2009 w w w. l i n u x j o u r n a l . c o m
sites. To test Flock’s have done the same with my Yahoo
capabilities, I sent Webmail, Twitter or blog entry. Similar
a friend a hilarious drag-and-drop functionality and
Figure 4. Flock packs a lot into a small space. The secret to keeping Bollywood music integration works while blogging on
your media organized is the Flock Toolbar. Each icon represents a video I had one of the supported blog sites.
different type of media by function. seen recently on Despite Flock’s toolbar-driven modular
YouTube. Culling layout, you’re probably wondering how
speed. Based on the latest Gecko my urge to call up YouTube on its own it packs so many goodies into such a
engine with a number of specialized tab, I instead did it the Flock way by small space. Admittedly, all that content
extensions, Flock bills itself as “The launching the Media Bar, which popped was a bit scrunched on my 12"-laptop
Social Web Browser” that “collects all up one-inch wide across the top of the display, but it still was functional. The
of your feeds, friends, media and sites browser window. Because the Media Bar real estate found in a large LCD is more
in one convenient place”. is integrated with several media-based appropriate for flocking. Nevertheless,
The reason for such a billing is that sites, including YouTube, I could choose features such as the rapidly sliding tab
Flock wants you to do nearly everything YouTube from the drop-down menu bar allow you to open and manage a
from a unified command center. This and search the site without going there huge volume of tabs.
includes interacting with social network- directly. The Media Bar came back with Otherwise, Flock was very customiz-
ing sites (such as Facebook and Twitter), thumbnails and mouse-over previews of able according to my whims, and the
photo and video search (such as Flickr the search results. Then—here’s the main toolbar was logical and functional
and YouTube), photo uploading and coolest part—after finding my video, after becoming accustomed to it. The
sharing (such as Picasa and Photobucket), I sent it to my friend by dragging the degree of integration with other sites is
blogging (such as Blogger and LiveJournal), thumbnail over to his Facebook entry in unprecedented among Linux-based
news consolidation with custom RSS the People Sidebar, which automatically browsers. Despite the heft of features,
feeds and bookmark syncing with composed a message to him, including Flock is based on Firefox, which
on-line bookmark services (such as the link to the video and the thumbnail. means the options are familiar,
delicious and magnolia). All I had to do was click Send. I could browsing is nimble, and most, but
The key to keeping all this stuff
straight is the Flock Toolbar, which
offers an icon that represents each type
of media by function (Figure 4). These
icons include My World, a home base of
sorts that includes the information you
want, such as news feeds and your
Facebook friends; the People Sidebar for
social-networking interactions; the
Media Bar for quick video and photo
searches; the Feeds Sidebar for manag-
ing RSS; Webmail for interfacing with
Web-based e-mail services; Favorites
(bookmarks); the Accounts and Services
Sidebar for managing accounts and
logins; the Web Clipboard, a location to
which you can drag links, images and
text to save for later perusal; the Blog
Editor and the Photo Uploader. Besides
all this, you can, of course, simply surf
the Web conventionally.

Happy Flocking
I first approached Flock 2.0 with my own
Firefox-colored assumptions and habits,
including a primal urge to summon each
site I visit onto its own tab or window. I
typically scroll through my tabs with Ctrl-
Tab or my windows with Alt-Tab. As I dug
in to Flock, I had to tell myself “Hold off
on the keystrokes and start flocking”, as
the animated introduction suggests.
As I began to “flock” on Flock, I real-
ized the tight integration with its partner

w w w. l i n u x j o u r n a l . c o m march 2009 | 6 1
FEATURE Browser Battles: Opera, CrossOver Chromium and Flock

not all, extensions are usable. edition is probably overkill on quantity, things go awry with others. The browser
Whether you choose Flock really it provided me with plenty of new identification tool aids the troubleshooting
depends on the degree to which you information sources, as well as a template process by letting you configure how
hang out on social media sites, share for how to maximize Flock. Konqueror reports itself—for example,
pictures and video with friends, blog as Internet Explorer, Googlebot, Firefox
frequently and track RSS feeds. If you Other Browsers for Linux: and Safari, among others.
are a social media addict, I suspect Flock Epiphany and Konqueror
will save you time and hassle. If you are The Linux platform is blessed with several Let Your Philosophy Decide
a more casual user, Flock may seem other Web browsers. Here is a quick With the above and more options avail-
claustrophobic and cluttered. I, for take on two, Epiphany for GNOME able, what are you going to choose as
instance, am a Facebook user who and Konqueror for KDE. your browser? We are fortunate that each
checks the site once or twice a day— If you are an avid Ubuntu user, you browser niche is being filled with great
probably not enough to warrant using probably are familiar with Epiphany, the options on the Linux platform. For those
Flock. However, I admit that having my GTK-based Web browser built for the who believe that efficiency lies in integra-
Facebook (and Twitter) contacts right GNOME desktop. Besides integrating tion and feature-richness, Flock and Opera
next door makes me more conscious of tightly with the GNOME desktop, are excellent options. Flock integrates the
and interactive with my contacts. Who Epiphany’s goal is to be simple and easy most tightly with other services, and Opera
knows, maybe I’ll stay on board. If you to use. The browser utilizes Mozilla’s builds in as much functionality as possible.
do decide to flock, however, be pre- Gecko layout engine and offers nearly the Neither browser is known for its page-load
pared to throw your typical browser same functionality as Firefox, including its speeds. Meanwhile, browsers like Firefox
habits out the window and re-orient extensions. However, one feature that and its more streamlined cousins (such
yourself to Flock’s all-in-one philosophy. stands out in Epiphany is its topic-based, as IceCat and Epiphany) hold the middle
Before putting Flock to bed, I should rather than hierarchical, bookmark ground, seeking to balance speed with
add that Flock makes two special editions management, which is similar to Gmail’s essential functionality, leaving many
for the Linux platform: the Gloss and Eco labels. This system allows you to catego- features to the extensible extension
editions. The Gloss edition is preconfigured rize a bookmark more intuitively with mul- system. Currently, Firefox is the fastest
for entertainment and fashion-related tiple topics. Epiphany also supports cookie we’ve got. However, although CrossOver
topics, and the Eco edition is for green management, pop-up blocking, tabbed Chromium is not so nimble, it gives us an
topics. Being an eco-geek, I checked browsing and its own extension package. enticing preview of the forthcoming
out the latter. On the negative side, Some native extensions relate to mouse Google Chrome for Linux. Chrome for
the souped-up editions are a release gestures, a certificate viewer, an interac- Windows is faster than Firefox. If you pride
behind—namely 1.2.6 at the time of tive Python console and smart bookmarks. speed and agility above all else, keep
writing, compared to 2.0 for the standard If you’re a KDE aficionado, you know your eye out for Chrome. Whatever your
release. The Eco edition, beyond its earthy Konqueror well as your “everything philosophy, you’ll find a great Linux-based
eye candy, preloads a plethora of enviro- tool”. Beyond managing and viewing browser to meet your needs.I
oriented links, media streams, RSS feeds files, Konqueror also is a decent and
and favorites. As an avid reader of green basic Web browser, though not as James Gray is Linux Journal Products Editor and a graduate
media, I was impressed with the wide robust functionally or stylistically as student in environmental sciences and management at Michigan
range of selections, many of which I had Firefox or Opera. I find Konqueror to State University. A Linux enthusiast since the mid-1990s, he
never seen before. Although the Eco be a great backup Web browser when currently resides in Lansing, Michigan, with his wife and cats.

TECH TIP Running Complex Commands with sudo

If you use sudo to run commands as root, you’ve probably run root-only file is still running as you. Your current shell does the
into “permission denied” problems when only part of a pipeline redirection before sudo starts.
or part of a command is running with root permissions. The solution is to run the whole pipeline under sudo. There
This fails with “permission denied” because the file is are a couple ways to do it, but I prefer:
writable only by root:
echo "echo 12000 > /proc/sys/vm/dirty_writeback_centisecs" | sudo sh
$ echo 12000 > /proc/sys/vm/dirty_writeback_centisecs
That way, I can type everything before the pipe character,
But, this fails too: and see what I’m about to run as root, then press the up
arrow and add the | sudo sh to do it for real. This is not a
$ sudo echo 12000 > /proc/sys/vm/dirty_writeback_centisecs big deal for short, obvious pipelines, but when you’re building
up a more complicated command as root, it’s safer to look at
Why? The /bin/echo program is running as root, because it first before you run it.
of sudo, but the shell that’s redirecting echo’s output to the —DON MARTI

6 2 | march 2009 w w w. l i n u x j o u r n a l . c o m
AIR
Out Your
Desktop
with
Adobe
Cross-platform never looked so Flashy.
SHAWN POWERS

M
ost Linux users are intimately familiar

with programs that are similar to their

commercial counterparts, but not quite

the same. There isn’t anything wrong

with clone applications, but if programs were inherently

usable, regardless of the underlying operating system,

fewer programmers would have to re-invent the wheel

over and over again.

6 4 | march 2009 w w w. l i n u x j o u r n a l . c o m
Advertiser Index
Cross-Platform Apps, a Great Concept
One real hope for Linux users is the idea of cross-platform
Advertiser Page # Advertiser Page #
applications. It’s not a new concept, but we’re beginning to
see some huge leaps in the ability for Linux users to use the 1&1 INTERNET, INC. 15, 17 LOGIC SUPPLY, INC. 41

same applications that Windows and OS X users use—not just www.oneandone.com www.logicsupply.com

clones, but the same actual apps.


Java, for instance, is a great way to make the underlying ABERDEEN, LLC 37 MICROWAY, INC. C4, 29

operating system unimportant. One really huge stumbling www.aberdeeninc.com www.microway.com

block with Java programs, however, is that packaging them for


the different computer systems is very difficult. Sure, you can ASA COMPUTERS, INC. 79 MIKRO TIK 7

download a JAR file, but that does the average user little www.asacomputers.com www.routerboard.com

good. It takes effort to make installers for each platform you


want to support. Java also has a reputation for poor perfor- CARI.NET 61 O'REILLY MYSQL USERS CONFERENCE 71

www.cari.net www.mysqlconf.com
mance. Before any Java developers form a lynch mob and hunt
me down with pitchforks, note that I said it has a reputation
COMMUNITY ONE 35 POLYWELL COMPUTERS, INC. 5
for poor performance. At one time it was true, but in most
developers.sun.com/events/communityone www.polywell.com
cases, these days Java programs perform quite well. However,
fair or not, the general opinion regarding Java programs to
CORAID, INC. 47 RACKSPACE MANAGED HOSTING C3
date is that they are slow and cumbersome.
www.coraid.com www.rackspace.com

On the Web, Computers Become Irrelevant DRUPALCON DC 63 SERVERS DIRECT 3


Web-based applications recently have become the most preva- dc2009.drupalcon.org www.serversdirect.com
lent way to provide equal access for everyone. Whether you
call it Web 2.0, advanced JavaScripting or just the availability ECOMM MEDIA, INC. 69 SHAREPOINT 51
of a more diverse set of Web programming frameworks, the ecommconf.com www.sptechcon.com
Web currently is a hotbed of new platform-agnostic programs.
That trend isn’t going away any time soon, but there are a few EMAC, INC. 21 SILICON MECHANICS 23, 27
problems that are tough to solve with on-line apps. For one, www.emacinc.com www.siliconmechanics.com
relying on the Web browser to handle multiple applications
puts all of your eggs in one basket. If the Web browser itself EMPERORLINUX 9 TECHNOLOGIC SYSTEMS 11
crashes, so does every one of your running programs. An even www.emperorlinux.com www.embeddedx86.com

FLORIDA LINUX SHOW 75 TECHWEB LIVE EVENTS (BLACKHAT) 39

www.floridalinuxshow.com www.blackhat.com

Equal-Opportunity GENSTOR SYSTEMS, INC. 57 UBIQUITI NETWORKS, INC. C2

Adobe? www.genstor.com www.ubnt.com

Although the initial development of Adobe’s AIR for IT360 25 ZT GROUP INTERNATIONAL 1

www.it360.ca www.ztgroup.com
the Linux platform has been behind its Windows and
Macintosh counterparts, Adobe promises future releases
all will come out at the same time for all three platforms.
I contacted Rob Christensen, Adobe AIR Senior Product
Manager, and he confirmed that future releases are
planned to come out simultaneously.
ATTENTION ADVERTISERS
At the time of this writing, that means while AIR 1.5 is
available for Windows and OS X, the latest version for June 2009 Issue #182 Deadlines
Space Close: March 23; Material Close: March 31
Linux is 1.1 Beta. The unfortunate side effect of the
different versioning is that many of the newest (read: Theme: Readers’ Choice Awards
coolest) AIR applications don’t run under Linux, because
they require the 1.5 runtime environment. In fact, due to BONUS DISTRIBUTIONS:
Sun’s Java One, O’Reilly Web 2.0 Summit, ISPCON Spring
the “beta” aspect of the Linux port, some apps designed RailsConf, phptek
to work with version 1.1 don’t even function properly.
Call Joseph Krack to reserve your space
+1-713-344-1956 ext. 118, e-mail joseph@linuxjournal.com
Hopefully, Adobe will remain true to its promise, so AIR
apps work everywhere, all the time, regardless of the
underlying OS. I’m hopeful, especially after seeing the
recent timely releases of Adobe Flash.

w w w. l i n u x j o u r n a l . c o m march 2009 | 6 5
FEATURE Adobe AIR

bigger problem is that if the Internet


itself isn’t accessible, neither is the
Web-based program.
Several potential solutions exist to
solve the “unconnected” problem
regarding Web apps. Google, for
instance, continues to develop its Gears
infrastructure that allows people to
use Web applications when in off-line
mode. The concept, whether imple-
mented by Google or someone else,
will make Web applications more viable
as desktop program alternatives.
Unfortunately, it still tethers us to a
Web browser. Projects like Prism can
allow for separate instances of Web
applications, but regardless of what
browser is used, the apps still require
the browser in order to function.

Enter: AIR
Adobe has taken its long history of Figure 2. DestroyFlickr manages your on-line Flickr account.
Flash on the Web and given developers
the ability to create standalone applica-
tions that don’t depend on a Web for Windows proves that Adobe is than using a dedicated client. I’m in
browser at all. I know that many Linux taking our favorite operating system that boat. Twhirl has lots of seemingly
Journal readers just rolled their eyes at more seriously. simple features that make it a great way
the mention of Flash technology under So, what makes AIR unique? Several to interface with the Twitter universe.
Linux, but to be fair to Adobe, it has things: Many users prefer another AIR-based
put more serious effort in its Linux Twitter app, known as TweetDeck. As
ports recently than ever before. The I Applications look and function the both are free, and both work well
mere fact that the same version of same, regardless of the operating under Linux, so I suppose it’s only fair
Flash is available for Linux as is available system. to mention both. Twhirl is just my
personal preference.
I Developers do not need to package Twhirl—works under Linux AIR 1.1
AIR apps separately. One package Beta: yes.
installs identically on any platform.
DestroyFlickr
I AIR applications, along with the AIR DestroyFlickr is a program that lets you
environment itself, can be installed manage your Flickr stream with an
directly from a Web link inside a Web interface that resembles a light table. It’s
browser (assuming a recent version a convenient way to use Flickr.
of Flash is installed on the computer). Another application that currently
works under Linux is Flump. It is much
I Applications are standalone and more simplistic in its interface, but it can
don’t require a browser. One AIR app upload and download photos.
doesn’t affect other apps if it crashes. DestroyFlickr—works under Linux
AIR 1.1 Beta: yes.
One of the best things about AIR
applications is that they tend to look
aesthetically pleasing. Let’s look at a few
from Adobe’s AIR Marketplace. I specifi-
cally focus on those that work under
Linux now, and a couple that I hope
work by the time you read this article.

Twhirl
Twhirl is one of the dozens of Twitter
Figure 1. Twhirl is a Twitter microblogging clients available. Many people find
client. Twitter’s Web interface much less useful Figure 3. Flump is a very simple Flickr app.

6 6 | march 2009 w w w. l i n u x j o u r n a l . c o m
Figure 4. If you would prefer to have a cute of AIR interacting with the underlying
Snackr fuzzy puppy read your RSS feeds to operating system.
continuously you while he rolls around on your
scrolls your desktop, you might prefer Pet-It RSS
RSS feeds, News by zerofractal.
so you Snackr—works under Linux AIR 1.1
can “snack” Beta: yes.
on them
at your Snippage
leisure. Snippage allows you to select a specific
section of a Web site and make it dis-
play in a widget on your desktop. The
Web site can update automatically, so if
the page changes, so does the widget.

Figure 8. Back It! does exactly as its name


suggests. It backs stuff up.

Back It!—works under Linux AIR 1.1


Beta: yes.

Remember the Milk Notifier


RTM Notifier logs in to your on-line
account and notifies you of upcoming
tasks. I noticed a few graphic glitches
running it under Linux, but the program
itself is fully functional.
Figure 6. Snippage lets you create a widget
from a Web page selection.

Snippage—works under Linux AIR


1.1 Beta: yes.

Google Analytics Reporting


Snackr Suite
Snackr is an RSS ticker that runs along If you look at Google Analytics informa-
the border of your screen. Clicking on tion very often, this application will save
a story opens it in a preview window, you time. Its functionality isn’t much
which gives you the option to open the greater than visiting Google’s Web site,
actual page in a browser. but the speed and convenience is nice.
Google Analytics Reporting Suite—
works under Linux AIR 1.1 Beta: yes.

Figure 9. Remember the Milk Notifier is a


popular on-line task manager.

RTM Notifier—works under Linux


AIR 1.1 Beta: mostly.

Sam’s Interactive Reader


Figure 7. Browsing through Google Analytics This is a children’s program that reads
information is simple with this application. with young readers interactively. There
also are activities and the ability to
Back It! download additional content. Pricing for
Back It! is a simple utility for backing up additional content varies from free to
a predetermined set of files and folders slightly more expensive than free.
Figure 5. Pet-It RSS uses an avatar much less from one place to another. The program The functionality of this program is
annoying than Microsoft’s Clippy. isn’t complex, but it’s a great example not consistent. Sometimes it won’t load

w w w. l i n u x j o u r n a l . c o m march 2009 | 6 7
FEATURE Adobe AIR

FotoBooth
FotoBooth is an application written in
Flex that allows you to take photos with
your Webcam. It supplies real-time
effects you can apply to the photos and
allows for uploading directly to Flickr.

Figure 10. I’m a sucker for childhood literacy, so I really hope this program works better by the
time you read this.
Figure 13. FotoBooth is a clone of Apple’s
at all, and sometimes it starts almost once AIR gets out of beta. PhotoBooth, with Flickr integration.
enough to use. I included the app, MyMediaPlayer—works under Linux
hoping it works well when AIR for AIR 1.1 Beta: almost, but no. FotoBooth has a complex history. It
Linux is no longer in beta. exists as a Web-only Flash application
Sam’s Interactive Reader—works Pandora Desktop and several versions written in AIR. Some
under Linux AIR 1.1 Beta: almost, If you use Pandora to listen to music, of the versions work under Linux, and
but no. you know how inconvenient it can be if some don’t. Again, hopefully by the time
you accidentally close the browser win- you read this, it will be a moot point.
MyMediaPlayer dow. Several Pandora AIR applications FotoBooth—works under Linux AIR
MyMediaPlayer is an application that exist in the wild, and assuming the 1.1 Beta: yes.
interfaces the hulu.com Web site and actual playback works once AIR is out
makes it easy to navigate and display of beta, this application will be awesome. Almost Equal-Opportunity
hulu videos. It even integrates in the Linux notifica- Development
tion area on the taskbar. Because countless numbers of AIR apps
are available, I’m certain I missed many
that you would appreciate. The best place
to search for new AIR applications is the
Adobe AIR Marketplace (see Resources).
There is a significant chance that
you’ll want to create your own custom
program as well. Fear not, because
Adobe also offers tools that allow devel-
opers to create their very own AIR apps.
Granted, the tools available for Linux
Figure 12. Pandora is a Web application just developers aren’t as robust as those
Figure 11. MyMediaPlayer makes the already- begging to be a standalone app. available for Windows and Macintosh
simple hulu.com even simpler—assuming it users, but the upside is that the Linux
works by the time you read this. As with the other apps that play tools are free—well, at least for now.
back media, Pandora apps don’t quite Folks familiar with the Eclipse IDE
Under the Linux beta of AIR, this work yet. By the time you read this, it can download the free (currently alpha,
application does everything but actually should be an application you won’t currently free, although that might
play the videos. The menu navigation is want to forget. change) Flexbuilder plugin. It interfaces
easier than using the hulu.com Web site, Pandora Desktop—works under with the extremely well-known Eclipse
and I expect it to be a great application Linux AIR 1.1 Beta: almost, but no. program to give Linux users a method

6 8 | march 2009 w w w. l i n u x j o u r n a l . c o m
FEATURE Adobe AIR
Resources

for creating AIR apps. If GUI program- Adobe AIR Linux FAQ: tinyurl.com/airfaq
ming environments don’t impress you,
Adobe AIR Marketplace: tinyurl.com/airmarket
AIR apps also can be created with a
simple text editor. Adobe Flexbuilder Linux Page: labs.adobe.com/technologies/flex/flexbuilder_linux
When you add the simplistic
installation method, the cross-platform Twhirl: www.twhirl.org
homogeny and the availability of (albeit
rudimentary) development tools for Linux, TweetDeck: www.tweetdeck.com
Adobe AIR is a platform that levels the
DestroyFlickr: www.destroytoday.com
playing field a bit for those who prefer
Linux. Most encouraging of all, at least Snackr: www.snackr.net
for me, is that Adobe is paying atten-
tion to Linux in a way that has never Snippage: snippage.gabocorp.com
before been witnessed. And, that kind
Google Analytics Reporting Suite: Available on the Adobe AIR Marketplace (see above)
of Flash really gets my attention.I
Back It!: backit.underplot.com
Shawn Powers is on the editorial staff for Linux Journal, a tech-
nology director for a school district, a dad, a husband and is Remember the Milk Notifier: rtm-notifier.com
beginning to lose his hair. He’s very happy about all but one of
those facts. Reach him via e-mail at shawn@linuxjournal.com. Sam’s Interactive Reader: www.storybookanytime.com

MyMediaPlayer: www.paulyanez.com/labs/mymediaplayer
LJ pays $100 for tech tips we
publish. Send your tip Pandora Desktop: www.pandora.com/desktop
and contact information to
techtips@linuxjournal.com. FotoBooth: tinyurl.com/fotobooth
Innovation Everywhere

The 5th annual MySQL Conference & Expo, co-presented by Sun Microsystems, MySQL and O’Reilly
Media, happening April 20 – 23, 2009 in Santa Clara, CA, brings over 2,000 open source and database
enthusiasts together to harness the power of MySQL and celebrate the huge MySQL ecosystem.

Take advantage of this rare opportunity to meet face to face with a huge core group of engineers who
are in the process of developing MySQL. Share ideas and get your toughest questions answered from
MySQL experts. Bring your team, your laptops, and leave with new insights in how to build high
performance scale-out applications using MySQL.

The quality of the sessions and tutorials at the MySQL Conference & Expo, is very high. Year after year,
the most frequent comment the conference team receives from attendees is that it is sometimes very
difficult to choose which great simultaneous session to attend. From novice to expert-level sessions,
developer to DBA, business to technical, the sessions provide expert insight into solving architectural,
design, and development issues your organization faces.

April 14 –17, 2008


Santa20–23,
APRIL Clara, California
2009
SANTA CLARA, CA

Register Now and Save 15% when you use discount code: mys09lj
www.mysqlconf.com
©2009 O’Reilly Media, Inc. O’Reilly logo is a registered trademark of O’Reilly Media, Inc. All other trademarks are the property of their respective owners. 80608
INDEPTH
The Day the Earth Stood Still
Linux visual effects artists around the world create a new sci-fi classic. ROBIN ROWE

The Day the Earth Stood Still is a particular patch took three days to render.” things a bit harder”, says Cinesite Visual
re-invention of the 1951 science-fiction Effects Producer Ken Dailey, who is based
film classic. Keanu Reeves stars as the Weta Digital in London. “I’d talk to Jeff every day and
benevolent visiting alien Klaatu, come to “Linux is an integral part of what we do make sure he has the right Quicktimes,
Earth to warn us to change our barbaric here at Weta”, says Production Engineering that everyone is looking at the same stuff.
ways or face destruction. Lead Peter Capelluto. “It’s very well suited Time was the biggest challenge. The
Ten years ago, Titanic was the first film for the dynamic needs of the visual-effects reaper shot in New York came very late.
to use Linux in a big way. Today, Linux industry. Our department would have a I think we had three weeks from the time
dominates big-budget visual effects and much more difficult time accomplishing our we got the plates. We shared Maya mod-
3-D animation. Ever since The Matrix, it’s goals with any other operating system.” els with Weta. We sent them our reaper
become routine to have several visual- “Weta predominantly uses Linux for our model and they shared models with us.”
effects companies working on the same workstations and also for our renderfarm “We did about 60 shots”, says Dailey.
film. A visual effects supervisor at the and servers”, says Capelluto. “There are a “We did where Klaatu is being interrogat-
studio, in this case Fox, selects which few applications that require the use of Mac ed, which shows how he can take control
companies will create the visual effects. OS X, Windows and Irix. Whenever possible, of electrical systems. Later in the movie,
we use Linux. The open-source nature of there’s a sequence where the military
Twentieth Century Fox Linux and the many Linux applications decides to attack Gort in Central Park with
“I came in and met with the director Scott are a major advantage. We also prefer it for drones. We had 3-D tanks and explosions.
Derrickson”, says The Day the Earth Stood stability, low cost, access control, multiuser We did the big tilt-down from space at
Still Visual Effects Supervisor Jeffrey A. capabilities, control and flexibility.” the beginning of the movie.”
Okun. “In Scott’s opinion, and one I agree Capelluto’s department develops pipeline “We’re principally using Maya, Shake
with, the day of visual effect as star of the software, such as the digital asset manage- and RenderMan”, says Dailey. “Shake is
movie is gone. He wanted to focus on ment system and the distributed resource running on Linux. Maya is running mostly
story. He wanted spectacular effects management system for their renderfarm. on Windows. We use a bit of Photoshop
that were invisible. When dealing with “We have 500 IBM Blade Servers, on Windows.” Cinesite uses Maya on Linux
spaceships, aliens and giant robots, 2,560 HP BL2x220C Blade Servers and and Windows. However, the range of
that’s a bit of a challenge.” 1,000 workstations”, says Weta Digital available plugins is far greater on Windows.
“Weta was our primary group on the Systems Department Lead Adam Shand. The 3-D painting package MudBox is the
film that did 220 shots on the film”, says “Ubuntu is our primary render and desk- main one. That’s recently been bought by
Okun. “Then Cinesite. We had Flash top distro. We also use CentOS, RHEL Autodesk and may be coming to Linux.
Filmworks and CosFX. Later on we added and Debian.” The workstations are IBM “We have about 80 desktop systems
Hammerhead and Hydraulx, a company and HP. Weta uses NetApp DataOnTap, running Linux”, says Cinesite Senior
called At the Post, and a couple other little NetApp GX, BluArc, Panasas and SGI file Systems Administrator Danny Smith.
companies. Weta handled the Sphere, the servers. Storage is mostly NAS, not SAN. “We have at least a couple hundred render
alien, the robot and the Swarm. It’s all For open-source apps, they use Apache, systems. All of those are IBM Blade systems.
particle systems based on chaos theory. Perl, Python, MySQL, PostgresSQL, Bind, We have about 40 Windows systems as
That means it’s render-intensive.” OpenOffice.org, CUPS, OpenLDAP, Samba, well. Our principal requirement for Windows
“There’s a shot of the Sphere that we Firefox, Thunderbird, Django, Cacti, is Photoshop. There’s no way to run
call the super-sphere shot”, says Okun. Cricket, MRTG and Sun Gridware. Photoshop reliably in its latest release on
“That starts in the swamp and takes you “We’re big fans of open-source code Linux with CrossOver. The main reason for
to various Spheres activating around the here at Weta”, says Capelluto. “We’re utiliz- Photoshop is the color depth—the full 16
world. That took 30 days to render. That’s ing Sun’s Grid Engine for distributed resource bits we require for film work in matte
pretty crazy. It’s around 1,100 frames. It’s management and have helped them fix a painting and dealing with textures.”
an amazing shot. You don’t want to show number of bugs. It’s very powerful to be able “CinePaint was looked at in the past,
it to the director at the end of the day to improve upon open-source software and back when it was Film Gimp”, says Smith.
and have him say, ’That’s not really our to fix any problems you encounter.” “Our biggest problem with it is finding peo-
sphere’...which is what happened. We ple with the skills to use it. People walking
came up with a patch system at Weta Cinesite in the door already know Photoshop. People
Digital where we could render a section “When your supervisor is in New Zealand would be more interested in GIMP or
and patch it over the offending thing. This and your editor is in Los Angeles, it makes CinePaint if it was more like Photoshop. If we

7 2 | march 2009 w w w. l i n u x j o u r n a l . c o m
INDEPTH

could find a tool that reduces our Photoshop


costs, a lot of people would be very happy.
We have 20 or 30 seats of Photoshop.”
“Shake is a product that’s being discon-
tinued”, says Smith. “Even though we’ve
done the site buyout, as soon as Apple
launches a competing product, they have the
right to discontinue our use of Shake. The
likely successor is Nuke. We’re trying to get
people up to speed with Nuke and doing
more and more with it. It takes time to train
people. It’s slowed down our adoption.”
“We mostly run Red Hat Fedora”, says
Smith. “We’re on version 4, migrating to
8. We’ve experimented with SUSE. The The arrival in New York’s Central Park of a giant sphere from another world may have dire
reason to stay with Red Hat is support consequences for our planet. Photo credit: WETA.
from software vendors. We’re paying for
that support, and it’s mission-critical.”
For dailies playback, Cinesite is using
the Windows system Scratch from
Assimilate. Scratch also is being used by
the Avid editors in Los Angeles on the Fox
lot. Smith had the Linux SpecSoft RaveHD
dailies system at his prior company, but
considers the California startup too far
away to support London. Cinesite also uses
FrameCycler on Linux for movie playback.
They have NetApps and Isilon file servers.

Flash Film Works


“We had Flash Filmworks handle a hundred
shots, 3-D helicopters and stuff like that”,
says Okun. Flash Film Works, based in Los
Angeles, has its desktops set up to dual-
boot. “This was one of the rare occasions
where most of the workstations stayed
in Windows”, says Flash Film Works
Technology Chief Dan Novy. “That’s mostly
because we weren’t doing a lot of fluid
dynamics simulations. The renders were Klaatu’s (Keanu Reeves) arrival on Earth via a giant sphere triggers a global upheaval. Photo
80% Windows. I didn’t need the high per- credit: WETA.
formance that I normally use 64-bit Fedora
for. The file servers are all Linux. I have a spe- says Novy. “But, for setting up file servers, I’m day’ that had an automobile factory. They
cialized Shake station that has The Foundry so used to the Red Hat paradigm. We have did the trooper-healing shot.”
Furnace suite on it for doing automation.” one Isilon cluster, a FreeBSD variant. Each “Hammerhead uses Linux for all of our
Even running Windows, they still are node is 1.4TB. I have five nodes and one graphics workstations for our visual-effects
using open-source tools. “Fusion 5 added backup. It’s old, and I’m leaning toward artists, as well as for our render boxes,
Python in addition to its Lua-based Ion BluArc to replace it. We have about 100 and file servers”, says Hammerhead Visual
scripting”, says Novy. “That can do a lot CPUs on the farm and about 50 desktops.” Effects Supervisor Thomas Dadras. “I feel
more automation, getting renders to the Flash Film Works backs up its data to Blu-ray. that Linux is the best possible environment
editor automatically, that sort of thing.” for visual-effects production because it’s so
Fusion recently has become available on Hammerhead incredibly customizable and scalable. We
Linux, but Lightwave is Windows. Flash Film “Hammerhead did a handful of really utilize a full spectrum of in-house scripts,
Works likes Lightwave’s free render nodes. difficult and excellent shots”, says Okun. aliases and environment variables that
A Maya RenderMan node would cost them “They did one really difficult 3-D helicopter enable artists to easily navigate the file
$4,000–$5,000; Mental Ray costs $1,200. with the Secretary of State on it. They did systems for the many shows that we have
“I personally run Ubuntu on my laptops”, a matte painting that was really ’saving the in-house at any given time.”

w w w. l i n u x j o u r n a l . c o m march 2009 | 7 3
INDEPTH

mid-level painting that guys had taken in Iraq of their tanks


stuff—quick texture shooting. It was an amazing reference.”
stuff. We’ve gone “On set, we have a Sphere-On camera
dual-boot on most that lets you take 360-degree HDRI images”,
of our Linux says Strause. “We use these super-high
machines, so model- dynamic images for photometric lighting,
ers and texture trying to re-create how the real light behaves
modelers can run Z- in the real world in our digital environment.
brush and When we have a real tank and a CG tank
Photoshop.” right next to it, we have to use a much fanci-
“We have more er technique to make it all look photo-real.”
than 500TB on the Hydraulx photographed the vehicles at
SAN network”, says a desert location in Los Angeles, then mod-
A massive and seemingly unstoppable alien force destroys a stadium in sec- Strause. “We have eled everything in Maya. Camera tracking
onds. Photo credit: WETA. a Think Logical uses Linux Boujou software, brought into
KVM switch, based Mental Ray for lighting and shading.
Hammerhead uses Maya with on fibre, that will route your monitor, key- “We use digital crowd simulation soft-
RenderMan and Mental Ray for rendering, board, mouse and tablet. You can take any ware called Massive”, says Strause. “We’ve
Shake and Nuke for 2-D compositing and machine in the building—our 25 Inferno written some custom tools that let us get
rotoscoping, Photoshop for texture stations or three big Final Cut Bays—and the stuff into Maya so we can render it in
painting and matte painting, and SynthEyes route it to any other machine in the build- our Mental Ray pipeline. We have soldiers
for 3-D tracking. They’ve internally ing or up into the screening room.” (The with guns and they’re running. The soldiers
developed software for 2-D and 3-D screening room has a 23’-wide screen.) avoid the moving vehicles automatically. It’s
tracking and rotoscoping. “Our sequence takes place where the all done with this neural network.”
“The company size fluctuates between Swarm escapes from a missile silo where “We have a custom version of Piranha
ten to 25 people depending on the amount they were storing Gort”, says Strause. here that we use for all our dailies”, says
of work”, says Dadras. “We currently have “The US military has hundreds of tanks and Strause. “We have it on every single Linux
17 people. We have nine artist desktop- soldiers and missile launchers there in case machine. We have an elaborate database,
Linux workstations, all with dual monitors. something bad happens. The Swarm takes based on MySQL, that’s our shot man-
The capacity of our Isilon server is 17TB. out the whole army. We were able to rent agement and render manager. We can
We also have an older SGI file server, a handful of vehicles...some M-1 Abrams, dynamically build edits. We can take an
about 5TB in size. We currently have 22 some Bradley Fighting Vehicles, a bunch of EDL of an off-line, and whenever people
render blades on our renderfarm.” Hummers with 50-caliber machine guns on mark a new daily that they want to look
“All our workstations and render the top and troop transport trucks.” at in the cut, they can hit View and Cut,
nodes are running on CentOS 5”, says “We had only six to seven weeks to and it will dynamically build off an XML
Hammerhead Systems Administrator Fatima do the entire sequence”, says Strause. file all the different QuickTimes, load
Mojaddidy. Hammerhead has eight Macs “Normally, you’d have three or four months. Piranha and dynamically build the cut. We
that are used by producers and coordina- The other problem we had was matching all use Shake to build the QuickTimes as a
tors for running software such as Filemaker. the Swarm dynamics that Weta did. Each job on our Linux renderfarm.”
A few of the Macs also are used in produc- company has such a unique pipeline, there’s
tion with Photoshop and SynthEyes. very little we can share. We looked at the Conclusion
trailer from Apple.com to figure it out and “Linux is the OS of choice for the film
Hydraulx reverse-engineer their Swarm effects to industry”, says Autodesk Television Industry
“Hydraulx stepped in right near the end”, create them from scratch for our shot.” Manager Bruno Sargeant. “Linux leverages
says Okun. “They did the most amazing “With all the fires in Los Angeles, the processing power of current workstations
job of creating an army out of eight jeeps we couldn’t shoot the weapons”, says and allows Flame and Inferno to reach
and 50 people. They were the only other Strause. “So for all the weapons you see performance previously obtainable only
people on the show to deal with any firing, we had to add CG shell casings, with supercomputers like SGI.”
particle systems stuff.” and we created all the tracers and muzzle Even more important than Linux
“All our workstations, our entire facility flashes with fluid simulations.” are the artists using Linux. “Computers
is now Linux”, says Hydraulx Visual Effects “When a 60-ton tank shoots, it’s going are machines, and they’re no different
Supervisor Colin Strause. “We use Inferno to shake the ground, so all the dust comes from a paintbrush”, says Okun. “It’s the
and Flame, Shake, Maya, Photoshop, a little into the air”, says Strause. “When the artist running the computer who makes
bit of After Effects, Combustion, Synflex for tanks fire, we have all the correct dynamics, the difference.”I
cloth simulations, Real Flow for fluid stuff such as the heavy tank tread jiggling on the
and Massive. Everything after that is our suspension. We went through YouTube, Robin Rowe is a Linux consultant and the project leader of
own custom tools. We use GIMP for doing which is great, and found all these videos CinePaint (www.CinePaint.org).

7 4 | march 2009 w w w. l i n u x j o u r n a l . c o m
INDEPTH

Run Your Own Virtual


Reality with OpenSim
By running OpenSim on your own server, you can create your own virtual world
and even connect it to other virtual worlds. BILL CHILDERS
Last month, I took you on a tour of Second Life and showed here’s how you build OpenSim on Ubuntu 8.04. This set of
you some applications for it besides entertainment. This commands installs Mono and the necessary dependencies and
month, I explain how you can run your own virtual island libraries, gets the latest source from SVN and builds it:
using the Second Life client and the open-source 3-D
application server software called OpenSimulator. OpenSimulator, sudo apt-get install subversion nant mono-gmcs \
or OpenSim for short, is a free (as in speech) implementation libmono-microsoft8.0-cil \
of a virtual world platform, utilizing the Second Life protocols. libmono-system-runtime2.0-cil \
From its FAQ: “OpenSim is a platform for operating a virtual libgdiplus libmono-i18n2.0-cil ruby
world and supports multiple independent regions connecting svn co http://opensimulator.org/svn/opensim/trunk opensim
to a single centralized grid. This is somewhat similar to the cd opensim
Web, where people can run their own Web servers, tied ./runprebuild.sh
together through the Internet. It can also be used to create nant
a private grid, analogous to a private intranet.” In other
words, OpenSim can be like a 3-D Apache server, enabling Once nant finishes running, that’s it. OpenSim is ready to
collaboration, entertainment and business without having be configured and started. OpenSim can run in two modes:
to utilize a centralized service. standalone and grid. Standalone OpenSim servers are islands
You don’t need a beefy machine to run OpenSim. I’ve had unto themselves—self-contained and not dependent on any
a Pentium 4 with 1GB of RAM running a basic island for a lit- separate login managers or services. Grid mode is the more
tle while, and it has supported eight concurrent logins without interesting mode, where multiple islands can be linked
any trouble. If you have a more modern machine, you even together into a cohesive virtual world. Second Life itself is
can run OpenSim locally on the same machine as your Second an example of a bunch of regions running in grid mode,
Life client. I also have tested this configuration on my Core 2 although there are other third-party grids now, such as
Duo-equipped laptop, and it ran quite well. OSGrid, DeepGrid and Openlife Grid.
The client is a much more demanding system than the Before you configure your OpenSim, you need to decide
server is. I hardly notice the server process when running this on the mode in which you will run. I recommend running your
in “all-in-one” mode. As a matter of fact, one machine can first sim in standalone mode to get the hang of the way things
support a number of sims (also known as regions). I have work. Once you understand standalone mode, you can set up
tested up to ten regions on a dual-core machine with 2GB of another sim or convert your standalone sim to a grid-based
RAM. So long as there isn’t crazy activity in one of the regions, sim, and either build your own network of sims or connect
they all have acceptable performance. This is similar to what your sim to another grid altogether, like OSGrid. Configuring
Linden Labs does in its data centers—it runs its “openspace” a grid server is beyond the scope of this article, but there is
regions at four regions per CPU core. excellent documentation at the OpenSimulator Web site.
The folks over at OpenSim say that the best method for Configuring a basic standalone server couldn’t be easier,
getting and running OpenSim is to build it from source, as the server asks you several questions on first startup, and
though they do offer nightly builds. OpenSim is written in C# it builds the opensim.ini configuration file from that.
and runs under Mono on Linux. Due to the high dependency Another decision you need to make prior to configuring
on Mono, I’m assuming you are running Ubuntu 8.04 or 8.10 OpenSim is what database back end you want to run. For
(to get OpenSim running on other distros, please see the Build experimentation and light use in standalone mode, the default
Instructions in the Resources section). Versions of Ubuntu earli- SQLite database is perfect. There are no special configuration
er than 8.04 need to have Mono upgraded at least to version settings to mess with and no external databases to set
1.9.1. (OpenSim will run under the 1.2.6 that ships with up. When you decide to graduate to grid mode, however,
Ubuntu 8.04, but 1.9.1 is preferred for its better memory you probably will want to run the back end on MySQL.
management.) The build process is well documented and Configuring a MySQL back end also is beyond the scope of
straightforward, even for a ham-fisted guy like me. this article, but again, there is great documentation on this
Before you try it, please check the OpenSimulator Build at the OpenSim Web site.
Instructions link in the Resources section of this article, but Let’s get your first OpenSim up and running. All the

7 6 | march 2009 w w w. l i n u x j o u r n a l . c o m
compiled binaries will be in the opensim/bin directory. You -loginpage http://<server IP>:9000/?method=login
either can run OpenSim from there or move them to a directory
of your choice. If you choose to move them, ensure that you In my case, I can log in to my server with the following:
move the files under the opensim/bin directory recursively.
Once you’ve got the binaries in place, you can start OpenSim ./secondlife -loginuri http://192.168.1.140:9000/ \
simply by running mono ./OpenSim.exe from the directory in -loginpage http://192.168.1.140:9000/?method=login
which you put the binaries. Once that command is executed,
OpenSim goes to work, creating a bunch of standard “assets” The client will launch, and you will see a basic HTML screen
and populating the SQLite database. (Figure 1). Input the first and last name of the Master Avatar
Next, you will see a prompt that asks you about the that you specified when configuring the server (see above) and
configuration of your server. It’s actually safe to accept all the the password you specified.
defaults if you just want to play with an OpenSim on the same The client then will log in to the server, and you’ll be on
machine as the client. Note that OpenSim’s default is to listen your own little island! It’s not much to look at, just a little
on loopback (that is, localhost) only. If you don’t put the IP hump in an empty sea, but then again, neither is your avatar.
address of your machine in the external hostname field, you Regardless of how you envision your avatar, all avatars in an
won’t be able to connect to your OpenSim instance from OpenSim deployment start out as one basic shape—the basic
another machine. You definitely will need to deviate from the Linden shape known as Ruth. This is because you have no
defaults if you want to have the client and server on different prepopulated inventory, so you get the generic unisex avatar,
machines. You probably also will want to specify the Master which just happens to look female. Go figure.
Avatar first and last name as something other than the
default. Here’s an example:

21:45:34 - [CONFIG]: Calling Configuration Load Function...


DEFAULT REGION CONFIG: Region Name [OpenSim Test]:
Bill's Place
DEFAULT REGION CONFIG: Grid Location (X Axis) [1000]:
1000
DEFAULT REGION CONFIG: Grid Location (Y Axis) [1000]:
1000
DEFAULT REGION CONFIG: Internal IP Address for
incoming UDP client connections [0.0.0.0]:
0.0.0.0
DEFAULT REGION CONFIG: Internal IP Port for
incoming UDP client connections [9000]: Figure 1. Logging In to My Virtual World
9000
DEFAULT REGION CONFIG: External Host Name [127.0.0.1]: Ruth is sort of ambiguous-looking (Figure 2), but it’s not
192.168.1.140 hard to fix that. By going into the inventory window, right-
DEFAULT REGION CONFIG: First Name of Master Avatar [Test]: clicking on Body Parts, and then clicking on New Body Part—
Bill New Shape, you can create a body shape, then wear it. Once
DEFAULT REGION CONFIG: Last Name of Master Avatar [User]: you wear that shape, you can right-click on your avatar, and
Deere select Edit Appearance. Then, edit that shape to your liking.
DEFAULT REGION CONFIG: (Sandbox Mode Only)Password for Once you get your shape dialed in, you can create basic
Master Avatar account [test]: clothing that’s a little better than what’s provided with Ruth,
password and look as fashionable as I do (Figure 3).
Another thing you may want to do to your island is to
Once you answer these questions, the OpenSim server fin- terraform it. This is done by right-clicking on the ground and
ishes its startup sequence and is ready for you to log in when selecting Edit Terrain. The terraforming dialog comes up, and
you see a Region (root) # : prompt. The OpenSim console from there, you can use the raise land or lower land tools to
allows you to do some basic management and administration change the elevation of certain areas of the parcel. I spent
of the server from this prompt, but the real fun stuff begins about five minutes in the terraforming dialog, and my island
when you fire up a Second Life viewer. The actual virtual world went from the basic little round hump to something that
can be accessed only via the Second Life viewer. Assuming vaguely resembles Pac-Man (Figure 4).
you already have the Second Life viewer and have untarred If you are a seasoned Second Life user, you may go through
it into a directory, you can log in to your server by running a period of shock once you realize there is no prepopulated
the following command: inventory, nor are there any stores to buy goods on your own
private island. Much like Robinson Crusoe, you are going to
./secondlife -loginuri http://<server IP>:9000/ \ have to make anything you want to use or wear on your own

w w w. l i n u x j o u r n a l . c o m march 2009 | 7 7
INDEPTH

Alternative Grids
Some of the alternative grids are very interesting places to
visit if you’re adventurous. One of my favorite places to
check out is OSGrid. OSGrid is a loose confederation of
independent OpenSim operators who have tied their sims
into a cohesive grid. Some of the operators are universities
experimenting with virtual worlds, and others are amateur
enthusiasts or OpenSim developers. Getting onto OSGrid is
easy; simply go to the OSGrid site (see Resources), and
register for a free account. Then, start your Second Life
client with the following command:
Figure 2. What I Looked Like at First
./secondlife -multiple -loginuri http://osgrid.org:8002 \
-loginpage http://osgrid.org/loginscreen.php \
-helperuri http://osgrid.org

Once you log in, feel free to wander about (Figure 5).
There’s lots to see and do, and unlike Second Life, there is
no economy, so you either find and utilize freebie items or
you create your own content. OSGrid is a great sandbox for
builders in Second Life who want to experiment without
upload costs as well.

If you want to try running your own OSGrid-enabled server at


home, you can find instructions on how to join your own server
to OSGrid at the OSGrid Web site. Attaching your own server
to OSGrid is much simpler than running your own private grid,
Figure 3. What I Looked Like after a Makeover because the centralized login and asset servers are maintained
by the OSGrid group. Reserve a spot on the OSGrid map for
your sim and check it out! It’s easier than it looks.

Figure 4. My Island after Its Makeover


Figure 5. Me Stepping Out to OSGrid

island. If you do know LSL scripting in Second Life, you’ll be


glad to know that there is an analog in OpenSimulator as well. more information on this—it’s a great way to jumpstart
The OpenSim folks have implemented about 85% of the LSL into a whole new virtual universe. If you can set up the
scripting language in OpenSim, and they are improving the infrastructure, but have a difficult time creating content,
support for it every day. you may choose this path.
Once your island is up and running, for an added chal- Once you’ve hooked your island into a grid, you can start
lenge, you may want to try connecting your private island to leverage all the shared inventory and assets of other people
to one of the alternative grids that have been set up by who have come before you. Much like Second Life, there are
virtual reality fans. See the Alternative Grids sidebar for stores on the alternative grids where you can get clothes,

7 8 | march 2009 w w w. l i n u x j o u r n a l . c o m
Getting Help
You can get help with your own OpenSim deployment via
various methods. Possibly the most convenient method is the
OpenSim IRC server that you can log in to for help with
running your own server. There is a great FAQ on the
OpenSim site as well. Other great resources are the residents
of OSGrid. Because they all had to connect their sims to
OSGrid themselves, they can be great technical resources.

vehicles, furniture and other goods—and most of it on the


alternative grids is free!
That’s the basics on your own island. At this point, you
can have friends or colleagues log in to your server using the
Second Life client, and you can converse and collaborate.
Explore what you can do with the technology, and have fun
making your own virtual world!I

Bill Childers is an IT Manager in Silicon Valley, where he lives with his wife and two children. He
enjoys Linux far too much and probably should get more sun from time to time. If he ever finds
the time to make it into Second Life, he goes by Bill Deere.

Resources

OpenSimulator: www.opensimulator.org

OpenSimulator Build Instructions: opensimulator.org/


wiki/Build_Instructions

OpenSimulator Configuration Instructions: opensimulator.org/


wiki/Configuration

Connecting to OpenSim: opensimulator.org/wiki/


Connecting

OpenSim Scripting: opensimulator.org/wiki/


Scripting_Documentation

OpenSim IRC Channel: irc://irc.freenode.net/opensim


(#opensim on irc.freenode.net)

Video: How to Run OpenSim on Windows: blip.tv/file/


1421954

Second Life Viewer Download: secondlife.com/support/


downloads.php

OSGrid: www.osgrid.org

DeepGrid: www.deepgrid.org

Openlife Grid: openlifegrid.com


EOF
The Most Personal Device
Today it’s the iPhone. Tomorrow it’s a Linux handheld. DOC SEARLS

Several years ago, I gave my wife a Nokia musical instruments, video game consoles, Yes, it’s closed and controlling and the rest
phone that I hoped would get her to start IP phones, home appliances and other of it. But what matters is the new markets
texting. It was a small phone that twisted devices. But mobile phones were the that open up.
open to expose a qwerty keyboard. I main thing. Amid Access’ literature was Android phones began hitting the
showed her how to use it, and later a poster showing off 219 different streets late last year. They aren’t as slick
sent her a test message. Her reply was “Access-powered mobile phones”. All and easy to use as the iPhone, but that
“no”. She never texted again with that running on Linux, presumably. doesn’t matter. In two years, all current
or any other phone. A couple Access employees greeted models of both will be very old hat. What
Until last December—that’s when she me, and I hit them right away with matters is that Android is Linux-based
got an iPhone. Within days, she was question begged by the iPhone’s success: and an open platform. Those two facts
expert at texting and is still schooling me “How long before the cell phone compa- alone will help accelerate the inevitable
on how to use the iPhone I bought for nies realize they’re running a data system conversion of the cell-phone system to
myself last summer. and not a phone system?” They were the cell-data system.
She calls the iPhone her “laptop taken aback at first, but gave thoughtful Android and other open platforms
replacement”. She still uses a laptop, responses. “It’ll be a long time”, one guy won’t just be media recorders and players,
but its main job is to serve as a wide- said. “But it will happen”, the other guy game machines, phones, musical instru-
screen iPhone that also syncs calendars, said. (See “WiMAXing Linux” on page 16 ments, radios and texting devices. They
apps and podcasts. for more on that.) will become wallets. They will shake
Yes, I know the iPhone is not a Then we started talking about the hands for us and help us do business.
Linux device. But that’s not the point. mobile data business, which in their case They will help us be more of what we
The iPhone is the modern equivalent was supporting development of apps for are, which is human.
of the Apple II. It models the future “Access-powered” phones. I asked if their As creatures, we humans are distin-
and cracks open a vast new territory system supported audio yet. One of the guished not only by our intelligence
for development. guys said no. At this point, I felt comfort- and use of language, but also by two
The iPhone is the first phone that able pulling out my iPhone and showing other remarkable characteristics: our
subordinates telephony to the rest of one app among many that was changing mobility and our expansiveness. We are
what it does, which could be anything. It’s my life: a stream tuner for Internet radio. relatively hairless and walk on two feet
a handheld computing device that hap- It wasn’t perfect, but because of it, my because we are runners. A well-conditioned
pens to do telephony. It’s native to the iPhone had become my main radio. I can adult human can run indefinitely. We
Net, not just to the phone system. And it “tune” in .mp3 streams from anywhere also expand our very selves though the
opens a category that Android and other that has an exposed URL or IP address. I things we invent, hold and manipulate.
Linux-based phones will fill. That category can listen anywhere in the US for however Our senses spread out through our
will have at least these three virtues: 1) it long I like. In cars, I jack it into the AUX clothes, our tools and our tech by a
will be native to the Net, not just the input on the dashboard. Thanks to the process called indwelling. When drivers
phone system; 2) it will be generative— unlimited data deal I have with AT&T, I say “my wheels” or pilots say “my
that is, it will open rather than closed to don’t worry about drinking too many bits. wings”, they mean it personally. The
the possibilities for what can be developed After showing the two guys my perimeters of our selves are not bound
for it; and 3) it will expand the range of iPhone playing a Boston radio station, by our bodies. They extend to include
what individual human beings can do both of them felt comfortable pulling the tech we use. To become expert is
while moving about in the world. iPhones out of their pockets as well. to enlarge ourselves, whether as car-
That last virtue is not shared with My friend Keith Hopper made an penters, drivers, pilots or whatever.
desktops or laptops, because those interesting observation recently. He said There is an evolutionary progression
are mostly limited to what you can do one of Apple’s roles in the world is finding from desk to lap to palm. Apple has done
sitting down. categories where progress is logjammed, us the favor of pointing the way. Our
At LinuxWorld August 2008, and opening things up by coming out job is to follow the path and open the
I went by the Access booth with a single solution that takes care of territory. When we’re done, “desktop”
(www.access-company.com), where everything, from the bottom to the top. and “laptop” will sound as antique as
they were showing off the vast range of Apple did it with graphical computing, “mainframe” and “minicomputer”.I
devices using the company’s Linux devel- with .mp3 players, with on-line music
opment and deployment systems. These sales and now with smartphones. In each Doc Searls is Senior Editor of Linux Journal. He is also a
included mobile phones, PDAs, Internet case, it opens up whole new territories fellow with the Berkman Center for Internet and Society at
terminals, car navigation systems, set-top that can then be settled and expanded by Harvard University and the Center for Information Technology
boxes, business operation terminals, other products, services and companies. and Society at UC Santa Barbara.

8 0 | march 2009 w w w. l i n u x j o u r n a l . c o m

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy