• No results found

+ Network Time Protocol

N/A
N/A
Protected

Academic year: 2022

Share "+ Network Time Protocol"

Copied!
114
0
0

Loading.... (view fulltext now)

Full text

(1)™. WATCH:. ISSUE OVERVIEW. V OCTOBER 2016 | ISSUE 270. Since 1994: The Original Magazine of the Linux Community. http://www.linuxjournal.com. Fixing the. Network Time Protocol. +. Simple Steps for Hardening Your Server The Importance of Machine Learning Shell Scripting a Mars Lander EOF: a New Networking Model. Flat File Encryption with OpenSSL and GPG LJ270-Oct2016.indd 1. 9/23/16 11:27 AM.

(2) Practical books for the most technical people on the planet.. GEEK GUIDES. Download books for free with a simple one-time registration. http://geekguide.linuxjournal.com. LJ270-Oct2016.indd 2. 9/21/16 7:26 PM.

(3) !. NEW. Beyond Cron, Part II: Deploying a Modern Scheduling Alternative Author: Mike Diehl. Machine Learning with Python Author: Reuven M. Lerner Sponsor: Intel. Sponsor: Skybot. Linux on Power: Why Open Architecture Matters. Hybrid Cloud Security with z Systems. Author: Ted Schmidt. Sponsor: IBM. Author: Petros Koutoupis. Sponsor: IBM. LinuxONE: the Ubuntu Monster. Ceph: Open-Source SDS. Author: John S. Tonello. Author: Ted Schmidt. Sponsor: IBM. Sponsor: SUSE. Linux on Power Author: Ted Schmidt. SSH: a Modern Lock for Your Server?. Sponsor: HelpSystems. Author: Federico Kereki Sponsor: Fox Technologies. LJ270-Oct2016.indd 3. 9/21/16 7:26 PM.

(4) CONTENTS. OCTOBER 2016 ISSUE 270. FEATURES 68 NTPsec:. a Secure, Hardened NTP Implementation. A man with one timeserver always knows what time it is. A man with two is never sure. Eric S. Raymond. 80 Flat File. Encryption with OpenSSL and GPG. Flat file encryption uses many of the methods and tools of SSH and SSL/TLS. Charles Fisher. 4 | October 2016 | http://www.linuxjournal.com. LJ270-Oct2016.indd 4. 9/21/16 7:26 PM.

