21.07.2015 Views

Linux Journal | December 2012 | Issue 224 - ACM Digital Library

Linux Journal | December 2012 | Issue 224 - ACM Digital Library

Linux Journal | December 2012 | Issue 224 - ACM Digital Library

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Nexus 7 | Raspberry Pi | GIMP 2.8 | Grive | grsyncEPUB, Kindle, Android, iPhone & iPad editionsFREE TOSUBSCRIBERSA Look atthe NewFeatures inGIMP 2.8Since 1994: The Original Magazine of the <strong>Linux</strong> CommunityDECEMBER <strong>2012</strong> | ISSUE <strong>224</strong> | www.linuxjournal.comBESTofBESTthe<strong>2012</strong>Readers’ChoiceGRIVEthe Open-SourceClient forGoogle DriveGet Started withRaspberry PiREVIEWED:Nexus 7PLUS:Troubleshootinga ColocatedKVM InstanceWEBDEVELOPMENTBook RoundupSCIENTIFICVISUALIZATIONwith NCLTESTING ANDREDIRECTINGstdin, stdout and stderr


visit us at www.siliconmechanics.com or call us toll free at 888-352-1173RACKMOUNT SERVERS STORAGE SOLUTIONS HIGH-PERFORMANCE COMPUTING“ Just becauseit’s badass,doesn’t meanit’s a game.”Pierre, our new Operations Manager,is always looking for the right tools to get morework done in less time. That’s why he respectsNVIDIA ® Tesla ® GPUs: he sees customers returnagain and again for more server productsfeaturing hybrid CPU / GPU computing, like theSilicon Mechanics Hyperform HPCg R2504.v3.We start with your choice of two state-ofthe-artprocessors, for fast, reliable, energyefficientprocessing. Then we add four NVIDIA ®Tesla® GPUs, to dramatically accelerate parallelprocessing for applications like ray tracing andfinite element analysis. Load it up with DDR3memory, and you have herculean capabilitiesand an 80 PLUS Platinum Certified power supply,all in the space of a 4U server.When you partner withSilicon Mechanics, youget more than stellartechnology - you get anExpert like Pierre.Silicon Mechanics and Silicon Mechanics logo are registered trademarks of Silicon Mechanics, Inc. NVIDIA, the NVIDIA logo, and Tesla, are trademarks or registered trademarks of NVIDIA Corporation in the US and other countries.


TrueNAS Storage AppliancesHarness the CloudUnified. Scalable. Flexible.Thanks to the Intel® Xeon® Processor 5600 series and highperformanceflash, every TrueNAS Storage appliance deliversthe utmost in throughput and IOPS.As IT infrastructure becomes increasingly virtualized, effectivestorage has become a critical requirement. iXsystems’ TrueNASStorage appliances offer high-throughput, low-latency backingfor popular virtualization programs such as Hyper-V, VMWare®,and Xen®. TrueNAS hybrid storage technology combinesmemory, NAND flash, and traditional hard disks to dramaticallyreduce the cost of operating a high performance storageinfrastructure. Each TrueNAS appliance can also serve multipletypes of clients simultaneously over both iSCSI and NFS, makingTrueNAS a flexible solution for your enterprise needs.For growing businesses that are consolidating infrastructure,the TrueNAS Pro is a powerful, flexible entry-level storageappliance. iXsystems also offers the TrueNAS Enterprise, whichprovides increased bandwidth, IOPS and storage capacity forresource-intensive applications.Supports iSCSI and NFS exportssimultaneouslyCompatible with popularVirtualization programs suchas Hyper-V, VMware, and Xen128-bit ZFS file system with upto triple parity software RAIDCall 1-855-GREP-4-IX, or go to www.iXsystems.comTrueNAS Pro Features• One Six-Core Intel® Xeon® Processor5600 Series• High Performance Write Cache• Up to 480GB MLC SSD Cache• Up to 220 TB SATA Capacity• Quad Gigabit Ethernet• 48GB ECC MemoryTrueNAS Enterprise Features• Two Six-Core Intel® Xeon® Processors5600 Series• Extreme Performance Write Cache• Up to 1.2TB High Performance ioMemory• Up to 500TB SATA or 320TB SAS Capacity• Dual Ten Gigabit Ethernet• 96GB ECC MemoryIntel, the Intel logo, and Xeon Inside are trademarks or registered trademarks of Intel Corporation in the U.S. and other countries.


letters@steven orr:They FixedfindRegardingSteven Orr’sletter in theSeptember<strong>2012</strong> issue:a fewmonths ago,I happenedto be looking at the find man pageand discovered they fixed -exec. Ifyou use the old format, it’s still broken.However, if you end the command witha + instead of an escaped semicolon, itworks correctly. They’ve also added anaction -execdir, which behaves exactlylike exec, except it’ll chdir to thedirectory the file is in. If you’ve ended thecommand it’s exec-ing with a +, it will runone copy of it per directory containingmatching files. The man page didn’t saywhat it does about excessive numbers ofmatches, but I haven’t run into any issuesyet. I’m pretty sure I’ve at least come nearthe pertinent limits, but I’m not certainI’ve actually crossed them yet.In other news, if you use zsh, and turnon the extendedglob option, you canmostly do away with find, so long asyou’re willing to go with some line noise.That being said, sometimes, I partiallyagree with Dave Taylor about the legibilityissue, so I go with a find | while { read file } { do stuff }approach. (For those of you who usebash, that’s basically find | while read file; do; do stuff;done, except.) As an old C programmer,I find it more legible, as well as easierto type (zsh takes either form).—Ed GrimmArchiving Conceptual SoftwareEngineering Designs for ReuseI work as a software engineer, butI’m studying mechanical engineering.In mechanical engineering, weoften represent systems in a simpleblackbox input/output diagram. Whenwe break the system down further,we create subsystems that also areinterconnected blackboxes with cleardefinitions of inputs and outputs.Some mechanical engineering designresearchers are trying to represent thesesystems (which preform functions)in a standardized way so that theconceptual design of the product canbe systematically archived. This alsoallows a computer to try to make newdesigns by matching up inputs withoutputs. For example, let’s say the input10 / DECEMBER <strong>2012</strong> / WWW.LINUXJOURNAL.COM


[ LETTERS ]That’s quite annoying. Otherwise,the content is perfect.—Klaus KolleKlaus, that isn’t normal. Somethingmust be going wrong. Perhaps trydeleting the app and removing itsdata, then re-installing it and seeif that helps. Sorry it’s been actingup on you. I agree, that would befrustrating!—Ed.Bash Notational Shortcuts, IIIIn Dave Taylor’s September Work theShell column, he wrote: “Drop me anote and tell me if you would preferus publishing sample scripts with all ofthese notational tricks, even at the riskof broad portability across environmentsand systems, or do you prefer more“standard” old-school scriptingtechniques that will even work on thatclunky old server you administer?”My short answer: please publishsample scripts “with all of thesenotational tricks”.My longer answer: as a 30-year veteranof writing shell programs (why demeana program written in a particularlanguage by calling it a “script?”) inC shell, Bourne, Korn, Bash and others,I think it is important to demonstrateclear, concise and efficient solutions toproblems. The last is best accomplishedin a shell programming language byemploying built-ins, so long as they arenot obfuscated.In closing, the first programminglanguage I used (8th grade) was APL.I wrote ray tracing code for opticalsystem design and loved it. However,I agree. Although APL is semanticallydense, it is the closest to a write-onlylanguage ever invented!Keep up the good work Dave.—Andrew PizialiAndroid Reader Makes Puppies CryI really enjoy your magazine andunderstand why it went digital.However, the Android reader app,especially on the Nexus 7, brings me nojoy. It crashes often, has trouble workingover Bluetooth networks on the Nexus7, and sometimes it gets stuck whiledownloading, and pages end up missing.It’s also quite slow. I have been grabbingthe PDFs, but having a central reader asintended would be nice.Anyhoo, hope it gets fixed soon.—KwanWWW.LINUXJOURNAL.COM / DECEMBER <strong>2012</strong> / 13


[ LETTERS ]I don’t necessarily read an issue themoment it arrives, but I do load themon my NOOK regularly. I read themwhen I have a block of uninterruptedtime—like an 11-hour flight homefrom Europe, when I read the August,September and October issuescover to cover. I never would haveconsidered taking the print editionswith me.I have decided that a 10" tablet isin my future (primarily for readingmagazines), and I second the requestsfor a user survey and perhaps a buyersguide article for tablets.I also would like an easier way todownload an issue. Right now Idownload it, add it to Calibre andthen sync my device to Calibre. Mypreferred method would be a Calibreplug-in/news recipe that downloadsnew issues automatically wheneverI start Calibre and sync my NOOK.I would love to have access to backissues in .epub format, but I realizethat this is a pretty big challenge andnot likely to happen.Thanks for publishing a great magazine.—Bruce MooreI’m happy to see you’re enjoyingthe digital edition. I think there aresome serious contenders for “goodtablet” now, so perhaps a buyer’sguide makes sense. We’ll have to seewhat we can come up with.As far as getting it on the device,in previous Letters sections,readers sent in a few scripts forautomatically sucking it off thee-mail link. If you combine thatwith Calibre’s e-mail feature, Iknow the process is pretty simplefor Kindle for reading as a personaldocument. I’m not sure if theNOOK has a similar e-mail featureor not, but it’s worth checkinginto. Usually, I just store my .epubsin my Dropbox and locate themwith the Dropbox app on myAndroid device.Hopefully something will work wellfor your NOOK. Oh, and for backissues, you do have access to all thedigital issues as a subscriber, butindeed they don’t go all the wayback to the beginning.Kyle’s Raspberry Pi Beer FridgeSuggestion (Part 2)Just an addition to my letter in theWWW.LINUXJOURNAL.COM / DECEMBER <strong>2012</strong> / 15


