Linux Journal Ebook Series
Total Page:16
File Type:pdf, Size:1020Kb
™ HOW TO: Home Automation with Raspberry Pi Since 1994: The Original Magazine of the Linux Community MAY 2015 | ISSUE 253 | www.linuxjournal.com COOL PROJECTS BUILD A Vehicle Monitoring and Control System CREATE A Safe to Store Your Sensitive Data PLUS Understanding Linux Permissions Send SMS Working Modify the WATCH: Notifications with Django Boot Menu— ISSUE OVERVIEW to Your Models and Libreboot V Smart Watch Migrations on an X60 LJ253-May2015bu.indd 1 4/24/15 12:18 PM NEW! Linux Journal eBook Series GEEK GUIDES FREE Download The DevOps Toolbox: NOW! Tools and Technologies for Scale and Reliability By Bill Childers Introducing The DevOps Toolbox: Tools and Technologies for Scale and Reliability by Linux Journal Virtual Editor Bill Childers. When I was growing up, my father always said, “Work smarter, not harder.” Now that I’m an adult, I’ve found that to be a core concept in my career as a DevOps engineer and manager. In order to work smarter, you’ve got to have good tools and technology in your corner doing a lot of the repetitive work, so you and your team can handle any exceptions that occur. More important, your tools need to have the ability to evolve and grow over time according to the changing needs of your business and organization. In this eBook, I discuss a few of the most important tools in the DevOps toolbox, the benefits of using them and some examples of each tool. It’s important to not consider this a review of each tool, but rather a guide to foster thinking about what’s appropriate for your own organization’s needs. Register today to receive your complimentary copy of The DevOps Toolbox: http://linuxjournal.com/devops-toolbox-guide Beyond Cron How to Know When You’ve Outgrown Cron Scheduling— and What to Do Next By Mike Diehl If you’ve spent any time around UNIX, you’ve no doubt learned to use and appreciate cron, the ubiquitous job scheduler that comes with almost every version of UNIX that exists. Cron is simple and easy to use, and most important, it just works. It sure beats having to remember to run your backups by hand, for example. But cron does have its limits. Today’s enterprises are larger, more interdependent, and more interconnected than ever before, and cron just hasn’t kept up. These days, virtual servers can spring into existence on demand. There are accounting jobs that have to run after billing jobs have completed, but before the backups run. And, there are enterprises that connect Web servers, databases, and file servers. These enterprises may be in one server room, or they may span several data centers. Register today to receive your complimentary copy of Beyond Cron: http://linuxjournal.com/beyond-cron-guide http://linuxjournal.com/geekguides LJ253-May2015bu.indd 2 4/24/15 12:18 PM LJ253-May2015bu.indd 3 4/24/15 12:18 PM MAY 2015 CONTENTS ISSUE 253 COOL PROJECTS FEATURES 54 Home Automation 68 Embed Linux in with Raspberry Pi Monitoring and Have a home with a life of its own. Control Systems Bharath Bhushan Lohray Linux touches the real world. Rick Brown ON THE COVER /V^;V!/VTL(\[VTH[PVU^P[O9HZWILYY`7PW )\PSKH=LOPJSL4VUP[VYPUNHUK*VU[YVS:`Z[LTW *YLH[LH:HML[V:[VYL@V\Y:LUZP[P]L+H[HW :LUK:4:5V[PMPJH[PVUZ[V@V\Y:THY[>H[JOW >VYRPUN^P[O+QHUNV4VKLSZHUK4PNYH[PVUZW 4VKPM`[OL)VV[4LU\·3PIYLIVV[VUHU?W 7S\Z!<UKLYZ[HUKPUN3PU\_7LYTPZZPVUZW Cover Image: © Can Stock Photo Inc. / 4774344sean 4 / MAY 2015 / WWW.LINUXJOURNAL.COM LJ253-May2015bu.indd 4 4/24/15 12:18 PM INDEPTH 80 Hacking a Safe with Bash How to script a safe to keep your sensitive data secure. Adam Kosmin COLUMNS 24 30 Reuven M. Lerner’s At the Forge Django Models and Migrations 38 Dave Taylor’s Work the Shell System Status as SMS Text Messages 44 Kyle Rankin’s Hack and / Libreboot on an X60, Part III: Modify the Boot Menu 90 Doc Searls’ EOF 28 An Easy Way to Pay for Journalism, Music and Everything Else We Like IN EVERY ISSUE 8 Current_Issue.tar.gz 10 Letters 16 UPFRONT 28 Editors’ Choice 50 New Products 93 Advertisers Index 54 LINUX JOURNAL (ISSN 1075-3583) is published monthly by Belltown Media, Inc., 2121 Sage Road, Ste. 395, Houston, TX 77056 USA. Subscription rate is $29.50/year. Subscriptions start with the next issue. WWW.LINUXJOURNAL.COM / MAY 2015 / 5 LJ253-May2015bu.indd 5 4/24/15 12:18 PM 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 E-MAIL: [email protected] URL: www.linuxjournal.com/advertising PHONE: +1 713-344-1956 ext. 2 Subscriptions E-MAIL: [email protected] URL: www.linuxjournal.com/subscribe MAIL: PO Box 980985, Houston, TX 77098 USA LINUX is a registered trademark of Linus Torvalds. LJ253-May2015bu.indd 6 4/24/15 12:18 PM LJ253-May2015bu.indd 7 4/24/15 12:18 PM Current_Issue.tar.gz Robotic SHAWN POWERS Sharks with Laser Eyes love the Cool Projects issue. with a new topic this month (you Don’t get me wrong, most might remember Dave was working I issues of Linux Journal are on a word search project in his last full of cool things to do, but this column). In this issue, he takes month, we do it just because of the on the topic of how to make your cool factor. As you can imagine, shell scripts send text messages. no Cool Projects issue is complete It’s a great way to get instant without a Raspberry Pi article, and notifications to users, which isn’t this one is particularly awesome. usually possible from inside a script. But let me start off with a bit I describe a couple cool programs about our columns. in this month’s upfront section, Reuven M. Lerner continues his starting with Budgie. If you like the series on Django, and this month, simplicity of the Chrome desktop he covers migrations and updating interface, but prefer a full-blown databases. If you’re a developer Linux system underneath, Budgie looking for a framework to start is perfect. I also talk about the with, or if you’re already using intricacies of the Linux permissions Django and want to learn more, system and even a few Bitcoin Reuven’s series is a great way to clients. It’s hard to beat the cool begin. Dave Taylor follows Reuven factor of Kyle Rankin’s column this month, however, as he continues V VIDEO: his series on Libreboot. People Shawn Powers runs have been installing open source through the latest issue. on hard drives for years, but with 8 / MAY 2015 / WWW.LINUXJOURNAL.COM LJ253-May2015bu.indd 8 4/24/15 12:18 PM CURRENT_ISSUE.TAR.GZ Kyle’s assistance, you will learn Adam Kosmin goes much further to install the open-source BIOS and describes his complete system replacement as well! for keeping data secure. Using Be sure to check out Bharath freely available tools and a handful Bhushan Lohray’s article for an of scripts and methods, he shows incredible home automation how to integrate secure encryption project. Starting from scratch into your daily routine. If you want with a Raspberry Pi, some relays to encrypt your data, but find it and some wiring, Bharath walks complex and frustrating, be sure to through the steps of using the read Adam’s article. GPIO pins to manage multiple The Cool Projects issue is a systems. Although it’s certainly favorite of mine year after year. Not possible to buy one of the many only is it a chance to start working embedded home automation on those ideas you’ve been putting kits available, starting from off for months, but it’s also a great scratch allows for some serious way to learn while playing. I learned customization and infinite more about how keyboards function programability. If you’ve been while making my MAME cabinet struggling to choose a brand of than ever before or since. As a kid home automation systems to try, who took apart everything I got my perhaps after reading this article, hands on, the Cool Projects issue THAT QUESTION WILL BECOME MOOT is an awesome way to learn how Rick Brown describes another to put a few things back together! awesome project, but this time it Whether you love projects or just integrates with existing systems.