Since 1994: The Original Magazine of the Linux Community JULY 2014 | ISSUE 243 | www.linuxjournal.com TINY CORE LINUX FOR FIREFIGHTERS HOW TO USE MACROS—A TIME-SAVING FEATURE OF VIM MOBILE, TIPS % FOR USING OLD DEVICES ANDROID A LOOK AT PRIVATE CLOUDS FOR REMOTE SYSTEM ADMINISTRATION OPEN- SOURCE NASA SOFTWARE GADGETS FORA HEALTHY LIFESTYLE TRY FLASK, APOWEFUL MICRO¬ FRAMEWORK WATCH: ISSUE OVERVIEW FREE AND OPEN SOURCE SOFTWARE EXPO FOSSCTCOnl AND TECHNOLOGY CONFERENCE 2 0 14 Come out and participate in the First Annual Fossetcon 2014 Florida's Only Free and Open Source Conference. With in 10 minutes of Disney Land, Universal Studios and Epcot Center. DAYO BSD Jmulk DAY 1 FOOD, TRAINING, WORKSHOPS AND CERTIFICATIONS FOOD, KEYNOTES, EXPO HALL, SPEAKER TRACKS DAY 2 FOOD, KEYNOTES, EXPO HALL, SPEAKER TRACKS FREE FOOD, -TRAINING. * CERTIFICATIONS > AND GIVEAWAYS!!! SEPT 11 • SEPT 13 ROSEN PLAZA HOTEL ORUNDO, FL Fossetcon 2014: The Gateway To The Open Source Community powered by: More info at www.fossetcon.org CITRIX Open@Citrix I ^ggj Are you considering software-defined storage? zStax StorCore ZFS Unified Storage from Silicon Mechanics is truly software defined storage. ZFS Unified Storage From modest data storage needs to a multi-tiered production storage environment, the zStax StorCore ZFS unified storage appliances have the right mix of performance, capacity, and reliability to fit your needs. zStax StorCore 64 The zStax StorCore 64 is your Tier 2 and 3 storage solution. While still leveraging all of the features inherent to the zStax platform, the StorCore 64 model offers an easily deployable and intuitively managed enterprise storage appliance. From backup and archival, to departmental file shares and streaming video, the zStax StorCore 64 has your needs covered. zStax StorCore 104 The zStax StorCore 104 is your system for highly available Tier 1 storage environments. Offering levels of redundancy, the StorCore 104 keeps your critical data available when competitors waiver. Finally, the StorCore 104 delivers a multi-tiered environment under one pane of management so you can elimi¬ nate the need for multiple vendors to satisfy your tiered data requirements. Talk with an expert today: 866-352-1173 - http://www.siliconmechanics.com CONTENTS SSS MOBILE FEATURES 54 Remote System Administration with Android Work as sysadmin from afar, thanks to some Android apps. Federico Kereki 74 New Uses for Old Devices Got a drawer full of old phones? Check out what you could be doing with them. Bill Childers ON THE COVER • Tiny Core Linux for Firefighters, p. 84 • How to Use Macros—a Time-Saving Feature of vim, p. 38 • Tips for Using Old Devices, p. 74 • Android Apps for Remote System Administration, p. 54 • Gadgets for a Healthy Lifestyle, p. 42 • Try Flask, a Powerful Microframework, p. 26 • A Look at Private Clouds, p. 98 • Open-Source NASA Software, p. 16 4 / JULY 2014 / WWW.LINUXJOURNAL.COM INDEPTH 84 Practical Tiny Core in the Fire Service Tiny Core Linux Redux: Linux helping first responders. Wi If redo Crespo 98 Is the Private Cloud a Real Cloud? According to Gartner research, by 2015, the majority of private cloud computing services will evolve to leverage public cloud services in a hybrid model. Mitesh Soni COLUMNS 26 Reuven M. Lerner’s At the Forge Flask 34 Dave Taylor’s Work the Shell Days Between Dates? 38 Kyle Rankin’s Hack and / The Only Mac I Use 42 Shawn Powers’ The Open-Source Classroom Healthy Robots 112 Doc Searls’ EOF A Pain in the Person IN EVERY ISSUE 8 Current lssue.tar.gz 10 UPFRONT 24 Editors’ Choice 50 New Products 115 Advertisers Index Thursday (3/20) 42 114b AM 12:30 I’M •OmronHJ 720 ♦•Wrthings Pulse Ultra ^^OmronKl 32 « Hi I’M 3:30 PM 4 3< *FKBltOnc ^^Accupcdo * N oomwalk 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 / JULY 2014 / 5 LINUX JOURNAL Subscribe to Linux Journal Digital Edition for only $2.45 an issue. ENJOY: Timely delivery LINUX JOURNAL Executive Editor Jill Franklin jill@linuxjournal.com Senior Editor Doc Searls doc@linuxjournal.com Associate Editor Shawn Powers shawn@linuxjournal.com Art Director Garrick Antikajian garrick@linuxjournal.com Products Editor James Gray newproducts@linuxjournal.com Editor Emeritus Don Marti dmarti@linuxjournal.com Technical Editor Michael Baxter mab@cruzio.com Senior Columnist Reuven Lerner reuven@lerner.co.il Security Editor Mick Bauer mick@visi.com Hack Editor Kyle Rankin lj@greenfly.net Virtual Editor Bill Childers bill.childers@linuxjournal.com Contributing Editors Ibrahim Haddad • Robert Love • Zack Brown • Dave Phillips • Marco Fioretti • Ludovic Marcotte Paul Barry • Paul McKenney • Dave Taylor • Dirk Elmendorf • Justin Ryan • Adam Monsen Publisher Carlie Fairchild publisher@linuxjournal.com Director of Sales John Grogan john@linuxjournal.com Associate Publisher Mark Irgang mark@linuxjournal.com Webmistress Katherine Druckman webmistress@linuxjournal.com Accountant Candy Beauchamp acct@linuxjournal.com Off-line reading Easy navigation Phrase search and highlighting Ability to save, clip and share articles Embedded videos 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 Brad Abram Baillio • Nick Baronian • Hari Boukis • Steve Case Kalyana Krishna Chadalavada • Brian Conner • Caleb S. Cullen Keir Davis • Michael Eager • Nick Faltys • Dennis Franklin Frey Victor Gregorio • Philip Jacob • Jay Kruizenga • David A. Lane Steve Marquez • Dave McAllister • Carson McDonald • Craig Oda Jeffrey D. Parent • Charnell Pugsley • Thomas Quinlan • Mike Roberts Kristin Shoemaker • Chris D. Stark • Patrick Swartz • James Walker Advertising E-MAIL: ads@linuxjournal.com URL: www.linuxjournal.com/advertising PHONE: +1 713-344-1956 ext. 2 Android & iOS apps, desktop and e-Reader versions Subscriptions E-MAIL: subs@linuxjournal.com URL: www.linuxjournal.com/subscribe MAIL: PO Box 980985, Houston, TX 77098 USA LINUX is a registered trademark of Linus Torvalds. SUBSCRIBE TODAY! LINUX JOURNAL DevOps Have projects in development that need help? Have a great development operation in place that can ALWAYS be better? Regardless of where you are in your DevOps process, Linux Journal can help! With deep focus on Collaborative Development, Continuous Testing and Release & Deployment, we offer here the DEFINITIVE DevOps for Dummies, a mobile Application Development Primer plus advice and help from expert sources like: • Forrester • Gartner • IDC • Linux Journal Plus a host of other eBooks, videos, podcasts and more. REGISTER NOW and receive unlimited access to all site content and downloads, plus alerts when new assets are made available. DevOps for Dummies Free eBook DevOps dumM ie ~ Today’s fast-moving world makes DevOps essential for any business aspiring to be agile and lean in order to respond rapidly to changing customer and marketplace demands. This book helps you under¬ stand DevOps and how your organization can gain real business benefits from it. You’ll also discover how a holistic view of DevOps that encompasses the entire software delivery life cycle - from ideation and the conception of new business capabilities to implementation in production - can bring competitive advantage in a continuous delivery world. Service Virtualization for Dummies Book Service Virtualization DUMte? Free eBook Discover service virtualization and how it fits into the big picture of software quality. In this book, Service Virtualization For Dummies, IBM Limited Edition, written by industry analysts Marcia Kaufman and Judith Hurwitz, learn how to deliver higher quality software by increasing the efficiency and effectiveness of your testing processes while reducing testing downtime and testing cost. REGISTER NOW http://devops.linuxjournal.com Current_lssue.tar.gz Is That a Penguin in Your Pocket? SHAWN POWERS W e're getting to the point in technological evolution that "mobile technology" no longer will be a term. It's becoming just "technology", as the stationary kind is less and less common. Perhaps I should trademark "Stationary Tech", in case the idea takes off! As Linux users, we've spent our lives expanding our install base to every device we can, so Linux on mobile devices is a pretty simple shift. As a people group, developers have had a bigger learning curve when developing for low-power, tiny-sized mobile devices. It's forced devs to streamline their code and focus on Ul more than ever before. Our resident developer, Reuven M. Lerner, starts this issue off by showing us the lean and powerful Flask framework that balances ease of use, a small core, oodles of features and a distinctly Python-like feeling when developing sites in it. VIDEO: Shawn Powers runs through the latest issue. Dave Taylor walks us through creating the logic for a script that counts days gone by. Thanks to leap years, counting backward in days can be a confusing endeavor. Combining math and ingenuity, Dave shows how it's done. Kyle Rankin follows Dave and teaches us all how to use a mac—more specifically, a macRO for the vim editor. Kyle gets far more use out of vim than I do, even though it's the editor I use on the command line as well. We should all learn to be a little more effective on the console if we heed Kyle's wisdom. This month, as usual, he has wisdom aplenty. I decided to take a shift this month and talk about health. Since I'm a nerd, when I talk about health, I talk about how technology can help promote that health. Specifically, I talk about how technology can aid you in living a healthy lifestyle. Whether you want to run a marathon or just make cool graphs of your weight loss/gain, my column should have something interesting for everyone. If you ever hang out with Kyle Rankin, 8 / JULY 2014 / WWW.LINUXJOURNAL.COM CURRENT ISSUE.TAR.GZ you should ask him about managing downtime in his data center from atop a ski lift—or maybe it was in a mountain cafe. I can't really remember. While he was years before his time, modern sysadmins are required to manage their server rooms at a moment's notice, and Federico Kereki gives us some great tools for doing real work on our Android mobile devices. I might not always have my laptop with me, but I don't even go to the bathroom without my phone. Federico helps make sure we get the most out of our mobile devices. Bill Childers addresses a topic near and dear to my heart this month, when he talks about getting new use out of old mobile devices. A few months back, I shared my (continuing) adventures with BirdCam. Bill goes about 20 steps further and gives us tons of cool projects and ideas for our outdated phones, tablets and other devices. Some of them already might have occurred to you, but some will be new and interesting. Open up your bottom drawer and grab those old phones! We also get an in-depth look at Tiny Core Linux from Wilfredo Crespo. Wilfredo takes us through the process of customizing the minimalist distribution to fit any particular set of requirements. In his case, the need is for a Web kiosk application to display call information in a fire department. I'm definitely in favor of Linux helping save lives, and this month, we get firsthand instructions on how it's happening. Finally, in this issue, we hear from Mitesh Soni about cloud computing. If a company decides not to trust public cloud vendors with its data, and so designs a private cloud infrastructure with their own hardware, is that still a cloud? Mitesh teaches us about the nuances of the private cloud, how the concept can coexist with public offerings, and what it means for the future of cloud computing. Anyone developing applications for the cloud won't want to miss it. Does mobile computing mean the end of the desktop is near? As someone with multiple jumbo monitors on his desk, I can say I don't think that day is coming any time soon. I can say with certainty that the mobile technology market is only going to keep growing, however. Much like data centers and cloud computing, Linux is a huge piece of the push for mobile technology. This month's issue is proof. Plus, it's just a really fun issue to read. We hope you enjoy it as much as we enjoyed putting it together!* Shawn Powers is the Associate Editor for Linux Journal. He’s also the Gadget Guy for LinuxJournal.com. and he has an interesting collection of vintage Garfield coffee mugs. Don’t let his silly hairdo fool you. he’s a pretty ordinary guy and can be reached via e-mail at shawn@linuxjournal.com Or. swing by the #linuxjournal IRC channel on Freenode.net. WWW.LINUXJOURNAL.COM / JULY 2014 / 9 FRONT NEWS + FUN diff -u WHAT’S NEW IN KERNEL DEVELOPMENT Once in a while someone points out a POSIX violation in Linux. Often the answer is to fix the violation, but sometimes Linus Torvalds decides that the POSIX behavior is broken, in which case they keep the Linux behavior, but they might build an additional POSIX compatibility layer, even if that layer is slower and less efficient. This time, Michael Kerrisk reported a POSIX violation that affected file operations. Apparently, reading and writing to files during multithreaded operations could hit race conditions and overwrite each other's changes. There was some discussion over whether this was really a violation of POSIX, but ultimately, who cares? Data clobbering is bad. After Michael posted some code to reproduce the problem, the conversation focused on what to do to fix it. But Michael did make an argument that "Linux isn't consistent with UNIX since early times. (E.g., page 191 of the 1992 edition of Stevens APUE discusses the sharing of the file offset between the parent and child after fork(). Although Stevens didn't explicitly spell out the atomicity guarantee, the discussion there would be a bit nonsensical without the presumption of that guarantee.)" Al Viro joined Linus in trying to come up with a fix. Linus tried introducing a simple mutex to lock files so that write operations couldn't clobber each other, and Al offered his own refinements that improved on Linus' patch. At one point, Linus explained the history of the bug itself. Apparently, once upon a time the file pointer, which told the system where to write into the file, had been locked in a semaphore so only one process could do anything to it at a time. But, they took it out of the semaphore in order to accommodate device files and other non-regular files that ran into race conditions when users were barred from writing to them whenever they pleased. That was what introduced the bug. At the time, it slipped through undetected, because that actual reading and writing to regular files was still handled atomically by the kernel. It was only the file pointer itself that could get out of sync. And, because high-speed threaded file operations are a pretty 10 / JULY 2014 / WWW.LINUXJOURNAL.COM rare need, it took a long time for anyone to run into the problem and report it. An interesting little detail is that, while Linus and Al were hunting for a fix, Al at one point complained that the approach Linus was taking wouldn't support certain architectures, including ARM and PowerPC. Linus' response was, "I doubt it's worth caring about. [...] If the ARM/PPC people end up caring, they could add the struct-return support to gcc." It's always interesting to see how corner cases crop up and get dealt with. In some cases, part of the fix has to happen in the kernel, part in GCC and part elsewhere. In this particular instance, Al felt the whole thing could be done in the kernel, and he was inspired to write his own version of the patch, which Linus accepted. Andi Kleen wanted to add low-level CPU event support to perf. The problem was that there could be tons of low-level events, and it varied widely from CPU to CPU. Even storing the possible events in memory for all CPUs would significantly increase the kernel's running size. So, hard-coding this information into the kernel would be problematic. He pointed out that the OProfile tool relied on publicly available lists of these events, though he said the OProfile developers didn't always keep their lists up to date with the latest available versions. To solve these issues, Andi submitted a patch that allowed perf to identify which event-list was needed for the particular CPU on the given system, and automatically download the latest version of that list from its home location. Then perf could interpret the list and analyze the events, without LINUX JOURNAL fit Your Service SUBSCRIPTIONS: Linux Journal is available in a variety of digital formats, including PDF, .epub, .mobi and an on-line digital edition, as well as apps for iOS and Android devices. Renewing your subscription, changing your e-mail address for issue delivery, paying your invoice, viewing your account details or other subscription inquiries can be done instantly on-line: http://www.linuxjournal.com/subs. E-mail us at subs@linuxjournal.com or reach us via postal mail at Linux Journal, PO Box 980985, Houston, TX 77098 USA. Please remember to include your complete name and address when contacting us. ACCESSING THE DIGITAL ARCHIVE: Your monthly download notifications will have links to the various formats and to the digital archive. To access the digital archive at any time, log in at http://www.linuxjournal.com/digital. LETTERS TO THE EDITOR: We welcome your letters and encourage you to submit them at http://www.linuxjournal.com/contact or mail them to Linux Journal, PO Box 980985, Houston, TX 77098 USA. Letters may be edited for space and clarity. WRITING FOR US: We always are looking for contributed articles, tutorials and real-world stories for the magazine. An author's guide, a list of topics and due dates can be found on-line: http://www.linuxjournal.com/author. FREE e-NEWSLETTERS: Linux Journal editors publish newsletters on both a weekly and monthly basis. Receive late-breaking news, technical tips and tricks, an inside look at upcoming issues and links to in-depth stories featured on http://www.linuxjournal.com. Subscribe for free today: http://www.linuxjournal.com/ enewsletters. ADVERTISING: Linux Journal is a great resource for readers and advertisers alike. Request a media kit, view our current editorial calendar and advertising due dates, or learn more about other advertising and marketing opportunities by visiting us on-line: http://ww.linuxjournal.com/ advertising. Contact us directly for further information: ads@linuxjournal.com or + 1 713-344-1956 ext. 2. V WWW.LINUXJOURNAL.COM / JULY 2014 / 11 [UPFRONT i They Said It Take the attitude of a student, never be too big to ask questions, never know too much to learn something new. —Og Mandino It is curious that physical courage should be so common in the world and moral courage so rare. —Mark Twain Observe your enemies, for they first find out your faults. —Antisthenes We act as though comfort and luxury were the chief requirements of life, when all that we need to make us happy is something to be enthusiastic about. —Charles Kingsley You don't become great by trying to be great. You become great by wanting to do something, and then doing it so hard that you become great in the process. —Randall Munroe overburdening the kernel. There was various feedback to Andi's code, mostly to do with which directory should house the event-lists, and what the filenames should be called. The behavior of the code itself seemed to get a good reception. One detail that may turn out to be more controversial than the others was Andi's decision to download the lists to a subdirectory of the user's own home directory. Andi said that otherwise users might be encouraged to download the event-lists as the root user, which would be bad security practice. Sasha Levin recently posted a script to translate the hexadecimal offsets from stack dumps into meaningful line numbers that pointed into the kernel's source files. So something like "ffffffff811f0ec8" might be translated into "fs/proc/generic.c:445". However, it turned out that Linus Torvalds was planning to remove the hex offsets from the stack dumps for exactly the reason that they were unreadable. So Sasha's code was about to go out of date. They went back and forth a bit on it. At first Sasha decided to rely on data stored in the System.map file to compensate, but Linus pointed out that some people, including him, didn't keep their System.map file around. Linus recommended using /usr/bin/nm to extract the symbols from the compiled kernel files. So, it seems as though Sasha's script may actually provide meaningful file and line numbers for debugging stack dumps, assuming the stack dumps provide enough information to do the calculations.— zackbrown 12 / JULY 2014 / WWW.LINUXJOURNAL.COM [UPFRONT i Adminer—Better Than Awesome! Language: English Admmer 3.1. 0 fMvSOLl ODBC fMvSOLl root@localhost Login System MySQL Server localhost Username Password Login 0 Permanent login I've always loved PHPMyAdmin for managing MySQL databases. It's Web-based, fairly robust and as powerful as I've ever needed. Basically, it's awesome. Today, however, I discovered something better than awesome: Adminer. Although it is conceptually identical to PHPMyAdmin, it is far simpler and far more powerful. How can it be both? The Adminer Web site has a great feature comparison: http://www.adminer.org/en/ phpmyadmin. For me, the interface is basic, no-nonsense and intuitive. I like that installation is a single PHP file, and I also like that it supports alternate database systems like Postgres. If you are someone who prefers to use a Web interface over the command line, don't be ashamed. Heck, I recently managed an entire database department at a university, and I still prefer a Web- based interface. Anyway, if you're like me, you'll love Adminer. Get your copy today at http://www.adminer.org. —SHAWN POWERS WWW.LINUXJOURNAL.COM / JULY 2014 / 13 [UPFRONT i It Actually Is Rocket Science Screenshot from the OpenRocket Web Site (http://openrocket.sourceforge.net) Depicting a 2-D View of the Rocket Design Process I've never once made a model rocket. I've always wanted to, but apart from "tube with explodey rocket part", I really didn't know where to start with designing. I recently found an open- source application that should help me with my lack of rocket science know-how: OpenRocket. The aspect of actually designing a rocket appeals to me, because not only will I have a better chance of launching a rocket successfully, but I'll also be able to compare expected results with actual results. If my carefully designed rocket veers into the neighbor's yard and blows up the dog house, I want to be able to figure out why! If you've always wanted to launch a model rocket, but never had that really cool middle- school science teacher that showed everyone how, check out OpenRocket. Even if you did launch rockets in school, with OpenRocket, you should be able to design a far more complex (and more awesome!) design on your computer. If you have any success with your pre-designed rocket, I'd love to see a video! Send a YouTube link to shawn@linuxjournal.com. —SHAWN POWERS 14 / JULY 2014 / WWW.LINUXJOURNAL.COM [UPFRONT i Great Scott! It’s Version 13! No matter how much I love Plex, there's still nothing that comes close to XBMC for usability when it comes to watching your network media on a television. I've probably written a dozen articles on Plex during the last few years, so you know that's tough for me to admit. Still, no matter how many Plex-enabled devices I might buy (Roku, Amazon Fire TV, phones, tablets, Web browsers), I run XBMC on all my televisions. The interface, when coupled with a back-end MySQL database, is just unbeatable. My ultimate dream is that XBMC and Plex would somehow merge together into an incredible living room experience that also kicks butt on a mobile device. Until that day of convergence, I'll keep supporting two platforms. And, the XBMC platform recently got a significant upgrade. Version 13, code-named "Gotham" was released in May 2014. By the time you read this, 13.1 should be out, which fixes some bugs. I'm most happy to see continued improvements with the Live TV and PVR features. Add to that further optimization for Android and Raspberry Pi devices, and XBMC is by no means out of the game. I'm excited to see XBMC continue along at a steady development pace. So, my weekend project once Saturday rolls around? Upgrading all my televisions to Gotham. Get a copy today at http ://w w w. xbmc.org. —shawn powers WWW.LINUXJOURNAL.COM / JULY 2014 / 15 [UPFRONT i Open-Source Space As I write this, NASA has just passed another milestone in releasing its work to the Open Source community. A press release came out announcing the release on April 10, 2014, of a new catalog of NASA software that is available as open source. This new catalog includes both older software that was previously available, along with new software being released for the first time. The kinds of items available include project management systems, design tools, data handling and image processing. In this article, I take a quick look at some of the cool code available. NASA Technology Tram ££ Projects | code.nasa.gov x C rt | D technology.nasa.gov & M □ O <1 4i QQ 5 ill Apps Feedly W Wikipedia, the free M Gmail Inbox Google Calendar Q YouTube boards Magazines Letter Writers Alliar J) Submit Articles » Other Bookmarks nasa National Aeronautics and Space Administration NASA Technology Transfer Portal HOME_ADVANCED SEARCH_ANALYTICS Welcome to the NASA Technology Transfer Portal-Bringing NASA Technology Down to Earth! The NASA Technology Transfer Portal contains data from all 10 NASA field centers and headquarters, enabling industry and the general public to find information about technology opportunities, licensing opportunities and past success stories Search NASA Technology Finder Search NASA Spinoff Get the iPad App i l 201 \ || 2010 ir~2009~| Other Useful NASA Links NASA Aerospace Technical Facility Inventory NASA Small Business Innovation Research Program NASA’s Innovation Impacts Across the U.S NASA Spinoff NASA Technology Reporting NASA Open Source Software NASA QuIckLaunch Featured Technologies Selective Functionalization Of Carbon Nanotubes Based Upon Distance Traveled A method and system for selective functionalization of a collection of carbon nanotubes (CNTs) based upon distance traveled. □ b s h 0 umumuQi Technologies Available for Licensing EB Aerodynamics Multiplexers Transmitters Aeronautics Biological Communications Mechanical Robotics Amplifiers Antennas valve protocols cables Power R ou ters Waveguides Algorithms Command Control CONTACT US QuickLaunch: A selection of specially priced licenses with a quick turnaround. Link to NASA Technology Transfer Technologies by Center Telemetry Acquisition Data Devices @ TFf.H BRIFFR _ Aerogels Coatings Planetary Landing Ames Research Center Armstrong Right Research Center ^ Glenn Research Center _ Jg Figure 1. The main technology transfer site is a portal to provide access to everything NASA has to offer. 16 / JULY 2014 / WWW.LINUXJOURNAL.COM [UPFRONT i The main Web site is at http://technology.nasa.gov. This main page is a central portal for accessing all of the technology available to be transferred to the public. This includes patents, as well as software. As a quick start, there is a subject cloud in the lower central region of the page that can do a search on several different keywords for you. Unfortunately, this is only a catalog of all the offerings, and it's not quite complete yet in terms of detailed information. So, for example, if you click on Command Control, you will be taken to a results page that includes items like Rendezvous and Proximity Operations Program (RPOP). If you click on that, you will be taken to a details page that is essentially unpopulated. The assumption is that this will be filled in as time allows in B NASA Technology Transt NASA TechFinder X 1 ^ Projects | code.nasa.gov C rt 1 [j technology.nasa.gov/ ? t=techfinder “☆I M □ O % «60Se » uJ Other Bookmarks Apps ^ Feedly W Wikipedia, the free M Gmail Inbox Google Calendar Q YouTube ^ boards Magazines Letter Writers Allia ) ) Submit Articles vasa National Aeronautics and Space Administration NASA Technology Transfer Portal HOME ADVANCED SEARCH ANALYTICS CONTACT US ▲ Command Control 1 2 3 4 5 6 7 next> last » Rendezvous And Proximity Operations Program (RPOP) Johnson Space Center Reference: SOFTWARE MSC-24473-1 2013-07-26 Cursor Control Device Test Suite Johnson Space Center Reference: SOFTWARE MSC-25214-1 2013-07-26 Valve Health Monitoring System Utilizing Smart Instrumentation for Real Time and ... Stennis Space Center Reference: PATENT SSC-00247 2013-07-08 Wireless Controlled Chalcogenide Nanoionic Radio Frequency Switch Glenn Kesearcn center Reference: PATENT LEW-18919-1 2013-01-18 Novel Winding and Control Schemes for Bearingless Motors Glenn Research Center Reference: PATENT LEW-18895-1 2013-01-18 A Comprehensive C++ Controller For A Magnetically Supported Vertical Rotor Versi... Glenn Research Center Reference: SOFTWARE LEW-17293-1 2012-07-20 Pulsed ultrasonic stir welding method Marshall Space Right Center Reference: PATENT 8,393.523 2012-06-14 Future ATM (Air Traffic Management) Concepts Evaluation Tool (FACET) Ames Research Center Reference: SOFTWARE ARC-14653-1 2012-04-23 Systems and methods for peak-seeking control Armstrong Flight Research Center Reference: PATENT 8447443 2012-02-07 Orientation control method and system for object in motion Marshall Space Right Center Reference: PATENT MFS-32651-1 2012-01-03 High power RF solid state power amplifier system Marshall Space Right Center Reference: PATENT MFS-32438-1 2011-08-23 Movable ground based recovery system for reuseable space flight hardware Ames Research Center Reference: PATENT 8,498,756 2011-08-18 High-efficiency power module Glenn Research Center ▼ Reference: PATENT 8,476.979 2011-07-07 A Figure 2. The results page on a search will give you a list of software and patents that are available from NASA. WWW.LINUXJOURNAL.COM / JULY 2014 / 17 [UPFRONT i the future. It does give you a list of what is available though, which is half the battle. Staying on the result list page, you should notice that there is the name of a NASA center on the right- hand side of each line. This is the actual source for the given patent or software entry. Once you find something of interest, you can go to the individual center's Web site to find more details about it. On the lower-right section of the main page of the NASA technology site, you can find direct links to the technology sections for each of the individual centers. The amount of information available at each of these centers varies, but you should be able to find out more details. Some of the sites have direct download links, so you can get the software that interests you. In other cases, sites provide only the contact details for a person you'll NASA Technology Tram O Projects | code.nasa.gov X | 4- -> C rt ' 0 code.nasa.gov/project/ ::: Apps O Feedly W Wikipedia, the free M Gmail Inbox £3 Google Calendar code.NASA sal | YouTube Q boards Q Magazines Letter Writers Allia< J) Submit Articles » Q Other Bookmarks Blog Projects Guide Share your Code Kodiak Library for rigurous verification of non-linear arithmetic https://github.com/nasa/Kodiak now posted on NASA GitHub. WellClear Ein^w **> Version Control System: Git center: Langley Hesearch center License: NASA Open Source Agreement Well-Clear Boundary Models for Integration of UAS in the NAS are now Open Sourced on GitHub. https://github.com/nasa/WellClear NASA Technology Transfer Program 2014 Software Catalog The NASA Technology Transfer Program’s 2014 Software Catalog is now available. The technologies featured in this catalog represent NASA’s best solutions to a wide array of complex problems, and they are on offer here to the public for use. They cover project management systems, design tools, data handling, and image processing, as well as (...) 8+1 Version Control System: Git Center: Langley Research Center License: NASA Open Souroe Agreement Language: MATLAB □ 8+i Version Control System: Git SVN Center: Ames Research Center Glenn Research Center Goddard Space Right Center Jet Propulsion Laboratory Langley Research Center Marshall Space Flight Center License: NASA Open Source Agreement Figure 3. Software released under open source is available at this blog. 18 / JULY 2014 / WWW.LINUXJOURNAL.COM [UPFRONT i need to talk to in order to get copies of the software in question. A PDF catalog also is available on the front page of the main technology site. Here, you can get a 172-page catalog of all of the available software, broken down into 15 categories, for off-line access. One issue that will become evident right away is that not everyone can access all of the available software. Some of the released software is available only to US residents, and some is even more restricted to only parts of the US government. So, is there an easier option for the international community? On the front page, there is a set of other useful NASA links on the lower-left side. The one labeled NASA Open Source Software (http://code.nasa.gov) will take you to a sister site that provides access to a more centralized repository of software released as open source. ^ ^ ® E0 J) Submit Articles NASA Technology Trans- S Projects | code.nasa.gov '.y : Quick Start Guide - Opei >'■ _ 4- C fli S https://sites.google.com/site/openmct/documentation/quick-start-guide j* *: Apps Feedly W Wikipedia, the free M Gmail Inbox Google Calendar O YouTube Q boards u Magazines Letter Writers AIMd- What is MCT? MCT is a user-object oriented system. With MCT, you will use a single interface to work with objects that correspond to the things you want to view and manipulate. Each representation of a user object is called a manifestation of that object. The object's core properties are independent of any particular manifestation. All user objects can interact with all other objects in consistent, predictable ways. User objects provided in the evaluation version include telemetry elements with simulated data feeds, a collection containing these objects, and a simple composition in a canvas view. • You can display the same data from MCT objects in different views: Alpha View Descendants [ Search | ? SS Systems SI Telemetry 1 Si Telemetry 2 Si Telemetry 3 Si Telemetry 4 Si Telemetry 5 a a = » Other Bookmarks You can combine objects into collections in a canvas view to create custom displays: '-l 8CA1 Ch2 Strial r 40 SCA1 Ch3 Krill*.. Figure 4. With the MCT, you can build your own application to monitor almost anything. WWW.LINUXJOURNAL.COM / JULY 2014 / 19 [UPFRONT i It is laid out as a list of available code within a WordPress blog, and it looks like it's being updated regularly. So, it's worth keeping an eye on this site for future releases. So far, I haven't yet looked at what kind of software is available from the technology exchange at NASA, and there is a rather broad collection to play with. The first one I look at here is the Mission Control Technologies (MCT). This package, hosted on GitHub, provides a real-time monitoring and visualizing platform that was developed at the Ames Research Center for use in spaceflight mission operations. It is based on configurable components, so you can use this to build your own application to monitor pretty much anything. If you want to build your own spacecraft to monitor, you will need some way of controlling its flight. Enter the Core Flight Executive (cFE), Figure 5. You can do all kinds of solar science with SunPy. 20 / JULY 2014 / WWW.LINUXJOURNAL.COM [UPFRONT i a portable, platform-independent embedded system framework developed at the Goddard Space Flight Center. It is used for flight software for satellite data systems and instruments, but you can use it for other embedded systems. It is built from subsystems including executive services, time services, event services, table services and a software bus. Python programmers can download SunPy, a library to handle several tasks you run into when doing solar science. For many scientific applications, you need to use clusters of machines. NASA is no exception to this. To handle the complexities, several software packages are available. For dealing with files, there are the Multi- Thread Multi-Node Utilities (Mutil). Mutil provides mcp and msum, which allow for parallelized access to files Figure 6. GMAT can help you plan out your next deep space mission from the comfort of your own living room. WWW.LINUXJOURNAL.COM / JULY 2014 / 21 [UPFRONT i for moving around a cluster. If you have a cluster of machines available over SSH, you can use them with Mesh (Middleware Using Existing SSH Hosts). Mesh provides a lightweight grid middleware that can group your cluster hosts into execution units. You then can issue a command, and Mesh will handle going to one of the available hosts in your group and running this command. If you need an interactive session, there is Ballast (Balancing Load Access Systems). With Ballast, when you try to SSH in to your cluster, you actually end up being shunted onto an available host within your cluster automatically. The last package I want to look at is mission analysis. There is the General Mission Analysis Tool (GMAT), which is designed to help you plan your next trip to Mars. You can use GMAT to model, optimize and estimate spacecraft trajectories. You can create physical resources required for the trip, like the spacecraft, thruster, tank, ground station and so on, and model how the trip will play itself out. There also are analysis model resources, including differential correctors, propagators and optimizers to define the details of the model. The user guide describes the multitude of available options. There also is a series of tutorials, including simulating an orbit, doing simple orbit transfers or even planning an optimal lunar flyby using multiple shooting that walks you through how to use GMAT in greater detail. Now that you've looked at some of the newly released code from NASA, hopefully your interest is piqued enough to go exploring through the more than 1,000 other pieces of code available there. You never know what you may find. If you find something really interesting, please share it with the rest of us!— joey Bernard LETTERS TO THE EDITOR We're moving Letters to the Editor to http://www.linuxjournal.com/letters to provide faster feedback and allow readers to comment. Please continue to send comments and feedback as usual via http://www.linuxjournal.com/contact or e-mail ljeditor@linuxjournal.com. We look forward to hearing from you! 22 / JULY 2014 / WWW.LINUXJOURNAL.COM I really enjoyed it. I can hardly wait to get back to work and start using what I learned. I will encourage employees and co-workers to attend future SPTechCons. The conference had great speakers with relevant subjects, and the whole thing was well organized I prefer SPTechCon over Microsofts SharePoint Conference in Vegas. I’m definitely going to tell others to The Best SharePoint Training in the World returns to Boston! Choose from more than 80 classes and tutorials! SPTechCon The SharePoint Technology Conference September 16-19, 2014 The Boston Park Plaza Hotel & Towers Bolster your career by becoming a SharePoint Master! • Learn from SharePoint experts, including dozens of SharePoint MVPs and Certified SharePoint Professionals • Master document management • Study SharePoint governance • Find out about SharePoint 2013 • Learn how to create applications for SharePoint that solve real business problems • Exchange SharePoint tips and tricks with colleagues • Test-drive SharePoint solutions in the Exhibit Hall If you or your team needs Microsoft SharePoint training, come to SPTechCon Boston! www.sptechcon.com —Greg Infrastructure Development Manager, ITG Inc. ong mi —Ray Ranson, Senior Architect, RSUI A BZ Media Event # [J □ tfl □ @SPTechCon (g&s. SPTechCon™ is a trademark of BZ Media LLC. SharePoint® is a registered trademark of Microsoft. [EDITORS’ CHOICE] Android Candy: Repix, Not Just Another Photo App Apps like Instagram have made photo filters commonplace. I actually don't mind the vintage look for quick cell-phone snapshots, but a filter can do only so much. At first glance, Repix is another one of those "make 24 / JULY 2014 / WWW.LINUXJOURNAL.COM your photo cool" apps that does little more than add a border and change saturation levels. It is more than that, however, taking photo modification to the next level and making it art. The photo here, for instance, is from the Repix Flickr stream. It's obviously been filtered, but you're sure to notice there's a lot more going on. I'm not a terribly visually artistic person, but Repix allows a few simple touches to make a beautiful difference. If you're looking for a simple way to make your cat photos a little more exciting, but don't want to have to transfer photos to a desktop application, check out Repix. The standard features are free, but with an in-app purchase, you can get more packages to play with. Due to its ability to help a luddite like myself create artsy photographs, Repix gets this month's Editors' Choice award. If you like to take photos, but don't have an artistic bone in your body, I urge you to check it out. It's in the Play Store, but the Web site is h tt p ://w w w. repix.it. —shawn powers • High performance NVidia 3-D on an QHD+ RGB/LED • High performance Core i7 Quad CPUs, 32 GB RAM • Ultimate configurability — choose your laptop's features • One year Linux tech support — phone and email • Three year manufacturer's on-site warranty • Choice of pre-installed Linux distribution: Rhino M4800/M6800 • Dell Precision M6800 w/ Core i7 Quad (8 core) • 15.6"-17.3" QHD+ LED w/ X@3200xl800 • NVidia Quadro K5100M • 750 GB - 1 TB hard drive • Up to 32 GB RAM (1866 MHz) • DVD±RW or Blu-ray • 802.11a/b/g/n •Starts at $1375 • E6230, E6330, E6440, E6540 also available Powerful: Rhino Tablet: Raven Raven X240 • ThinkPad X240 by Lenovo • 12.5" FHD LED w/ X@1920xl080 •2.6-2.9 GHz Core i7 •Up to 16 GB RAM • 180-256 GBSSD •Starts at $1910 • W540, T440, T540 also available Vi t < — Rugged: Tarantula - Tarantula CF-31 • Panasonic Toughbook CF-31 • Fully rugged MIL-SPEC-810G tested: drops, dust, moisture & more • 13.1" XGA TouchScreen • 2.4-2.8 GHz Core i5 •Up to 16 GB RAM • 320-750 GB hard drive / 512 GB SSD • CF-19, CF-52, CF-H2, FZ-G1 available EmperorLinux ...where Linux & laptops converge www. Em perorLin ux.com 1 - 888 - 651-6686 0 1 Model specifications and availability may vary. COLUMNS AT THE FORGE Flask REUVEN M. LERNER Love Python, but don’t want the overhead of a large Web framework? Try Flask, a lean, powerful microframework. Let's face it, the Web has gotten big and complicated. No longer is it really possible for someone to be the "Webmaster", as we used to say back in the olden days of Web development. Today, we have front- end developers, back-end developers, system administrators, graphic designers, writers and any number of other jobs associated with the Web. Those of us fortunate enough to know a few of these things call ourselves "full-stack Web developers", but even full-stack developers need other people, with other talents, in order to get a Web application up and running. As the Web has become more complex, so have the frameworks we use to develop applications. Once, we could put up a simple application in a matter of minutes by writing a CGI program. Later, it was enough to slap together a few pages of PHP or perhaps even a template that mixed HTML with a higher-level language. But then came the frameworks—first the big ones, from the Java and .NET worlds, and then the open-source ones, particularly Rails (for Ruby) and Django (for Python). These frameworks are totally amazing, and they do just about everything you ever would want from a Web-development framework. But over time, these frameworks— developed in order to get away from large, do-everything frameworks from the world of enterprise software— have become big. I won't use the term "bloated", because the fact is that I believe most framework maintainers are doing a good job of balancing the core needs and functionality with optional extras. However, there are times when you want the best of all worlds—the ease and speed of creating something without a big framework, while still enjoying the benefits that a framework can provide. This is where "micro¬ frameworks" can suit your needs perfectly. For example, when creating the site that powers my consulting Web site (http://lerner.co.il), I 26 / JULY 2014 / WWW.LINUXJOURNAL.COM 1 COLUMNS AT THE FORGE wanted there to be some dynamic content and also to be able to program things. But, I wasn't about to fire up a full instance of Rails or Django just for that. One of the first, and best-known, microframeworks is Sinatra, which I covered in this column several years ago. Sinatra is written in Ruby, which makes it a great alternative to Rails for smaller projects. But if you're a Python developer, and particularly if you want to make use of the terrific Python infrastructure and community, you actually have several options from which to choose. Perhaps the best known and most fully featured microframework for Python is Flask, written by Armin Ronacher and other members of the international "Pocoo" team of Python developers. There are other microframeworks for Python, such as Bottle, but Flask seems to do a good job of balancing ease of use, a small core, oodles of features, a distinctly Python-like feeling when developing sites in it and a large array of extensions that make it easy to add all sorts of functionality without writing it yourself. So in this article, I take a brief tour of Flask and show how it can make life quite easy for Web developers. I've already incorporated Flask into the curriculum of some of my Python courses, not only because it allows us to get up and running quickly, but also because I find that the design reinforces the coding style Python developers should aim to attain. Starting with Flask Assuming that you have pip (the modern Python installation program) on your computer, you can install Flask with: pip install flask (Depending on the permissions of your computer, you might need to install the above as root.) With that package (and its dependencies) in place, you're ready to start developing. Create a new Python program that contains the following: #!/usr/bin/env python from flask import Flask app = Flask(_name_) @app.route("/") def foo(): return "Hello, world...!" app.run(debug=T rue) Let's go through this program (which I have called simple.py), line by line, to see what it does before WWW.LINUXJOURNAL.COM / JULY 2014 / 27 COLUMNS AT THE FORGE Listing 1. simple.py #!/usr/bin/env python from flask import Flask, render_template, requ app = Flask(_name_) @app.route("/blah") @app.route("/") def foo(): return render_template('foo.html') @app.route("/submit", methods=["POST"]) def submit() : username = request.form['name'] return "Thank you for submitting a form, % app.run(debug=T rue) Listing 2. foo.html
Test paragraph