Linux Journal March PDF
Linux Journal March PDF
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
Xfce
An Alternative
Lightweight
Desktop
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
Systems
Systems
FEATURES
48 FAST APP LAUNCHING WITH
GNOME DO
Use GNOME Do and its many plugins to
extend desktop functionality.
Kyle Rankin
58 BROWSER BATTLES:
OPERA, CROSSOVER
CHROMIUM AND FLOCK
Stuck on Firefox? You may find fulfillment in
an alternative browser.
James Gray
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
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
Linux Journal is published by, and is a registered trade name of, Belltown Media, Inc.
PO Box 980985, Houston, TX 77098 USA
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
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.
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
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.
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
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 ]
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.
*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
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!
99 3 mon*ths
Quad-Core
Server
$
199. per month
$
299. 99 3 months
per month
FREE!*
HURRY! Special offer ends February 28th.
$
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
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 });
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
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
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
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
MAXIMIZE YOUR
BUSINESS SUCCESS
UNIFIED COMMUNICATIONS
VolP
SECURITY
DATA CENTERS
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
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.
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
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
$ 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:
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
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”.
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
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 /
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
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
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.
4 2 | march 2009 w w w. l i n u x j o u r n a l . c o m
NEW PRODUCTS
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
$ 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
(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
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
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
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
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.
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:
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
w w w. l i n u x j o u r n a l . c o m march 2009 | 5 5
FEATURE Xfce
Resources
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.
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
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.
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
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
download a JAR file, but that does the average user little www.asacomputers.com www.routerboard.com
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
www.floridalinuxshow.com www.blackhat.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
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.
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.
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
w w w. l i n u x j o u r n a l . c o m march 2009 | 7 3
INDEPTH
7 4 | march 2009 w w w. l i n u x j o u r n a l . c o m
INDEPTH
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:
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.
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.
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
OSGrid: www.osgrid.org
DeepGrid: www.deepgrid.org
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