FREE DVD LIVE BOOT THE LATEST MINT www.linuxuser.co.uk L IN U X U S E R & D E V E L O P E R THE ESSENTIAL MAGAZINE IS FOR THE GNU GENERATION S U E 1 7 1 MAXIMISE PERFORMANCE TODAY BBEETTTTEERR BEST SSEERRVVEERRSS FIREWALLS HEAD-TO-HEAD IN 24 HHOOUURRSS B E T T E BUILD AND DEPLOY THE BEST OPEN R S E SSOOUURRCCEE SSEERRVVEERR AARRCCHHIITTEECCTTUURREE NNOOWW R V DEPLOY A LAMP STACK E R S IN REMOTE ADMIN 2 4 H O ON UBUNTU U R S UPGRADE YOUR HARDWARE Take control of your Ubuntu system from anywhere PPPOOOCCCKKKEEETTTCCCHHHIIIPPP OOONNN TTTEEESSSTTT THE BEST FOR YOUR BUDGET DDooeess tthhiiss LLiinnuuxx hhaannddhheelldd bbaasseedd oonn tthhee CCHHIIPP bbooaarrdd have what it takes to impress gamers? PREVENT SSH ATTACKS Prevent brute force, wardialling and man-in- OOPPEENN SSOOUURRCCEE the-middle attacks on your servers AAII CCOONNTTRROOLL AA RROOBBOOTT ARM WITH PI “ w ““MMyyccrroofftt iiss tthhee ooppeenn ssoouurrccee w w answer to voice-activated person“al .lin UUssee tthhee SSkkyywwrriitteerr ggeessttuurree--sseennssiinngg bbrreeaakkoouutt ttoo mmaakkee aa rroobboott mmoovvee assistants like the Amazon Echo” ux –Ryan Sipes u ALSO INSIDE Code your own ASP. se ISSUE 171 £5.99 r.c » Develop your Bash scripting skills NET Core web apps ISSN 2041-3270 71 > o » L earn advanced concurrent .uk programming techniques in Go Leverage this cross-platform » Salix 14.2 Xfce Edition reviewed development framework under Linux 9 772041 327002 001_LUD171_FINAL.indd 1 04/10/2016 16:02 Full Page.indd 1 03/10/2016 09:51 THE MAGAZINE FOR THE GNU GENERATION Welcome Imagine Publishing Ltd Richmond House, 33 Richmond Hill Bournemouth, Dorset, BH2 6EZ ☎ +44 (0) 1202 586200 Web: www.imagine-publishing.co.uk www.linuxuser.co.uk www.greatdigitalmags.com to issue 171 of Linux User & Developer Magazine team Editor April Madden [email protected] ☎ 01202 586218 Designer Rebekka Hearl This issue Photographer James Sheppard Senior Art EditorStephen Williams Editor in ChiefDan Hutchinson Publishing DirectorAaron Asadi Head of Design Ross Andrews » Better servers in 24 hours Contributors Dan Aldred, Joey Bernard, Christian Cawley, Sanne De Boer, Kunal » Remote admin on Ubuntu Deo, Nate Drake, Gareth Halfacree, Tam Hanna, Oliver Hill, Phil King, Paul O’Brien, Swayam Prakasha, Richard Smedley, Jasmin Snook, Mihalis Tsoukalos and Kevin Wittmer » Open source AI Advertising Digital or printed media packs are available on request. » Prevent SSH attacks Head of Sales Hang Deretz ☎ 01202 586442 [email protected] Account Manager Luke Biddiscombe ☎ 01202 586431 Welcome to the latest issue of Linux User & Developer, [email protected] FileSilo.co.uk the UK and America’s favourite Linux and open source Assets and resource fi les for this magazine can now be found on this website. magazine. Servers were once the sole province of Support fi [email protected] corporations and other large organisations. Now you’re International Linux User & Developer is available for licensing. much more likely to see one in someone’s home – maybe H☎e a+d4 4of (I0n)t 1er2n0a2ti o5n8a6l 4L0ic1ensing Cathy Blackman they’re running their own business with it and it’s dealing [email protected] with essential fi les and folders, web access and accounts, Subscriptions For all subscriptions enquiries or maybe they’re simply using it to serve fi les around their home [email protected] ☎ UK 0844 249 0282 network. These days many more of us are doing that, and if you ☎ Overseas +44 (0) 1795 418661 www.imaginesubs.co.uk want to get in on the action, then head to p18 where our experts Head of Subscriptions Sharon Todd explain everything you need to know to upgrade an existing home or Circulation Circulation Director Darren Pearce SME server, or build one from scratch. ☎PP☎rro o00dd11u22uc00tci22ot ni55o D88ni66re22c00t00or Jane Hawkins ioLsnos ou17ke Nf1o7or2v ideOaf ctoo uhrasvee, roenmceo tyeo auc’vcee gsost t yoo iut,r b suetr yvoeur ’ullp n aenedd rtuon mnainkge, situ’sr ea tghoaotd’s Finance Want it sooner? secure. Check out the tutorial on p38 to fi nd out more about remote Finance Director Marco Peroni Subscribe administration using SSH, and the one on p48 to fi nd out how you Founder Group Managing Director Damian Butt today! can prevent SSH attacks and keep your data secure. Plus we have Printing & Distribution guides to Bash scripting, .NET and programming in Go to help you PPrriinntteedd bbyy WWiilllliiaamm GGiibbbboonnss,, 2266 PPllaanneettaarryy RRooaadd,, Willenhall, West Midlands, WV13 3XT develop your skills further. On p52, we take an in-depth look at Distributed in the UK, Eire & the Rest of the World by: Linux Mint, including a breakdown of the various versions and how Marketforce, 5 Churchill Place, Canary Wharf London, E14 5HU they compare, plus advanced tips and tricks to confi gure it to your ☎ 0203 148 3300 www.marketforce.co.uk liking and to make sure it’s locked up tight. Enjoy the issue! Distributed in Australia by: April Madden, Editor Gordon & Gotch Australia Pty Ltd 26 Rodborough Road Frenchs Forest, New South Wales 2086, Australia ☎ +61 2 9972 8800 www.gordongotch.com.au Get in touch with the team: Disclaimer The publisher cannot accept responsibility for any unsolicited material lost or damaged in the post. All text and layout is the copyright of Imagine Publishing Ltd. Nothing in this magazine may be reproduced [email protected] in whole or part without the written permission of the publisher. All copyrights are recognised and used specifi cally for the purpose of criticism and review. Although the magazine has endeavoured to ensure all information is correct at time of print, prices and Buy online availability may change. This magazine is fully independent and not affi liated in any way with the companies mentioned herein. Facebook: Twitter: If you submit material to Imagine Publishing via post, email, social Linux User & Developer @linuxusermag network or any other means, you automatically grant Imagine Publishing an irrevocable, perpetual, royalty-free license to use the material across its entire portfolio, in print, online and digital, and to deliver the material to existing and future clients, including but not limited to international licensees for reproduction in international, licensed editions of Imagine products. Any material you submit is sent at your risk and, although Visit us online for more news, opinion, tutorials and reviews: every care is taken, neither Imagine Publishing nor its employees, agents or subcontractors shall be liable for the loss or damage. www.linuxuser.co.uk © Imagine Publishing Ltd 2016 ISSN 2041-3270 www.linuxuser.co.uk 3 003_LUD171.indd 3 05/10/2016 16:09 Contents Subscribe & save! 28 C gUchraSeena cc tksu n usoebtuowstm c ooruefibfrres er ! on page 65 Reviews 83 Firewalls Which of these offer the best firewall protection for your desktop? 18 Better servers in 24 hours Build a server with the right hardware and software ClearOS IPCop OpenSource Tutorials 08 News 30 Bash masterclass: Flanking Bash T he biggest stories from with the power of Qt M0n0wall pfSense the open source world Use the Qt language in your shell scripts and get even more from Bash 12 Interview 88 CHIP and PocketCHIP Ryan Sipes introduces us to 34 Start coding ASP.NET Core web The CHIP is an impressive board, but Mycroft, the open source AI apps on the Linux desktop what about its handheld dock? Build your own weather app using ASP.NET 16 Kernel column Core development frameworks 90 Salix 14.2 Xfce Edition The latest on the Linux Can this latest version of Salix make kernel with Jon Masters 38 Remote system administration slackware relevant again? on Ubuntu 92 Free software Learn how to ensure that your remote Richard Smedley recommends some admin is locked down securely excellent FOSS packages for you to try 42 Concurrent programming in Go – Part 2 Learn more about advanced concurrent programming techniques in Go 48 Prevent SSH attacks Keep your Secure Shell locked down and ensure you keep your data to yourself Features 18 Better servers in 24 hours 67 Practical Raspberry Pi Build a better server today Learn how to use the Pi and a Skywriter breakout board to control a robot arm, 52 Ultimate guide to Mint 96 Free downloads discover how to use a Pi as a Tor proxy, Get more from the world’s Find out what we’ve uploaded to our digital and much more most popular distro content hub FileSilo for you this month Join us online for more Linux news, opinion and reviews www.linuxuser.co.uk 4 004_LUD171.indd 4 05/10/2016 11:29 NEW next generation Cloud Servers UK data centres, Flexible Pay as you UK support use pricing Enterprise features Set up in seconds Cloud Servers from: • Load balancing • Easy to use £15. 00 • VPN control panel • External fi rewall per month ex VAT charged at 20% 0808 1686 777 Call or visit fasthosts.co.uk/cloud-servers SERVERS • WEB HOSTING • DOMAIN NAMES • EXCHANGE EMAIL Full Page.indd 1 03/10/2016 09:52 Open Source On the disc On your free DVD this issue Load DVD Find out what’s on your free disc To access software and tutorial files, simply insert the disc into Welcome to the Linux User & Developer DVD. the Cinnamon environment for the Debian edition, your computer and double-click This issue, get the most from Mint. Choose from and learn how to configure them like a pro and the icon. the Cinnamon or MATE desktop environments explore how you can do more with the world’s Live boot for the Ubuntu-based Sarah edition, or load up favourite Linux distro. To live-boot into the distros Featured software: supplied on this disc, insert the disc into your disc drive and reboot your computer. Please note: • You will need to ensure that your computer is set up to boot from disc (press F9 on your computer’s BIOS screen to change Boot Options). • Some computers require you to press a key to enable booting from disc – check your manual or the manufacturer’s website to fi nd out if this is the Linux Mint 18 ‘Sarah’ – Linux Mint 18 ‘Sarah’ – case on your PC. • Live-booting distros are read MATE edition Cinnamon edition from the disc: they will not be installed permanently on your The MATE edition of the Linux Mint desktop boasts all For those who like their desktop to have some graphical computer unless you choose the power of the latest version of Mint combined with fl air, the Cinnamon desktop for the latest edition of to do so. the solid, traditional interface of MATE – perfect for Linux Mint is sleek and elegant – excellent for those increasing your productivity and giving you all-round who want the best-looking Linux installation possible. For best results: usability. This distro live boots. This distro live boots. This disc has been optimised for modern browsers capable of rendering recent updates to the HTML and CSS standards. So to get the best experience we recommend you use: • Internet Explorer 8 or higher • Firefox 3 or higher • Safari 4 or higher • Chrome 5 or higher Problems with the disc? Send us an email at linuxuser@ imagine-publishing.co.uk Please note however that if you Linux Mint Debian Edition – ‘Betsy’ are having problems using the programs or resources provided, With alternative repos from the Debian base and the look and feel of classic Mint Cinnamon, this version of Linux Mint then please contact the relevant is perfect for pro users who want more control while retaining all the usability of Mint. This distro live boots. software companies. 6 006-007 Disc Tutorial.indd 6 04/10/2016 17:53 Disclaimer Important information Check this before installing or using the disc For the purpose of this disclaimer statement the phrase ‘this disc’ refers to all software and resources supplied on the disc as well as the physical disc itself. You must agree to the following terms and conditions before using ‘this disc’: Loss of data In no event will Imagine Publishing Limited accept liability or be held responsible for any damage, disruption and/or loss to data or computer systems as a result of using ‘this disc’. Imagine Publishing Limited makes every effort to ensure that ‘this disc’ is delivered to you free from viruses and spyware. We do still strongly recommend that you run a virus checker over ‘this disc’ before use and that you have an up-to-date backup of your hard drive before using ‘this disc’. Hyperlinks: Imagine Publishing Limited does not accept any liability for content that may appear as a result of visiting hyperlinks published in ‘this disc’. At the time of production, all hyperlinks on ‘this disc’ linked to the desired destination. Imagine Publishing Limited cannot guarantee that at the time of use these hyperlinks direct to that same intended content as Imagine Publishing Limited has no control over the content delivered on these hyperlinks. Software Licensing Software is licensed under different terms; please check that you know which one a program uses before you install it. • Shareware: If you continue to use the program you should register it with the author • Freeware: You can use the program free of charge • Trials/Demos: These are either Live boot time-limited or have some Distros functions/features disabled Insert the disc into your computer and Distros can be live booted so that you • Open source/GPL: Free to use, reboot. You will need to make sure that can try a new operating system instantly but for more details please visit your computer is set up to boot from disc without making permanent changes to https://opensource.org/licenses/ your computer gpl-license FOSS Explore Unless otherwise stated you do not Insert the disc into your computer and have permission to duplicate and double-click on the icon or Launch Disc Alternatively you can insert and run the distribute ‘this disc’. fi le to explore the contents disc to explore the interface and content wwwwww..lliinnuuxxuusseerr..ccoo..uukk 77 006-007 Disc Tutorial.indd 7 04/10/2016 17:53 08 News & Opinion | 12 Interview | 96 FileSilo RASPBERRY PI Raspberry Pi smashes 10 million total sales The tiny computer that changed the computing landscape as we know it Above Over 10 million Raspberry Pi units have been sold worldwide One of the best things about being involved Raspberry Pi has now sold well over a staggering But the good news doesn’t stop there; to within the computing industry is that things 10 million units. While many of its initial sales celebrate the achievement the Raspberry Pi are constantly moving at an incredible rate. were made by Raspberry Pi enthusiasts, it Foundation has announced the availability of The whole computing landscape has changed is now actually used all over the place. It has the new Raspberry Pi Starter Kit. As its name dramatically over the past few years, and there’s been fl own into space, used in schools to teach suggests, the kit will include the basics needed to never been as much emphasis on entry-level kids and plays an integral role in the continued start and build your own project – no matter what computing as there is today. At the forefront development of the Internet of Things. In an it turns out to be. The core components will be of this development is the Raspberry Pi, the offi cial announcement, Raspberry Pi Foundation able to guide you through the process of building wallet-friendly computer that has forged its founder, Eben Upton, was understandably your fi rst desktop computer, which is simpler own niche in the market. While multiple spin- ecstatic about the news. “You can imagine how than you may think, or heading down a software offs have challenged the Pi’s crown, consistent strange it feels to be able to announce that over route by constructing and maintaining your improvements and attractive price points have the last four and a half years we’ve sold a grand own server. kept it ahead of the competitors. total of 10 million Raspberry Pis. Thanks to you, In the kit, users will be able to fi nd a Raspberry In the past few weeks, the team over at the we’ve beaten our wildest dreams by three orders Pi 3 Model B board, an offi cial 2.5A multi-region Raspberry Pi Foundation has found that the of magnitude, and we’re only just getting started.” power supply, an 8GB NOOBS SD card, case, 1m He continued: “There was no expectation that HDMI cable, optical mouse and a high-quality The Pi Foundation found adults would use Raspberry Pi, no expectation keyboard. With every sale, users will also get of commercial success, and certainly no their hands on the Adventures in Raspberry Pi that Raspberry Pi has sold expectation that four years later we would be Foundation special annual. The Raspberry Pi well over a staggering 10 manufacturing tens of thousands of units a day Starter Kit is now available for £99($130). Go over in the UK, and exporting Raspberry Pi all over to raspberrypi.org for details on stockists and million units the world.” current availability. 8 008-011_LUD171.indd 8 04/10/2016 17:55 TOP FIVE Best open- source video editing tools 1 OpenShot The reason OpenShot has remained so popular ARDUINO for so long is down to its simplicity. In just a few minutes, you can have cut your video on the Crowdfunded Explore timeline, fully rendered it and then exported it. Of course, there are plenty of advanced options also included, but it’s the basics that it really excels at. M3 takes aim at 2 Pitivi Pitivi is one of the few video editing suites written in Python, but that doesn’t detract from its suite of Arduino boards features. It’s a great choice for those seeking an easy way to manage multiple video fi les simultaneously in one place. Can the Explore M3 breathe life into the Arduino board industry? India-based startup, Explore Embedded, may made it possible to expand on this further with have only been looking to crowdfund $700 the availability of a virtual COM port and a JTAG for its all-new Explore M3 board, but it’s soon debug port. turned into one of the more impressive boards Alongside the main M3 unit, users can to appear for some time. The USB-enabled also get their hands on an optional ARM 3 Lightworks Explore M3 supports Arduino IDE at its core, Starter Kit. The kit looks to equip users with with wider support for both FreeRTOS and bare the basic components needed to complete Perhaps the best thing about Lightworks is that metal development on board as well. Bare metal basics projects using Arduino and bare metal there’s both an RPM and deb download available for it, something not usually found in most video editing programming environments, such as Kiel, Co-IDE programming. The kit includes the M3 board, suites. Options are fairly basic, but get the job done. and Ellipse, will all work without fault here. a microSD breakout, a 128x64 OLED display, a The Explore M3 board is based on NXP’s variety of IoT sensors, relays and resistors, and a 4 KDEnlive LPC1768 Cortex-M3 microcontroller and as you’d DC motor. Explore Embedded has also included expect, it’s completely open-source inside and out. a wide range of beginner-friendly tutorials for an Arguably the most complete suite of the bunch, KDEnlive also boasts an impressive suite It uses a microUSB 2.0 port as one of its primary assortment of Arduino projects, which can be a of keyboard shortcuts. These shortcuts are connection ports, which is believed to be solely to vital resource when beginning your adventure reprogrammable, so you can automate different keep costs low. In terms of power, the Explore M3 into the world of Linux. tasks when you need it. is a decidedly mixed bag. There’s 512kb of flash There’s a lot of Arduino here for your money, memory, partnered with 64kb of RAM. There’s especially when you consider the board goes for 5 Blender plenty of room to expand on this with a few simple $19 online. The optional ARM Starter Kit, which we Blender is one of the few video editing suites used tweaks, however. should add is definitely worth the money, goes for in a professional setting, and rightly so. It’s the What developers will lick their lips at the sight of $49. Those who are interested should head across ideal choice for advanced users needing a little is the board’s I/O, which includes four UARTs, two to the exploreembedded.com website for shipping extra from their editing suite. Seeing as it’s free, it I2Cs and 38 GPIOs. Explore Embedded has also information and device availability. rivals many of the best. www.linuxuser.co.uk 9 008-011_LUD171.indd 9 04/10/2016 17:56 OpenSource Your source of Linux news & views DiStrO Linux Mint 18 KDE is now available Linux Mint is bigger and better than ever before Linux Mint has been one of the few distributions in 2016 to really substantially grow its user base. Its latest announcement is another step forward. After a successful beta period, with only minimal faults noted, a stable version of Linux Mint 18 KDE edition has been made available. The KDE edition follows the same pattern as the Mint Cinnamon and MATE releases earlier in the year. It comes bundled with Above Linux Mint 18 is by far the best version of Mint yet a fantastic new Update Manager tool, and In terms of system requirements, a clean major improvement from previous updates, an array of the newly-designed X-Apps. Of install of Linux Mint 18 requires 10GB of disk and showcases just how amazing Linux Mint course, there’s still the choice of the default space, with 20GB recommended, alongside really is. KDE apps available for users as well. 2GB of RAM. Installation is noted to be quicker Linux Mint 18 will continue to receive vital than expected, and it would seem the process security updates until 2021. All future point It marks a major has been simpliied even further. The last versions of Mint, of which there’s usually improvement from previous requirement requires a 1024x768 resolution many, will all use Mint 18 as their package display, an odd requirement, but something base, perfect for simple and quick upgrades. updates and showcases that comes as standard on most modern For those currently running the beta, head just how amazing Linux computer monitors. The biggest addition across to the Update Manager section and hit to the Mint 18 update is the introduction of Refresh to apply the new updates and start Mint really is the Plasma 5.6 desktop interface. It marks a using this fantastic new distro. HArDWArE Parrot and Canonical partner up in new drone project Drones have become one of the biggest hobbies Attaching the kit also couldn’t be simpler, as S.L.A.M.dunk impresses on the speciications of 2016, and rightly so. The market for drones is the tiny wing-shaped device attaches to the top side of things. There’s an Nvidia Tegra K1 constantly expanding, but up until now there’s of the drone, relaying data almost immediately. as its central hub for power, with a ish-eye been little crossover between drones and It’s believed that as time goes on and more camera sporting a 1500x1500 resolution the Linux operating system. Canonical’s new developers get on board and involved, creating located at the front. Also included is an partnership with drone manufacturers Parrot obstacle avoidance – a key factor missing from inertial-measurement unit, ultrasound sensor, looks to change all that. most drones – will eventually be standard. magnetometer and a barometer for all your Together the two tech giants have created From a hardware point of view, the data gathering needs. the S.L.A.M.dunk development kit, aimed Perhaps the best thing of all is that thanks to at aiding the creation of autonomous and The tiny wing-shaped the HDMI port, users are actually now able to obstacle avoidance drones and robots. The kit hook up their monitor straight to the development device attaches to the top is powered by Ubuntu and the Robot Operating kit and have a full Ubuntu 14.04 computer at their System, which allows Linux developers to of the drone, relaying data ingertips. For more information, head across to prototype designs, perform 3D mapping and www.parrot.com for speciic pricing information almost immediately use on-board sensors for data gathering. and availability. 10 008-011_LUD171.indd 10 04/10/2016 17:56