[ UPFRONT ]Scientific Visualizationwith NCLMany of my previous articles havelooked at software packages that doscientific calculations and generatescientific results. But, columns ofnumbers are nearly impossible tomake sense of—at least, by regularhuman beings. So what can youdo? The answer is visualization. Wedo massive amounts of processingvisually, and the easiest way for us toreview information is through somegraphical format. Because of thepower of graphical representations,several packages have been writtenby different groups. In this article, I’mlooking at NCL (the NCAR CommandLanguage, http://www.ncl.ucar.edu).NCAR is the National Center forAtmospheric Research, where theComputational and InformationSystems Laboratory develops NCL.NCL is an interpreted languagedesigned specifically for data analysisand visualization. It supports severaldifferent file formats used in scientificcomputations, and it also providesseveral data analysis functions built-in.NCL is available as both source codeand precompiled binaries. These arehosted at the Earth System Grid Web site(http://www.earthsystemgrid.org).The first step is to get an accounton the Earth System Grid site. Onceyour registration is complete, you candownload either the source code or thebinaries for the system that interestsyou. The binaries are packaged astarballs, and they have been compiledfor both Debian-based and Red Hatbasedsystems. You can select between32-bit and 64-bit binaries. Once youhave the correct tarball downloaded,you can unpack it in the directory ofyour choice. The usual place on UNIXsystems is /usr/local, but you are freeto place it anywhere on your system.After unpacking, you need to setseveral environment variables beforeactually using NCL. The first is theenvironment variable NCARG_ROOT.You need to set this to the parentdirectory containing the NCLexecutables and libraries. For example,if you unpack NCL in /usr/local, youwould set NCARG_ROOT=/usr/local.You also need to add the locationof the NCL executables to your path.In this example, you would add$NCARG_ROOT/bin or /usr/local/binto the PATH environment variable. You22 / DECEMBER <strong>2012</strong> / WWW.LINUXJOURNAL.COM


[ UPFRONT ]also need to create a configurationfile in your home directory, named.hluresfile. This file will holdconfiguration options like the defaultfont and the default color table.Once everything is set up, youquickly can test whether NCL isworking correctly by running:ng4ex gsun01nThis command copies an NCL scriptfile named gsun01n.ncl into yourcurrent working directory and runsit through NCL to produce somegraphical output.If you decide to build NCL fromsource, you need to install a number ofextra libraries to handle all the possibleinput file formats, as well as all thepossible output graphics formats.A full set of instructions is availableat http://www.ncl.ucar.edu/Download/build_from_src.shtml.It is strongly advised that youtry to use the prebuilt binariesfirst, before going through all thework involved in building NCLfrom scratch.Now that NCL is installed and readyto use, what can you actually do withit? If you enter the command ncl,you will get a prompt where youcan enter commands. Entering thefollowing command tells NCL to startrecording the commands you issue inyour current NCL session:record "my_script.ncl"When you are done, type stoprecord to tell NCL to stop recordingyour session. At this point, you willhave an NCL script that you can reuselater, if you wish.Once you have your NCL script,you can run it through NCL withthe command:ncl


[ UPFRONT ]X11 window, an NCAR ComputerGraphics Metafile or a PostScriptfile. This second group is dataobjects. Data objects store theactual information used in youranalysis and graphical presentation.The third group is the view objects,which represent the elements ofyour graphical representation. Thesemight be things like text objects,tick marks or contour plots, amongothers. The fourth is the group of“other” objects, which includeseverything else, such as overlays orannotations. You can create newobjects by using the commands:objectname = create "object_character_name"➥class_name parent_objectend createwhere you create a new object basedoff an existing parent object.So, what does a basic graphical displaylook like? You can generate somethingsimple with the following example:beginx11 = create "x11" xWorkstationClass defaultappend createtext = create "text" textItemClass x11end createdraw(text)frame(x11)endSave these commands into a filenamed sample1.ncl. To run it, youcan execute ncl


[ UPFRONT ]array1(0:63) = file_data(0:63)Graphing is a bit more complex.The first step is to create a dataobject that will store the values tobe graphed. For example, you coulduse something like this:field1 = create "field1" coordArraysClass defaultapp"caYArray": (Y-data)"caXArray": (X-data)end createwhere you would replace X-dataand Y-data with the actual dataarrays you want to use. Once thisis done, you actually can do thegraphing with:xy_plot = create "xy_plot" xyPlotClass wks"xyCoordData": field1end createdraw(xy_plot)frame(wks)This creates an xy_plot object,based on the data you importedinto NCL. Next you need to run theReadLINUX JOURNALon yourAndroid deviceDownload the appnow in theAndroidMarketplace.www.linuxjournal.com/androidFor more information about advertising opportunities within <strong>Linux</strong> <strong>Journal</strong> iPhone, iPad andAndroid apps, contact Rebecca Cassity at +1-713-344-1956 x2 or ads@linuxjournal.com.


[ EDITORS' CHOICE ]SSH tunneling support, delta-onlysynchronization, speed, versatility, andquite frankly, it’s just a great program. Ithas everything—except a GUI.Don’t get me wrong; rsync worksgreat without a GUI. I use it on thecommand line almost daily. The problemwith rsync’s amazing power is a rathercomplex set of arguments. It’s possible tolearn those flags, but for the neophyteuser, they can be overwhelming. That’swhere Grsync really shines.Grsync does a great job of turningcountless command-line options intoa manageable collection of checkboxes and text-entry areas. When youadd the nifty “sessions” feature thatremembers settings along with sourceand destinations, it turns into the perfectfilesystem sync tool. If you’ve ever feltrsync was powerful but too complexto use on a regular basis, I highlyrecommend Grsync. For making such apowerful tool accessible to the unwashedmasses, Grsync gets this month’s Editors’Choice Award. Now go copy some files!See http://grsync.sourceforge.net.—SHAWN POWERS<strong>Linux</strong> JournaLon youre-ReaderCustomizedKindle and Nookeditionsnow availablee-ReadereditionsFREEfor SubscribersLEARN MORE


COLUMNSAT THE FORGE<strong>2012</strong> BookRoundupREUVEN M.LERNERWhat has Reuven been reading? And, what should you bereading? It’s time to review this year’s crop of technical books.Once again, I’m dedicating my<strong>December</strong> <strong>2012</strong> column to a review ofthe latest books (and other resources)that I’ve found interesting, useful orjust entertaining during the past year.It continues to amaze me that despitethe state of the global economy ingeneral, and of publishing in particular,we continue to enjoy a large numberof high-quality technology-relatedbooks each year. A growing numberof these books are being produced ase-books, rather than printed copies,and many of them are being producedby independent authors and smallpublishers, rather than the moreestablishednames in the publishingbusiness. By paying attention to blogs,forums and technology podcasts, youcan learn about these independentpublications, which often are both lowin price and high in quality. (Of course,there also are some for which I’ve paidthat turned out to be not nearly asgood as I had hoped.)RubyI spend a large part of my timedeveloping software (as opposedto consulting or training); thus, I’malways interested in improving mytechniques, learning more about thetechnologies I use on a day-to-day basisand incorporating the latest ideas intomy work. My first-choice programminglanguage continues to be Ruby, alongwith the Ruby on Rails framework.For that reason, I’m happy to see thatthe number of resources for Rubyprogrammers continues to grow. Onceagain, The Pragmatic Programmers haveled the way with a good number ofRuby-related titles.Several years ago, The PragmaticProgrammers came out with a bookcalled Rails Recipes, which containedall sorts of interesting, bite-size ideas,suggestions and practical solutions forRails developers. This year, The PragmaticProgrammers released Rails Recipes: Rails3 Edition, which brings the book into30 / DECEMBER <strong>2012</strong> / WWW.LINUXJOURNAL.COM


COLUMNSAT THE FORGEmost widely deployed programmingenvironment in the world, given theincredibly large number of browsersthat ship with it, on computers of allshapes, sizes and makes. I still haveissues with the JavaScript language,but there’s no avoiding its use in themodern Web era, and there are manyadd-ons and frameworks that make itsuse more palatable.I was pleasantly surprised to see thatO’Reilly has released a new version ofDavid Flanagan’s classic book, JavaScript:The Definitive Reference. I have had acopy, physical or virtual, of this bookon my shelf since its first edition wasreleased, and although the physicalbook has become almost unmanageablylarge at more than 1,000 pages, thecontent continues to be useful. The bookhas been updated to include some ofthe latest trends and libraries in the|JavaScript world, including jQuery, HTML5(including such items as client-sidestorage and Web sockets) and node.js.It’s nice to know that I can continueto rely on Flanagan’s clear writing toteach (and just remind) me of aspectsof JavaScript that I need to know.I often tell students in my classes thatthe problem with programming todayis not the development, but ratherthe maintenance. JavaScript, with itsextremely loose structure and lack ofbuilt-in systems for modular code,makes it even easier for problems tooccur. Thus, I was happy to see thebook Maintainable JavaScript, writtenby Nicholas C. Zakas and publishedby O’Reilly. Many of the thingsthat Zakas writes are obvious toexperienced JavaScript programmers,such as the fact that you can useeither single or double quotationmarks to define strings.What is more useful and impressiveis his collection of facts about styleguides and the implications of yourchoices—contrasting, for example, thejQuery style guide (which prefers doublequotation marks) and the Google styleguide (which suggests single quotationmarks). I wish this book had included amention of CommonJS, which offers astandardized system for modularizingand deploying JavaScript, an importantaspect of maintainable code. I alsosee this book as complementary toCrockford’s small but excellent book,JavaScript: The Good Parts, whichwas released a few years ago but stillcontains very useful information.A new series written byRails-veteran Noel Rappin andindependently published at his site(http://www.noelrappin.com)attempts to introduce developers toJavaScript development, including theuse of Backbone, CoffeeScript andtest-first development (TDD). The series32 / DECEMBER <strong>2012</strong> / WWW.LINUXJOURNAL.COM


COLUMNSAT THE FORGEensure smooth usage.If you already are familiar withHTML5, but (like me) still are learninghow to work with mobile devices,O’Reilly’s Head First Mobile Web,written by Lyza Danger Gardner andJason Grigsby, might fit the bill.Like other volumes in the “HeadFirst” series, this book aims at deepunderstanding, rather than teachingyou a great many things. So youshouldn’t expect to come awayfrom this book an expert in mobileWeb application development, butyou should come away with a goodunderstanding of how to design a sitesuch that it’s appropriate for use withmobile devices.Although I love Ruby (and Rails), I’mstarting to look into a number of otherlanguages, some of which I will explorein these pages during the coming year.One language I definitely want tospend more time learning and workingwith is Erlang, in which creating newprocesses is as fundamental, safeand easy as allocating a new string.Zach Kessin’s book Building WebApplications with Erlang, publishedby O’Reilly, is an eye-openingintroduction to the language and itsuse as a Web back end for massivelyscalable applications.I must also mention R, a languagedesigned for statistical work that I’mfinding is increasingly in demand.The Art of R Programming, written byNorman Matloff and published by NoStarch Press, is a great introductionto R as a programming language, notjust for statistical programming. TheR Cookbook, published by O’Reillyand written by Paul Teetor, is notablefor the large number of basic andadvanced techniques, presentedclearly and without too much text orbackground, for aspiring R hackers.And although it’s not aprograming language, I’m startingto understand and use tmux(http://tmux.sourceforge.net), analternative to GNU Screen that isgaining many fans. tmux: ProductiveMouse-Free Development, publishedby The Pragmatic Programmers andwritten by Brian P. Hogan, is shortand practical, and really got me toappreciate how great this tool isand how much I need to use it evenmore in my work.DatabasesReaders of this column know I’m abig fan of PostgreSQL, which not onlycontinues to be an excellent database,but also a great example of a well-runopen-source project. However, as aconsultant asked to work on a varietyof different systems and platforms, andas someone who tries to apply the best34 / DECEMBER <strong>2012</strong> / WWW.LINUXJOURNAL.COM


COLUMNSAT THE FORGEWeekly” (http://rubyweekly.com),“JavaScript Weekly”(http://javascriptweekly.com),“StatusCode” (http://statuscode.org),“Python Weekly”(http://www.pythonweekly.com)and “Freelancing Weekly”(http://freelancingweekly.com).I don’t really read all of the linksthey present, but that’s sort of thepoint. There’s no way I would havetime to find all of these links, letalone read them, on my own.Other BooksThere’s not much room left for me torecommend my favorite non-computerbooks of the year. I was very excitedto teach a Ruby class in Beijing in June<strong>2012</strong>, and I prepared for that trip inpart by reading some books. I alreadyhad recommended Peter Hessler’sCountry Driving, so it made sense forme to read (and now recommend)his two other books, Oracle Bonesand River Town, both of which wereas fascinating and deep as they werefunny. I also read Postcards fromTomorrow Square by James Fallowsand Dreaming in Chinese by DeborahFallows; I didn’t think that they werequite as strong as the Hessler books,but I still enjoyed them a great deal.I also managed to learn a bitof Mandarin through ChinesePod(http://chinesepod.com), whichnot only helped me learn some ofthe language and customs, butalso provided my children withhours of entertainment (or torture)as they listened to their father tryingto mimic the sounds.When I was younger, I thoroughlyenjoyed Raymond Smullyan’s writing,a logician and mathematician whowrote some great books of logicpuzzles. I decided to get two of hisbooks for my children to enjoy withme, and although I perhaps wore outmy welcome with an overdose, we allenjoyed thinking through the puzzlesin What is the Name of this Book?Finally, if you’re interested inunderstanding a bit about how thebrain works and allows us to followsuch puzzles, Thinking, Fast andSlow by Daniel Kahneman has beena pleasure to read, not only becauseof his insightful descriptions ofhow people think, but also for hisdescriptions of many great psychologyexperiments through the years, thedesigns of which are as interesting tome as the results they provided.■Reuven M. Lerner is a longtime Web developer, consultantand trainer. He is also finishing a PhD in learning sciences atNorthwestern University. His latest project, SaveMyWebApp.com,went live this spring. Reuven lives with his wife and children inModi’in, Israel. You can reach him at reuven@lerner.co.il.WWW.LINUXJOURNAL.COM / DECEMBER <strong>2012</strong> / 37


COLUMNSWORK THE SHELLWorking withStdin and StdoutDAVE TAYLORTesting and redirecting stdin, stdout and stderr can be complicatedwithin a shell script. Dave digs in and shows you how to changeyour redirects even halfway through running a script.Last month, I erroneously titledmy column as “SIGALRM Timers andStdin Analysis”. It turned out thatby the time I’d finished writing it, Ihad spent a lot of time talking aboutSIGALRM and how to set up timers toavoid scripts that hang forever, butI never actually got to the topic ofstdin analysis. Oops.So this month, let’s start with thattopic. The behavior to emulate hereis something a lot of utilities dowithout you paying much attention:they behave differently if their inputor output is a pipe or file than theydo when it’s stdin (the keyboard) orstdout (the screen). Try ls versusls|cat to see what I mean.The test command has a helpfulflag in this regard: -t. From theman page:True if the file whose file descriptor number isfile_descriptor is open and is associated with a terminal.Worth knowing is that filedescriptor #0 is stdin; #1 is stdout,and #2 is stderr (pronounced“standard in”, “standard out” and“standard error”, respectively). That’swhy using >& to redirect by filedescriptors works with 2>&1 to causeerror messages to go to stdout justlike regular output messages.Back to the topic though. In practice,the -t test can be used like this:#!/bin/shif [ -t 0 ]; thenecho script running interactivelyelseecho stdin coming from a pipe or filefiIt’s easy to test:$ sh inter.shscript running interactively$ sh inter.sh < inter.sh38 / DECEMBER <strong>2012</strong> / WWW.LINUXJOURNAL.COM


COLUMNSWORK THE SHELLNow, what about identifying if the output is aninteractive terminal, file or pipe?stdin coming from a pipe or file$ cat inter.sh | sh inter.shstdin coming from a pipe or filePerfect. Now, what aboutidentifying if the output is aninteractive terminal, file or pipe?It turns out that you can use thesame basic test, just replace thefile ID 0 with #1:if [ -t 1 ] ; thenecho output going to the screenelsefiecho output redirected to a file or pipeThe results:$ sh inter.shscript running interactivelyoutput going to the screen$ sh inter.sh | catscript running interactivelyoutput redirected to a file or pipe$ sh inter.sh > output.txt$ cat output.txtscript running interactivelyoutput redirected to a file or pipePretty cool, actually.Let’s back up a bit and have anotherlook at file redirection before leavingthis topic, however.I already talked about the commontrick of 2>&1 to redirect stderrto stdout—something that’s veryhelpful on the command line. Youalso can redirect specific lines ofoutput in a shell script to stderr, soyour error messages are sent to thescreen even if stdout is being sent toa pipe or file:echo Error: this is an error message >&2But, what if you want to haveyour script force stdout to a specifictarget regardless of what someonedoes on the command line? It canbe done—of course—although itinvolves a very different approach:the use of the exec command.At its most basic, the exec call islike a subshell invocation (which isreally what happens each time youinvoke any system command like lsor fmt), but it’s the existing shellthat’s replaced with the specifiedcommand, effectively killing thecurrent process. If you have a shellscript that sets up specific parametersWWW.LINUXJOURNAL.COM / DECEMBER <strong>2012</strong> / 39


COLUMNSWORK THE SHELLfor an external call, for example, youcould end it with:exec $cmd $argsecho This is still stdout but goes elsewhereecho but where does this go\? >&2exec dateecho this script is kaputand anything you might have after thatpoint in the original script is jettisonedbecause the script is no longer running,it’s replaced by $command.But exec actually is more nuancedthan that, and in particular, a quirkof its behavior gives the solution weseek: exec replaces all the currentassignments for stdin, stdout andstderr with those specified as part ofthe invocation.So here’s the solution, redirectingstdout to a file:exec > output.txtIn practice, you can see how itworks with this snippet:echo This is stdoutexec > output.txtecho This is still stdout but goes elsewhereLet’s actually put a few differentthings together in this script so youcan see how this all works together:echo this goes to stdoutecho and this goes to stderr >&2exec > output.txtHere’s what happens when you runthe program:$ sh test.shthis goes to stdoutand this goes to stderrbut where does this go?But, what’s actually in output.txt?$ cat output.txtThis is still stdout, but itgoes elsewhere:Sun Oct 7 10:29:56 MDT <strong>2012</strong>Interesting. Notice that, as expected,“this script is kaput” never shows upbecause once the exec invokes anexternal program (in this case, date),the script itself is done, because itsprocess has been replaced with thedate program.Notice that the exec redirected onlystdout, so that the error message atthe very end still goes to the screen.Want to have both stdout and stderrredirected to the file? It’s literally aone-character change! Instead of the40 / DECEMBER <strong>2012</strong> / WWW.LINUXJOURNAL.COM


COLUMNSWORK THE SHELLWant to have both stdout and stderr redirected tothe file? It’s literally a one-character change!above exec redirect, use this:exec &> output.txtThat’s easy enough, isn’t it?Now, what about the oppositesituation where the user hasredirected stdout to a file, but you stillwant it to go to the screen anyway?That’s done with yet another sequenceon the exec invocation: 1>&2, whichredirects stdout to stderr.Let’s look at the same script as above,with exec 1>&2. Here’s what happens:$ sh test2.sh > /dev/nulland this goes to stderrThis is still stdout but goes elsewherebut where does this go?Sun Oct 7 10:47:44 MDT <strong>2012</strong>Frazier wrote about similar topicsin <strong>Linux</strong> <strong>Journal</strong>’s Upfront section,during 2010, but his approach wasconsiderably more complicated thanmine. Sorry Mitch!■Dave Taylor has been hacking shell scripts for more than30 years. Really. He’s the author of the popular Wicked CoolShell Scripts and can be found on Twitter as @DaveTaylorand more generally at http://www.DaveTaylorOnline.com.New on<strong>Linux</strong><strong>Journal</strong>.com,the White Paper<strong>Library</strong>Pretty cool, eh?That’s it for this month. As always,if you have any interesting scriptingprojects, challenges or ideas, drop me anote via http://www.linuxjournal.com/contact, and I’ll have a look. Input alwaysis welcome!Also, if you have an extraordinarymemory, you might recall that Mitchwww.linuxjournal.com/whitepapersWWW.LINUXJOURNAL.COM / DECEMBER <strong>2012</strong> / 41


COLUMNSHACK AND /Home,My BackupData CenterKYLE RANKINWhen Kyle’s colocated KVM instance won’t boot, he has topull out every troubleshooting trick to get his most valuableserver back on-line.New <strong>Linux</strong> users often ask me“what is the best way to learnabout <strong>Linux</strong>?” My advice alwayscomes down to this: install and use<strong>Linux</strong> (any distribution will do butsomething stable works better),and play around with it. Inevitably,you will break something, and theninstead of re-installing, force yourselfto fix what you broke. That’s myadvice, because I’ve personally learnedmore about <strong>Linux</strong> by fixing my ownproblems than just about any otherway. After years of doing this, youstart to build confidence in your<strong>Linux</strong> troubleshooting skills, so thatno matter what problem comes yourway, you figure if you work at it longenough, you can solve it.That confidence was put to the testrecently when I had a problem witha KVM host. After a power outage,it refused to boot a virtual machinethat was my primary personal serverfor just about everything. In thisarticle, I walk through a problem thatalmost had me stumped and showhow I was able to find a solution in anunorthodox place (at least for me).The SetupBefore I dive too deep into myproblem, it would help to understandmy setup. Although I do haveservers at home, my primary server iscolocated in a data center. I share theserver with a friend, so the physicalserver simply acts as a secured KVMhost, and I split the server’s RAMand CPU across two virtual machines50/50. All of my most importantservices from my primary DNS server42 / DECEMBER <strong>2012</strong> / WWW.LINUXJOURNAL.COM


COLUMNSHACK AND /and e-mail for me and my immediatefamily, a number of different Websites and blogs, and even my mainIrssi session sits on one of those twoVMs. I end up hosting secondaryDNS and e-mail from a server onmy home connection, but due to aone-megabit upstream connection, Idon’t host much else at home for theoutside world.One day (while a relative happenedto be visiting from out of town), Inoticed that both my main server andthe physical server that was hostingit were unavailable. I notified mycontact at the data center, and itended up being an accidental poweroutage that affected my cabinet. Iwas taking my relative out to thecoast for the day, far away fromdecent cell-phone reception. So,since there wasn’t much I could do, Iassumed that long before I got backinto town that afternoon, powerwould be restored, and other thanlosing over a year’s uptime, I wouldbe back up and running.Everything but the SyncThe first time I knew there was a realproblem was when I got back intotown and my main server still wasdown. I could log in to the physicalhost, however; so at first I wasn’t tooworried. After all, I had seen KVMinstances not recover from a physicalhost reboot before. In the past, it waseither from not setting a VM to startat boot or sometimes even a waywardlibvirt apparmor profile that got inthe way. Usually once I logged in tothe physical host, I could change anybad settings, disable any troublesomeapparmor module, then manuallylaunch my VM with virsh. This timewas different.When my VM wouldn’t bootmanually, I was ready to blameAppArmor. It had blocked VMs frombooting in the past, but this time,neither setting the libvirtd AppArmormodule to complain mode, disablingall AppArmor modules nor evenforcefully stopping AppArmor seemedto help. I even resorted to rebootingthe physical host to heed AppArmor’swarning that forcibly stopping itafter it was running may cause somemodules to misbehave. Nothinghelped. When I connected a consoleto the VM as it booted, I startedseeing initial kernel errors as thoughit was having trouble mounting theroot filesystem. Great. Did the poweroutage corrupt my data?The next step in the troubleshootingprocess was to attempt to bootfrom a rescue disk. With KVM, it’srelatively easy to add a local ISOimage as though it were a CD-ROM.WWW.LINUXJOURNAL.COM / DECEMBER <strong>2012</strong> / 43


COLUMNSHACK AND /So after not much effort, I discoveredI could, in fact, boot a rescue disk andconfirmed from the rescue disk I couldmount my VM’s drives, and the datadid not seem corrupted. So then whywouldn’t it boot? After I ran a manualfsck from the rescue disk, I attemptedto reload GRUB, and that was whenI got my first strange clue about thenature of the problem—even fromthe rescue disk, I wasn’t able to writeto the filesystem reliably. I wouldget virtual ATA resets, even though Iseemed to be able to read fine.So, I assumed I had some level ofcorruption with that particular VM,but because my data wasn’t affected,I figured in the worst case, I couldspawn a fresh VM and migrate thedata over. So, that’s what I tried nextusing the ubuntu-vm-builder wrapperscript I used previously to build myVM. The VM seemed to spawn fine;however, once again, even this brandnewVM refused to boot properly andhad the same strange disk errors.It was at this point that mytroubleshooting steps start to geta bit hazy, because I starting tryingmore desperate things. I booteddifferent kernel versions in GRUB(after all, the kernel had beenupdated a few times in the year theserver had been up). I audited allof the filesystem permissions onmy VM disk images, and I tried tolaunch the VMs as root just in case.I even tried converting one VM’s disksfrom qcow2 to raw with no results.Even Web searches came up empty.This server had been down longerthan it ever had before, and I wasstarting to run out of options.The SyncMy first break came when I decided tocopy the VM I had just spawned overto almost identical hardware I had athome with the same distribution andsee if I could reproduce the problemthere. I picked the new host simplybecause since qcow2 filesystems growon demand, it happened to have thesmallest disks and was the fastestto sync over. The process was prettystraightforward. First I exported thatKVM instance’s configuration XML filewith virsh on the colocated host:$ virsh dumpxml test1.example.net > test1.example.net.xmlThen I copied that XML file to myhome server, created a local directorynamed after this VM to store its diskimages and synced them over fromthe physical host:$ mkdir test1.example.net$ rsync -avx --progress remotehost:/var/lib/libvirt/➥images/test1.example.nett/est1.example.net/44 / DECEMBER <strong>2012</strong> / WWW.LINUXJOURNAL.COM


COLUMNSHACK AND /The Sync BackWell, we were almost back inbusiness. See, I had been using thatserver at home for a number ofdays now, and between the e-mail,blogs and other services, it had alot of new data on it. This meant Icouldn’t just start up the image thatwas already on the colocated server.I had to sync up the changes frommy home server.The real trick to this was that Icouldn’t just sync the server hot. Forone, the disk would be changing allthe time, and two, I didn’t want torisk having the same server running inweird states on two different physicalhosts. This meant syncing the actualdisk images. The problem was thatwhile the 45GB disk images synced tomy house relatively quickly over my12Mb-downstream (plus the serverwas already down at the time, sodowntime wasn’t a consideration),syncing the same data up with my1Mb upstream was going to take along time—too long for a pure coldsync to be a solution, as I just couldn’thave that much downtime.The solution here was going to betwo-fold, and it was based on a fewassumptions I could make:n Although a fair number of files hadchanged on my local VM instance,the actual size of the change wasrelatively small compared to thesize of the disk images.n rsync has an excellent mechanismfor syncing over only the parts oflarge files that have changed.n A lot of the changes in my qcow2files were likely going to be at theend of those files anyway.n If I use rsync with the --inplaceoption, it will modify the existingdisk image on the remotemachine directly and save diskspace and time.So my plan for phase 1 was torun rsync from physical host tophysical host and sync over theqcow2 disk images hot while the VMwas running and tell rsync to syncthe disk images in place. BecauseI could assume the remote imageswould be somewhat corruptedanyway (that’s the downside ofsyncing a disk image while the diskis being used), I didn’t have to careabout --inplace leaving behind apotentially corrupted file if it werestopped midway through the sync.I could clean it up later.The advantage of doing the phase1 rsync hot was that I could get all46 / DECEMBER <strong>2012</strong> / WWW.LINUXJOURNAL.COM


COLUMNSHACK AND /of the main differences betweenthe home and colocated imagessorted out while the server wasstill running at home. I even couldpotentially run that rsync multipletimes leading up to phase 2 justto make sure it was as up to dateas it could be. Here are the rsynccommands I used to perform thephase 1 hot sync:$ rsync -avz --progress --inplace disk0.qcow2➥remotehost:/var/lib/libvirt/images/www.example.net/disk0.qcow2could start with phase 2. I neededthe phase 2 rsync to run while theVM was powered off so I could makesure the disk wasn’t being written toduring the sync. Otherwise, I wouldrisk corruption on the filesystem.Because this required downtime,I picked a proper maintenancewindow for my server when it wouldbe less busy, finished a final phase 1hot sync a few hours before, thenhalted the VM cleanly before Iperformed the final syncs:$ rsync -avz --progress --inplace disk1.qcow2➥remotehost:/var/lib/libvirt/images/www.example.net/disk1.qcow2Between rsync’s syncing only thebits that changed and the fact thatI used -z to compress the databefore it was transferred, I wasable to sync these files way fasterthan you would think possible on a1Mb connection. Of course, thesecommands ended up saturatingmy bandwidth at home, so sinceI wasn’t under time pressure forthe hot sync to complete, I endedup setting a bandwidth limit of 10kilobytes per second for the largerdisk1.qcow2 image:$ rsync -avz --progress --inplace disk0.qcow2➥remotehost:/var/lib/libvirt/images/www.example.net/disk0.qcow2$ rsync -avz --progress --inplace disk1.qcow2➥remotehost:/var/lib/libvirt/images/www.example.net/disk1.qcow2Because of the previous work ofsyncing up the disk images, the finalcold sync took only an hour or twowith most of the time being spentwith rsync seeking between the localand remote image to confirm theywere in sync. Once the commandscompleted, I was able to power upthe server again on my colocatedhost, change its IPs back, and I wasback in business.■$ rsync -avz --progress --inplace --bwlimit=10 disk1.qcow2➥remotehost:/var/lib/libvirt/images/www.example.net/disk1.qcow2Once phase 1 was complete, IKyle Rankin is a Sr. Systems Administrator in the San FranciscoBay Area and the author of a number of books, including TheOfficial Ubuntu Server Book, Knoppix Hacks and Ubuntu Hacks.He is currently the president of the North Bay <strong>Linux</strong> Users’ Group.WWW.LINUXJOURNAL.COM / DECEMBER <strong>2012</strong> / 47


COLUMNSTHE OPEN-SOURCE CLASSROOMPlus, if you build a custom case out ofLEGO blocks, you can add wings, rocketsand LEGO dudes sitting on top.that can provide at least 700mAh.Remember, when it comes toamperage, more is better, so don’tworry about a one- or two-amppower adapter ruining the unit. Itwill draw only as much as it needs.If the power supply doesn’t provideat least 700mAh, however, theRaspberry Pi will not be reliable.Most problems with the RPi tendto be related to a weak or faultypower adapter.Don’t Box Me InOnce you connect power to your RPi,you’ll quickly find that it’s awkwardto handle. I didn’t bother talkingabout a case first, because we allknow building a case is not the firstthing anyone is going to do. Still,if you want to keep your Pi in goodshape, protecting it with some sortof case is important. Thankfully,there are more case options thanstars in Hollywood.Case Option: Buy One Youbought the Raspberry Pi, and it wasonly $35. It seems only logical tospend an additional $10–$15 on aprebuilt case to house it. There areclear cases, colorful cases, expensivecases and cheap cases. Most of thecommercially available cases areplain, square boxes, but the RPi is alittle square device, so that makessense. Buying a case also guaranteesa snug fit and proper-fittingconnections. If your Pi is going to behandled a lot, a fitted case is a verygood idea.Case Option: Steal from theNursery The Raspberry Pi is small,and it really lends itself to a LEGOcastle motif. Seriously, when it firstcame out, there were more LEGObasedRPi cases than anything else.If you have access to the right sortof LEGO blocks, it’s surprising howsturdy those little suckers can bewhen properly built. Plus, if youbuild a custom case out of LEGOblocks, you can add wings, rocketsand LEGO dudes sitting on top.Besides, who wouldn’t want to havea desktop computer system that candouble as a toy space station?Case Option: 3-D Printing Ifyou have a 3-D printer, I can’tWWW.LINUXJOURNAL.COM / DECEMBER <strong>2012</strong> / 49


COLUMNSTHE OPEN-SOURCE CLASSROOMFigure 1. This foldable case is simple, cheap and pretty cool-looking (image fromhttp://h2database.com).think of a cooler way to coveryour Pi. Templates are available onthe Internet, but even without atemplate, it’s possible to make acase as tight-fitting or as ventilatedas you want. Now with the differentcolor options available for 3-Dprinters, the sky is really the limit.Case Option: Regular PrintingI didn’t buy a case. I don’t have a3-D printer. And, my kids no longerhave LEGO blocks lying around forme to steal. For me, I wanted a casethat was simple, cheap and did thejob. Thankfully, the folks over athttp://h2database.com/raspi haveprovided a printable template thatfolds into a Raspberry Pi case. The50 / DECEMBER <strong>2012</strong> / WWW.LINUXJOURNAL.COM


COLUMNSTHE OPEN-SOURCE CLASSROOMFigure 2. I am probably the only kid on the block with a bootable box of Pop-Tarts.coolest print stock is a clear mylarsheet. Figure 1 shows how cool afoldable clear case can look.Case Option: Crazy Go Nuts Youhave a computer with a silly name,so why not compliment that with asilly case? The Raspberry Pi is smallenough to fit inside a Pop-Tart box, anold shoe, a DVD case, a hollowed-outbook or a carved Halloween pumpkin.Of course, any case that is wet likelywill damage or destroy your Pi, but it’sawful tempting to make a “RaspberryPumpkin Pi”, isn’t it? The possibilitiesare endless with RPi case mods, so letyour creativity lead the way.Getting the BootFirst off, the Raspberry Pi willnot PXE boot. It also won’t bootdirectly from a USB device. Bothof those things really bum me out,WWW.LINUXJOURNAL.COM / DECEMBER <strong>2012</strong> / 51


COLUMNSTHE OPEN-SOURCE CLASSROOMAs the Raspberry Pi doesn’t have a BIOS, theonly way to allocate RAM is to put a binary filenamed start.elf into the /boot directory.but nonetheless, the RPi does bootquite nicely from the included SDslot. Because it won’t boot fromUSB, installing an operating systemis easiest from a second computer.Several <strong>Linux</strong> distributions arecompiled for the ARM-based RPi,but the most popular by far is theDebian-based Raspbian OS.For best performance, a class 10 SDcard is recommended. Once you getthe SD card, instructions for copyingthe Raspbian OS are available athttp://www.raspberrypi.org. Thegood news is that even if your SDcard is small and slow, once the unitis booted, there’s no reason the OScan’t live largely on a USB drive. Ifyou want to experiment with movingthe bulk of the OS off the SD card,the Raspberry Pi Web site has somegreat tutorials.Splitting Your BrainThe Raspberry Pi comes with a sharedsystem for system RAM and GPU RAM.Because the GPU is a powerful devicecapable of driving a high-resolutionmonitor and hardware renderingseveral types of video, if you’re usingthe RPi in a multimedia setting, you’llwant to be sure the GPU gets plentyof RAM. If you’re running the Pi ina headless server mode, you’ll likelywant to use as little of the RAM aspossible for the GPU, reserving thebulk for the system.The absolute minimum the GPUneeds is 16MB. That doesn’t seemlike a lot, but because the systemmaxes out at 256MB or 512MB, even16MB can be significant. As theRaspberry Pi doesn’t have a BIOS,the only way to allocate RAM is toput a binary file named start.elfinto the /boot directory. Due to theproprietary nature of the GPU, thosevarious .elf files are downloadedfrom http://www.raspberrypi.org.If you’re running headless, you’llwant to grab the .elf binary withonly 16MB dedicated to GPU.Otherwise, you’ll have to decide howmuch GPU RAM your applicationwill require. Trial and error might bethe only way to figure out the bestsplit. The good news is that the newmodel B units come with 512MB of52 / DECEMBER <strong>2012</strong> / WWW.LINUXJOURNAL.COM


COLUMNSTHE OPEN-SOURCE CLASSROOMRAM instead of 256, so it allowsfor much more flexibility with thememory split.To Swap or Not to SwapSD cards are getting better everyyear when it comes to wear levelingand write cycles. The concern isalways that excessive use of theSD card will wear it out, and it willbecome read-only. Because the RPialso suffers from limited and nonexpandableRAM, the issue of swapspace is highly debated.Raspbian comes installed bydefault with a swap file active—not a swap partition, but a swapfile. Whether this swap file willwear out your SD card is still upfor debate. I tend to be paranoidabout such things, so I searched foran alternative. Because I have the512MB units, I have a little moreRAM to work with, so I decidedto use zRam to compress someof the system RAM and use it asswap space. How does that work?Basically, zRam allows the systemto use RAM as swap space, but in acompressed mode that allows it toappear as more RAM+swap than thesystem actually contains.zRam already is compiled into theRaspbian kernel, so if you want totry my method, it just takes a littlescripting. I absolutely love the scriptI found at the eXtremeSHOK.comWeb site. That site is off-line atthe time of this writing, so I’veincluded the script below. Createa file called /etc/init.d/zram, whichcontains the following:#!/bin/bash### BEGIN INIT INFO#Provides: zram#Required-Start:#Required-Stop:#Default-Start: 2 3 4 5#Default-Stop: 0 1 6#Short-Description: Increased Performance In <strong>Linux</strong> With zRam#(Virtual Swap Compressed in RAM)#Description: Adapted for Raspbian (Rasberry pi) by eXtremeSHOK.com#using https://raw.github.com/gionn/etc/master/init.d/zram### END INIT INFOstart() {mem_total_kb=$(grep MemTotal /proc/meminfo | grep -E➥--only-matching '[[:digit:]]+')modprobe zramsleep 1#only using 50% of system memory, comment the line#below to use 100% of system memorymem_total_kb=$((mem_total_kb/2))echo $((mem_total_kb * 1024)) > /sys/block/zram0/disksizeWWW.LINUXJOURNAL.COM / DECEMBER <strong>2012</strong> / 53


NEW PRODUCTSSymantec’s VeritasCluster ServerThe beauty of the upgraded Veritas Cluster Server,says its maker Symantec, is this: the pinnacle levelof high availability and disaster recovery that hasbeen available in the physical world now applies to the virtual one. Not only can applicationsrunning in virtual machines be monitored, but they also can be recovered when an incidentoccurs. Virtual machine reboots, thus, are eliminated, keeping downtime to a minimum,allowing all users to do business even in the face of human error, system failure or naturaldisaster. Veritas allows users to choose how they want to architect their environment—thatis, fail over from V to V, V to P or P to V. Downtime from patching, server maintenance andupgrades is eliminated, because applications can be moved between primary and secondarynodes with no disruption in business. The new version of Veritas Cluster Server works withexisting VMware tools like vMotion, DRS and SRM and integrates with vCenter, such thatusers can continue to use the features of the native stack without compromise.http://www.symantec.com/cluster-serverDell KACE K1000Management ApplianceResource-strapped IT teams face myriad challenges, including endpoint security, regulatorycompliance, server management and BYOD (Bring Your Own Device) issues. In an effort to facedown these challenges, Dell beefed up the Dell KACE K1000 Management Appliance, whichthe firm describes as “an easy-to-use, comprehensive and affordable appliance that fulfills all ofthe systems management needs of organizations of all sizes”. Functions include initial inventoryand discovery, software distribution, configuration management, patching, security vulnerabilityremediation, asset management, service desk and reporting. This latest v.5.4 of the K1000 addsfeatures related to endpoint security and regulatory compliance, which are important to thefinancial services and healthcare industries, among others. Additionally, this version expandsvisibility and audit-trail capabilities made possible by the new machine inventory API. But mostimportant, say the folks in Round Rock, the new appliance extends operating system supportto Windows 8, Mac OS X Mountain Lion, Red Hat 6, Ubuntu and SUSE <strong>Linux</strong> Enterprise Server11 SP2—a critical piece of the puzzle for IT admins for solving BYOD issues.http://www.dell.com/KACE56 / DECEMBER <strong>2012</strong> / WWW.LINUXJOURNAL.COM


NEW PRODUCTSCharles Babbage’s On thePrinciples and Development ofthe Calculator and Other SeminalWritings (Dover Publications)Eighteenth-century British “Renaissance man” Charles Babbagedeveloped the idea of a programmable computer and articulatedthe principles on which all modern computing machines arebased. To keep Babbage’s seminal ideas from disappearing, DoverPublications is updating the 1961 release of On the Principlesand Development of the Calculator and Other Seminal Writings,a compilation of his writings and those of several of his contemporaries. The writingsilluminate the work that eventually led to the development of the calculator. Interestingly,Babbage’s Difference Engine No. 2 from the late 1800s was able to compute the values ofpolynomial functions with results up to 31 digits. The ideas found in Babbage’s writingsare essential reading for anyone interested in the history of computing technology.http://store.doverpublications.comPerforce’s Git FusionGit is great, but now it’s got more with help from Perforce’s GitFusion. With Git Fusion, developers who use Git can continue to usetheir preferred tools, but they now have flexible new capabilitiesfor customization, reuse and sharing of projects. Teams can use Gitrepositories and their components in new ways, combining them andcreating new repositories by selectively reusing elements from other Gitor Perforce code lines. Git Fusion also extends Perforce’s enterpriseversion management capabilities to Git repositories, bringing addedIP security and defensibility, scalability, compliance and visibility todisconnected projects. Perforce and Git Fusion are free for up to 20 users.http://www.perforce.comPlease send information about releases of <strong>Linux</strong>-related products to newproducts@linuxjournal.com orNew Products c/o <strong>Linux</strong> <strong>Journal</strong>, PO Box 980985, Houston, TX 77098. Submissions are edited for length and content.WWW.LINUXJOURNAL.COM / DECEMBER <strong>2012</strong> / 59


REVIEWHARDWAREGetting the Mostfrom the Nexus 7A look at the king of the 7" tablets. PHILIP RAYMONDThe ASUS/Google Nexus 7arrived at my door on August 1,<strong>2012</strong> with a lot of anticipationfrom both me and the rest ofthe consumer electronics world.A quad-core Tegra 3 processorfrom NVIDIA, a 1200x800HD IPS display covered with thelatest scratch-resistant CorningGorilla Glass and a 1.2 megapixelfront-facing camera were amongits most notable cool features.Fast-forward to late September<strong>2012</strong>, and although it has gottenmostly positive reviews, it is viewedprimarily as a consumption device,with a lack of ways to use it forproducing anything short of e-mailmessages. I believe this review willchange your mind and show youhow to use it for both productionand consumption in ways youdidn’t know. The way to do this iswith the right app—better known60 / DECEMBER <strong>2012</strong> / WWW.LINUXJOURNAL.COM


REVIEWI tried six different Android video editing-apps, somefree some paid, and five out of six were horrible.as the right tool for the right job.Let’s start with my favorite topic,producing videos. As long as yourneed is only for production of shortform,nothing-fancy videos, theNexus 7 can do it. Yes, it has onlya front-facing camera. However, Iwas surprised to discover I had goodresults when I held it in the generaldirection of the action, without theaid of a screen to see what wascaptured. I used the app CameraICS+, the plus being the pay-for$.99 version that captures 720p HDvideo from the Nexus 7. It also canbe used for shooting high-qualitystill photos as well.Next, for editing, check out the appcalled Andromedia. I tried six differentAndroid video editing-apps, some freeFigure 1. Storyboard LayoutWWW.LINUXJOURNAL.COM / DECEMBER <strong>2012</strong> / 61


REVIEWFigure 4. Selecting a TransitionFigure 5. Selecting Where the Next Sequence Comes fromWWW.LINUXJOURNAL.COM / DECEMBER <strong>2012</strong> / 63


REVIEWFigure 6. Export SettingsFigure 7. Naming the Project64 / DECEMBER <strong>2012</strong> / WWW.LINUXJOURNAL.COM


REVIEWsome paid, and five out of six werehorrible. Andromedia was the onlyone that worked as advertised, andit was free! It isn’t perfect though.Rendering a six-minute HD video tooknearly 45 minutes, but it does work.It has all of the basic editing toolsyou’d expect and some you mightnot. It edits and exports 720p HDvideo; it can super titles you createover either a color background ora picture; it has several choices ofscene transitions, and it even allowsimporting and editing of audio, ifyou want to add music or soundeffects. It’s also easy to use. Becauseit is a free app, there are small adsat the bottom of the GUI, but Ididn’t find them to be annoying orintrusive. The screenshots in Figures1–7 show the editing process.Speaking of screenshots, on theNexus 7, you can make them byholding down the power button andthe volume button at the same timefor about two seconds, which isfollowed by a nondescript sound.Another very useful app is calledES File Explorer. This is the best wayto handle the storage limitations onthe Nexus 7, and it doesn’t involve acloud. This app lets you transfer toany sharable device with a hard driveon your home network. For me, thatwould be my 2TB network hard drive.Figure 8. Choosing a Folder Using the ESFile ExplorerBasic photo editing is achievedby choosing a photo in the galleryand touching the choice icon in theupper-right corner.If you need to print, any of theAndroid apps for the major printermanufacturers will work, but it needsto be a network printer. Epson Iprintfor Android worked for me and myEpson Workforce 630. It also will printWWW.LINUXJOURNAL.COM / DECEMBER <strong>2012</strong> / 65


REVIEWYou can transfer files to and from the Nexus 7and your smartphone via Bluetooth as well.Figure 9. Choice of Viewsdocuments and pictures stored onclouds, like Google Drive.The Nexus 7 is a Wi-Fi-only device;however, it is possible to connect tothe Internet by tethering the Nexus 7to your Android phone via Bluetoothby pairing them and checking thebox on the phone to allow Internettethering. My experience with doingthis is acceptable, but the BluetoothInternet speed is knocked down toabout 400kbps—even when thephone is getting 4G service that’smore than triple that speed. That said,it will get you on the Net when Wi-Fiisn’t available. In fact, any smartphonethat allows Bluetooth tethering toshare the phone’s Internet connectionwill work with the Nexus 7. The onestep you need to do to make this workis to activate the Bluetooth visibilityfrom both the Nexus 7 and the phone,66 / DECEMBER <strong>2012</strong> / WWW.LINUXJOURNAL.COM


REVIEWbe the envy of anyone with an iPhone.Now, let’s talk about consumption.Much has been made about thelack of Flash support for all Androidversions after 4.0. This affects theNexus 7, which, as everyone shouldknow by now, runs Jellybean 4.1.This is not as big of a problem assome might think. Some major videocontent sites like CNN and CNET dostill stream only Flash from their Websites. What some folks don’t know isthat these and other Flash-only Websites have much or all of the samecontent on their YouTube channels inHTML5 that the Nexus 7 will play. InFigure 10. Picture Editing on the Nexus 7prior to pairing.You can transfer files to and fromthe Nexus 7 and your smartphonevia Bluetooth as well. Another wayto transfer files, playlists or anythingon your browser is by means of NFC(Near Field Communication). Only afew devices other than the Nexus 7have this, such as the Samsung Galaxy3 phones. All you do is tap the tops ofthe two devices to transfer, and you’llFigure 11. Side View of the Nexus 7WWW.LINUXJOURNAL.COM / DECEMBER <strong>2012</strong> / 67


REVIEWtime (I’ll predict less than a year), allmajor video content sites will streamHTML5—it is the future, Flash is not.I bought my Nexus 7 with theoptional gray neoprene case. As youcan see in Figure 11, the front flapdoubles well on most surfaces as akickstand for viewing.As far as other entertainmentcontent, no problem: Netflixapp—check, Pandora app—check,Hulu Plus app—check, Spotifyapp—check, YouTube app—check,Ustream app—check, Tune In Radioapp—check, Skype app—check,<strong>Linux</strong> <strong>Journal</strong> app—check.Maybe you’re like me and enjoyrecording HD TV programs usingFreevo and a Hauppauge HD PVRconnected to a cable box to store onyour network drive. Using the ES FileExplorer app I mentioned earlier, theNexus 7 will play it. The video I recordfrom the HDPVR is MPEG-4 in a .m2tscontainer, which the Nexus 7 doesn’trecognize. The trick is to hold yourfinger on the file icon until it asks youwhat type of file it is (choose video),then choose the player. With a goodWi-Fi signal, the Nexus 7 will streamFigure 12. Nexus 7 Videoplayer68 / DECEMBER <strong>2012</strong> / WWW.LINUXJOURNAL.COM


FEATURE Readers’ Choice Awards <strong>2012</strong>READERS’CHOICEAWARDS<strong>2012</strong>Readers’ Choice votes are in!Compare your favorites withother readers and see if you’rethe oddball or everyone else is!SHAWN POWERSIt’s that time of year again. After 11 months of us tellingyou about products, services and companies, this month,you, the readers, run the show. We’ve formatted thingsa little differently this year, as we’ve gotten lots of feedbackdesiring a deeper look into the results.70 / DECEMBER <strong>2012</strong> / WWW.LINUXJOURNAL.COM


BEST LINUX DISTRIBUTIONThe distribution category has similar results as lastyear, but it shows a trend. Other distributions,many still based on Ubuntu, are sneakingup the ladder. In fact, next year we’ll haveto break out the different official brandsof Ubuntu, because if they were separated,I suspect the finalists would look a bit different.For that matter, if we lumped all the Debianbaseddistributions together, the spread would behuge between first and second place!30.1% Ubuntu (any flavor, Kubuntu, Edubuntu, etc.)14.7% Debian13.4% <strong>Linux</strong> Mint10% Arch <strong>Linux</strong>8.6% Fedora4.2% OpenSUSE3.8% Gentoo3.3% CentOS3.1% Other*2.5% Slackware1.9% Red Hat1.5% PC<strong>Linux</strong>OS.7% MEPIS.5% Bodhi <strong>Linux</strong>.3% Novell/SUSE.3% Pardus.3% Sabayon.2% Mandriva.2% Puppy.1% Chrome OS.1% Slitaz*Mageia had the most write-in votes.BEST DISTRIBUTION FORNETBOOKS/LIMITED HARDWAREAlthough we kept the title “Ubuntu Netbook Remix” this year, it’s really a misnomer,as Ubuntu has consolidated its Netbook interface (Unity) into its main product. Withtheir tiny screens, every pixel counts, and Canonical’s one-size-fits-all design workswell on a Netbook. It’s neat to see Android so high on the list, however. With laptopdocks for phones and keyboards for tablets, Android is becoming a viable operatingsystem for more than just making calls and checking e-mail.25.9% Ubuntu Netbook Remix (any flavor)14.9% Debian14.1% Android OS12.7% Arch<strong>Linux</strong>11.3% Other*7.1% Puppy3.9% Fedora3.1% Chrome OS2.5% MeeGo1.7% PC<strong>Linux</strong>OS (any flavor)1% Slax1% Slitaz.9% Jolicloud*Both CrunchBang and <strong>Linux</strong> Mintreceived many write-in votes in thiscategory.WWW.LINUXJOURNAL.COM / DECEMBER <strong>2012</strong> / 71


BEST E-MAIL CLIENT40.2% Thunderbird31.3% Gmail Web client7.5% Evolution5.9% mutt5.5% Kmail4.1% Other1.6% Claws1.5% Alpine (pine)1.2% Opera.5% Sylpheed.3% GMX(Global Mail Exchange).3% RoundcubeBEST IM CLIENTThe results here line up with last year’s results, in that Pidgin isstill the top pick. Surprisingly, the Microsoft-owned, completelyproprietary Skype is still in second place with a healthy lead overthe competition. I switched to BitlBee this year for all my IMneeds, which falls into the “Other” category, but our favoriteresponse, which came as a write-in from several people, was“Telepathy”. It’s great to see our digital version has traversed thegalaxy and garnered readers on Vulcan. It will be interesting to see if “MindMeld” makes the list of e-mail clients next year.56% Pidgin (formerly Gaim)15.1% Skype9.2% Empathy8.8% Kopete7.8% Other1.2% Gajim1.2% Psi.4% amsn.4% kmessBEST IRC CLIENT31.2% pidgin27.8% XChat13.2% Irssi9.1% Chatzilla7.4% Konversation6.8 % Other3.5% Quassel.8% KVircWWW.LINUXJOURNAL.COM / DECEMBER <strong>2012</strong> / 73


FEATURE Readers’ Choice Awards <strong>2012</strong>BEST MICROBLOGGINGCLIENT36.8% Gwibber16% Other16% Tweetdeck13.9% Choqok5.2% Pino5% HootSuite2.7% Seesmic2.5% Jaiku1.4% Nitwit.7% Spaz73.3% LibreOffice12% Google Docs8.4% OpenOffice.org3.8% Other1.2% GNOME Office.5% Calligra Suite.5% KOfficeBESTOFFICE SUITE.2% IBM Lotus SymphonyBEST SINGLE OFFICE PROGRAMThere were significant write-ins for LibreOffice Writer, which we should havelumped together with OOWriter. Or, maybe we shouldn’t have. Nonetheless,based on the office suite results, it makes sense that LibreOffice Writer sharesthe top spot with OOWriter. Again in the second-place spot is AbiWord. Ifyou’re looking for a fairly robust, no-nonsense word processor, it’s tough tobeat the single-purpose AbiWord.27.2% OOWriter18.6% AbiWord13% OOCalc12.8% Scribus9.6% Other6.6% Gnumeric6.4% LyX3.7% KWord1.2% KSpread.9% OOImpress74 / DECEMBER <strong>2012</strong> / WWW.LINUXJOURNAL.COM


BEST GRAPHICS/DESIGN TOOLThis year, GIMP tops the list again as the favoritegraphics/design tool. Now that it supports singlewindow mode, we suspect it will only gain inpopularity. For some reason, folks found it difficult tonavigate the many-window default layout of GIMP. Ifyou’re coming from Photoshop, that single windowview makes you feel much more at home using <strong>Linux</strong>.67.8% GIMP13.3% Inkscape8% Blender3.6% ImageMagick3% Krita2.3% LibreOffice Draw1.2% Other.8% OpenOffice DrawBEST DIGITAL PHOTOMANAGEMENT TOOLdigiKam edges out Picasa again this year, butsince Google dropped the <strong>Linux</strong> version of Picasa, the number two spot will be gapingopen next year. As the husband of a photographer, I have hundreds of thousands ofphotos to manage, and quite honestly, I haven’t found a great way to keep track ofthem on any platform. digiKam and Shotwell certainly get better and better every year;the question is whether local native apps or cloud-based storage will truly be king.22.5 digiKam22.2% Picasa17.3% Shotwell11% F-spot8.4% gThumb8.1% Gwenview4.9% Other3.7% GQview1.6% Bibble Professional.3% gtkam84.6% AudacityBEST AUDIO TOOL7.2% Ardour 4.4% Other 3.8% LMMSWWW.LINUXJOURNAL.COM / DECEMBER <strong>2012</strong> / 75


FEATURE Readers’ Choice Awards <strong>2012</strong>BEST AUDIO PLAYERIt still surprises me that VLC is on the list as audio player,and this year it even took top place! I’ve long used VLCas a video player, but never really considered it a viableaudio player. I’m clearly not one of the cool kids,because VLC received almost 25% of the popularvote! Much like photos, a music collection cangrow to be unwieldy. It’s great to have such a wideselection of tools to tame the beast.24.9% VLC20.4% Amarok14.1% RhythmBox11.1% Other*10% Banshee6.4% Audacious5.1% MPlayer3.5% XMMS1.6% Exalie1.4% MOC1.3% Totem.1% Last.fm*Clementine had several write-in votes.BEST MEDIA PLAYER69.1% VLC15.4% MPlayer4.7% SMPlayer4.2% Totem3.3% Kaffeine1.7% XINE1% Other.6% MiroBEST BOOKMARKSYNCING TOOL33% Firefox Sync32.4% Chrome Bookmarks11.4% Google Bookmarks11% xmarks(formerly Foxmarks)6.9 % Other4.8% Delicious.4% Weave76 / DECEMBER <strong>2012</strong> / WWW.LINUXJOURNAL.COM


BEST ON-LINECOLLABORATIONTOOL61.3% Google Docs18.5% Wikis6.9% Other5.9% Zimbra2.6% Kolab2.5% Basecamp2.3% eGroupWareBEST CLOUD-BASED FILE STORAGEWe love Dropbox, and it takes the lion’s share of votes again this year. It’salso great to see viable alternatives with a decent following. Will Dropboxcontinue to reign supreme, or will features like SpiderOak’s baked-in encryptionmotivate folks to switch? Dropbox is certainly ourincumbent, but with cloud-based storage beingsuch a new market, it’s exciting to see what thefuture holds!53.4% Dropbox14.6% Ubuntu One12.2% Other*8.6% Amazon S35.1% SpiderOak3.5% Box.net1.8% SparkleShare.4% CloudSafe.4% SugarSync*OwnCloud and Google Drive bothhad many write-in votes.BEST KID-FRIENDLYAPPLICATION42.8% Tux Paint14.6% Gcompris11.4% Scratch9.4% Tux Typing8.6% Other7.9% Tux of MathCommand5.3% KTuberlingWWW.LINUXJOURNAL.COM / DECEMBER <strong>2012</strong> / 77


FEATURE Readers’ Choice Awards <strong>2012</strong>BEST GAMEOh “Other”, how we love you. Will <strong>Linux</strong> users ever get the Steam platform?If so, will that change the landscape of <strong>Linux</strong> gaming? It’s hard to say. Wejust know it’s exciting to see games that work well under <strong>Linux</strong>, when not toomany years ago, that wasn’t the case. If you haven’t been paying attentionto the <strong>Linux</strong>-friendly Humble Bundle charity drives, be sure to watch for itsnext offering. <strong>Linux</strong> users are always the top donators, and all the games are<strong>Linux</strong>-compatible, so it’s a win-win for everyone.17.6% Other12.9% World of Goo12.4% Frozen Bubble9.5% Doom9.1% Minecraft/Spoutcraft8.7% Battle for Wesnoth8.2% Tux Racer (PlanetPenguin Racer/Extreme Tux Racer)6.2% Super Tux3.8% Enemy TerritoryQuake Wars3.8% freeciv3.8% Urban Terror2.8% Nexuiz1.2% MaelstromBEST SQL DATABASEThis year we separated SQL databases fromNoSQL databases. It seemed unfair to pit twodifferent technologies against each other,when both are perfectly cromulent systems.We think the results are much more useful.47.4% MySQL28.8% PostgreSQL12.2% SQLite4.1% MariaDB4% Oracle1.8% Other1% Firebird.8% DB2BEST NoSQL DATABASE33.4% MongoDB22.3% CouchDB21.9% Cassandra12.2% Other6.6% Redis1.8% Dynomite1.8% Riak78 / DECEMBER <strong>2012</strong> / WWW.LINUXJOURNAL.COM


BEST BACKUP SOLUTION41.7% rsync11.6% tar8.9% Other*7% Amanda6% Bacula4.4% Simple <strong>Linux</strong> Backup4.1% Back in Time3.2% Arkeia3.1% BackupPC3.1% rsnapshot2.8% luckyBackup1.7% rdiff-backup1.2% cpio1.2% Mondo.1% BakBone NetVault*Deja Dup and “custom scripts” hadseveral write-in votes.56.1% VirtualBox17.7% VMware13.5% KVM5.3% XenBEST VIRTUALIZATIONSOLUTIONVirtualBox continues to flourish under its Oracleownership. Thankfully, the core product remainsopen source, and its compatibility with freshversions of distributions seems to be fast andup to date. Although it’s not something I’d usefor a server room, VirtualBox does a great job ofemulating desktop environments.3.9% QEMU1.6% Citrix Xenserver1.5% Other.4% OpenVZ.1% Scalent V/OE SoftwareBEST MONITORINGAPPLICATION51.8% Nagios13.4% Other7.9% OpenNMS7.2% Zabbix4.9% Zenoss Core4% Uptime Software3.6% Ganglia3.1% Munin2.5% Hyperic1.6% GroundworkWWW.LINUXJOURNAL.COM / DECEMBER <strong>2012</strong> / 79


FEATURE Readers’ Choice Awards <strong>2012</strong>BEST REVISION CONTROL SYSTEM63% Git18.6% Subversion6.6% Mercurial6.2% CVS2.7% Other1.8% bazaar.8% monotone.1% darcs.1% svkBEST PROGRAMMINGLANGUAGE28% Python19% C++18.9% C8.9% Java8.2% Perl6.1% Other4% Ruby3.1% JavaScript2.4% C#.7% Erlang.7% HaskellNew: Intel Xeon E5 Based ClustersBenchmark Your Code on Our Xeon E5 BasedTesla Cluster with:AMBER, NAMD, GROMACS, LAMMPS, or Your Custom CUDA CodesUpgrade to New Kepler GPUs Now!Microway MD SimCluster with8 Tesla M2090 GPUs8 Intel Xeon E5 CPUs and InfiniBand2X Improvement over Xeon 5600 SeriesGSA ScheduleContract Number:GS-35F-0431N


BEST SCRIPTING LANGUAGE36.3% Python24.4% Bash14.2% Perl13.8% PHP4.8% Ruby2.2% Awk2.2% Other1.6% Lua.4% GroovyBEST IDE26.7% Eclipse25.6% vim7.5% Geany6.9% Other*6.1% QtCreator5.4% NetBeans4.1% KDevelop3.1% Sublime 21.3% IntelliJ IDEA1.2% Anjuta.6% MonoDevelop.5% Codewarrior.3% Zend Studio.1% Eric4*CodeBlocks and Komodo Edit bothreceived several write-ins.Harness Microway’s Proven GPU ExpertiseThousands of GPU cluster nodes installed.Thousands of WhisperStations delivered.Award Winning BioStack – LSAward Winning WhisperStation Tesla – PSC with 3D‘11AWARDBESTBest NewTechnologyns/Day (Higher is Better)CPU + GPUCPU Only1.070.332.020.653.541.301 Node2 Nodes 4 NodesNAMD F1-ATP Performance GainConfigure Your WhisperStation or Cluster Today!www.microway.com/tesla or 508-746-7341


FEATURE Readers’ Choice Awards <strong>2012</strong>BEST OPEN-SOURCECONFIGURATIONMANAGEMENT TOOL42.5% Puppet15.7% Other8.9% Chef8.9% OpenQRM8.7% Spacewalk8.1% Cfengine4% RHN Satellite3.2% Bcfg2BEST PLATFORM FOR DEVELOPINGRICH INTERNET APPSRemember back when HTML5 was little more than a fancy dream? It wasn’ttoo long ago that the features of HTML5 seemed ridiculous and impossible,but here we are, in <strong>2012</strong>, and HTML5 is the new standard. Web applicationsare becoming less and less “out there”, and much more immersive, thanks tothe features of HTML5. Perhaps next year the survey will be “What non-HTML5platform do you use?”, because otherwise, it’s a no-brainer.86.9% HTML54.7% Other3.1% Gears (formerlyGoogle Gears)2.5% JavaFX1.6% OpenLaszlo.9% Mono Moonlight.2% ZK FrameworkBEST PACKAGE MANAGEMENTAPPLICATION33.8% apt17.3% synaptic12.9% yum10.8% pacman9.2% aptitude3.9% portage3.4% YaST2% Software Center1.8% Zypper1.7% Other1.7% pkgtool.6% PiSi (Pardus).6% Smart Package Manager.2% InstallAnywhere82 / DECEMBER <strong>2012</strong> / WWW.LINUXJOURNAL.COM


BEST RSS READER52.4% Gmail RSS reader18.1% Other16.8% akregator12.7% lifereaBEST FILE ENCRYPTION59.3% GPG30.4% pgp6.6% Other*3.7% vim-openssl pluginBEST JAVA JRE57.5% Openjdk38.4% Oracle4.2% Other*TrueCrypt received several write-in votes.BEST JAVA APP SERVER60.1% tomcat21.9% jboss10.9% Other*7.1% glassfish *jetty had many write-in votes.BEST JOURNALING FILESYSTEM78.8% ext410.9% ext36.2% xfs4.1% Other* *btrfs had many write-in votes.BEST FILE MANAGER49.8% Nautilus26.9% Dolphin13.4% Other*9.9% Thunar*PCMan File Manager, midnight commander andbash/command-line/vim/shell all received several write-ins.WWW.LINUXJOURNAL.COM / DECEMBER <strong>2012</strong> / 83


FEATURE Readers’ Choice Awards <strong>2012</strong>BEST CONTENTMANAGEMENT SYSTEMWordPress and Drupal and Joomla, oh my!WordPress takes the victory this year with itseasy learning curve and plethora of themes andwidgets. Drupal is right on its heels, however,with its flexibility and customization options.All of the CMSes in the survey do their jobsadmirably well, and each has its niche to fill inthe industry. The best thing to do with all thesewonderful open-source options is to try them out and see!34.9% WordPress27.8% Drupal15.3% Joomla!8.1% Other4.4% Alfresco1.5% Liferay1.3% Concrete 51.3% Mambo1% TYPO3.8% CMS Made Simple.8% Documentum.2% e107.2% Silva.2% ZotonicBEST LINUX-FRIENDLYWEB HOSTING COMPANYIt turns out that our favorite <strong>Linux</strong>-Friendly Web hosting company is also ourfavorite <strong>Linux</strong> game! “Other” is the victor this year, followed by a whole hostof <strong>Linux</strong>-friendly providers. Amazon takes the top non-“Other” spot, but not byas much as I suspected. <strong>Linux</strong> users are truly an eclectic bunch.18.9% Other17.7% Amazon12.6% GoDaddy.com11% Linode7.7% Rackspace5.6% 1&14.7% Dreamhost4.5% HostGator2.8% Bluehost2.6% OpenHosting2.3% OVH1.4% Hurricane Electric1.2% Site51.2% Siteground1% SoftLayer Technologies.9% Host Monster.9% Verio.7% NearlyFreeSpeech.net.5% Pair.5% Slicehost.3% NeoSpire.3% Server Beach.2% Arvixe.2% Codero.2% Contegix84 / DECEMBER <strong>2012</strong> / WWW.LINUXJOURNAL.COM


BEST LINUX LAPTOP VENDORIt’s great to see a big company like our top vendor, Dell, supporting <strong>Linux</strong> users,especially when it’s obvious by the numbers that the company is doing a greatjob of it. Equally as exciting is to see companies like System 76 and ZaReasongain popularity by catering directly to the <strong>Linux</strong> community. Gone are the dayswhen <strong>Linux</strong>-supported laptops were hard to find; welcome to the new worldwhere we have choices, options and multiple brands!24.9% Dell20.5% System 7619.1% ASUS12.5% Other*7.4% Acer5.7% ZaReason5.2% Emperor<strong>Linux</strong>3.1% <strong>Linux</strong>Certified1.4% <strong>Linux</strong> Laptop Company.3% R Cubed Technologies*Lenovo received manywrite-in votes.BEST LINUX DESKTOPWORKSTATION VENDORDell dominates this category as well this year. With more than a third ofthe vote, Dell is doing something right for our readers! The landscapeof workstation vendors is even wider than the laptop world, and again,it’s great to see familiar names like System 76, Penguin Computing andMicroway making an impact as well.37.2% Dell26.9% System 7614.8% Other*8.5% Penguin Computing3% Microway2.1% R Cubed1.8% HPC Systems1.6% Pogo <strong>Linux</strong>1.2% Advanced ClusteringTechnologies1.2% MadTux.7% Open Sense Solutions.5% ASA Computers.4% Recompute*As always, there were manywrite-in votes for “build my own”.WWW.LINUXJOURNAL.COM / DECEMBER <strong>2012</strong> / 85


FEATURE Readers’ Choice Awards <strong>2012</strong>BEST LINUX SERVER VENDOR<strong>Linux</strong> is nothing new in the server room, and the results in this category showit. IBM takes top spot again this year, proving that when it comes to servers,IBM is tough to match. Dell and HP both garner significant votes as well,showing that <strong>Linux</strong> in the data center isn’t a novelty; it’s the norm.24% IBM23.6% Dell16.5% Hewlett-Packard10.3% System 767.4% Other*4.6% Penguin Computing4.2% Super MicroComputers2.6% ZaReason1.6% Sun Microsystems1.2% iXsystems.9% HPC Systems.9% Silicon Mechanics.7% Tyan Computers.4% ASA Computers, Inc..4% Microway.4% Rackable Systems.2% Aberdeen.2% RackMount Pro.2% SGI*“Build my own” had tons of write-invotes in this category as well.BEST LINUX BOOKAs in previous years, this category was write-in only, and this year, wehad a tie for first place between long-standing-winner <strong>Linux</strong> in a Nutshell,by Ellen Siever, Stephen Figgins, Robert Love and Arnold Robbins, and thenewly published The Debian Administrator’s Handbook, by Raphael Hertzogand Roland Mas. Second place goes to The <strong>Linux</strong> Programming Interface:A <strong>Linux</strong> and UNIX System Programming Handbook, by Michael Kerrisk.BEST LINUX JOURNAL COLUMNI did my best this year to sneak up on Kyle Rankin’s popularity.Heck, the editorial staff even gave me a second column, butadded together, my votes paled in comparison to Kyle’s. Hisrelevant, timely, super-geeky column reminds us month aftermonth why we love <strong>Linux</strong>. Hats off to you, my friend. Dave Taylorand I will happily take silver and bronze to your gold.28.7% Hack and / by Kyle Rankin15.4% Work the Shellby Dave Taylor14.5% The Open-SourceClassroom byShawn Powers9.4% diff -u by Zack Brown7.6% At the Forge byReuven M. Lerner7.6% Other7.4% EOF by Doc Searls4.8% Current_<strong>Issue</strong>.tar.gzby Shawn Powers4.6% New Productsby James Gray86 / DECEMBER <strong>2012</strong> / WWW.LINUXJOURNAL.COM


BEST BRAND OFVIDEO CHIPSET48% NVIDIA27.5% ATI/AMD22.5% Intel1% Other.9% VIABEST LINUX SMARTPHONEMANUFACTURER50.1% Samsung16.2% HTC8.8% Motorola7.6% Nexus6% Nokia4.4% Other3.4% Sony Ericsson2.4% LG.7% Dell.3% KyoceraBEST LINUX TABLET MANUFACTURERTablets have been around for a few years now, but the competition isgetting more and more intense. Samsung takes the top spot this year withits passion for Android innovation. If there’s one company trying to makesure Apple can’t steal the tablet and phone market for itself, it’s Samsung.The other company with a runaway number of votes is ASUS. If you addthe write-in votes for “Google Nexus”, which is manufactured by ASUS,you can see the company has a very healthy second-place position. The realwinner in this race? <strong>Linux</strong> users!45.2% Samsung28.7% ASUS7.1% Other*6% Motorola4.4% Acer2.4% Archos1.9% Dell1.6% Toshiba1.5% Nokia.4% ViewSonic.3% Le Pan.1% Coby.1% SuperPad.1% Velocity Micro*Google Nexus 7 (made by ASUS)received several write-in votes.WWW.LINUXJOURNAL.COM / DECEMBER <strong>2012</strong> / 87


FEATURE Readers’ Choice Awards <strong>2012</strong>BEST OTHER LINUX-BASED GADGETWe’re excited, and not at all surprised, to see the Raspberry Pi in the topspot this year. What a neat device, and what amazing potential it has asthe core of cool projects everywhere.47.9% Raspberry Pi26.5% Amazon Kindle6.6% Other*6.4% B&N NOOK5% TomTom NavigationSystem2% Popcorn Hour1.7% PogoPlug1.7% Sheeva plug1.1% Chumby.6% Kangaroo TV.3% Ben NanoNote.3% BUG*BeagleBone and BeagleBoard bothreceived several write-in votes.BEST NEW OPEN-SOURCE PROJECT(RELEASED IN 2011 OR <strong>2012</strong>)Low price point, incredible design and nifty name, Raspberry Pi stole theshow this year as the best new Open-Source Project. When the release dayfinally came, people were lined up outside the store waiting to buy their ownRaspberry Pis. Of course, we’re geeks, so “lining up” meant waiting at ourcomputers to pre-order on-line, but the concept still was the same. To be fair,we should shine a little light on Cinnamon and OwnCloud, both getting asignificant number of votes. Much like Fred Kaps, who followed the Beatles onThe Ed Sullivan Show, it would be easy to overlook some really great projects!BEST NEW COMMERCIAL APPLICATION(RELEASED IN 2011 OR <strong>2012</strong>)My fellow optimists, I’m happy to see you voted for Steam based on Valve’scommitment to release a <strong>Linux</strong> client. We know <strong>Linux</strong> is a great platformfor gaming, and if Valve can put its weight behind the support of ourOS, it could mean the floodgates would open when it comes to availablecommercial games. Valve did it for OS X; let’s see how it goes for <strong>Linux</strong>!88 / DECEMBER <strong>2012</strong> / WWW.LINUXJOURNAL.COM


PRODUCTOF THE YEAROh, Raspberry Pi, we love you so much! You’reour favorite new Open-Source Project, andyou’re our favorite <strong>Linux</strong>-based gadget. Itonly stands to reason you’re the Product ofthe Year! We’re excited to see the projects,experiments, modifications and integrationsyou’ll be involved in. When you combine “lowprice” with “amazing features”, it makes foran equation that’s hard to beat. We can’t waitto see what the Raspberry Pi will do next!■Shawn Powers is the Associate Editor for <strong>Linux</strong> <strong>Journal</strong>. He’s also the Gadget Guyfor <strong>Linux</strong><strong>Journal</strong>.com, and he has an interesting collection of vintage Garfieldcoffee mugs. Don’t let his silly hairdo fool you, he’s a pretty ordinary guy and canbe reached via e-mail at shawn@linuxjournal.com. Or, swing by the #linuxjournalIRC channel on Freenode.net.Help us make Readers’ Choice 2013 even better.Please send suggestions for new categories orany ideas you have for improving the awardsvia http://www.linuxjournal.com/contact.WWW.LINUXJOURNAL.COM / DECEMBER <strong>2012</strong> / 89


INDEPTHIntroducing GriveAn independent open-source implementation of GoogleDrive—up in the cloud.MEHDI POUSTCHI AMINEarlier this year, Google introducedits Google Drive cloud storage service.Cloud storage is a model of networkedon-line storage where data is storedin virtualized pools of storage thatthird parties generally host. Hostingcompanies operate large data centers,and people who require hostingbuy or lease storage capacity fromthem. The data-center operators,in the background, virtualize theresources according to their customers’requirements and expose them asstorage pools, which the customersthemselves can use to store files ordata objects. Physically, the resourcesmay span across multiple servers.A Web service applicationprogramming interface (API) accessescloud storage services through a cloudstorage gateway or through a Webbaseduser interface. Google Drive isa place where you can create, share,collaborate and keep all of your stuff.You can upload and access all of yourfiles, including videos, photos, GoogleDocs, PDFs and more.The advantage of the GoogleDrive is that it could become yourcentralized storage vault for all yourdocuments in the cloud. It lets youcreate and collaborate in the sameway as Google Docs did.1) Create and collaborate: GoogleDocs is built right in to Google Drive,so you can work with others in realtime on documents, spreadsheets andpresentations. Once you choose toshare content with others, you can addand reply to comments on anything(PDFs, images, video files and so on)and receive notifications when otherpeople comment on shared items.You can upload up to 30 different fileextensions, which many other cloudservices don’t allow.2) Store everything safely andaccess it anywhere (especially whileon the go): Synchronization is oneof the coolest things ever. When youuse a synchronizing storage product,like Google Drive, any file you put in90 / DECEMBER <strong>2012</strong> / WWW.LINUXJOURNAL.COM


INDEPTHthe drive, and anything you changethat’s stored in the drive, is updatedautomatically—not just in the cloudbut on all the other devices that youhave connected to the Drive. So youcan start working on a file on onecomputer, close it and then open it ona second computer, and what you’llsee is the version you closed on thefirst one. You can access your stufffrom anywhere—on the Web, in yourhome, at the office or while runningerrands, from all of your devices. Youcan install Drive on your Mac or PCand can download the Drive app toyour Android phone or tablet. Andregardless of platform, blind users canaccess Drive with a screen reader.3) Search everything by keywordand filter by file type, owner andmore: Drive even can recognizetext in scanned documents usingOptical Character Recognition (OCR)technology. Let’s say you upload ascanned image of an old newspaperclipping. You can search for a wordfrom the text of the actual article.Drive uses image recognition so that ifyou drag and drop photos from yourGrand Canyon trip into Drive, youlater can search for “Grand Canyon”,and photos of it should pop up. Thistechnology is still in its early stages,and it’s expected to improve over time.Figure 1. Google Drive on a Mac, PC and Android Phone or TabletWWW.LINUXJOURNAL.COM / DECEMBER <strong>2012</strong> / 91


INDEPTH4) Get your old files: Drive keeps acopy of every file you edit on it. It alsotracks changes on documents and keepsrevision copies of up to 30 days or thelast 100 revisions.5) Easy sharing to Google+:Backing up photos is one of the mostpopular uses of cloud storage services,and with that in mind, it’s no surpriseto see that Google has made it easy forGoogle+ users to share images from itsnew Google Drive service. Google hasintegrated the two services to allowGoogle Drive users to share photos fromthe cloud service to Google+ from withinthe social network itself.Google’s new cloud storage solutionfeatures 5GB of free space. If you havenever used a cloud-based storage servicelike Google Drive before, take a momentto consider the advantages of keepingyour files on-line. Because files can beaccessed from any computer with anInternet connection, Drive eliminates theneed to e-mail or save a file to a USBdrive. And because Drive allows you toshare files, working with others becomeseasier than ever before.Google Drive and PrivacyGoogle’s biggest problem with theGoogle Drive privacy policy is that thereisn’t actually a specific Google Driveprivacy policy—there’s just Google’s newunified term of service and privacy policy.Google states, “You retain ownershipof any intellectual property rights thatyou hold in that content. In short, whatbelongs to you stays yours.”That means Google can’t use yourcontent for commercial purposeswithout your consent. However, the termof service also states:You give Google (and those wework with) a worldwide license touse, host, store, reproduce, modify,create derivative works (such asthose resulting from translations,adaptations or other changeswe make so that your contentworks better with our Services),communicate, publish, publiclyperform, publicly display anddistribute such content. The rightsyou grant in this license are forthe limited purpose of operating,promoting, and improving ourServices, and to develop new ones.For content that is yours, Google can’tre-use it for its own purposes, but it canuse content you upload in order to serveyou. This can include integrating servicestogether (like reading your scannedpictures in order to OCR them), and itcan include analyzing your files to targetadvertisements to you. Google alreadydoes this in Gmail.Google doesn’t currently serve ads92 / DECEMBER <strong>2012</strong> / WWW.LINUXJOURNAL.COM


INDEPTHin Google Docs (now called GoogleDrive), but it may, according to itslicense agreement, use data about thecontent you upload to target ads to youanywhere on the service.Google also may give up your datain response to a legal demand, likea subpoena. If you want your cloudstorage to be a little more out of touch,you might be interested in Wuala, whichhas no storage servers in the UnitedStates. Or, you might just want to keepyour data off the Internet.Google Drive and SecurityGoogle Drive encrypts data betweenyour computer and the Google servers.If you’re using your Google Drive overthe Web, the connection defaults tosecure (HTTPS), and when you usethe software that makes your GoogleDrive appear on your computer likea local hard drive, the data betweenyour computer and Google is likewiseencrypted. No casual hacker will beable to grab your files by monitoring orintercepting your Internet connection toGoogle. Your data also is stored underlock and key at Google itself, but it isnot encrypted on the Google servers.You will have to encrypt your own filesahead of time. A Google rep explainedwhy: encrypting files stored at Googlewould prevent you from previewingthem on the Web, and it also wouldprevent services like Google Gogglesand its OCR engine from accessing fileson your behalf. (I presume it also wouldprevent Google’s ad-serving algorithmsfrom scanning your data to serve youmore targeted messages, and this ishow Google makes its money.)<strong>Linux</strong> InstallationIf you install the Google Drive clientapp for your Windows or Mac PC, youcan sync all your on-line Google Docsto your computer. You can be selectivewith your syncing—sync Google Docs,all of My Drive or individual folders, anditems in Shared with me.But for all the celebration, there issomething missing: a <strong>Linux</strong> client. TheGoogle Drive client is not yet availablefor <strong>Linux</strong>, and the old Google Docs FSdoes not work too well with GoogleDrive, so besides the Web interface,the best solution for getting GoogleDrive on <strong>Linux</strong> right now is usingGrive, an unofficial, open-source,command-line <strong>Linux</strong> client for GoogleDrive. Grive has been put together bya third-party developer, and it looksquite nice. Thanks Google for makingDrive an open platform.The purpose of Grive Project is toprovide an independent implementationof the Google Drive client. It uses theGoogle Document List API to talk toGoogle’s servers. The code is written inWWW.LINUXJOURNAL.COM / DECEMBER <strong>2012</strong> / 93


INDEPTHstandard C++.As of version 0.2.0, Grive can dotwo-sided synchronization betweenGoogle Drive and the local directory.It can download and upload changedfiles. New directories in Google Driveand the local directory also can bedownloaded/uploaded. It cannot yetdo the following:n Wait for changes in the filesystemto occur and upload the filesafterward. Sync is performed onlywhen you run Grive.n Symbolic link support.n Sync all files/folders withmultiple parents and downloadGoogle Documents.n Support for files >2GB.Those things will be added in thefuture, possibly during the next release.At the time of this writing, you easilycan install Grive in Ubuntu 11.10 orlater using the following commands:system :~$ sudo add-apt-repository ppa:nilarimogard/webupd8system :~$ sudo apt-get updatesystem :~$ sudo apt-get install griveOn other <strong>Linux</strong> distributions, theinstallation is a little involved, as aGrive package is not yet available. Youcan compile it from source.Grive source code is available atGitHub if you want to tinker with it.Setup is a bit of a pain right now,and it requires some command-linework, which is not uncommon in<strong>Linux</strong>. But, I am here to show youhow to install it on RPM-based <strong>Linux</strong>(CentOS, Fedora and Red Hat).For starters, you need a dedicatedmachine or virtual server, as well as areliable Internet connection.In this scenario, let’s use CentOS.As you may know, CentOS is anenterprise-class <strong>Linux</strong> distributionderived from sources freely provided tothe public by the Upstream OS Provider(http://www.redhat.com/rhel).I strongly recommend using CentOS6.0, because CentOS 6.0 has beencompletely rebuilt with a newer buildsystem and library checks to confirmupstream binary compatibility. It alsobrings a new kernel, new versions ofkey server components and improvedvirtualization support.Before you install Grive, you need todo some preparatory work. Note: all thefollowing commands must be run as root.First, update your CentOS. This isoptional, but I strongly recommend it.Run the yum command:[root@system ~]# yum update94 / DECEMBER <strong>2012</strong> / WWW.LINUXJOURNAL.COM


INDEPTHNext, disable SELINUX, and simplyedit the /etc/selinux/config file:[root@system ~]# vi /etc/selinux/configThen add a line like:SELINUX=disabledNow, you need to enable an extrarepository, ATrpms.ATrpms is a third-party RPMrepository. Its original focus was uponsoftware used in natural sciences,especially in the field of high-energyphysics, such as tools for numericalprogramming or for scientificpublications. Since then, this repositoryincludes many non-scientific softwaretitles, like system tools or multimediapackages, resulting in a far moregeneric repository. Currently, packagesare built only for Red Hat <strong>Linux</strong> flavors.Install and enable ATrpms in CentOSby running the following commands:the required packages:[root@system ~]# yum install automake autoconf \openssl openssl-devel json-c json-c-devel curl \curl-devel libcurl-devel libcurl libarchive \libarchive-devel libidn libidn-devel expat \expat-devel binutils binutils-develCMake is a cross-platformbuild system generator. CMakeis used to control the softwarecompilation process using simpleplatform- and compiler-independentconfiguration files. Check yourCMake package version:[root@system ~]# rpm -qa | grep -i cmakeIf the version of CMake is


INDEPTHIf the version of Boost is


INDEPTH-----------------------Please input the authentication code hereEnding NotesIf you get a “crash” (a bunch of errormessages on the screen), you should run:That’s it. Now, each time you wantto sync Google Drive with your localgrive folder, navigate to the .grivefolder and run /usr/bin/grive(this time without the -a, becauseyou already have authenticated Grivewith Google Drive). You can set upa cron job if you want to do thison a regular basis.If everything works fine, Grivewill create a .grive file in yourhome directory. It also will startdownloading files from your GoogleDrive to your current directory. Afterall this business is done, all you needto do to refresh your Google Drivefiles is run Grive from the terminal.Is it as convenient as Google’sofficial desktop solutions? No, but youare not running <strong>Linux</strong> because you arelooking for easy solutions.[root@system ~]# /usr/bin/grive -l log.txtBecause the file will contain alog of the sync operation, you maywant to edit the file first to removepersonally sensitive information andthen send it to Grive developers.Keep up with the posts athttps://plus.google.com/116411649000013553715/posts andhttps://github.com/grive/grive/issuesfor the latest information, especiallyregarding news on newly discoveredbugs and when you need to downloadand build again!■Sayyed Mehdi Poustchi Amin is currently a PhD research studentin computer science at SIU. His research is focused on developinghoneypot decoys for analysis of Internet attacks. His professionalcertifications include CCNA, MCTS, MCITP and MCSE. He welcomescomments on this article and beyond at mehdi.poustchi@gmail.com.ResourcesThe Grive Project—an Open-Source <strong>Linux</strong> Client for Google Drive: https://github.com/Grive/griveThe Official Google Blog, “Introducing Google Drive”: googleblog.blogspot.in/<strong>2012</strong>/04/introducing-google-drive-yes-really.html#!/<strong>2012</strong>/04/introducing-google-drive-yes-really.html“Grive: Open Source Google Drive Client for <strong>Linux</strong>”:www.webupd8.org/<strong>2012</strong>/05/grive-open-source-google-drive-client.htmlThe Google Drive FAQ: news.cnet.com/8301-1023_3-57420402-93/the-google-drive-faqWWW.LINUXJOURNAL.COM / DECEMBER <strong>2012</strong> / 97


INDEPTHchange GIMP according to yourtastes still holds true.Tabbed NavigationThe other major UI change is thetabbed view. Often photographers anddesigners work with multiple images,so it usually is cumbersome for anartist to work with multiple windows.To tackle this issue and provide aneasy way to switch back and forthwhen dealing with multiple images,Figure 2. Single Window Mode in GIMP 2.8Figure 3. Tabbed Image View in GIMPWWW.LINUXJOURNAL.COM / DECEMBER <strong>2012</strong> / 101


INDEPTHGIMP has come up with a tabbed viewof all the active windows.The tabbed view sits on top ofthe editing canvas and displays asmall thumbnail preview of all theactive windows—an efficient way totoggle between multiple images. It’sa feature that isn’t very new amonggraphics editors, but it still is aworthy add-on for multitasking withimages easily.Other UI ChangesMajor UI changes have overshadowedmost of the new release’s makeover;however, the developers have paidclose attention and fine-tuned somesmaller areas and made changeswhere they matter most:n Multi-column dock: with previousversions, it was possible to groupmultiple docks together in aFigure 4. Multiple Tool Bars Docked Sideways102 / DECEMBER <strong>2012</strong> / WWW.LINUXJOURNAL.COM


INDEPTHFigure 5. New Opacity Slider Enhanced forTouch Devicestabbed view, but with GIMP 2.8,developers are allowing users todock the window sideways or invertical view. The ability to stackmultiple docks is a nice way tolet users modify the look and feelfreely according to their own needsand working area.n Transparency slider: GIMP 2.8brings a new transparency sliderto the table. Initially suggestedwith the GIMP usability project,the new idea saw daylight withthe final release. The changes aretailor-made to target users withtablets and those who use a stylusor pen for drawing and paintingwith the GIMP.n Additional space for toolboxes: thedocking bars now have more areaand less unused space. DevelopersFigure 6. New Save and Export Systemhave removed the top unusedarea and done away with the tabinformation that took up a lot ofspace. As a result, toolboxes aremore efficient and have less clutter.n Save and export features: GIMP’slatest release has two new waysto save files. The previous savefeature worked for saving bothGIMP’s native .xcf files (that saveall the detailed information)WWW.LINUXJOURNAL.COM / DECEMBER <strong>2012</strong> / 103


INDEPTHalong with native MIME imageformats, such as .png, .jpg andso on. With GIMP 2.8, the savefeature will save images only inGIMP’s native .xcf format. To saveimages in MIME image formats,you have to choose the Exportoption from the file menu.That sums up GIMP’s changes in theuser interface department. However,many bold changes in the newrelease not only enhance the editingexperience but also pave the way forfuture GIMP development.Layer GroupingThe most painful part in editing andcreating huge images are layers. Animage is an amalgamation of manylayers, and managing images withmany layers can be a daunting task.To provide an easy workaround,GIMP 2.8 boasts layer groupingfeatures. You simply create a newgroup, and if you want to addlayers, simply drag and drop intothe layer group.Inside the layer group, you cancarry out all the generic layer-relatedtasks, so these new groups don’tlimit your editing.Resource TaggingTagging is an efficient way to locatedata, especially if you have severalplugins, brushes and gradientsinstalled. GIMP 2.8 lets you easily tagresources that allow you to navigatequickly through the massive resourcesat your disposal.Figure 7. Layer Grouping with MultipleLayers GroupedOn-Canvas Text EditingThis feature created great hooplawith the GIMP 2.8 release. On-canvasediting, which was part of a projectfrom Google’s Summer of Code 2011,104 / DECEMBER <strong>2012</strong> / WWW.LINUXJOURNAL.COM


INDEPTHFigure 8. On-Canvas Editing in Actionallows you to edit text directly inthe canvas—no more pop-up boxesfor adding text to images. The mainadvantage of the on-canvas editoris to provide a clutter-free and moreprecise experience.Cairo AdoptionAll on-canvas tools, such asperspective transformation, shear,rotate and scale tools, are redrawnusing the Cairo graphics library.As a result, the tools look moreprofessional, and they carry a newon-canvas status indicator and nolonger use the ubiquitous status barat the bottom.GEGL and OpenCL ImplementationStarting with GIMP 2.6, GEGLhas come a long way with majorimprovements. The most importantis support for OpenCL. With supportfrom AMD and a GSOC project,GIMP now scales with graphicsprocessors for image processing,which makes a normal imagefunction much faster.GIMP, being an image editor,requires you to work with arrayWWW.LINUXJOURNAL.COM / DECEMBER <strong>2012</strong> / 105


INDEPTHvariables and even multiprocessingcapabilities are needed to completetasks quickly; however, with theadvent of SIMD-based processors(graphics card/processors) andOpenCL, it is now much easier forgraphics-intense applications toleverage their work on SIMD enginesfor faster processing.However, the current state ofGEGL/OpenCL is dismal in <strong>Linux</strong>.GEGL doesn’t scale well, and infact, it performs much slower whencompared to plain CPU-basedprocessing. This could very wellbe the AMD driver’s fault, as itsOpenCL support and performancein <strong>Linux</strong> is still flaky.GEGL also has developed supportfor higher-bit image processing,which is still in development andshould debut with GIMP 2.10.Developers have already laid outa plan for fully functional andcomplete GEGL integration withGIMP 2.10, so in future releases, allthe functions will be done in parallelusing OpenCL code stack.Closing ThoughtsWith many nifty add-ons, suchas mathematical calculations inresize windows, improved cagetransformation tools and APIchanges for simplified script writing,GIMP 2.8 has come a long way andis a far cry from its older versions.The revamped UI and newunderlying code have given GIMPa much-needed momentum. WithGIMP 2.8, developers have coveredmany milestones, providing a moreenhanced interface along withbleeding-edge OpenCL acceleration.However, GEGL support andthe dismal OpenCL performance,at least under <strong>Linux</strong>, have keptme thinking. With refinementsevery day, I believe that withGIMP 2.10, we will have full-blownOpenCL-accelerated image editing.Looking forward, GIMP 2.10 and3.0 will bring an even more massivechangelog, making it a worthycompetitor to proprietary solutions.With GIMP 2.8, developers havecleared many hurdles that hinderedits mass adoption. The clunkyinterface is more usable and intuitivethan ever. GIMP 2.8 establishes itselfas one of the premier open-sourcealternatives to proprietary solutions,providing bleeding-edge solutionswith an intuitive interface and anever-improving ecosystem.■Shashwat Pant is a FOSS enthusiast and hardware freak. Helikes to tweak his hardware for optimum performance. He isan IT Engineering student studying in India and likes to reviewthe latest FOSS software and distributions.106 / DECEMBER <strong>2012</strong> / WWW.LINUXJOURNAL.COM


If You Use <strong>Linux</strong>, You Should BeReading LINUX JOURNAL❯❯ In-depth informationproviding a full 360-degree look at featuredtopics relating to <strong>Linux</strong>❯❯ Tools, tips and tricks youwill use today as well asrelevant information forthe future❯❯ Advice and inspiration forgetting the most out ofyour <strong>Linux</strong> system❯❯ Instructional how-tos willsave you time and moneySubscribe now for instant access!For only $29.50 per year—lessthan $2.50 per issue—you’ll haveaccess to <strong>Linux</strong> <strong>Journal</strong> eachmonth as a PDF, in ePub & Kindleformats, on-line and through ourAndroid & iOS apps. Wherever yougo, <strong>Linux</strong> <strong>Journal</strong> goes with you.SUBSCRIBE NOW AT:WWW.LINUXJOURNAL.COM/SUBSCRIBE


EOFBiggest DataDOC SEARLSOur old enemy was proprietary platforms. Should it now beproprietary data?Turns out maps matter.That’s always been the casefor me. I’m a map freak. I ownhundreds of paper maps in variousspecialties, plus many atlases, bookson geography, geology and other geoobsessions.But I’m no longer an edgecase, because maps are proving to beessential on smartphones, which todayapproaches a billion or more people.<strong>Digital</strong> maps on phones are now amongthe core portfolio of smartphone apps,alongside voice, text, calendar andcontacts. What could be more mobileabout a phone than a map to help theuser look things up and get around?In appearance and function,smartphone maps evolved fromstandalone GPS units, which werelimited to location lookup and turnby-turndirections in both text andvoice form. But maps on phones grewmuch deeper, because boundlessamounts of memory, intelligenceand usage-based heuristics could belocated in the cloud, and delivered tothe app and the user through an APIover a live data connection.Nobody has done more with cloudbasedmapping than Google. By themiddle of this year, Google-made or-based map apps were the primarysources of location and navigationinformation for users carrying all kindsof mobile devices—especially Androidand Apple mobile devices. Amongsmartphones, that pair alone comprisedabout a 90% market share in the US.In September <strong>2012</strong>, however, Applereleased iOS 6 and the iPhone 5, bothwith a new Maps app that did notuse Google as a data source. The newGoogle-free Maps app quickly turnedinto Apple’s worst fail since the Newton.Initial sales of the iPhone 5 were good,as were installs of iOS 6. But thencame reports of the new Maps app’sdisabilities, which were extreme. Missingwere countless major points of interest,such as the entire subway systems ofNew York, London and Paris. Museumswere moved into rivers. Dead businessescame to life, and live businesses wentaway. At the time of this writing108 / DECEMBER <strong>2012</strong> / WWW.LINUXJOURNAL.COM


EOF(in early October <strong>2012</strong>), iPhone 5sales projections have been reviseddownward, and Apple’s stock is dippingas well. The map debacle may not be theonly reason, but it’s still a big one.Why would Apple do something soobviously harmful to itself? BecauseGoogle was clearly withholdingessential mapping features fromiOS to favor Android, and Appleneeded to rid itself of a clearly hostilesupplier. As an owner of both Androidand Apple phones, that much wasobvious to me. But news of it didn’tmake the mainstream press (at leastas far as I know) until David Poguereported as much in his New YorkTimes column of September 27, <strong>2012</strong>(http://www.nytimes.com/<strong>2012</strong>/09/27/technology/personaltech/applesnew-maps-app-is-upgraded-butfull-of-snags-review.html?_r=0):After poking around, here’s whatI’ve learned.First, why Apple dropped the oldversion: Google, it says, was saving<strong>Linux</strong> JournaLnow availablefor the iPad andiPhone at theApp Store.linuxjournal.com/iosFor more information about advertising opportunities within <strong>Linux</strong> <strong>Journal</strong> iPhone, iPad andAndroid apps, contact Rebecca Cassity at +1-713-344-1956 x2 or ads@linuxjournal.com.


EOFall the best features for phonesthat run its Android software. Forexample, the iPhone app never gotspoken directions or vector maps(smooth lines, not tiles of pixels),long after those features had cometo rival phones.Apple has a variety of replacementdata sources, starting with TomTom,the Netherlands-based maker ofnavigation (mostly GPS) systems.TomTom’s primary data source is itsTele-Atlas subsidiary, which it acquiredfor 2.9 billion euros in 2008. The prioryear, Nokia acquired Navteq, Tele-Atlas’ main competitor, for 5.7 billioneuros. Google used Tele-Atlas as asource until October 2009, when itbecame its own primary data source.Google, Navteq and Tele-Atlas alldeploy special vehicles on streetsto create, correct and enhancemapping. In Google’s case, this alsohas included mapping of Wi-Fi accesspoints to fine-tune a user’s locationfurther. Microsoft, Google and Applealso have aerial views provided bothby satellites and low-flying aircraft.And all are feeding their cloudsand crunching up data gathered bywatching what users do.At this point, it would be easy todigress into vendor sports and handicapwhich of the map data sources andmobile device suppliers will win inthe marketplace. But instead, I wantto look at what all this says aboutdependencies. What we see here is thereplacement of the platform with theBig Data API—let’s call it a BiGDAPI—asa single source of market-making andmarket-breaking dependency.Google’s passive-aggressive mapapp game with Apple, and Apple’srefusal to keep playing it, are bothevidence of Google’s huge leveragethrough its map BiGDAPI.The term “Big Data” has been aroundfor a long time, but has obtainedbuzzphrase status only in the last twoyears. Although much that can be saidabout Big Data is positive and harmless(better medicine, better science, betteranalytic fodder for countless goodpurposes), one unspoken motivationbehind the buzz is obtaining highdegrees of market leverage. And muchof that leverage is not in harmonywith the constructive motivations andpractices behind free software, opensource and <strong>Linux</strong>. Because, behindmany of the big APIs are vast junglesof exclusive and patent-protectedfunctionalities and restrictions arounduse. Such as, for example, the spokenturn-by-turn directions Google wouldn’tallow Apple to use. It can be dispiriting110 / DECEMBER <strong>2012</strong> / WWW.LINUXJOURNAL.COM


to see platform leverage exceededby large proprietary databases andexclusive services made availablethrough APIs. But it’s important tobring attention to what’s going on,so here we are.We also should remember that goodthings come from APIs. For exposingorganizational competencies in purelyuseful ways, nothing beats them. (Fora sample, take a look at the growinglist of APIs at ProgrammableWeb.com:http://www.programmableweb.com/apis/directory.)One hopeful force on the mappingfront is OpenStreetMap.org, whichhas been crowdsourcing mapsdata for years. It has an API too(http://wiki.openstreetmap.org/wiki/API). Perhaps in time, freedevelopers and users can best thesums of data currently locked upin proprietary mapping bases, andthe analytics as well. But until then,it’s helpful just to watch what’shappening in the mapping space,and how dependent we remain onproprietary companies and BiGDAPIsover which we have little control.■Doc Searls is Senior Editor of <strong>Linux</strong> <strong>Journal</strong>. He is also afellow with the Berkman Center for Internet and Society atHarvard University and the Center for Information Technologyand Society at UC Santa Barbara.Advertiser IndexThank you as always for supporting ouradvertisers by buying their products!ADVERTISER URL PAGE #1&1 http://www.1and1.com 17Emac, Inc. http://www.emacinc.com 19iXsystems http://www.ixsystems.com 7Microway http://www.microway.com 80, 81SCALE http://www.socallinuxexpo.org 55Silicon Mechanics http://www.siliconmechanics.com 3Usenix Lisa https://www.usenix.org/conference/lisa12 2ATTENTION ADVERTISERSThe <strong>Linux</strong> <strong>Journal</strong> brand’s following hasgrown to a monthly readership nearlyone million strong. Encompassing themagazine, Web site, newsletters andmuch more, <strong>Linux</strong> <strong>Journal</strong> offers theideal content environment to help youreach your marketing objectives. Formore information, please visithttp://www.linuxjournal.com/advertising.WWW.LINUXJOURNAL.COM / DECEMBER <strong>2012</strong> / 111

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!