Linux Journal | February 2016 | Issue
Total Page:16
File Type:pdf, Size:1020Kb
™ A LOOK AT KDE’s KStars Astronomy Program Since 1994: The Original Magazine of the Linux Community FEBRUARY 2016 | ISSUE 262 | www.linuxjournal.com + Programming Working with Command How-Tos Arguments in Your Program a Shell Scripts BeagleBone Interview: Katerina Black Barone-Adesi on to Help Brew Beer Developing the Snabb Switch Network Write a Toolkit Short Script to Solve a WATCH: ISSUE Math Puzzle OVERVIEW V LJ262-February2016.indd 1 1/21/16 5:26 PM NEW! Agile Improve Product Business Development Processes with an Enterprise Practical books Author: Ted Schmidt Job Scheduler for the most technical Sponsor: IBM Author: Mike Diehl Sponsor: people on the planet. Skybot Finding Your DIY Way: Mapping Commerce Site Your Network Author: to Improve Reuven M. Lerner Manageability GEEK GUIDES Sponsor: GeoTrust Author: Bill Childers Sponsor: InterMapper Combating Get in the Infrastructure Fast Lane Sprawl with NVMe Author: Author: Bill Childers Mike Diehl Sponsor: Sponsor: Puppet Labs Silicon Mechanics & Intel Download books for free with a Take Control Linux in simple one-time registration. of Growing the Time Redis NoSQL of Malware http://geekguide.linuxjournal.com Server Clusters Author: Author: Federico Kereki Reuven M. Lerner Sponsor: Sponsor: IBM Bit9 + Carbon Black LJ262-February2016.indd 2 1/21/16 5:26 PM NEW! Agile Improve Product Business Development Processes with an Enterprise Practical books Author: Ted Schmidt Job Scheduler for the most technical Sponsor: IBM Author: Mike Diehl Sponsor: people on the planet. Skybot Finding Your DIY Way: Mapping Commerce Site Your Network Author: to Improve Reuven M. Lerner Manageability GEEK GUIDES Sponsor: GeoTrust Author: Bill Childers Sponsor: InterMapper Combating Get in the Infrastructure Fast Lane Sprawl with NVMe Author: Author: Bill Childers Mike Diehl Sponsor: Sponsor: Puppet Labs Silicon Mechanics & Intel Download books for free with a Take Control Linux in simple one-time registration. of Growing the Time Redis NoSQL of Malware http://geekguide.linuxjournal.com Server Clusters Author: Author: Federico Kereki Reuven M. Lerner Sponsor: Sponsor: IBM Bit9 + Carbon Black LJ262-February2016.indd 3 1/21/16 5:26 PM FEBRUARY 2016 CONTENTS ISSUE 262 FEATURES 64 Temperature Control in a Homebrewing Tun Using a BeagleBone Black How to program a BeagleBone Black to solve your beer-brewing problems. Klaus Kolle 88 Command-Line Tutorial: Does Every Year Have a Friday the 13th? Solving this puzzle is a great exercise in picking a handful of shell commands from Linux’s rich palette and combining them into a short script. Sol Lederman ON THE COVER 7YVNYHTH)LHNSL)VUL)SHJR[V/LSW)YL^)LLYW >YP[LH:OVY[:JYPW[[V:VS]LH4H[O7\aaSLW (3VVRH[2+,Z2:[HYZ(Z[YVUVT`7YVNYHTW >VYRPUN^P[O*VTTHUK(YN\TLU[ZPU@V\Y:OLSS:JYPW[ZW 0U[LY]PL^!2H[LYPUH)HYVUL(KLZPVU +L]LSVWPUN[OL:UHII:^P[JO5L[^VYR;VVSRP[W 4 / FEBRUARY 2016 / WWW.LINUXJOURNAL.COM LJ262-February2016.indd 4 1/21/16 5:26 PM COLUMNS 32 Reuven M. Lerner’s At the Forge Tech Book Roundup 40 Dave Taylor’s Work the Shell Working with Command Arguments 22 46 Shawn Powers’ The Open-Source Classroom The Powers That Be 52 Susan Sons’ Under the Sink Fast Network Routing, Meet Userspace 100 Doc Searls’ EOF Giving Silos Their Due 46 IN EVERY ISSUE 8 Current_Issue.tar.gz 10 Letters 14 UPFRONT 30 Editors’ Choice 60 New Products 103 Advertisers Index 64 LINUX JOURNAL (ISSN 1075-3583) is published monthly by Belltown Media, Inc., PO Box 980985, Houston, TX 77098 USA. Subscription rate is $29.50/year. Subscriptions start with the next issue. WWW.LINUXJOURNAL.COM / FEBRUARY 2016 / 5 LJ262-February2016.indd 5 1/22/16 11:02 AM Executive Editor Jill Franklin [email protected] Senior Editor Doc Searls [email protected] Associate Editor Shawn Powers [email protected] Art Director Garrick Antikajian [email protected] Products Editor James Gray [email protected] Editor Emeritus Don Marti [email protected] Technical Editor Michael Baxter [email protected] Senior Columnist Reuven Lerner [email protected] Security Editor Mick Bauer [email protected] Hack Editor Kyle Rankin lj@greenfly.net Virtual Editor Bill Childers [email protected] Contributing Editors )BRAHIM (ADDAD s 2OBERT ,OVE s :ACK "ROWN s $AVE 0HILLIPS s -ARCO &IORETTI s ,UDOVIC -ARCOTTE 0AUL "ARRY s 0AUL -C+ENNEY s $AVE 4AYLOR s $IRK %LMENDORF s *USTIN 2YAN s !DAM -ONSEN President Carlie Fairchild [email protected] Publisher Mark Irgang [email protected] Associate Publisher John Grogan [email protected] Director of Digital Experience Katherine Druckman [email protected] Accountant Candy Beauchamp [email protected] Linux Journal is published by, and is a registered trade name of, Belltown Media, Inc. PO Box 980985, Houston, TX 77098 USA Editorial Advisory Panel Nick Baronian Kalyana Krishna Chadalavada "RIAN #ONNER s +EIR $AVIS -ICHAEL %AGER s 6ICTOR 'REGORIO $AVID ! ,ANE s 3TEVE -ARQUEZ $AVE -C!LLISTER s 4HOMAS 1UINLAN #HRIS $ 3TARK s 0ATRICK 3WARTZ Advertising % -!),: [email protected] URL: www.linuxjournal.com/advertising 0(/.% EXT Subscriptions % -!),: [email protected] URL: www.linuxjournal.com/subscribe MAIL: PO Box 980985, Houston, TX 77098 USA LINUX IS A REGISTERED TRADEMARK OF ,INUS 4ORVALDS LJ262-February2016.indd 6 1/21/16 5:27 PM Where every interaction matters. break down your innovation barriers power your business to its full potential When you’re presented with new opportunities, you want to focus on turning them into successes, not whether your IT solution can support them. Peer 1 Hosting powers your business with our wholly owned FastFiber NetworkTM, solutions that are secure, scalable, and customized for your business. Unsurpassed performance and reliability help build your business foundation to be rock-solid, ready for high growth, and deliver the fast user experience your customers expect. Want more on cloud? Call: 844.855.6655 | go.peer1.com/linux | Vew Cloud Webinar: Public and Private Cloud | Managed Hosting | Dedicated Hosting | Colocation LJ262-February2016.indd 7 1/21/16 5:27 PM Current_Issue.tar.gz For the Love SHAWN POWERS of Linux love my job. I teach Linux by day Reuven M. Lerner provides a and write about Linux at night. BREAKDOWN OF SOME OF HIS TOP PICKS I )TS EASY TO FALL IN LOVE WITH YOUR ON TOPICS FROM PROGRAMMING TO work when the things you do align podcasting. It’s hard to go wrong WITH YOUR PASSIONS !LL OF US HERE IN with a good book, and Reuven will the Linux Journal community have HELP YOU FIND ONE A LOVE FOR ,INUX AND OPEN SOURCE 7ITH THE HELP OF $AVE 4AYLOR YOU but even inside our world, there are will learn to deal with command some topics that are just downright arguments in scripts using getopt FUN 4HIS MONTH IS FULL OF ARTICLES in your code. Dealing with we’re passionate about. arguments doesn’t seem like a big *OEY "ERNARD STARTS OFF WITH A DEAL BUT WHAT IF PEOPLE COMBINE LOOK AT +3TARS )F YOURE A SPACE NUT THEM &OR INSTANCE -rf instead like me, you’ll want to check out OF -r -f 2ATHER THAN WRITE PAGES HIS DETAILED LOOK AT THE +$% NATIVE OF CONDITIONALS $AVE EXPLORES HOW astronomy program. It’s dark enough to use getopt, which does all the to see the stars only at night, but DIRTY WORK FOR YOU )F YOU NEED TO WITH *OEYS HELP YOU CAN SURF THE write a script that accepts command- NIGHT SKY ANY TIME OF DAY 4HEN line arguments, this month’s column WHAT BETTER WAY TO END A DAY OF is a must-read. LCD star gazing than to read a ) TAKE A STEP AWAY FROM THE TECH BOOK ON YOUR FAVORITE SUBJECT keyboard this issue and head around TO THE BACK OF THE COMPUTER V VIDEO: SPECIFICALLY TO THE POWER CORD -Y Shawn Powers runs FAMILY RECENTLY MOVED INTO AN OLD through the latest issue. TURN OF THE CENTURY HOUSE AND EVEN 8 / FEBRUARY 2016 / WWW.LINUXJOURNAL.COM LJ262-February2016.indd 8 1/21/16 5:27 PM CURRENT_ISSUE.TAR.GZ with a massive electrical overhaul, the 3OL ,EDERMAN FINISHES OFF THE POWER IS FLAKY AT BEST ) DECIDED TO issue with some awesome problem share my experience this month and SOLVING 4HE BEST USE OF ,INUX OR CLARIFY SOME OF THE VARIOUS HARDWARE technology in general, is to make options available to help regulate QUICK WORK OF SOMETHING THAT WOULD and stabilize the electricity coming take a long time to do on your own. INTO YOUR HOME OR BUSINESS 4HE FACT 3CRIPTING WAS DESIGNED FOR THAT that I’m writing this on a desktop exact purpose. In this command-line computer rather than a laptop means tutorial, Sol describes how to write a MY HARD WORK HAS PAID OFF ONE LINER TO FIND A SPECIFIC DATE AND Susan Sons has an incredible then put that one-liner into a script interview with Katerina Barone-Adesi TO MAKE IT MORE FLEXIBLE -OST GOOD this month where she gets the details programs start with a problem that ON 3NABB )F YOUVE NEVER HEARD OF needs to be solved, and in this case, Snabb, you’ll be glad you read the THE PROBLEM IS TRYING TO FIND THE NEXT interview, because it’s an incredible Friday the 13th. network toolkit that isn’t built in We all have passions that drive us TO THE ,INUX KERNEL )F THE IDEA OF TO LEARN AND EXPLORE &OR SOME OF bypassing the Linux kernel to increase US ME ITS FEEDING THE BIRDS &OR SPEED SEEMS ODD YOU DEFINITELY WANT OTHERS ITS BREWING THE PERFECT BEER TO READ THIS INTERVIEW The best part about being a Linux You might remember Kyle Rankin geek is that we can take advantage WRITING A FEW YEARS AGO ABOUT USING OF ,INUXS OPEN SOURCE NATURE AND a Pogo Linux device (and later a make our passions really come to Raspberry Pi, I think) to keep his LIFE 7E HOPE YOU SHARE SOME OF homebrew beer chilled while it the excitement we brought into this AGED +LAUS +OLLE TAKES A DIFFERENT issue and can’t wait to hear about approach, and using a BeagleBone WHAT SORTS OF PROJECTS YOU IMPROVE "LACK HE CONTROLS THE HEATING OF WITH THE HELP OF OUR FAVORITE /3Q the mash during his beer-making process.