ebook img

Linux User & Developer 172 - Take Charge of the Command Line Interface PDF

100 Pages·2016·18.328 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Linux User & Developer 172 - Take Charge of the Command Line Interface

WITH 3 LIVE BOOTING DISTROS FREE DVD www.linuxuser.co.uk L IN U X U S E R & D E V E L O P E R IS THE ESSENTIAL MAGAZINE S U FOR THE GNU GENERATION E 1 7 2 _ TAKE CHARGE OF THE COMMAND LINE > INTERFACE T A K E C H A R G E O F T MASTER SYNTAX CHAIN COMMANDS PASS ARGUMENTS H >_ >_ >_ E C O USE JAVA WITH M Terminal M OSINT A >_ N D L BASH SCRIPTS IN E IN MASTERCLASS T E R F Discover how shell scripts can be integrated A Protect your servers and find C into Sun’s popular cross-platform language E exploits before the hackers do HOW TO MANAGE PROCESSES Take control of everything your Ubuntu box is doing ASP.NET CODING EXPLAINED Microservice architecture with ASP.NET and Docker TEST YOUR DISC MISSING? ASK YOUR GO PROGRAMS RETAILER PPIIXXEELL DISCOVER w w Introducing the Pi’s new desktop w Learn about profiling and use the runtime package .lin u x u LOCATE PHONES NEXTCLOUD BOX s e ISSUE I1S72S N 2041-327P0RINTED IN THE UK £5.99 r.c 72 > o .u How to use your Pi to seek & How does Nextcloud’s k identify Bluetooth devices private cloud shape up? 9 772041 327002 001_LUD172_week4.indd 1 01/11/2016 14:05 Full Page.indd 1 31/10/2016 10:35 Welcome THE MAGAZINE FOR THE GNU GENERATION to issue 172 of Linux User & Developer Future Publishing Ltd Richmond House, 33 Richmond Hill Bournemouth, Dorset, BH2 6EZ ☎ + 44 (0) 1202 586200 Web: www.linuxuser.co.uk www.greatdigitalmags.com This issue www.futureplc.com Editorial Editor April Madden [email protected] ☎ 01202 586218 » Take charge of the command line interface Senior Art Editor Stephen Williams Designer Rebekka Hearl » Protect your servers Editor in Chief Dave Harfi eld Photographer James Sheppard » Discover Pixel Contributors Dan Aldred, Joey Bernard, Toni Castillo Girona, Christian » Confi gure your desktop Cawley, Sanne De Boer, Nate Drake, Gareth Halfscree, Tam Hanna, Oliver Hill, Phil King, Kushma Kumari, Paul O’Brien, Swayam Prakasha, Richard Smedley, Jasmin Snook, Mihalis Tsoukalos and Kevin Wittmer Advertising Welcome to the latest issue of Linux User & Developer, Digital or printed media packs are available on request. Head of Sales Hang Deretz the UK and America’s favourite Linux and open source ☎ 0 1202 586442 [email protected] magazine. A while back we asked you how often you Account Manager Luke Biddiscombe [email protected] use the command line interface and what for, and the International results were very interesting. While over half of you use it Linux User & Developer is available for licensing. Contact the International department to discuss partnership opportunities. at least half the time, many of you pointed out that given Head of International Licensing Cathy Blackman ☎ + 44 (0) 1202 586401 the choice you’ll use the GUI because you’re more used [email protected] to it, sacrifi cing the additional control you get from the CLI for Subscriptions For all subscription enquiries: ease of use. This set us thinking: what if we could break down the [email protected] ☎ 0 844 249 0282 complexities and advanced techniques of the command line and ☎ O verseas +44 (0)1795 418661 Look for Head owfw swub.ismcarigpitnioenssu bSsh.caor.ounk Todd iosns u15e D17e3c gTihvaet y’so wu htheere t oooulrs f aenadtu srkei ollsn ypo1u8 ncoemede tso i nta: kheig chh-aerngde t oefc iht nliikqeu ae sp rfoo?r CC iirrccuulla☎attioi o0 n1n D20ir2e c5t8o6r 2D0a0rren Pearce WSauntb its scoorinbere? programming your system and understanding the syntax you need Production today! to use to chain commands, pass in arguments and much more. P roduc☎tio 0 n1 D20ir2e c5t8o6r 2J0a0ne Hawkins Also this issue we take a look at confi guring your desktop your way. Maybe you want to check out the sleek design focus of next- Management Finance & Operations Director Marco Peroni gen distros like Apricity OS and Elementary OS, or maybe you want Creative Director Aaron Asadi Editorial Director Ross Andrews to use tools like the KDE Plasma Desktop and others to design your Printing & Distribution own? Whatever you want from your Linux interface, you’ll fi nd out William Gibbons, 26 Planetary Road, Willenhall, West Midlands, WV13 3XT how to achieve it on p56, and all the tools you need are on the disc Distributed in the UK, Eire & the Rest of the World by Marketforce, 5 Churchill Place, Canary Wharf, London, E14 5HU for you to experiment with too. ☎ 0 203 787 9060 www.marketforce.co.uk Enjot the issue! Distributed in Australia by Gordon & Gotch Australia Pty Ltd, 26 Rodborough Road, Frenchs Forest, New South Wales 2086 April Madden, Editor ☎ + 61 2 9972 8800 www.gordongotch.com.au Disclaimer The publisher cannot accept responsibility for any unsolicited material lost or damaged in the post. All text and layout is the copyright of Future Publishing Ltd. Get in touch with the team: Nothing in this magazine may be reproduced 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 availability may [email protected] change. This magazine is fully independent and not affi liated in any way with the companies mentioned herein. If you submit material to Future Publishing via post, email, social network or any other means, you automatically grant Future Publishing an irrevocable, perpetual, Buy online royalty-free licence to use the material across its entire portfolio, in print, online Facebook: Twitter: and digital, and to deliver the material to existing and future clients, including but not limited to international licensees for reproduction in international, Linux User & Developer @linuxusermag licensed editions of Future Publishing products. Any material you submit is sent at your risk and, although every care is taken, neither Future Publishing nor its employees, agents or subcontractors shall be liable for the loss or damage. © 2016 Future Publishing Ltd Visit us online for more news, opinion, tutorials and reviews: ISSN 2041-3270 www.linuxuser.co.uk www.linuxuser.co.uk 3 003_LUD171.indd 3 02/11/2016 14:46 Contents >>>___ Subscribe & save! 32 C gUchraSeena cc tksu n usoebtuowstm c ooruefibfrres er ! on page 65 Reviews 81 IRC clients Which multi-network chat client is best for Linux users? 18 Take charge of the command line interface Learn to use the most powerful Linux commands like a pro WeeChat Quassel OpenSource Tutorials 08 News 34 Bash masterclass: Make Bash T he biggest stories from work with Java HexChat Konversation the open source world Shell scripts can be integrated into Sun’s cross-platform language 12 Interview 86 Nextcloud Box Qin Wei discusses the world’s 38 Realise a microservice architecture This provate cloud is powered by a smallest router with ASP.NET Core and Docker Raspberry Pi 2 Learn how you can use ASP.NET Core to deliver 16 Kernel column .NET-based microservices in Linux 88 Chapeau 24 The latest on the Linux Does Chapeau’s latest release do kernel with Jon Masters 42 Manage processes in Ubuntu enough to stand out? Take a deeper look at process management 90 Free software on Ubuntu systems Richard Smedley recommends some 46 Learn how to test your Go software excellent FOSS packages for you to try Master testing in Go and use profiling and the runtime package 52 Use OSINT techniques to protect your servers Find out if your servers are exposing sensitive information to attackers Features 18 Take charge of the command line 67 Practical Raspberry Pi interface Use your Pi to locate and identify Bluetooth Master the CLI today devices, install and explore the new Pixel 96 Free downloads desktop, discover how the pi-topCEED is 56 Configure your desktop Find out what we’ve uploaded to our digital changing education, and more! Give your Linux a new look content hub FileSilo for you this month Join us online for more Linux news, opinion and reviews www.linuxuser.co.uk 4 004_LUD172.indd 4 02/11/2016 16:44 210 x 297 DOMAINS | MAIL | HOSTING | eCOMMERCE | SERVERS NEW! 1&1 MANAGED CLOUD HOSTING The best of both worlds! Scalable on-demand and fl exible server resources combined with a high performance hosting package: The new 1&1 Managed Cloud Hosting is here! Ideal for online projects which require the highest levels of availability, security and fl exibility. Dedicated resources 20+ stack variations Managed by 1&1 experts Flexible scalability 9 Deployed <1 minute £ .99 per month* from excl. 20% VAT Trusted Performance. Intel® Xeon® processors. 1 1 1 MONTH CALL SECURE CHOICE SHORT TERM SPEAK WITH AN CONTRACTS EXPERT 24/7 FAIL-SAFE 0333 336 5509 * 1&1 Managed Cloud Hosting starts at £9.99/month. No minimum contract term. No set up fee. Prices exclude 20% VAT. 1and1.co.uk Visit 1and1.co.uk for full product details, terms and conditions. 1&1 Internet Limited, Discovery House, 154 Southgate Street, Gloucester, GL1 2EX. Full Page.indd 1 31/10/2016 10:35 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 take the KDE Plasma Desktop for a whirl. your computer and double-click DVD. This issue, transform your desktop Plus there’s Conky and Cairo-Dock to switch the icon. with a range of tools. Live boot Apricity OS up essential parts of your Linux interface, Live boot ‘Aspen’ and discover its beautiful Cinnamon and all the essential tutorial fi les you need and GNOME environments, take a look to follow along with the tutorials in this issue. To live-boot into the distros at Elementary OS ‘Loki’ and its stunning Please note that all the distros on this disc are supplied on this disc, insert the Pantheon desktop, or fi re up KDE neon to designed for 64-bit architecture. disc into your disc drive and reboot your computer. Featured software: 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 KDE neon website to fi nd out if this is the case on your PC. Apricity OS ‘Aspen’ Check out all of the latest KDE software, including the • Live-booting distros are read KDE Plasma Desktop, built on a stable LTS Ubuntu from the disc: they will not be Live boot the stunning GNOME interface of Apricity release. Make your desktop your own! installed permanently on your OS. Once installed, to switch to the Cinnamon computer unless you choose version while running Apricity OS GNOME, open the to do so. Terminal and type For best results: freezedry --load /etc/freezedry/cinnamon. toml This disc has been optimised for modern browsers capable of Enter your password when prompted and answer ‘Y’ rendering recent updates to the to any prompts about replacing ‘apricity-os-gnome’ HTML and CSS standards. So Elementary OS ‘Loki’ with ‘apricity-os-cinnamon’. Now log out of GNOME to get the best experience we by selecting your username and clicking ‘Log out’ in recommend you use: the upper-right corner of the screen. Log in on the Take a look at the stunning Patheon desktop showcased login screen that appears. in the latest version of Elementary OS. • 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 Conky Cairo-Dock Please note however that if you are having problems using the Conky is a lightweight system monitor for X environments Cairo-Dock is a desktop dock interface that allows you to programs or resources provided, that can display a wide range of system stats and can be confi gure your desktop interface. It’s desktop-agnostic then please contact the relevant extended and themed to your preferences. and can be added to with plugins, applets and scripts. software companies. 6 006-007 Disc Tutorial.indd 6 01/11/2016 17:25 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 ‘this disc’: Loss of data In no event will Future Publishing 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’. Future Publishing 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: Future Publishing 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. Future Publishing cannot guarantee that at the time of use these hyperlinks direct to that same intended content as Future Publishing has no control over the content delivered on any of 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 Free and open-source software needs to have permission to duplicate and be installed via the distros or by using the Alternatively you can insert and run the distribute ‘this disc’. disc interface disc to explore the interface and content wwwwww..lliinnuuxxuusseerr..ccoo..uukk 77 006-007 Disc Tutorial.indd 7 01/11/2016 17:25 08 News & opinion | 12 interview | 96 Filesilo Below There’s plenty of customisations users can apply to Ubuntu 16.10 Distro Ubuntu 16.10 cleans up performance Yakkety Yak update boosts cloud, container & package management Ubuntu is far and away the most popular Shuttleworth, who leads Canonical’s product those who like to experiment with virtual Debian-based operating system, and if the team and oversees the Ubuntu project. “Our machines, you’re in luck, as the new Unity Low latest update from Canonical is anything to go focus is to enable true hybrid cloud operations, Graphics Mode dramatically improves Ubuntu by, it’s going to continue going from strength to and this release further enhances the tools and 16.10’s performance when used in a VM. strength. Ubuntu 16.10 delivers a plethora of new platform that most companies depend on to Ubuntu’s ever-popular Nautilus ile features, with some major improvements going operate effectively across all major public clouds manager has undergone major UI and UX on under the hood. At its core is a new hybrid and in one’s own data centre, from bare metal to changes as well. It now includes a built-in cloud operation system, alongside improved cloud container.” ile transfer progress widget, and a series bare-metal cloud performance. Users will also In order to help take container and package of pop-over bubbles when renaming iles. be to take advantage of world-leading process- management to the next level, Canonical has Smaller improvements are also numerous; container coordination through Kubernates, also introduced a new Linux package which is including setting icon orders, zoom levels and while there’s also full container support in named Snaps. Snaps in Ubuntu 16.10 merge streamlined transfer speeds. As you’d expect, OpenStack. container and packaging technology together all native Ubuntu applications have been “The world’s fastest hypervisor, LXD, and into a single format, enabling developers to updated for this release. Among them is the the world’s best cloud operating system, format and distribute their apps and services latest version of Mozilla’s Thunderbird email Ubuntu, together with the latest OpenStack and from cloud to IoT. As well as working on Ubuntu client, as well as the Rhythmbox music player Kubernetes make for the world’s fastest and 16.10, Snaps will also work in later 16.04 and the 49th release of Mozilla Firefox. best private cloud infrastructure” said Mark releases and across a range of alternate Linux For those interested in getting their hands on operating systems. the latest update, the Ubuntu 16.10 installation Core desktop functions Eagle eyed users will also be able to ind a image is a hefty 1.5GB, noticeably larger than number of small improvements to the Unity previous updates. Oficial word from Canonical have been streamlined, desktop, and in particular the Compiz window is that the extra size is needed due to additional helping everything work manager that acts as its central hub. Core language packs being included. Downloads of desktop functions have been streamlined, Ubuntu 16.10 (Yakkety Yak) can be found over that little bit smoother helping everything work more smoothly. For at www.ubuntu.com. 8 008-011_LUD172.indd 8 02/11/2016 14:46 top five Niche Linux distros 1 C.A.IN.E Despite its odd name, C.A.iN.e is the distro of choice for those needing to perform computer forensics, aiding detectives throughout their investigations. it focuses on a user-friendly front- end, and can be installed on a hard drive, or run from a live CD. 2 Gentoo RASpBERRY pI The reason Gentoo has a small, but loyal, following, is because it’s one of the few distros that enable Raspberry Pi reveals users to modify and recompile source code to their exact needs. it isn’t for the faint-hearted, and is reputed to be one of the hardest distros to master. a brand new interface Getting to grips with Raspbian’s latest desktop Raspbian has long been the operating system Changes are immediately noticeable, with of choice for many users who have invested a new splash screen on hand that displays the in a Raspberry pi unit. it has proven to be a image version for quicker identification. The splash great OS of choice for those starting off in the screen now covers up most of the initialisation 3 Ubuntu Studio world of developing for the first time, and even text when booting up the operating system. On the more so when it is used in conjunction with the desktop, application icons have been refreshed, for all you media enthusiasts out there, look no Raspbian Desktop. with the Pi team wanting “something that looked further than Ubuntu Studio. it comes with a plethora After nearly two years of development, the businesslike enough to be appropriate for those of media editing programs readily available to you, Raspberry Pi foundation has announced the people who use the Pi desktop for serious work, complete with worklows to help you manage your various projects. release of the new and drastically improved but with just a touch of playfulness.” A series of 16 PiXeL desktop for Raspbian users. in an official all-new wallpapers can also be found with their 4 MuLinux statement from Simon Long, senior principal eXif information as an added bonus. engineer at Raspberry Pi, he said: “i think the Desktop windows now sport thinner frames MuLinux is a tiny distro, requiring just 20MB of HD desktop has reached the point where it’s a and rounded corners, with subtle improvements space and 4MB of RAM to run it at a decent level. complete product in its own right and should also made to the default Roboto font. Perhaps the While not tailor-made for newer machines, it’s the perfect accompaniment to an aging desktop that have its own name. So today, we’re announcing biggest addition is a series of new applications needs saving from the scrapheap. the release of the PiXeL desktop, which will ship making their debut on the desktop. Both the vNC with the foundation’s Raspbian image from now view and vNC Server applications have been 5 Yellow Dog on. The latest set of changes are almost entirely integrated into the operating system, as well as an to do with the appearance of the desktop; there initial version of Chromium browser, instead of the Despite being originally developed for Apple computers in the late Nineties, under new ownership, are some functional changes and a few new aging epiphany. for those looking to download the Yellow Dog is now one of the better distros for high- applications... but this is mostly about making latest version of Raspbian with the PiXeL desktop, performance, multicore computing. it’s even been things look nicer.” head across to the official Raspberry Pi blog. used in development for the PlayStation Network. www.linuxuser.co.uk 9 008-011_LUD172.indd 9 02/11/2016 14:46 OpenSource Your source of Linux news & views KERNEL Linux kernel 4.7.10 will be last in series Existing 4.7 users need to make the move over to 4.8 Despite the Linux 4.8 kernel being around for some time now, there are still plenty of users yet to make the move across to the newer 4.8 update. In a recent announcement, kernel maintainer Greg Kroah-Hartman has said that the latest 4.7.10 kernel update will be the last in the series. “I’m announcing the release of the 4.7.10 kernel. All users of the 4.7 kernel series must upgrade. This is the LAST 4.7 stable kernel to be released, it is now end-of-life, please use 4.8 instead at this point in time.” For those still looking to keep faith with the Above It’s time for users to move over to the 4.8 kernel branch 4.7 kernel, the .10 update introduces some enhancements to the Broadcom b43 and to the 4.7.9 update, namely to counter the ‘Dirty improvements. There have been noticeable brcm80211 wireless drivers, and an overhaul to COW’ bug that’s been circling as of late. the kernel’s cryptography framework and ARC While the 4.7.10 update is entirely usable, it’s You will fi nd that architecture. File systems have also gone under important to note that it’ll be the last .7 release migrating over to the 4.8 the scope, with noticeable improvements to to get any sort of security maintenance. You will the ReiserFS, Btrfs, EXT4, Debugfs and FUSE fi nd that migrating over to the 4.8 kernel branch kernel branch couldn’t be fi lesystems. In total, there are 49 changed couldn’t be made any easier and is relatively made any easier and is fi les, 411 insertions and a surprisingly low 172 simple. Those interested should head across deletions. Alongside the announcement of the to the kernel.org blog for further details. Linux relatively simple 4.7.10 release, further patches have been added kernel 4.7.10 sources are available to download. SECURITY ‘Dirty COW’ security fl aw putting millions at risk Network security has seen multiple exploits V3 that the exploit is actually becoming more The kernel fl aw, dubbed ‘Dirty COW’, is appear in recent years, but one to come into widely used and at a rather alarming rate. actually an 11-year-old bug that has had focus in the past few weeks has actually “The exploit in the wild is trivial to execute, multiple patches attempted by Linus Torvalds been in the wild for a number of years. This never fails and has probably been around for himself. Unfortunately, his efforts have yet follows on from a warning from Red Hat, years – the version I obtained was compiled to fully fi x the issue. The exploit itself can be which indicates that the fl aw is now being with gcc 4.8,” he also said. “An unprivileged used to gain root server access, potentially exploited on multiple desktops worldwide. local user could use this fl aw to gain write enabling someone to gain access to a Linux Phil Oester, a Linux security researcher access to otherwise read-only memory machine via an executable fi le. who was the one to initially uncover the fl aw, mappings and thus increase their privileges At the time of writing, there’s little has explained in a very recent interview with on the system.” information on how to protect yourself from the Dirty COW exploit. It’s advisable, however, It’s advisable, however, to make sure to upgrade the to make sure to upgrade the security strength security strength of the systems used and to keep a close of the systems used and to keep a close eye on your network server access. A potential fi x eye on your network server access should be available in 2017. 10 008-011_LUD172.indd 10 02/11/2016 14:47

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.