(5) CONTENTS. COLUMNS. 34 Reuven M. Lerner’s At the Forge Machine Learning Everywhere. 40 Dave Taylor’s Work the Shell Mars Lander, Take II: Crashing onto the Surface. 22. 46 Kyle Rankin’s Hack and / Simple Server Hardening. 52 Shawn Powers’ The Open-Source Classroom Hodge Podge. 106 Doc Searls’ EOF A New Mental Model for Computers and Networks. IN EVERY ISSUE 8 10 14 32 60 113. Current_Issue.tag.gz Letters UPFRONT Editors’ Choice New Products Advertisers Index. 52. ON THE COVER ‹-P_PUN[OL5L[^VYR;PTL7YV[VJVSW ‹:PTWSL:[LWZMVY/HYKLUPUN@V\Y:LY]LYW ‹;OL0TWVY[HUJLVM4HJOPUL3LHYUPUNW ‹:OLSS:JYPW[PUNH4HYZ3HUKLYW ‹,6-!H5L^5L[^VYRPUN4VKLSW ‹-SH[-PSL,UJY`W[PVU^P[O6WLU::3HUK.7.W. 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.. 5 | October 2016 | http://www.linuxjournal.com. LJ270-Oct2016.indd 5. 9/21/16 7:26 PM.

(6) Executive Editor Senior Editor Associate Editor Art Director Products Editor Editor Emeritus Technical Editor Senior Columnist Security Editor Hack Editor Virtual Editor. Jill Franklin [email protected] Doc Searls [email protected] Shawn Powers [email protected] Garrick Antikajian [email protected] James Gray [email protected] Don Marti [email protected] Michael Baxter [email protected] Reuven Lerner [email protected] Mick Bauer [email protected] Kyle Rankin [email protected] 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 Accountant. Katherine Druckman [email protected] Candy Beauchamp [email protected]. Linux Journal is published by, and is a registered trade name of, Belltown Media, Inc. 0/ "OX 

(7) (OUSTON

(8) 48  53! 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] 52,: www.linuxjournal.com/advertising 0(/.%     EXT  Subscriptions % -!),: [email protected] 52,: www.linuxjournal.com/subscribe -!), 0/ "OX 

(9) (OUSTON

(10) 48  53! LINUX IS A REGISTERED TRADEMARK OF ,INUS 4ORVALDS. LJ270-Oct2016.indd 6. 9/21/16 7:26 PM.

(11) LJ270-Oct2016.indd 7. 9/23/16 11:25 AM.

(12) Current_Issue.tar.gz. Out with the New, and in with the Newer!. T. 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 email at [email protected]. Or, swing by the #linuxjournal IRC channel on Freenode.net.. V. HERE WAS A SHOW A FEW YEARS BACK CALLED

(13) h%XTREME -AKEOVER (OME %DITIONv 4HE PREMISE OF THE SHOW WAS TO FIND FAMILIES who needed their houses overhauled, but couldn’t AFFORD TO DO IT ON THEIR OWN 'ENERALLY

(14) THOSE CHOSEN HAD SACRIFICED FOR OTHERS RATHER THAN SPEND TIME AND MONEY ON THEMSELVES 4HEN THE SHOW WOULD completely redo their houses, making it so nice the HAPPY FAMILIES NO LONGER COULD AFFORD THE TAXES

(15) and they’d soon be homeless. I might have missed THE POINT OF THE SHOW

(16) BUT THE IDEA OF IMPROVING ON OUTDATED INFRASTRUCTURE CERTAINLY RINGS TRUE FOR )4 FOLKS 4HIS MONTH

(17) WE LOOK AT IMPROVING OUR LIVES BY improving on the tech we depend on every day. Reuven M. Lerner starts out by teaching how to create Skynet and turn civilization over to ROBOTIC OVERLORDS -ORE SPECIFICALLY

(18) HE DISCUSSES MACHINE LEARNING 4HANKFULLY

(19) ITS NOT ALL LASER guns and extermination, but rather a great way to get computers to make smart decisions instead. SHAWN POWERS. VIDEO:. Shawn Powers runs through the latest issue.. 8 | October 2016 | http://www.linuxjournal.com. LJ270-Oct2016.indd 8. 9/21/16 7:27 PM.

(20) Current_Issue.tar.gz OF JUST CRUNCHING NUMBERS 4HE NOTION OF MACHINE LEARNING DOESNT HAVE TO BE SCIENCE FICTION DYSTOPIA

(21) AND 2EUVEN SHOWS HOW IT CAN BE A HUGE BENEFIT $AVE 4AYLOR FOLLOWS WITH PART TWO OF HIS Mars landing simulation. I assume it’s a coincidence that Dave is teaching how to colonize another planet the same month Reuven IS TEACHING HOW TO MAKE THINKING MACHINES %ITHER WAY

(22) BOTH columns are very educational! +YLE 2ANKIN EXPLORES HOW TO DEFEND AGAINST ATTACK BY HARDENING YOUR SERVERS 4HE IDEA OF SERVER HARDENING HAS BEEN AROUND FOR SO LONG

(23) MUCH OF THE INFORMATION ON THE INTERNET IS OUTDATED +YLE WALKS THROUGH SOME SIMPLE

(24) PRACTICAL PROCEDURES FOR MAKING SURE YOUR SERVERS ARE AS SECURE AS POSSIBLE )F YOU HAVE ANY SERVERS EXPOSED TO THE INTERNET

(25) OR EVEN AN UNTRUSTED INTRANET

(26) YOU OWE IT TO YOURSELF AND YOUR COMPANY TO READ +YLES COLUMN THIS MONTH !S FOR ME ON THE other hand, I couldn’t decide what to write about, so I just wrote about all the various topics that I couldn’t decide between. My DAY TO DAY LIFE IS PRETTY NERDY

(27) SO HOPEFULLY SOME OF MY STREAM OF CONSCIOUSNESS MASHUP WILL BE OF USE ) TEND TO GET EXCITED ABOUT THE things I love, and I sure do love technology! .40 IS A SERVICE THAT HAS BEEN AROUND FOR A LONG TIME

(28) AND MOST OF US JUST INSTALL IT WITHOUT THINKING TWICE %RIC 3 2AYMOND COVERS .40SEC THIS MONTH

(29) WHICH IS A HUGE OVERHAUL TO THE .40 SYSTEM WE KNOW SO WELL )F YOUR EXPERIENCE WITH .40 ENDS WITH sudo     apt-­get  install  ntp , you should really read his article and CONSIDER .40SEC #HARLES &ISHER FOLLOWS %RIC WITH A LOOK AT ENCRYPTIONˆ SPECIFICALLY

(30) /PEN33, AND '0' ENCRYPTION WITH FLAT FILES 4HE CONCEPT OF ENCRYPTING FILES ISNT NEW

(31) BUT #HARLES WILL FORCE YOU TO LOOK AT THE IDEA IN A DIFFERENT LIGHT 0LUS

(32) HE INCLUDES LOTS OF CODE EXAMPLES

(33) WHICH always helps me understand things. Whether you want to improve your old technology with new or JUST IMPROVE YOUR EXISTING TECH

(34) THIS ISSUE SHOULD BE FUN 7E HAVE ALL THE FEATURES YOUVE COME TO EXPECT

(35) INCLUDING PRODUCT REVIEWS

(36) ANNOUNCEMENTS

(37) TECH TIPS AND SO ON 4HE BEST PART ABOUT IMPROVING YOUR INFRASTRUCTURE WITH ,INUX IS THAT UNLIKE h%XTREME -AKEOVERv

(38) IT WILL SAVE YOU PROBLEMS IN THE FUTURE INSTEAD OF CAUSING MORE 3O WITHOUT FURTHER ADO

(39) h$RIVER

(40) -OVE 4HAT "USv Q 9 | October 2016 | http://www.linuxjournal.com. LJ270-Oct2016.indd 9. 9/21/16 7:27 PM.

(41) LETTERS. LETTERS PREVIOUS Current_Issue.tar.gz. ]. NEXT UpFront. V. V. [. Self-Sovereign Identity I always read Doc Searls’ column, not to learn anything new but to try TO FIGURE OUT WHAT HIS POINT IS )N THE *ULY  ISSUE

(42) HE INTRODUCES THE CONCEPT OF hSELF SOVEREIGN IDENTITYv WITH SEVERAL OBSCURE SENTENCES

(43) AND THEN

(44) TO TAKE FUZZY THINKING TO A HIGHER LEVEL

(45) HE QUOTES $EVON ,OFFRETO WITH A PARAGRAPH OF ABSOLUTE GIBBERISH (ERES ONE EXCERPT ! SELF 3OVEREIGN IDENTITY PRODUCES AN ADMINISTRATIVE TRAIL OF DATA RELATIONS that begin and resolve to individual humans.. And another: ! SELF 3OVEREIGN IDENTITY IS THE ROOT OF ALL PARTICIPATION AS A VALUED SOCIAL BEING WITHIN HUMAN SOCIETIES OF ANY TYPE. Now that’s gibberish. It’s ironic that this column appears in a magazine that is so INFORMATIVE OTHERWISE —Phil Miller. Doc Searls replies: Phil, I try to bring up subjects, and make points, that nobody else does. If some of that effort comes off as gibberish, at least it beats silence. Lots of original thinkers and authorities on topics don’t make full sense. 10 | October 2016 | http://www.linuxjournal.com. LJ270-Oct2016.indd 10. 9/21/16 7:27 PM.

(46) LETTERS But that doesn’t mean what they say isn’t worth listening to, or de-bugging. That’s why I followed the Devon Loffreto quote by compressing his point down to “only the individual has root for his or her own source identity”. In a world where surveillance is the norm, I believe that insight can help guide some necessary work. That’s why I wrote this piece.. Tiny Internet—Test for CPU Extensions for Virtualization )M A BIT BEHIND IN MY READING

(47) SO )M NOT SURE IF anyone else has commented on this. In the May  ISSUE OF LJ IN *OHN 3 4ONELLOS h4HE 4INY )NTERNET 0ROJECT

(48) 0ART )v

(49) HE PROVIDES INSTRUCTIONS ON SEEING IF THE COMPUTER CAN SUPPORT VIRTUALIZATION

(50) BUT HE TESTS ONLY FOR )NTELS 64 3OME INDIVIDUALS NEW TO THIS MAY HAVE !-$ BASED SYSTEMS ESPECIALLY IF THEY ARE USING OLDER HARDWARE

(51) AS AMD is not nearly as popular as it once was). Anyway, it’s always better not to assume what the #05 IS AND DO egrep  '(vmx|svm)'  /proc/cpuinfo and instruct users to make sure they have either VMX OR SVM IN THE OUTPUT !LSO

(52) DONT FORGET that, again when using older PCs, some may not HAVE  BIT CAPABILITY SO CHECKING FOR hLMv IN THE OUTPUT ALSO IS IMPORTANT

(53) AND IF IT ISNT PRESENT

(54) TO USE  BIT DISTROS !ND FINALLY

(55) SOME VIRTUALIZATION PLATFORMS REQUIRE %XECUTE $ISABLE TO BE ENABLED

(56) SO USERS SHOULD CHECK FOR either 8$ OR .8 IN THE OUTPUT OF ETCCPUINFO —Mark Dean. John S. Tonello replies: You’re absolutely right about AMD. Many of my early machines were. At Your Service SUBSCRIPTIONS: Linux Journal is available in a variety of digital formats, including PDF, .epub, .mobi and an online digital edition, as well as apps for iOS and Android devices. Renewing your subscription, changing your email address for issue delivery, paying your invoice, viewing your account details or other subscription inquiries can be done instantly online: http://www.linuxjournal.com/subs. Email us at [email protected] 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 online: 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: [email protected] or +1 713-344-1956 ext. 2.. 11 | October 2016 | http://www.linuxjournal.com. LJ270-Oct2016.indd 11. 9/21/16 7:27 PM.

(57) LETTERS AMD-powered, albeit well before 64-bit was widely available. Your tips are great for anyone looking to test their hardware before proceeding with building a “Tiny Internet”. Thank you for sharing!. Photo of the Month 4HIS DRAWING OF 4UX WAS A BIRTHDAY GIFT TO ME FROM MY FIVE YEAR OLD DAUGHTER —big.foot. PHOTO OF THE MONTH Remember, send your Linux-related photos to [email protected]!. WRITE LJ A LETTER We love hearing from our readers. Please send us your comments and feedback via http://www.linuxjournal.com/contact.. RETURN TO CONTENTS. 12 | October 2016 | http://www.linuxjournal.com. LJ270-Oct2016.indd 12. 9/21/16 7:27 PM.

(58) O’Reilly Live Training Online or in person, but always in real time.. Get intensive, hands-on training on current critical technology topics, led by instructors from O’Reilly’s unparalleled network of tech innovators and expert practitioners.. See the list of courses ©2016 O’Reilly Media, Inc. O’Reilly is a registered trademark of O’Reilly Media, Inc. | D2873. LJ270-Oct2016.indd 13. 9/23/16 11:26 AM.

(59) UPFRONT. UPFRONT PREVIOUS Letters. NEXT Editors’ Choice. V. V. NEWS + FUN. diff -u. What’s New in Kernel Development Kan Liang RECENTLY TRIED TO GET SOME NETWORKING CONFIGURATION CODE INTO THE KERNEL THAT WOULD INTERPRET A SIMPLE SET OF USER POLICIES IN order to tweak the networking code in subtle ways to speed up data TRANSFERS AS MUCH AS POSSIBLE 5NFORTUNATELY

(60) ALTHOUGH HIS IDEAS SEEMED SOUND TO FOLKS LIKE Stephen Hemminger and Alexei Starovoitov, they both objected to INCLUDING CODE IN THE KERNEL THAT WASNT STRICTLY NECESSARY 4HEY FELT THE SAME FEATURES COULD BE ACHIEVED ENTIRELY IN USER SPACE +ANS ARGUMENT THAT A USER SPACE IMPLEMENTATION WOULD BE MORE COMPLEX AND DIFFICULT FELL ON DEAF EARS 4HE SAME ARGUMENT HAS BEEN USED MANY TIMES BEFORE

(61) BUT THE KERNEL FOLKS HAVE TO TAKE A HARD LINE on the issue or risk the kernel being overrun with bloat. Some even would argue that this already has happened. "ECAUSE OF THIS

(62) UNLESS +AN FINDS A BETTER ARGUMENT

(63) IT DOESNT SEEM likely that his code will get into the kernel, although it could very WELL BECOME A TIGHTLY INTEGRATED USER SPACE TOOL William C. Roberts recently posted some code to randomize the 14 | October 2016 | http://www.linuxjournal.com. LJ270-Oct2016.indd 14. 9/21/16 7:27 PM.

(64) UPFRONT. LOCATIONS OF NEW MEMORY ALLOCATIONS 4HIS IS A STANDARD SECURITY TECHNIQUE

(65) BUT 7 ILLIAM WANTED TO APPLY IT BY DEFAULT TO ALL mmapped memory regions. 6ARIOUS FOLKS OBJECTED THAT Android had experienced particular PROBLEMS WITH THIS SORT OF THING IN THE PAST

(66) AS IT CAUSED EXTREME MEMORY FRAGMENTATION THAT INEVITABLY WOULD LEAD TO THE FAILURE OF ALL ATTEMPTED MEMORY REQUESTS 4HE SOLUTION

(67) AS SUGGESTED BY Dave Hansen, turned out to be SIMPLY TO DISABLE 7 ILLIAMS PATCH ON  BIT SYSTEMS /NCE THIS IDEA was presented, everyone immediately agreed that it would solve the PROBLEM %VEN 7 ILLIAM LIKED IT 0RESTOˆAN EXTREMELY RARE CASE OF A SECURITY ISSUE HAVING A SIMPLE

(68) clean solution that everyone agrees on. Luis R. Rodriguez AND OTHERS HAVE BEEN SIMPLIFYING THE VERY COMPLEX ,INUX BOOT PROCEDURE

(69) IN PART BY REMOVING SUPPORT FOR EARLY ACCESS TO DEVICE FIRMWARE 4HEIR HOPE WAS THAT KERNEL DEVICES COULD ACCESS FIRMWARE AT A SLIGHTLY LATER TIME IN THE BOOT PROCESS

(70) AFTER THE FIRMWARE COULD BE MADE AVAILABLE ON A MOUNTED FILESYSTEM !S IT TURNED OUT

(71) HOWEVER

(72) THERE WERE MORE PIECES OF CODE AND more use cases, such as embedded systems, relying on early access TO FIRMWARE THAN ,UIS HAD REALIZED !FTER SOME DISCUSSION

(73) IT BECAME CLEAR THAT SUPPORT FOR A FEW REMAINING USERS OF EARLY FIRMWARE ACCESS WOULD HAVE TO REMAIN IN THE KERNEL

(74) AT LEAST FOR NOW

(75) AND THAT A more gradual approach to rooting out the remaining users would have to be taken. Rafael J. Wysocki RECENTLY PROPOSED A NEW KIND OF RUNTIME DRIVER DEPENDENCY

(76) IN WHICH A GIVEN DRIVER COULD BE LOADED ONLY IF THE DRIVERS IT DEPENDS ON ARE ALSO LOADED

(77) AND MAY BE UNLOADED ONLY IF no other drivers depend upon it. )T TURNS OUT THERE ARE SOME NUANCES TO GET RIGHT BEFORE SOMETHING like this really could be accomplished. For one thing, the code to IMPLEMENT DEPENDENCIES MIGHT LOOK AWFULLY SIMILAR TO THE EXISTING CODE TO PROBE FOR RESOURCES BEFORE LOADING A GIVEN DRIVER )T WOULD be important to avoid too much code duplication, which might 15 | October 2016 | http://www.linuxjournal.com. LJ270-Oct2016.indd 15. 9/21/16 7:27 PM.

(78) UPFRONT REQUIRE REFACTORING THAT ENTIRE AREA OF THE kernel source. 4HERES ALSO THE QUESTION OF WHEN A DEPENDENCY MIGHT BE IDENTIFIED &OR SOME drivers, certain dependencies would be clearly known and could be registered in a CONFIGURATION FILE &OR OTHERS

(79) A DEPENDENCY would be based on which other drivers already had been loaded and could provide certain resources, so there would have to be at least TWO PHASES OF DEPENDENCY IDENTIFICATION 3OME DEPENDENCIES ALSO MIGHT BE hWEAKvˆ USEFUL IF PRESENT

(80) BUT NOT ABSOLUTELY NEEDED FOR normal operations. !FTER SOME DISCUSSION

(81) 2AFAEL POSTED SOME CODE IMPLEMENTING THE BEGINNINGS OF HIS IDEA 4HERE SEEMS TO BE GENERAL APPROVAL OF THE OVERALL CONCEPT 4HE ONLY ISSUES ARE EXACTLY HOW TO SUPPORT THE VARIOUS FEATURES and how to avoid too much complexity in the implementation. —Zack Brown. THEY SAID IT One must desire something to be alive. —Margaret Deland. Confidence is 10% hard work and 90% delusion. —Tina Fey. I must create a system or be enslaved by another man’s. —William Blake. To live a creative life, we must lose our fear of being wrong. —Joseph Chilton Pearce. There’s a place in the brain for knowing what cannot be remembered. —John Green. 16 | October 2016 | http://www.linuxjournal.com. LJ270-Oct2016.indd 16. 9/21/16 7:27 PM.

(82) 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. LJ270-Oct2016.indd 17. |. Managed Hosting. |. Dedicated Hosting. |. Colocation. 9/21/16 7:27 PM.

(83) UPFRONT. Android Candy: That App Is for the Birds! 5SUALLY BIRD RELATED APPS INVOLVE PIGS AND ANGER

(84) BUT IF YOURE A BIRD WATCHER LIKE MYSELF

(85) THERES ANOTHER bird app you must download. Cornell ,ABS HAS RELEASED A FREE APP CALLED -ERLIN "IRD )$ THAT HELPS IDENTIFY BIRDS you see in the wild. (UNDREDS OF BOOKS ARE AVAILABLE TO HELP YOU FIGURE OUT WHAT SORT OF BIRD you’re looking at, but Merlin uses several metrics to narrow down the FEATHERY MYSTERY )T USES Q Size. Q Color(s). Q Geographic location (via GPS). Q 4IME OF YEAR Q %NVIRONMENT ON TREE

(86) IN WATER

(87). (Image from Google Play Store). on ground and so on). /NCE IT NARROWS DOWN THE OPTIONS TO A HANDFUL OF BIRDS

(88) IT PROVIDES PHOTOS OF THE MALE

(89) FEMALE AND JUVENILE VARIETIES )T EVEN INCLUDES A button that lets you listen to their particular birdsong. )F YOURE A BIRD LOVER

(90) OR JUST LIKE TO SOUND SMART IN FRONT OF YOUR FRIENDS

(91) THE -ERLIN "IRD )$ APP IS A MUST HAVE )TS COMPLETELY FREE AND REMARKABLY accurate. Find it on the Google Play store today! —Shawn Powers 18 | October 2016 | http://www.linuxjournal.com. LJ270-Oct2016.indd 18. 9/21/16 7:27 PM.

(92) JOIN 2,000+ OPEN SOURCE TECHNOLOGISTS AND DECISION MAKERS FROM ALL OVER THE WORLD. OCTOBER 26 & 27 | DOWNTOWN RALEIGH T H E 2 0 1 6 E V E N T W I L L F E AT U R E :. Ȉ Nearly  every  major  technology  company  in  the  U.S.     Ȉ Ȉ Ȉ Ȉ. More  than  150  speakers  and  180  sessions   Some  of  the  most  well  known  speakers  in  the  world   10  news-­‐‑making  keynotes   37  tracks  over  both  days  on  nearly  every  “open”  topic. ALLTHINGSOPEN.ORG LJ270-Oct2016.indd 19. 9/21/16 7:27 PM.

(93) UPFRONT. On-the-Fly Web Server -OST OF YOU have a web server installed on your network somewhere. In FACT

(94) MOST OF YOU probably have several. In a pinch, however, getting to the web directory CAN BE DIFFICULT 4HANKFULLY

(95) THERES A SUPER SIMPLE

(96) INCREDIBLY AWESOME ONE LINER YOU CAN TYPE TO GET A FUNCTIONAL WEB server running and serving out your current directory: python  -­m  SimpleHTTPServer. 4HAT ONE LINER OR THE 0YTHON  ALTERNATIVE

(97) python  -­m  http.server ) WILL START A WEB SERVER ON PORT 

(98) SERVING FILES FROM YOUR CURRENT DIRECTORY 5SUALLY PRESSING ># WILL STOP THE SERVER

(99) BUT IF NOT

(100) SOME MORE COMMAND LINE FU WILL STOP THE PROCESS AS WELL kill  `ps  |  grep  SimpleHTTP  |  grep  -­v  grep  |  awk  '{print  $1}'`. )TS POSSIBLE TO CHANGE THE PORT BY ADDING IT AFTER THE SimpleHTTPServer , but since you’re running as a user, you won’t be able to run on a privileged port. 4HANKS TO JAFRALDO ON HTTPWWWCOMMANDLINEFUCOM FOR THE KILL script.) —Shawn Powers. 20 | October 2016 | http://www.linuxjournal.com. LJ270-Oct2016.indd 20. 9/21/16 7:27 PM.

(101) UPFRONT. Sunshine in a Room with No Windows )M A BIT OF a weather nut. It might be because I’m getting OLDER

(102) BUT FOR some reason, the weather FASCINATES ME )M NOT QUITE to the point that I watch 4HE 7EATHER Channel on a regular basis, BUT ) DO CHECK THE FORECAST OFTEN ) ALSO SPEND THE VAST MAJORITY OF MY DAY IN A TERMINAL WINDOW 5NTIL RECENTLY

(103) IF ) WANTED TO CHECK THE WEATHER

(104) ) HAD TO OPEN A BROWSER AND CLICK A LINK IN ORDER TO GET THE FORECAST 4HANKS TO )GOR #HUBIN  IGOR?CHUBIN ON 4WITTER

(105) ) NOW CAN GET THE FORECAST FROM THE COMFORT OF MY TERMINAL WINDOW !LL YOU NEED TO DO IS TYPE curl  wttr.in/your_town. AND YOULL GET A NICE TEXT BASED GRAPHICAL FORECAST 9OU ALSO CAN VIEW THE PAGE IN A WEB BROWSER IF YOU PREFER IT LOOKS COOL THERE TOO

(106) BUT BEING ABLE TO WHIP UP A FORECAST ON THE COMMAND LINE IS JUST AWESOME )VE tried using city names and zip codes, and both seem to work well. )F YOU WANT TO KNOW WHAT THE WEATHER IS LIKE

(107) BUT DONT WANT TO OPEN a window, give it a try! —Shawn Powers 21 | October 2016 | http://www.linuxjournal.com. LJ270-Oct2016.indd 21. 9/21/16 7:27 PM.

(108) UPFRONT. Chemistry on the Desktop &OR THIS ARTICLE

(109) ) THOUGHT )D INTRODUCE ANOTHER CHEMISTRY APPLICATIONˆ SPECIFICALLY

(110) "+#HEM

(111) A FREE CHEMICAL DRAWING PROGRAM !S OPPOSED TO MANY OTHER CHEMISTRY APPLICATIONS

(112) "+#HEM PROVIDES BOTH A NICE '5) FOR CONSTRUCTING MOLECULES AND A SET OF CHEMICAL ANALYSIS TOOLS TO LOOK AT THE PROPERTIES OF THE NEWLY CONSTRUCTED MOLECULE Most distributions should have a package available to make installation EASIERˆFOR EXAMPLE

(113) $EBIAN BASED DISTRIBUTIONS CAN INSTALL "+#HEM WITH. Figure 1. When you first start BKChem, you get a blank canvas to start building your molecule. 22 | October 2016 | http://www.linuxjournal.com. LJ270-Oct2016.indd 22. 9/21/16 7:27 PM.

(114) UPFRONT THE FOLLOWING COMMAND sudo  apt-­get  install  bkchem. /NCE "+#HEM IS INSTALLED

(115) YOU CAN START IT EITHER FROM THE MENU ENTRY or by executing the command bkchem FROM A TERMINAL WINDOW 7HEN IT FIRST OPENS

(116) YOULL SEE A BLANK SCREEN WHERE YOU CAN START YOUR chemical construction. )F YOU HAVE A PREVIOUSLY CREATED MOLECULE

(117) YOU CAN LOAD IT BY CLICKING the FileALoad menu item, which will load the data into a new tab, or you can click the FileALoad to the same tab menu option to load it into the currently active tab.. Figure 2. You can edit an element by clicking the middle mouse button. The menu you get depends on the type of element you are editing. 23 | October 2016 | http://www.linuxjournal.com. LJ270-Oct2016.indd 23. 9/21/16 7:27 PM.

(118) UPFRONT. Figure 3. You can add larger commonly used structures with templates.. "+#HEM ALSO CAN IMPORT DATA FROM OTHER FILE FORMATS )F YOU CLICK FileA)MPORT

(119) YOULL SEE THAT YOU CAN IMPORT FILES WITH #-,

(120) #-, OR -OLFILE FORMATS )F YOU WANT TO START BY BUILDING YOUR OWN MOLECULE

(121) SEVERAL MENUS OF BUILDING BLOCKS ARE AVAILABLE 4HEY ARE LAID OUT AS A PAIR OF ROWS

(122) JUST BELOW THE MENU LISTINGS AT THE TOP OF THE WINDOW 4HE TOP ROW OF ICONS SELECTS WHICH LIST OF ICONS WILL BE AVAILABLE IN THE SECOND ROW 4HE FIRST ICON IN THE FIRST ROW IS SIMPLY AN ARROW

(123) ALLOWING YOU TO SELECT OBJECTS WITHIN YOUR MOLECULE SO YOU CAN EDIT THEIR PROPERTIES 4HE NEXT ICON PULLS UP THE ROW OF drawing elements where you can start to draw your new molecule. 4HERE ARE SEVERAL CHOICES IN TERMS OF LINE THICKNESSES

(124) STYLES AND BOND ANGLES

(125) AND YOU CAN CREATE A CHAIN OF ELEMENTS SIMPLY BY CLICKING ON THE END OF AN EXISTING LINE SEGMENT 24 | October 2016 | http://www.linuxjournal.com. LJ270-Oct2016.indd 24. 9/21/16 7:27 PM.

(126) UPFRONT Figure 4. You can scale parts of your molecular structure to make it easier to work on.. /NCE YOU HAVE THE BASICS OF YOUR STRUCTURE LAID OUT

(127) YOULL WANT TO EDIT THE DETAILS NEXT 4O DO THIS

(128) CLICK ON THE FIRST ICON AGAIN CAPTIONED WITH hEDITv

(129) AND THEN CLICK ON THE STRUCTURE ELEMENT YOU WANT TO EDIT 4HIS is where having a proper mouse is a must, as you need to click with the middle button on your mouse to pull up the edit panel. )F YOU ARE USING A LAPTOP TOUCH PANEL

(130) YOU NEED TO CLICK THE LEFT AND RIGHT BUTTONS TOGETHER AND THEN SCROLL WITH THE TOUCH PAD ITSELF !S AN EXAMPLE

(131) IF YOU CLICK ON AN ATOM

(132) YOU CAN CHANGE THE ATOM IN THIS LOCATION OR EVEN REPLACE IT WITH SOME TYPE OF ATOMIC GROUP

(133) SUCH AS AN ALCOHOL GROUP 9OU ALSO CAN EDIT ALL KINDS OF DISPLAY OPTIONS

(134) SUCH AS COLORS USED

(135) FONTS FOR TEXT

(136) TEXT PLACEMENT AND LINE WIDTHS 4HE THIRD ICON ON THE TOP ICON ROW PULLS UP A LIST OF AVAILABLE TEMPLATES FOR LARGER COMMONLY USED ATOMIC STRUCTURES

(137) SUCH AS BENZENE RINGS 4HE FOURTH ICON ON THE TOP ROW LETS YOU PULL UP A LIST OF TEMPLATES THAT 25 | October 2016 | http://www.linuxjournal.com. LJ270-Oct2016.indd 25. 9/21/16 7:27 PM.

(138) UPFRONT Figure 5. A configuration window allows you to edit properties of your structure’s elements easily.. YOU HAVE CREATED PREVIOUSLY

(139) ALLOWING YOU TO ADD TEMPLATES FOR THOSE SUBSTRUCTURES THAT YOU USE MOST OFTEN 9OU MAY NEED TO PLAY WITH THE DISPLAY IN ORDER TO BE ABLE TO SEE EVERYTHING CLEARLY WHILE YOU ARE WORKING 4HE APPROPRIATE INSTRUCTIONS ARE UNDER THE /BJECT MENU ITEM 4HE FIRST OPTION ON THAT MENU IS 3CALE 3ELECTING EITHER A PORTION OF YOUR STRUCTURE OR THE WHOLE THING

(140) you essentially can zoom in or out to see the structure better as you work on it. 9OU ALSO CAN MAKE CHANGES TO THE DISPLAY

(141) SUCH AS ALTERING THE STACK layers or mirroring horizontally or vertically. 4HE LAST OPTION AVAILABLE IS THE /BJECTA#ONFIGURE MENU ITEM 4HIS WILL 26 | October 2016 | http://www.linuxjournal.com. LJ270-Oct2016.indd 26. 9/21/16 7:27 PM.

(142) UPFRONT. Figure 6. You can get a list of basic chemical information about your structure.. POP UP ANOTHER WINDOW WHERE YOU EASILY CAN CHANGE ATOM

(143) BOND

(144) FONT OR COMMON DETAILS FOR THE DISPLAY 4HIS IS ALSO THE SAME WINDOW THAT APPEARS WHEN YOU CLICK ON THE 0ROPERTIES ITEM ON THE %DIT MENU WHICH YOU GET when clicking the middle mouse button). 3O FAR

(145) )VE JUST BEEN DESCRIBING BUILDING UP A MOLECULE )N THE REST OF THE SCREENSHOTS HERE )M USING A SIMPLE BENZENE RING TO DISCUSS THE chemistry you can do with BKChem. 9OU CAN GET BASIC INFORMATION ABOUT YOUR STRUCTURE BY CLICKING ON ChemistryA)NFO

(146) WHICH WILL POP UP A NEW WINDOW WITH ITEMS LIKE THE CHEMICAL FORMULA

(147) MOLECULAR WEIGHT AND COMPOSITION )F YOU WANT TO CHECK TO SEE WHETHER THE STRUCTURE YOUVE BUILT MAKES 27 | October 2016 | http://www.linuxjournal.com. LJ270-Oct2016.indd 27. 9/21/16 7:27 PM.

(148) UPFRONT. Figure 7. Sometimes, the chemistry doesn’t work out.. sense, you can select it and click on the ChemistryACheck chemistry MENU ITEM )F EVERYTHING MAKES SENSE

(149) YOULL SEE A NEW WINDOW TELLING you that everything is okay. Otherwise, you’ll get an error message HIGHLIGHTING WHAT DOESNT QUITE WORK FROM A CHEMICAL POINT OF VIEW 4HIS IS WHERE YOU MAY NEED TO DIG INTO THE GRITTIER ITEMS AVAILABLE FROM THE %DIT MENU WHEN YOU CLICK ON AN ELEMENT WITH THE MIDDLE MOUSE BUTTON 9OU MAY NEED TO CHANGE THE TYPE OF ATOM OR CHANGE ITS VALENCY !S AN EXAMPLE OF THE TYPE OF ERROR YOU MIGHT ENCOUNTER

(150) SEE WHAT HAPPENED WHEN ) CHANGED ONE OF THE CARBON ATOMS TO AN OXYGEN ATOM IN THE BENZENE RING &IGURE   !T THE FAR RIGHT SIDE OF THE MENU BAR

(151) THERE IS AN ENTRY FOR AVAILABLE 28 | October 2016 | http://www.linuxjournal.com. LJ270-Oct2016.indd 28. 9/21/16 7:27 PM.

(152) UPFRONT. Figure 8. You can calculate bond angles for your molecule.. PLUGINS /NE OF THESE PLUGINS ALLOWS YOU TO CALCULATE BOND ANGLES 9OU CAN SELECT TWO CONNECTED BONDS BY HOLDING DOWN THE 3HIFT KEY AND CLICKING THEM ONE AFTER THE OTHER 4HEN YOU CAN CLICK ON THE PluginsAAngle between bonds menu item to calculate the angle. 7HEN YOUVE FINISHED ALL OF THE WORK OF CREATING YOUR NEW MOLECULAR STRUCTURE

(153) YOULL WANT TO SAVE IT FOR FURTHER ANALYSIS OR TO SHARE WITH OTHER RESEARCHERS 4HE DEFAULT FILE FORMAT THAT STRUCTURES ARE SAVED IN IS AN 36' 3CALABLE 6ECTOR 'RAPHICS FILE )F YOU WANT TO SAVE YOUR WORK USING A DIFFERENT FILE FORMAT

(154) CLICK ON &ILEA%XPORT TO GET A LIST OF ALL THE SUPPORTED FILE FORMATS -OST OF THEM ARE SIMPLY OTHER GRAPHICS FILE FORMATS

(155) BUT A FEW ARE SPECIFICALLY USED FOR STORING CHEMICAL INFORMATION 9OU CAN SELECT #-, OR #-, #HEMICAL -ARKUP ,ANGUAGE TO SAVE 29 | October 2016 | http://www.linuxjournal.com. LJ270-Oct2016.indd 29. 9/21/16 7:27 PM.

(156) UPFRONT MORE OF THE CHEMICAL INFORMATION FOR YOUR STRUCTURE 9OU ALSO CAN SAVE YOUR STRUCTURE IN THE MOLFILE FILE FORMAT

(157) WHICH WAS CREATED BY -$, )NFORMATION 3YSTEMS TO STORE MORE DETAILED INFORMATION ABOUT A CHEMICAL STRUCTURE )F YOU JUST WANT AN EASILY SHARED IMAGE OF YOUR MOLECULAR STRUCTURE

(158) YOU CAN EXPORT IT INTO EITHER A 0$& OR 0.' FILE As you have seen here, you can use BKChem to build molecular structures in a way similar to many other chemistry applications. 7HAT IS SLIGHTLY DIFFERENT WITH "+#HEM IS THAT YOU CAN DO SOME BASIC CHEMISTRY WITH YOUR NEWLY CREATED STRUCTURE DIRECTLY FROM "+#HEM 4HIS ADDED FUNCTIONALITY MIGHT BE ENOUGH TO MAKE "+#HEM A TOOL you’ll want to add to your arsenal. —Joey Bernard. 30 | October 2016 | http://www.linuxjournal.com. LJ270-Oct2016.indd 30. 9/21/16 7:27 PM.

(159) Instant Access to Premium Online Drupal Training Instant access to hundreds of hours of Drupal training with new videos added every week! Learn from industry experts with real world H[SHULHQFHEXLOGLQJKLJKSURȴOHVLWHV Learn on the go wherever you are with apps for iOS, Android & Roku We also offer group accounts. Give your whole team access at a discounted rate!. Learn about our latest video releases and RIIHUVȴUVWE\IROORZLQJXVRQ)DFHERRNDQG 7ZLWWHU #GUXSDOL]HPH

(160)  Go to http://drupalize.me and get Drupalized today!. LJ270-Oct2016.indd 31. 9/21/16 7:27 PM.

(161) PREVIOUS UpFront. NEXT Reuven M. Lerner’s At the Forge. Non-Linux FOSS: Don’t Drink the Apple Kool-Aid; Brew Your Own!. V. V. EDITORS’ CHOICE. ™. EDITORS’ CHOICE. ★. Some tools that I use on the command line are so basic and so INGRAINED IN MY DAY TO DAY ACTIONS THAT ITS WEIRD WHEN THEYRE NOT AVAILABLE 4HIS OFTEN HAPPENS TO ME ON /3 8 ) LOVE THAT /3 8 HAS 5.)8 UNDERPINNINGS ) LOVE THAT THE TERMINAL WINDOW IS A real terminal window and works like a terminal window should work. "UT

(162) ) DONT LIKE THE LACK OF BASIC TOOLS THAT ARE AVAILABLE %VEN MORE

(163) I dislike that I can’t simply apt-­get (or yum ) the missing applications INTO MY SYSTEM 4HANKFULLY

(164) )M NOT ALONE )F YOUVE EVER OPENED A TERMINAL WINDOW ON /3 8 AND TRIED TO USE wget

(165) YOU KNOW THE FEELING TOO %NTER (OMEBREW 4HE CONCEPT OF (OMEBREW HAS BEEN AROUND FOR QUITE A WHILE &INK

(166) -AC0ORTS AND PROBABLY A FEW OTHERS GIVE YOU THE OPTIONS TO INSTALL SOFTWARE THAT ISNT PART OF /3 8 ITSELF 4HOSE OTHER OPTIONS MAKE ME UNCOMFORTABLE

(167) HOWEVER

(168) BECAUSE THEYRE MORE INTEGRATED INTO THE 32 | October 2016 | http://www.linuxjournal.com. LJ270-Oct2016.indd 32. 9/21/16 7:27 PM.

(169) EDITORS' CHOICE. (Image from http://brew.sh). 5.)8 PORTS SYSTEM )T MIGHT SEEM ODD THAT BETTER INTEGRATION MAKES ME UNCOMFORTABLE

(170) BUT IT DOES )D RATHER HAVE SOMETHING ) CAN ERASE EASILY WITHOUT AFFECTING THE REST OF THE SYSTEM )D RATHER HAVE THE NON NATIVE APPLICATIONS LIVE SEPARATELY FROM THE NATIVE APPS 0ART OF THAT IS PERSONAL PREFERENCE

(171) BUT PART OF IT IS BASED ON YEARS OF EXPERIENCE WITH TROUBLESHOOTING PROBLEMS )F THERES A PROBLEM WITH Homebrew, it’s much easier to troubleshoot. !NYWAY

(172) IF YOUD LIKE TO HAVE A PACKAGE MANAGER FOR SOME OF THE hMISSINGv PROGRAMS IN /3 8

(173) BUT YOUD ALSO LIKE TO BE ABLE TO DELETE THE ENTIRE SYSTEM FAIRLY SIMPLY

(174) (OMEBREW IS PERFECT FOR YOU 3IMPLY head over to http://brew.sh COOL 52,

(175) RIGHT AND PASTE THE INSTALLATION SCRIPT INTO A TERMINAL WINDOW 4HERES AN UN INSTALL SCRIPT AS WELL

(176) OR YOU SIMPLY CAN DELETE THE BITS MANUALLY %VEN IF YOURE JUST CURIOUS

(177) ITS EASY TO INSTALL (OMEBREW AND GIVE IT A GO )N FACT

(178) THANKS TO ITS SIMPLE INSTALLUN INSTALL AND THE INCREDIBLE CONVENIENCE OF HAVING COMMON TOOLS AVAILABLE ON /3 8

(179) (OMEBREW GETS THIS MONTHS %DITORS #HOICE AWARD )F YOU HAVE A -AC

(180) CHECK IT OUT —Shawn Powers. RETURN TO CONTENTS 33 | October 2016 | http://www.linuxjournal.com. LJ270-Oct2016.indd 33. 9/21/16 7:27 PM.

(181) AT THE FORGE. Machine Learning Everywhere. REUVEN M. LERNER Reuven M. Lerner offers training in Python, Git and. You’ve probably already heard of machine learning, but read on for some examples of why you should learn it and how it can help you.. PostgreSQL to companies around the world. He blogs at http://blog.lerner.co.il, tweets at @reuvenmlerner and curates http://DailyTechVideo.com.. PREVIOUS Editors’ Choice. NEXT Dave Taylor’s Work the Shell. Israel, with his wife and. V. V. Reuven lives in Modi’in, three children.. THE FIELD OF STATISTICS TYPICALLY HAS HAD A BAD REPUTATION. )TS SEEN AS DIFFICULT

(182) BORING AND EVEN A BIT USELESS -ANY OF MY FRIENDS HAD TO TAKE statistics courses in graduate school, so that they could ANALYZE AND REPORT ON THEIR RESEARCH 4O MANY OF THEM

(183) THE CLASSES WERE A FORM OF NERDY

(184) BORING TORTURE -AYBE ITS JUST ME

(185) BUT AFTER ) TOOK THOSE COURSES

(186) ) FELT LIKE ) WAS SEEING THE WORLD THROUGH NEW EYES Suddenly, I could better understand the world around me. Newspaper articles about the government and SCIENTIFIC AND CORPORATE REPORTS MADE MORE SENSE ) ALSO COULD IDENTIFY THE FLAWS IN SUCH REPORTS MORE EASILY AND CRITICIZE THEM FROM A POSITION OF UNDERSTANDING 34 | October 2016 | http://www.linuxjournal.com. LJ270-Oct2016.indd 34. 9/21/16 7:27 PM.

(187) AT THE FORGE -UCH OF THE POWER OF STATISTICS LIES IN THE CREATION OF A hMODELv

(188) OR A MATHEMATICAL DESCRIPTION OF REALITY ! MODEL IS A CARICATURE OF SORTS

(189) IN THAT IT DOESNT REPRESENT ALL OF REALITY

(190) BUT RATHER JUST THOSE FACTORS THAT YOU THINK WILL AFFECT THE THING YOURE TRYING TO UNDERSTAND A model lets you say that given inputs A, B, C and D, you can know, more or less, what the output will be. 3OMETIMES

(191) THE GOAL OF A STATISTICAL MODEL IS TO PREDICT A VALUEˆFOR example, given a certain size and neighborhood, you can predict the PRICE OF A HOUSE /R

(192) GIVEN SOMEONES AGE

(193) WEIGHT AND WHERE THEY LIVE

(194) YOU CAN PREDICT HIS OR HER LIKELIHOOD OF GETTING A CERTAIN DISEASE /FTEN

(195) THE GOAL IS TO PREDICT A CATEGORYˆFOR EXAMPLE

(196) IN AN UPCOMING ELECTION

(197) FOR WHOM ARE PEOPLE LIKELY TO VOTE 4AKING INTO ACCOUNT WHERE THEY LIVE

(198) WHAT LEVEL OF EDUCATION THEYVE RECEIVED

(199) THEIR ETHNIC BACKGROUND AND A FEW OTHER FACTORS

(200) YOU CAN OFTEN PREDICT FOR WHOM PEOPLE WILL VOTE BEFORE THEY KNOW IT THEMSELVES $URING THE PAST FEW YEARS

(201) THERE HAS BEEN A HUGE AMOUNT OF BUZZ AROUND THE TERMS hBIG DATAv

(202) hDATA SCIENCEv AND hMACHINE LEARNINGv As these buzzwords continue to gain acceptance, many statisticians are wondering what the big deal is. And to be honest, their complaint MAKES SOME SENSE

(203) GIVEN THAT hMACHINE LEARNINGv IS

(204) MORE OR LESS

(205) A COMPUTERIZED VERSION OF THE PREDICTIVE MODELS THAT STATISTICIANS HAVE BEEN CREATING FOR DECADES .OW

(206) WHY AM ) TELLING YOU THIS "ECAUSE ) ACTUALLY DO BELIEVE THAT MACHINE LEARNING IS A GAME CHANGER FOR HUGE PARTS OF OUR LIVES *UST as my perspective was changed when I learned statistics, giving me tools to understand the world better, many businesses are having their perspectives changed, as they use machine learning to understand THEMSELVES BETTER %VERYTHING FROM ONLINE SHOPPING

(207) TO THE ITEMS YOU SEE IN YOUR SOCIAL NETWORK FEEDS

(208) TO THE VOICE RECOGNITION ALGORITHMS IN YOUR PHONE

(209) TO THE FRAUD DETECTION USED BY YOUR CREDIT CARD COMPANY IS BEING AFFECTED

(210) BOOSTED AND HOPEFULLY IMPROVED VIA MACHINE LEARNING 4HIS MEANS THAT NO MATTER WHAT SORT OF SOFTWARE DEVELOPMENT YOU DO

(211) you would be wise to gain as much experience as you can with machine LEARNING )TS BENEFITS MIGHT NOT BE OBVIOUS TO YOU AT ONCE OR EVEN BE applicable to your work right away. But machine learning is becoming UBIQUITOUS

(212) AND THERE IS NO SHORTAGE OF WAYS IN WHICH TO USE IT 35 | October 2016 | http://www.linuxjournal.com. LJ270-Oct2016.indd 35. 9/21/16 7:27 PM.

(213) AT THE FORGE So with this article, I’m starting a series on machine learning and some OF THE WAYS YOUR ORGANIZATION CAN TAKE ADVANTAGE OF IT )LL LOOK AT A NUMBER OF PROBLEMS

(214) MANY OF WHICH ARE COMMON ON WEB APPLICATIONS

(215) THAT CAN BENEFIT FROM USING MACHINE LEARNING !LONG THE WAY

(216) ) HOPE YOULL GET LOTS OF IDEAS FOR THE SORTS OF ANALYSIS AND USES THAT MACHINE learning can bring to your applications. )F YOURE COMPLETELY NEW TO THE WORLD OF MACHINE LEARNING

(217) ) ENCOURAGE YOU TO READ THE FREE 'EEK 'UIDE ) WROTE ON THE SUBJECT

(218) PUBLISHED BY Linux Journal and available at http://geekguide.linuxjournal.com/content/ MACHINE LEARNING PYTHON .. Uses for Machine Learning )F YOU HAVE EVER INVESTED MONEY

(219) YOULL UNDOUBTEDLY REMEMBER THAT THE FUND IN WHICH YOU INVESTED

(220) OR THE BROKER WITH WHOM YOU WORKED

(221) WARNED YOU THAT hPAST PERFORMANCE IS NO GUARANTEE OF FUTURE RESULTSv OR WORDS TO THAT EFFECT 4HATS BECAUSE WE

(222) AS LIVING BEINGS

(223) ARE CONDITIONED TO ASSUME THAT IF THE WORLD WORKED A CERTAIN WAY IN THE PAST

(224) THEN ITLL LIKELY WORK A CERTAIN WAY IN THE FUTURE &OR MOST OF US

(225) MOST OF THE TIME

(226) this is a good way to live our lives. Machine learning works on this principle, that the past is a good INDICATOR OF THE FUTURE 7E CREATE A MACHINE LEARNING MODEL

(227) TELLING THE MODEL THAT GIVEN A SET OF INPUTS

(228) WE GOT A PARTICULAR OUTPUT /NE SUCH PIECE OF INFORMATION IS UNLIKELY TO GIVE US ANYTHING USEFUL "UT

(229) SEVERAL hundred samples later, the model can start to make some predictions. Several thousand, or even million, samples later, and your predictions CAN POTENTIALLY BE QUITE ACCURATE. Customer Patterns )F YOU RUN AN ONLINE STORE

(230) MACHINE LEARNING CAN HELP YOU TO UNDERSTAND YOUR CUSTOMERS BETTER &OR EXAMPLE

(231) IF YOU KNOW THAT CUSTOMERS WHO BOUGHT PRODUCTS 8 AND 9 ALSO BOUGHT PRODUCT :

(232) YOU CAN SEND EMAIL PROMOTIONS TO SUCH PEOPLE WHO HAVENT YET BOUGHT :

(233) KNOWING THAT A PROPORTION OF THEM WILL RESPOND POSITIVELY -ORE NEFARIOUSLY

(234) YOU ALSO COULD RAISE THE PRICE ON PRODUCT : WHEN THOSE PEOPLE VISIT YOUR SITE

(235) KNOWING THAT A FAIR NUMBER OF SUCH PEOPLE are likely to buy it anyway. 36 | October 2016 | http://www.linuxjournal.com. LJ270-Oct2016.indd 36. 9/21/16 7:27 PM.

(236) AT THE FORGE !ND BY HOW MUCH SHOULD YOU RAISE THE PRICE !SSUMING ENOUGH TRAFFIC

(237) YOU CAN TRY DIFFERENT NUMBERS ON DIFFERENT PEOPLE

(238) UNTIL YOU FIGURE OUT THE OPTIMAL SETTING )F YOU HAVE ADDITIONAL INFORMATION ABOUT YOUR CUSTOMERS

(239) SUCH AS THEIR AGE

(240) GENDER OR WHERE THEY LIVE

(241) A MACHINE LEARNING ALGORITHM CAN HELP YOU DETERMINE EVEN MORE ABOUT THEMˆFROM WHAT THEYRE LIKELY TO BUY

(242) TO HOW OFTEN THEYLL VISIT YOUR STORE 9OU ALSO CAN KEEP TRACK OF THINGS THEY THOUGHT ABOUT BUYING

(243) BUT LATER REMOVED FROM THEIR SHOPPING CARTS 4AKE THE FAMOUS STORY OF 4ARGET

(244) WHICH SENT A hSO YOURE EXPECTINGv PROMOTION TO A TEENAGE GIRL IN THE 5NITED 3TATES )T TURNS OUT THAT 4ARGETS MACHINE LEARNING SYSTEMS HAD CORRECTLY IDENTIFIED THAT BASED ON HER PURCHASING HABITS

(245) SHE WAS LIKELY TO BE PREGNANT 4HE ONLY PROBLEM WAS THAT THIS TEENAGER IN QUESTION

(246) WHO WAS INDEED PREGNANT

(247) HADNT TOLD HER PARENTS ) RECENTLY SPOKE WITH THE #4/ OF A NEW ONLINE MARKETPLACE FOR A SPECIFIC TYPE OF CONSULTING

(248) IN WHICH CUSTOMERS AND CONSULTANTS WOULD COMMUNICATE

(249) WITH A GOAL TOWARD SOLVING THE PROBLEM !FTER EACH SESSION

(250) EACH OF THE PARTICIPANTS WOULD THEN INDICATE HOW SATISFIED THEY WERE 4HE #4/ WANTED to know where machine learning could help; I told him that over time, they COULD ACCUMULATE A HUGE AMOUNT OF DATA REGARDING WHICH TYPES OF CUSTOMERS GOT ALONG BEST WITH WHICH SORTS OF CONSULTANTSˆALLOWING THEM TO MAKE increasingly good recommendations and be better matchmakers. !ND SPEAKING OF hMATCHMAKERSv

(251) EVERY MODERN ONLINE DATING SITE USES MACHINE LEARNING 4HEY KNOW A LOT ABOUT THEIR USERS

(252) AND THEY USE THAT data to try to predict which people in their database are likely to be the GREATEST SUCCESS 9OU COULD SAY THAT THESE DATING SITES

(253) THANKS TO THEIR MACHINE LEARNING SYSTEMS

(254) KNOW MORE ABOUT PEOPLES DATING PREFERENCES than people could explicitly say about themselves.. Recommendation Engines /NE CLASSIC EXAMPLE OF MACHINE LEARNING IS A RECOMMENDATION ENGINE ) HAVE BEEN SHOPPING ON !MAZON SINCE IT FIRST OPENED

(255) SO )VE PROVIDED THAT COMPANY WITH A GREAT DEAL OF DATA ABOUT MYSELF AND THE THINGS ) LIKE TO purchase. When it suggests that I might be interested in a product, the odds are good that I either have it already, or that I considered it or that I would indeed be interested in it. )F YOU RUN AN E COMMERCE SITE

(256) YOU CAN USE MACHINE LEARNING TO SIMILAR 37 | October 2016 | http://www.linuxjournal.com. LJ270-Oct2016.indd 37. 9/21/16 7:27 PM.

(257) AT THE FORGE ENDS 9OU CAN CREATE A MODEL THAT IDENTIFIES WHICH PRODUCTS ARE SIMILAR TO WHICH OTHER PRODUCTS 4HEN

(258) YOU CAN GO THROUGH SOMEONES PURCHASE HISTORY

(259) FINDING UNPURCHASED PRODUCTS THAT ARE SIMILAR TO THE ONES THAT they already have bought. .OWADAYS

(260) SITES LIKE !MAZON OFTEN HAVE ACCESS NOT ONLY TO YOUR purchase history, but also to the ratings you gave to various products. In this way, sites can suggest not only the products that you’re likely to buy, but also those that you’re most likely to enjoy as well. Another way to handle recommendations is to look at people, rather THAN PRODUCTS )NSTEAD OF TELLING ME WHAT )M LIKELY TO BUY BASED on my past purchases, a site could tell me what I’m likely to buy, BASED ON MY FRIENDS PURCHASING HABITS )F YOU HAVE ACCESS TO FRIENDS RECOMMENDATIONS

(261) THE COMBINATION OF A FRIENDS PURCHASE AND A HIGH RATING FROM THAT FRIEND MIGHT MAKE A PRODUCT ESPECIALLY ATTRACTIVEˆAND

(262) THUS

(263) THE OBJECT OF A SPECIAL PROMOTION. Finances /F COURSE

(264) MANY OF THE HEAVIEST AND LARGEST USERS OF MACHINE LEARNING ARE FINANCIAL FIRMS 9OU CAN BE SURE THAT CREDIT CARD COMPANIES AND OTHER PAYMENT COMPANIES

(265) SUCH AS 0AY0AL

(266) SPEND A GREAT DEAL OF TIME AND EFFORT ON MACHINE LEARNING ALGORITHMS THAT IDENTIFY WHEN SOMEONE MIGHT BE COMMITTING FRAUD )F ) USE MY CREDIT CARD TO BUY SOMETHING UNUSUAL OR IN A COUNTRY ) HAVENT VISITED BEFORE

(267) MY CREDIT CARD COMPANY SOMETIMES WILL contact me to make sure the transaction is legitimate. !S YOU CAN IMAGINE

(268) SUCH MACHINE LEARNING MODELS TAKE A WIDE VARIETY OF INPUTS TO TRY TO DETERMINE WHETHER THE TRANSACTION IS LEGITIMATE OR FRAUDULENT 4HESE CHECKS OFTEN HAVE TO TAKE PLACE IN REAL TIME

(269) WHICH MAKES THEM PARTICULARLY IMPRESSIVE IN MY BOOK

(270) GIVEN THE AMOUNT OF DATA that they have to deal with in a given moment. But, there inevitably will BE SOME FALSE POSITIVES AND FALSE NEGATIVES IN SUCH A SYSTEM )F YOURE LIKE ME

(271) THE FALSE NEGATIVES CONTINUE TO HAUNT YOU FOR A LONG TIME AFTERWARD !FTER ALL

(272) ALTHOUGH ) UNDERSTAND HOW THESE COMPANIES ARE JUST TRYING TO DO their jobs, it’s maddening to be stuck at the supermarket checkout, trying TO CONVINCE YOUR CREDIT CARD COMPANY THAT YOURE SIMPLY TRYING TO BUY MILK and bread in Stockholm. h&IN4ECHv COMPANIES ARE POPPING UP ALL OVER

(273) AND MUCH OF WHAT THEY 38 | October 2016 | http://www.linuxjournal.com. LJ270-Oct2016.indd 38. 9/21/16 7:27 PM.

(274) AT THE FORGE DO IS AN APPLICATION OF MACHINE LEARNING TO FINANCE HENCE THE NAME

(275) OF COURSE  7HETHER ITS IDENTIFYING FRAUD OR LOOKING FOR INVESTMENT OPPORTUNITIES

(276) SUCH MODELS CAN CRUNCH MORE DATA MORE QUICKLY THAN PEOPLEˆAND CAN DRAW UPON MILLIONS OF PREVIOUS EXAMPLES

(277) RATHER THAN the dozens that humans can keep in their heads.. Summary !S YOU CAN SEE

(278) MACHINE LEARNING OFFERS AN INCREDIBLE VARIETY OF SOLUTIONS

(279) PROVIDING OPPORTUNITIES FOR NEW TYPES OF ANALYSIS )TS DEFINITELY WORTH sitting down to learn something about machine learning. In upcoming ARTICLES

(280) ) PLAN TO WALK YOU THROUGH HOW TO SOLVE SOME OF THE PROBLEMS DESCRIBED IN THIS COLUMN USING OPEN SOURCE LANGUAGES AND TOOLS ) HOPE you’ll soon see that in data science and machine learning, the coding is THE EASY PART 4HE HARD PART IS THINKING ABOUT HOW TO BUILD YOUR MODEL

(281) what to include and which algorithm would be the most appropriate. Q. RESOURCES Machine learning is a huge field, and part of the problem is the plethora of sources of information. One long-standing weekly email list is KDnuggets at http://kdnuggets.com. You also should consider the Data Science Weekly newsletter (http://datascienceweekly.com) and This Week in Data (HTTPSDATAREPUBLICBLOGCOMCATEGORYTHIS WEEK IN DATA), describing the latest data sets available to the public. I am a big fan of podcasts, and I particularly love “Partially Derivative”. Other good ones are “Data Stores” and “Linear Digressions”. I listen to all three on a regular basis and learn from them all. Finally, if you’re looking to get into data science and machine learning, I recommend Kevin Markham’s Data School (http://dataschool.org) and Jason Brownlie’s “Machine Learning Mastery” (http://machinelearningmastery.com), where he sells a number of short, dense, but high-quality ebooks on these subjects.. Send comments or feedback via http://www.linuxjournal.com/contact or to [email protected].. RETURN TO CONTENTS 39 | October 2016 | http://www.linuxjournal.com. LJ270-Oct2016.indd 39. 9/21/16 7:27 PM.

(282) WORK THE SHELL. Mars Lander, Take II: Crashing onto the Surface PREVIOUS Reuven M. Lerner’s At the Forge. NEXT Kyle Rankin’s Hack and /. V. V. Dave succeeds at crashing the lander on the Martian surface—and says it’s progress!. DAVE TAYLOR Dave Taylor has been hacking shell scripts on Unix and Linux systems for a really long time. He’s the author of Learning Unix for Mac OS X and the popular shell scripting book Wicked Cool Shell Scripts. He can be found on Twitter as @DaveTaylor, and you can reach him through his tech Q&A site: http:// www.AskDaveTaylor.com.. IN MY LAST ARTICLE, I SPENT ALMOST THE ENTIRE PIECE EXPLORING GRAVITATIONAL PHYSICS, OF ALL UNLIKELY TOPICS. 4HE FOCUS WAS ON WRITING A VERSION OF THE CLASSIC ARCADE GAME Lunar Lander

(283) BUT THIS TIME

(284) IT WOULD BE LANDING A CRAFT ON the red planet Mars rather than that pockmarked lump OF ROCK ORBITING THE %ARTH Being a shell script, however, it was all about the physics, NOT ABOUT THE 5)

(285) BECAUSE VECTOR GRAPHICS ARE A BIT TRICKY TO ACCOMPLISH WITHIN "OURNE 3HELLˆTO SAY THE LEAST 40 | October 2016 | http://www.linuxjournal.com. LJ270-Oct2016.indd 40. 9/21/16 7:27 PM.

(286) WORK THE SHELL. Landing on the Earth’s surface has lots more complexity with atmospheric drag and weather effects, but looking at Mars, and not during its glory days as Barsoom, it’s atmosphere-free. 4O MAKE THE SOLUTION A FEW DOZEN LINES INSTEAD OF A FEW THOUSAND

(287) ) SIMPLIFY THE PROBLEM TO TWO DIMENSIONS AND ASSUME SAFE

(288) FLAT LANDING SPACES 4HEN ITS A QUESTION OF FORWARD VELOCITY

(289) WHICH IS EASY TO calculate, and downward velocity, which is tricky because it has the CONSTANT PULL OF GRAVITY AS YOU FIRE YOUR RETRO ROCKETS TO COMPENSATE AND THEREBY AVOID CRASHING ONTO THE PLANETS SURFACE )F ONE WERE WORKING WITH 3PACE 8 OR .!3!

(290) THERE WOULD BE LOTS OF FACTORS TO TAKE INTO ACCOUNT WITH A REAL -ARTIAN LANDER

(291) NOTABLY THE MASS OF THE SPACECRAFT AS IT BURNS FUEL

(292) THE MASS DECREASES

(293) A NUANCE THAT THE gravitational calculations can’t ignore. 4HATS BEYOND THE SCOPE OF THIS PROJECT

(294) HOWEVER

(295) SO )M GOING TO USE SOME HIGHLY SIMPLIFIED MATHEMATICS INSTEAD

(296) STARTING WITH THE ONE DIMENSIONAL PROBLEM OF DESCENT speed  =  speed  +  gravity         altitude  =  altitude  -­  speed. Surprisingly, this works pretty well, particularly when there’s negligible ATMOSPHERE ,ANDING ON THE %ARTHS SURFACE HAS LOTS MORE COMPLEXITY WITH ATMOSPHERIC DRAG AND WEATHER EFFECTS

(297) BUT LOOKING AT -ARS

(298) AND NOT DURING ITS GLORY DAYS AS "ARSOOM

(299) ITS ATMOSPHERE FREE )N MY LAST ARTICLE

(300) ) PRESENTED FIGURES USING FEET AS A UNIT OF MEASURE

(301) BUT ITS TIME TO SWITCH TO METRIC

(302) SO FOR THE SIMULATION GAME

(303) )M USING -ARTIAN GRAVITY   METERSSECSEC 4HE SPACESHIP WILL ENTER THE ATMOSPHERE AT AN ALTITUDE OF  METERS ABOUT  MILE

(304) AND PLAYERS HAVE JUST MORE THAN  SECONDS TO AVOID CRASHING ONTO THE -ARTIAN SURFACE

(305) WITH A TERMINAL VELOCITY OF MS 3INCE )M MAKING GAME OUT OF IT

(306) THE CALCULATIONS ARE PERFORMED IN 41 | October 2016 | http://www.linuxjournal.com. LJ270-Oct2016.indd 41. 9/21/16 7:27 PM.

(307) WORK THE SHELL ONE SECOND INCREMENTS

(308) MEANING THAT YOU ACTUALLY CAN USE THE RETRO ROCKETS AT ANY POINT TO COMPENSATE FOR THE TUG OF GRAVITY AND HOPEFULLY land, rather than crash into Mars! 4HE EQUATION CHANGES ONLY A TINY BIT speed  =  speed  +  gravity  +  thrust. !GAIN

(309) THERE ARE COMPLEX ASTRO MECHANICAL FORMULAS TO FIGURE OUT FORCE PRODUCED IN A RETRO ROCKET BURN VERSUS FUEL EXPENDED

(310) BUT TO SIMPLIFY

(311) )M ASSUMING THAT FUEL IS MEASURED IN OUTPUT FORCE METERS OF COUNTER thrust per second. 4HAT IS

(312) IF YOU ARE DESCENDING AT  METERSSECOND

(313) APPLICATION OF  UNITS OF THRUST WILL FULLY COMPENSATE AND GET YOU TO ZERO DESCENT

(314) ESSENTIALLY HOVERING ABOVE THE SURFACEˆUNTIL THE INEXORABLE PULL OF GRAVITY BEGINS TO DRAG YOU BACK TO THE PLANETS SURFACE

(315) AT LEAST Gravity diminishes over distance, so too much thrust could break you COMPLETELY FREE OF THE PLANETS GRAVITATIONAL PULL No bueno 4O INCLUDE that possibility, I’m going to set a ceiling altitude. Fly above that height, AND YOUVE BROKEN FREE AND ARE DOOMED TO FLOAT OFF INTO SPACE. Floating-Point Math 3HELL SCRIPTS MAKE WORKING WITH INTEGER MATH QUITE EASY

(316) BUT ANY REAL CALCULATIONS NEED TO BE DONE WITH FLOATING POINT NUMBERS

(317) WHICH CAN BE TRICKY IN THE SHELL 4HEREFORE

(318) )NSTEAD OF USING THE $((  )) notation or expr

(319) )M GOING TO TAP THE POWER OF bc , the binary calculator program. Being in a shell script, it’s a bit awkward, so I’m going to use a rather FUNKY NOTATIONAL CONVENIENCE TO CONSTRAIN EACH CALCULATION TO A SINGLE LINE speed=$(  $bc  <<<  "scale=3;;  $speed  +  $gravity  +  $thrust"  ). "Y DEFAULT

(320) FOR REASONS ) DONT UNDERSTAND

(321) bc also wants to work with JUST INTEGER VALUES

(322) SO ASK IT TO SOLVE THE EQUATION 

(323) AND ITLL RETURN  )NDICATE HOW MANY DIGITS AFTER THE DECIMAL PLACE TO TRACK WITH scale , HOWEVER

(324) AND IT WORKS A LOT BETTER 4HATS WHAT )M DOING ABOVE WITH scale=3  4HAT GIVES THREE DIGITS OF PRECISION AFTER THE DECIMAL POINT

(325) ENOUGH FOR THE GAME TO FUNCTION FINE 42 | October 2016 | http://www.linuxjournal.com. LJ270-Oct2016.indd 42. 9/21/16 7:27 PM.

(326) WORK THE SHELL. Thrust is the force being exerted by the rocket when it’s firing, so that’ll have to be something the user can enter after each second (the “game” part of the game). Martian Lander Core Code 7ITH THAT NOTATION IN MIND

(327) ) CAN FINALLY CODE THE BASICS OF THE -ARTIAN LANDER while  [  $altitude  -­gt  0  ]   do      speed=$(  $bc  <<<  "scale=3;;  $speed  +  $gravity  +  $thrust"  )      altitude=$(  $bc  <<<  "scale=3;;  $altitude  +  $speed"  )      time=$((  $time  +  1  ))   done. /BVIOUSLY

(328) THERE ARE A LOT OF VARIABLES TO INSTANTIATE WITH THE CORRECT VALUES

(329) INCLUDING GRAVITY n

(330) ALTITUDE  METERS

(331) THRUST RETRO rockets start powered down, so the initial value is 0), and speed and time also should both be set to 0. %VEN WITH THIS TINY SNIPPET

(332) HOWEVER

(333) THERE ARE SOME PROBLEMS &OR example, the conditional that controls the while loop tests whether ALTITUDE IS GREATER THAN ZERO "UT ALTITUDE IS A FLOATING POINT NUMBER

(334) SO THE TEST FAILS 4HE EASY SOLUTION IS A SECOND VARIABLE THATS JUST THE INTEGER PORTION OF ALTITUDE alt=$(  echo  $altitude  |  cut  -­d\.  -­f1  ). One problem solved. 4HRUST IS THE FORCE BEING EXERTED BY THE ROCKET WHEN ITS FIRING

(335) SO THATLL HAVE TO BE SOMETHING THE USER CAN ENTER AFTER EACH SECOND THE hGAMEv PART OF THE GAME  "UT ONCE ITS FIRED

(336) IT SHOULD SHUT OFF AGAIN

(337) SO THRUST NEEDS TO BE SET BACK TO ZERO AFTER EACH CALCULATION IS COMPLETE 4HERES ALSO A TRICKY CHALLENGE WITH POSITIVE AND NEGATIVE VALUES HERE 43 | October 2016 | http://www.linuxjournal.com. LJ270-Oct2016.indd 43. 9/21/16 7:27 PM.

(338) WORK THE SHELL 'RAVITY SHOULD BE A NEGATIVE VALUE

(339) AS ITS PULLING THE CRAFT INEXORABLY CLOSER TO THE CENTER OF THE PLANET 4HEREFORE

(340) THRUST SHOULD BE POSITIVE

(341) SINCE ITS FIGHTING GRAVITY 4HAT MEANS SPEED WILL BE NEGATIVE WHEN DROPPING TOWARD THE SURFACE

(342) AND POSITIVE WHEN SHOOTING UPWARD

(343) POTENTIALLY ESCAPING THE PLANETS GRAVITY FIELD ENTIRELY (ERES A REFINEMENT ON THE CORE PROGRAM LOOP while  [  $alt  -­gt  0  ]   do      speed=$(  $bc  <<<  "scale=3;;  $speed  +  $gravity  +  $thrust"  )      thrust=0          #  rocket  fires  on  a  per-­second  basis      altitude=$(  $bc  <<<  "scale=3;;  $altitude  +  $speed"  )      alt=$(  echo  "$altitude"  |  cut  -­d\.  -­f1  )      time=$((  $time  +  1  ))      echo  "$time  seconds:  speed:  $speed  m/s              altitude:  $altitude  meters."   done. 4HAT WORKS IF YOU JUST WANT TO PLUMMET TO THE PLANET WITHOUT ANY ROCKET FIRING )TD LOOK LIKE THIS 1  seconds:  speed:  -­3.722  m/s  altitude:  496.278  meters.   2  seconds:  speed:  -­7.444  m/s  altitude:  488.834  meters.   3  seconds:  speed:  -­11.166  m/s  altitude:  477.668  meters.   4  seconds:  speed:  -­14.888  m/s  altitude:  462.780  meters.   5  seconds:  speed:  -­18.610  m/s  altitude:  444.170  meters.   6  seconds:  speed:  -­22.332  m/s  altitude:  421.838  meters.   7  seconds:  speed:  -­26.054  m/s  altitude:  395.784  meters.   8  seconds:  speed:  -­29.776  m/s  altitude:  366.008  meters.   9  seconds:  speed:  -­33.498  m/s  altitude:  332.510  meters.   10  seconds:  speed:  -­37.220  m/s  altitude:  295.290  meters.   11  seconds:  speed:  -­40.942  m/s  altitude:  254.348  meters.   12  seconds:  speed:  -­44.664  m/s  altitude:  209.684  meters.   13  seconds:  speed:  -­48.386  m/s  altitude:  161.298  meters.   14  seconds:  speed:  -­52.108  m/s  altitude:  109.190  meters.   15  seconds:  speed:  -­55.830  m/s  altitude:  53.360  meters. 44 | October 2016 | http://www.linuxjournal.com. LJ270-Oct2016.indd 44. 9/21/16 7:27 PM.

(344) WORK THE SHELL !T THIS POINT

(345) THE CRAFT IS DROPPING AT MS AND IS ONLY  METERS ABOVE THE SURFACE OF THE PLANET

(346) SO YOU CAN COUNT ON A BIG

(347) UGLY CRASH "//- !T SECOND 

(348) YOU COULD APPLY  UNITS OF THRUST TO JERK THE CRAFT BACK TO ZERO SPEED

(349) BUT WHAT IF YOU DIDNT HAVE  UNITS OF FUEL OR IF THE MAX THRUST YOU COULD EXERT AT ANY GIVEN UNIT TIME WAS  DUE TO ROCKET DESIGN AND PASSENGER SURVIVAL CONSTRAINTS 4HATS WHERE THIS GETS INTERESTING )N MY NEXT ARTICLE

(350) )LL DIG INTO THOSE CONSTRAINTS AND FINALLY ADD SOME INTERACTIVITY TO THE PROGRAM &OR NOW

(351) BE CAREFUL OUT THERE FLYING THIS PARTICULAR SPACE CRAFT )TS YOUR BUDGET THAT THE REPLACEMENT PARTS ARE COMING OUT OF

(352) AFTER ALL 0ROPS TO *OEL 'ARCIA AND #HRIS 9ORK FOR THEIR ONGOING ASSISTANCE WITH ALL THE GRAVITATIONAL FORMULAS !NY ERRORS AND GLITCHES ARE ALL DUE TO MY own rusty physics. Q. Send comments or feedback via http://www.linuxjournal.com/contact or to [email protected].. RETURN TO CONTENTS 45 | October 2016 | http://www.linuxjournal.com. LJ270-Oct2016.indd 45. 9/21/16 7:27 PM.

(353) HACK AND /. Simple Server Hardening Server hardening doesn’t have to be a series of arcane complex commands.. KYLE RANKIN Kyle Rankin is a Sr.. PREVIOUS Dave Taylor’s Work the Shell. NEXT Shawn Powers’ The Open-Source Classroom. in the San Francisco Bay Area and the author. V. V. Systems Administrator. of a number of books, including The Official Ubuntu Server Book, Knoppix Hacks and. THESE DAYS, IT’S MORE IMPORTANT THAN EVER TO TIGHTEN UP THE SECURITY ON YOUR SERVERS, YET IF YOU WERE TO LOOK AT SEVERAL OFFICIAL hardening guides, they read as though they were WRITTEN FOR 2ED (AT FROM  4HATS BECAUSE THEY were WRITTEN FOR 2ED (AT IN  AND UPDATED HERE AND THERE THROUGH THE YEARS ) CAME ACROSS ONE OF THESE GUIDES WHEN ) WAS REFERRING TO SOME OFFICIAL HARDENING BENCHMARKS FOR A 0#) AUDIT AND REALIZED IF OTHERS NEW TO ,INUX SERVER ADMINISTRATION WERE to run across the same guide, they likely would be OVERWHELMED WITH ALL OF THE OBSCURE STEPS 7ORSE THOUGH

(354) THEY LIKELY WOULD SPEND HOURS PERFORMING obscure sysctl tweaks and end up with a computer that was no more protected against a modern ATTACK )NSTEAD

References

Related documents

Section 3.4, the derivation of a deterministic equivalent of the mutual informa- tion of the K-hop amplify-and-forward (AF) MIMO relay channel in Section 3.5, and the

Freight container An article of transport equipment that is of a permanent character and accordingly strong enough to be suitable for repeated use; specially designed

The diagnostic maneuver used to elicit BPPV emanating from a horizontal canal is the same used to look for positional nystagmus: the supine patient’s head is rotated first to

The results of the linear mixed-effects model analysis with the fixed effects CONDITION (local vs. global motion) and GROUP (VIMS vs. healthy groups) for the

If the notches extracted from the subject’s pinna image are to be compared with a set of HRTFs taken from a database, various notch distance metrics can be defined based on

• Delivery site types (e.g., senior centers/AAA, residential facilities, healthcare organizations, community/multi-purpose facilities, faith-based organizations)...  The majority

Introduction Methodology Results Conclusion Experimental Design Dimensions Examples Evaluation Pop: most similar words. pop music

When fixing maturity, Myers (1977) shows the riskier the debt, the stronger the overhang effect. Our result indicates that if the variation of debt riskiness comes from maturity, the