GO FASTER 12 PROJECTS Get into quantum Back up to the cloud, FREE 4.7GB computing today! create flexible notes DOWNLOAD READY TO BOOT 18.04 ZORIN OS &MORE The #1 open source mag

Full install and upgrade guide Customise the new desktop Get started in minutes!

Pi User

RUNAFULLY BLOWN ATARI ST

GET STARTED WITH THE ARDUINO Thomas Sigdestad on using ENJOY WINDOWS browsers as operating systems APPS ON YOUR Pi BETTER WEBSITES DOCKER MADE EASY The best open source Containers make releasing to build your next site and using a !

WELCOME

Subscribe FREE GIFT &save! On digital and print WHO WE ARE – see p22

This issue we asked our experts: Ubuntu 18.04 has arrived! Are you going to upgrade? Are you not? Tell the readers Paint the town orange your thoughts – and show your working! I for one am genuinely excited by the latest release of Ubuntu. is Jonni Bidwell no stranger to controversial I risked my work machine’s health and my decisions, but it feels recent moves own continued productivity/sanity by – switching back to Gnome, installing the daily image we used on our disc. abandoning convergence devices These are the sacrifices I’m willing to make to – have enabled it to focus on the ensure you glorious readers have a smooth core job of making Ubuntu as good coverdi disc experience. i I’ve been keeping the image up to date as possible. and actually really like the new Ubuntu. But I still prefer Arch… Despite its comical Bionic Beaver codename, Ubuntu 18.04 will stand as the foundational basis for a Nick Peers plethora of distros with support Despite the name (Bionic Beaver? Really?), reaching out for five years. An untold number of servers will rely on its I shall be updating to Ubuntu 18.04. I’ll also stability and support, while this release delivers the smallest footprint be taking a fresh backup before doing so, yet from its minimal install. because borked upgrades never end well and On page 30 ’s own Bionic Bidwell will guide you I’ prefer the security of a flawless roll-back through a smooth upgrade from older versions, a smooth install from optionti rather th thanth having to unpick or reinstall from scratch. scratch and a smooth guide around the all-important new features. In the background the kernel moves to 4.15 (so including the essential Spectre and Meltdown patches), the new Gnome desktop is now the Les Pounder default new look, Wayland is an experimental option and there’s a Ubuntu 18.04 is out and will I be upgrading? host of updated programs. The rest of 2018 will see all the Ubuntu- Well, yes. My trusty Lenovo X220 has been based distro updated in turn: we’re expecting 19 to be the rocking 16.04 since release and I’m ready to next big update and as you’d expect, we’ll be covering that in-depth embrace the new. I’m most looking forward when it happens. to the new-look Nautilus file manager Of course, there’s a vast world of open source outside of the because I spend so much time in there. Ubuntu world and we’re covering as much of it as we possibly can in the rest of the issue. If you’re thinking of building a new PC, we test the new budget AMD Ryzen 3 2200G with its integrated graphics capable Mayank Sharma of 1080p gaming at a bargain price. Don’t miss our look at how you Since Neil hasn’t asked me to review it, I’m can try quantum computing now, from the comfort of your own home. going to give this one a pass. The new We explore open source content management systems, create desktop theme has been pushed to the multiple Wordpress sites, explore container technology, run classic autumn release, so it’ll just be more of the Atari St systems, sort out your tasks and loads more, so enjoy! same on the desktop front.

Shashank Sharma I find more and more distributions pandering only to their existing user base. Sometimes, barely at that. I see no reason to crowd my Arch installation with Ubuntu 18.04. That Neil Mohr Editor said, should the need arise, I can always [email protected] make room for anotherano virtual machine. But it’s unlikely for said VM to last as long as the typical Ubuntu release cycle.

www.techradar.com/pro/linux June 2018 LXF237 3 FREE GIFT

SUBSCRIBE NOW! Contents page 22

REVIEWS

Intel Optane SSD 800p 17 Is this the affordable SSD from Intel we’ve all been waiting for? Probably not because of its M.2 interface, but it’s certainly affordable and has I/O off the charts!

The next LTS release of Ubuntu is here! Install, upgrade, tweak and enjoy the new features… or just tear your hair out – all on page 30!

AMD Ryzen 3 2200G 18 A graphics-packing quad-core processor that appears to be the dream match for anyone wanting to build a budget gaming PC – if it works on Linux, that is…

Zentyal 5.1 19 Point releases that are a year in the making are enough reason to interest Shashank Sharma. But is his curiosity misplaced with this wannabe commercial server distro?

MX Linux 17.1 20 If what Shashank Sharma expects from a distribution is Goliath, MX Linux is definitely David, with possibly the easiest and slickest distro of 2018 so far.

Before the Storm 21 ROUNDUP INTERVIEW Donning a hoody, a face full of spots and mooching around the train tracks, Philippa Warr fits in well with the Linux Format team as she tackles this teen-angst simulator.

Content management systems 24 Ready to carve your own space on the interwebs, but can’t decide on which CMS to use? Shashank Sharma has some open Jonni Bidwell talks progressive web apps with source suggestions… Enonic founder Thomas Sigdestad 38

4 LXF237 June 2018 www.linuxformat.com CONTENTS

ON YOUR USER FREE DVD Ubuntu 18.04 ‘RC’ Zorin OS 12.3 Pi news 49 Slax 9.4.0 A new Raspberry Fields event, even more Page 96 JAMs around the country and the intriguing Museum in a Box project.

Exagear desktop 50 Run Windows programs on your Pi desktop. “Heresy!” shouts no one in this day and age.

Maker Life: Getting You Started Kit 51 Alex Cox tests the painless plug-and-play TUTORIALS Pi programming package for the rest of us.

Ardunio serial connections 52 TERMINAL: Moreutils 58 Les Pounder shows us that the Raspberry A lesser-known collection of Unix tools to Pi and Arduino can be best friends and increase productivity on the terminal work together on a project. sounds exciting to Shashank Sharma.

Atari ST emulation 54 CHERRYTREE: Get organised 60 Nick Peers travels back in time to reveal Bobby Moss is here to help your thoughts how to transform your Pi into a fully fledged blossom into tasty ideas that you can Atari ST machine and run his old floppies. garnish your delicious projects with.

LEDE: Embedded Wordpress 62 CODING ACADEMY Combine the LEDE framework, a cheap router, a little ingenuity and you can have your own development server. Hugo site generator 88 Mihalis Tsoukalos teaches you how to DOCKER: Virtual apps 66 use the Hugo Framework – developed It took a lot of convincing for a lethargic using Go – to create a secure web Mayank Sharma to power off his virtual sites with static files. machines and learn to virtualise apps.

WordPress multi-site 92 BACKUP: Custom cloud 72 Get equipped with the tools to create and Brian Mork walks you through a custom clone multiple sites for enhanced site cloud system with backup and recovery management, with Kent Elchuk pushing procedures, security and usability options. you over every obstacle. SYSADMIN: Using nftables 76 We wonder about AMD security and then REGULARS AT A GLANCE dive into using Nftables all with the calm, soothing guidance of Valentine Sinitsyn.

News 6 Subscriptions 22 Google, Java, Android and API law, what the IN-DEPTH heck Oracle?! Crazed EU copyright Back issues 70 proposals, naughty Symantec GPL antics, Valve updates Steam OS and Mint Box 2. Overseas subs 71 Quantum computing 44 Locked in his super-cooled computing Mailserver 10 HotPicks 81 basement Mats Tage Axelsson explains International Linux install day, installing Alexander Tolstoy hasn’t got time to run how mere mortals can get working with beside Windows, install Node-RED, around his house, checking that all of his literally the coolest tech around… installing on Dells. Everyone’s installing us. door handles are clean, because he’s too busy checking for the best FOSS Linux user groups 13 such as Gnome, Amarok, , Les Pounder gets jiggy with his micro:bit RawTherapee, , Krunner-translator, over in Leeds City Centre. Heimer, Stacer, Qsoundrec, Tower game and Battle for Wesnoth. Answers 14 Replacing the MacOS toolchain, fixing Your Free DVD 96 spellchecker issues, updating to the latest Ubuntu release, and NAS or VPN options? Next month 98

www.techradar.com/pro/linux June 2018 LXF237 5 Newsdesk THIS ISSUE: Google vs Oracle EU copyright reforms Symantec busted! Valve commits to Linux New Mintbox kills 32-bit

SOFTWARE Google vs Oracle: the struggle is real! Recent court ruling sides with Oracle, but there are far widerimplicationsandwe’venotseenthelastofthisfight.

he battle between Google and Oracle decision is going to create a significant shift in over whether Google used Oracle’s how software is developed worldwide… It really T intellectual property when using Java to means that copyright in this context has teeth… build the Android platform has added a new Sometimes free is not really free.” chapter to the sorry tale, with an appeals court Google wasn’t happy with the ruling and said recently siding with Oracle. in a statement emailed to The Register: “We are If you’ve missed this back and forth over the disappointed the court reversed the jury finding past eight years, Oracle claims that Google’s that Java is open and free for everyone… This Android infringes on two type of ruling will make apps and online services Google’ s use of Java in AndroidAndroid hashas patents that relate to its Java language, while more expensive for users.” caused an ongoing feud. Google maintains that it should have been able So, for developers who rely on fair use when to use Java for free considering that the 11,500 using existing code to help write their own lines of code that are claimed to have been software, the ramifications of this change in the copied are insignificant compared to the millions relationship between fair use and copyright could of lines of code that makes up Android. In 2012 a be severe. It’s even more troubling because it jury decided that Java isn’t protected under copyright law, but in 2014 an appeals court “DEVELOPERS MAY SHY AWAY FROM rejected that decision, suggesting that Google’s use of the API was in violation of copyright law. In COMPATIBILITY, LEADING TO LESS 2016 a jury decided that Google’s use of Oracle’s APIs was protected by fair use, which Oracle INTEROPERABILITY AND INNOVATION” appealed against, and which a judge has just ruled in Oracle’s favour. could impact on compatibility between While this latest ruling looks like it could cost platforms. In the past, many developers would Google a lot of money, there are more worrying attempt to make their software compatible with implications for people who aren’t too concerned other existing programs and platforms, which is about the search giant’s bank balance. what Google claimed it was doing with Java. With Since the latest ruling, a number of people this ruling, developers may shy away from that, have shown their concern about what this means leading to less interoperability and innovation, or when it comes to using open source software it could even stop them creating the software at when developing their own software. As CNN all, due to fears of a copyright lawsuit. reports, Christopher Carani, a partner with It’s a worrying development, but as this long- O t McAndrews, Held & Malloy and a professor at running case has constantly proved, the fight’s in 2010, and it’s been at loggerheads Northwestern’s law school suggests that, “The not over yet. with Google ever since.

6 LXF237 June 2018 www.linuxformat.com NEWSDESK

COPYRIGHT LAW OPINION EU copyright reforms for SECURE VIDEO digital media sparks anger COMESOFAGE There’sfearsthattheEuropeanUnionmaybegettingtoo trigger-happywhenitcomestoprotectingcopyright.

he European Union has been looking to infringement and legitimate cases, such as align its legislation with the copyright parody, which could result in legal content being Olivier Crête T implications of the internet, with taken down. There’s also the fact that this far- Olivier is the multimedia proposals known as the Directive on Copyright in reaching surveillance is plain creepy, and any lead at Collabora Ltd. the Digital Single Market. While some institutions content that is deemed to be infringing copyright have welcomed this, there’s also been concern. is taken down automatically, forcing the uploader In her article, “Censorship machines are to have to appeal to get their content uploaded. Launched by coming” (http://bit.ly/censorship-machines), The burden on websites and platforms to Haivision in 2017, and freely Julia Reda, a member of the European monitor these uploads will also available on GitHub via the Parliament representing the Pirate Party outlines disproportionately affect smaller platforms and Mozilla Public License 2.0, some of the objections. One of the most start-ups that don’t have the resources. If you’re SRT is an innovative UDP- troubling aspects is the plan to introduce upload concerned about this new revelation, visit the based protocol enabling filters. According to Julia, Article 13, in Liberties website at http://bit.ly/europe-free- high-quality, low-latency conjunction with Recitals 38 and 39 of the speech. It shows you how you can lobby your video streaming across proposed EU copyright reform, calls for internet MEP (while we still have them). unpredictable networks. platforms that are used to upload large amounts With secure, end-to-end Handing of content by its users, such as YouTube, or a AES encryption, optimised over content photo-sharing website, to have to monitor user packet retransmission and filtering behaviour and filter future uploads to ensure that to bots, as controllable buffering, SRT no copyrighted content is uploaded. the EU is leverages the best of IP Julia goes on to explain that freedom of planning to standard attributes while expression could be limited, because this do, has been maintaining compatibility to automatic monitoring software could have met with traditional UDP-based trouble distinguishing between outright resistance. broadcast and streaming workflows. Its main purpose is to send live TV streams across the internet, for GPL example, to upload to streaming services as a low latency RTMP replacement. While an SRT Alliance was Naughty Symantec caught out also formed to support its implementation, the open USoutfitspottedusingLinuxwithoutsharingthesourcecode. source nature of SRT played a key role in driving its ompanies wanting to use Linux on an OpenWRT (often used for router operating adoption in both the embedded device and sell it to systems) and provided with the GPLv2 licence. community and end users. consumers need to adhere to Linux’s The problem is that Symantec hasn’t provided Thanks to collaborative GNU General Public License version 2 (http:// the source code, and in the documentation for development, initial support bit.ly/-public-license), which means the router, it states that “The product described for SRT has already made agreeing to provide the source code for the in this document is distributed under licenses its way into the latest device. It’s both a legal requirement and basic restricting its use, copying, distribution, and releases of the “big three” good manners. decompilation/reverse engineering,”which is an open source multimedia Sadly, many individuals and companies obvious conflict with the GPLv2 licence. frameworks: GStreamer, don’t adhere to this, and Symantec, the Matthew took to Twitter to contact Symantec. VLC and FFmpeg. security company behind the Norton antivirus While Symantec didn’t respond to his tweet, With the SRT Alliance now software, is one of them. Matthew Garrett, a Zdnet.com reports the company stated that boasting over 100 members, Linux security and Google “Symantec is fully committed to complying with and the open source engineer, noticed that Symantec’s Norton Core its license obligations in connection with use of community supporting the Router was running a Linux distro based on the open source components in its products. We take protocol, there’s little doubt QCA Software Development Kit project, which these claims seriously and are looking into the that SRT will become is an open-source platform based on matter.”Let’s hope this gets sorted quickly. the de facto standard.

www.techradar.com/pro/linux June 2018 LXF237 7 NEWSDESK

OPINION GAMING IF THE Valve confirms its CAP FITS… OS gaming aims

Steam Machines aren’t selling big, but Valve is still committed to Valve still believes in gaming on Linux. gaming on Linux, via the console-like Steam Machines.

alve is one of the most prominent insisting that the removal of any reference to Keith Edmunds names in PC gaming, and it has Steam Machines was “a routine cleanup of the Keith is Tiger Computing Ltd’s V previously done a lot to support gaming Steam Store navigation”,and that “while it’s true MD, which provides support for on Linux, in the form of pre-built gaming PCs Steam Machines aren’t exactly flying off the businesses using Linux. known as Steam Machines that run a customised shelves, our reasons for striving towards a Linux distro known as SteamOS, as well as competitive and open gaming platform haven’t encouraging ports of popular games to Linux. significantly changed.” We’ve long known However, Valve’s decision to remove a link on While Valve is honest about the lack of success that the year of the Linux its store’s front page to Steam Machines has led of Steam Machines, it also says it’s learnt a lot desktop is never going to some people to worry that Valve is retreating from customer feedback, and highlights its dawn. It’s not because from its support of Linux. Valve posted a defence ongoing investment in the Vulkan graphics API, Linux isn’t capable – far of both Steam Machines and the future of which is an open source alternative to Microsoft’s from it – but because gaming on Linux on its Steam Community Windows-only DirectX tools, hopefully making it things have changed. forums (see http://bit.ly/steam-machines), possible for more games to run on Linux. People don’t want Linux or Windows or Mac. They want applications: to write a letter, carry out a financial HARDWARE TECH analysis, improve their sex appeal in a photo. Office 365, Google Apps… whatever. It’s the same on the Mintbox boost Nvidia kills 32-bit server side of the fence. Businesses want to run their Compact PC goes from an GPU maker makes good on its Docker container. They don’t care whether that’s on AMDA4CPUtoIntelCeleron. threats to end 32-bit support. Azure, AWS, Google Cloud or in that noisy room down hile Valve is having trouble shifting its vidia has joined a growing list of the corridor. compact Linux-toting PCs (see above), hardware and software makers that are The level of abstraction W Linux Mint has had more success with N dropping support for 32-bit operating has just gone up. As one the Mintbox Mini, and it has now revealed the systems, halting GeForce graphics card driver open source advocate and Minitbox Mini 2, available to buy in June. support at the end of April 2018. This means business leader said to me This new version ditches the AMD A4 Micro- owners of Nvidia tech running a 32-bit OS will last week, “The operating 6400T processor for an Intel Celeron J3455, lose out on future updates and fixes. system is becoming which brings a four-fold increase in performance, Nvidia has also given a date for when it will irrelevant”.Sure, there’ll and over twice the performance of the Mintbox cease security updates: January 2019. These always be the enthusiast, Mini Pro. It also gets 802.11ac wireless support, changes will affect its range of GPUs, from high- just as we have those who Bluetooth and a new fanless design for £211, end enthusiast cards to low-end Fermi models. take joy in tinkering with which is only $4 more than the original. There’s While many gamers are unlikely to have an their 1962 Jaguar. But the also a Mini Pro 2, which comes with 8GB RAM Nvidia GPU running on a 32-bit distro and world has moved on. and a 120GB SSD, which will go on sale for £207. hardware, people who don’t feel the need to There will, though, always You can find out more about the device at keep up with the latest games, but still require be a need for those who http://bit.ly/mintbox-mini-2. a discrete graphics card, may find themselves understand how it works. out of luck. What Kubernetes can do, As hardware reviews site Phoronix.com how to configure GlusterFS, points out, however (http://bit.ly/nvidia-32-bit- how to design efficient, end), this is to do with 32-bit operating system secure infrastructures. And support, so there’s a good chance that Nvidia they’ll often be built on will still include 32-bit libraries with their 64-bit Linux – but don’t lose sight The Mintbox drivers. However, for many people it may be the of what businesses Mini 2 gets a excuse they need – or the gentle shove – to really want. spec boost. move over to the world of 64-bit.

8 LXF237 June 2018 www.linuxformat.com NEWSDESK

OPINION Distro watch DEEP IN What’s down the side of the sofa? THOUGHT

FACEBOOK CONTAINER EXTENSION Facebook’s handling of its users’ data has been under scrutiny recently, and if you’re concerned about what sort of information Facebook has on you, and how it’s being shared, then you’ll want to install Mozilla’s new Facebook Container Extension. Mike Dolan With it installed, next time you visit the social network Mike is vice-president of a new blue-coloured “container” tab will open, keeping strategic programs at your Facebook activity separate from your general The . web activity, and vice-versa. You can find out more at Now you can have more control over http://bit.ly/facebook-container-ex. the information you feed into Facebook. Last month, The Linux Foundation announced the 7.5 launch of the LF Deep The latest version of the enterprise-level distro by Red Learning Foundation, an Hat is now available, and according to the release umbrella organisation that will announcement (http://bit.ly/red-hat-enterprise), it support and sustain open comes with boosted security and compliance controls source projects in artificial (thanks to OpenSCAP integration), as well as tools to intelligence, machine learning, reduce storage costs, and better integration with and deep learning. The Microsoft’s Windows and Azure platforms. community is working to One change that’s getting a lot of attention, however, make these critical new is the depreciation of Python 2, which will be replaced Version 7.5 brings a lot of new tools, and technologies available to with Python 3 in the next major release. also paves the way for the move to a users and data scientists Python 3 code base. everywhere, including through a marketplace for building, combining and KRITA 4.0.1 sharing models. Krita, which is developed by KDE, has become one of The initial project of LF the most popular image-editing programs for digital Deep Learning is the Acumos artists. Some of the new features added with the latest AI Project, a comprehensive update include using scalable vector graphics (SVG) on platform for AI model vector layers by default, rather than OpenDocument discovery, development and drawing document format (ODG). sharing. More projects around SVG is the most widely-used format for vector AI, ML and DL have been graphics, so that move will be welcomed by artists. proposed and the community There’s also a new text tool, a brand-new Python is working to evaluate them. scripting tool, new brushes and a lot more. For the full If you’re a digital artist looking for an LF Deep Learning list visit http://bit.ly/krita-new-features. excellent open source image editor, then Foundation is being Krita is a fantastic choice. supported by members including Amdocs, AT&T, B.Yond,Baidu, Huawei, Nokia, GIMP 2.10 RC1 Tech Mahindra, Tencent, Speaking of popular image-editing software, GIMP’s Univa and ZTE. With their first release candidate for 2.10 is now available. Not support the community only does it include 142 bug fixes since 2.9.8 was has access to host the released at the end of last year, but it now has a range marketplace and CI build of new features that improve how GIMP handles infrastructure. system resources, such as the new Dashboard dock We encourage more that helps monitor its usage. individuals and organisations There’s lots of handy features with this early version to get involved by using and of the program, and to check out the full list head to contributing to LF Deep http://bit.ly/gimp-release-candidate. The long-running GIMP project continues Learning and Acumos AI. to go from strength to strength. Learn how at http://bit.ly/ deep-learning-tlf and www.acumos.org.

www.techradar.com/pro/linux June 2018 LXF237 9 Get your cable drops! Subscribe today and get 6 cable drops Mailserver See page 22 Write to us at Linux Format, Future Publishing, Quay House, The Ambury, Bath BA1 1UA or [email protected].

Windows Mate Neil says I’ve been running Linux for some time. I usually buy We started running an “Escape Windows” issue a few your magazine at my local bookstore. Most of my years back, which seemed to be popular with readers. If current computers are a few years old and I’m pretty Microsoft attempts to roll out new versions of Windows comfortable installing Linux on a Windows 7 box. But we tend to try and pump out an updated version to help I really need to update my desktop and all of the new people install Linux alongside it or replace Windows computers are running Windows 10. entirely. The reality is that on a new Windows system, I’d like to see an article on any problems one installing most SecureBoot supporting distros (Ubuntu, might encounter buying a Windows 10 desktop and Fedora, openSUSE, RHEL) is no harder than freeing up installing Linux on it. I don’t want to brick a perfectly 30GB or so on the Windows partition. good computer. I’m going to replace Windows since I The main headache is when people decide that normally use my desktop as a Samba and MySQL they’re going to start playing with more obscure distros Most Linux distros server. I’m running a Mint Mate box, but am open to that don’t support SecureBoot, don’t play nicely with are frankly easier to install these days moving to one of the other Mate distros. UEFI boot partitions, or they install Windows afterwards than Windows. Terry Haimann and cross their fingers that it all works. Narrator: It didn’t. Red Les Many thanks to Les Pounder for his great tutorial on Node-Red (LXF231). I struggled initially because I couldn’t access the GPIO from my Pi. It took many hours to get to the bottom of it, which turned out to be a /dev/gpiomem privilege problem. I’m running physical computing classes with some pupils at my local high school. This gives an IOT option that’s remarkably quick to get going. Should you say Raspbian “Jessie or Stretch” rather than the latest release? I thought I was up to date with “Wheezy”, but trying to install node-red made me realise that I wasn’t supported and needed to upgrade my system. Stuart Gordon

Neil says Glad to hear you both enjoyed Les’ work and that you managed to get over your problem. Really, half the real learning is getting problems solved, don’t you think? [email protected] Helpdex

10 LXF237 June 2018 www.linuxformat.com MAILSERVER

Dell Hero We’re covering more I have had four Ubuntu desktops, but Santa didn’t Node-RED: it makes IoT easy to build. bring me a Linux laptop for Christmas. I then remembered that about a year ago, an old friend gave me his beaten-up Dell Studio laptop running Window 7. It took several minutes to boot up and was crammed with lots of annoying pop-ups. I used the DVD that came with LXF231 to test 17.10 (a 32-bit distro) on this Dell laptop and was amazed at the speed of operation. I had just two problems, now happily overcome. First, I found that it’s really difficult to remove a DVD from a laptop slide-in slot after you’ve formatted the HDD and deleted the old OS. No doubt someone will tell me later that there’s a secret option in BIOS or

CREDIT: nodered.org CREDIT: GRUB (or whatever) to eject a DVD. I managed to install Lubuntu 17.10 from the The problem with putting version specific releases in imprisoned DVD and I’m impressed with the results. our dead-tree publication is that things go out of date The second problem is that the laptop’s Wi-Fi so quickly. Perhaps we should put in brackets the stopped working. I borrowed an external Wi-Fi dongle version used in the article? from a smart TV and plugged it into a USB port on the laptop. This enabled me to download a driver for You ain’t seen us, right? the internal Broadcom Wi-Fi card and then I saw the In 2014 your magazine published a one-off special on Wi-Fi LED on the keyboard light-up. I now have the online privacy and I was wondering if you plan on Linux laptop that I craved, but Santa didn’t bring me. doing a follow up, in light of the changes that have I love the minimalist Lubuntu desktop and the thin happened since that time? I know that you cover toolbar along the bottom edge, and all the apps are privacy and security issues in your monthly conveniently arranged into categories. No more publication, but I’m interested in another one-off scrolling down the Ubuntu launcher for me! publication that has all the info in a handy desk So, let me send a big thank you to the good folks reference publication. at Linux Format magazine (and the friend who Thanks for all work you do in your monthly Linux donated his old damaged laptop). You all made a publication to educate a recent convert over to the 70-year old man very happy this Christmas. Linux OS platform, and keep inspiring and educating Pete Barrett us readers in the years to come. Delaney Cummings Most Dell laptops make a solid Neil says base for a Hopefully you grabbed issue LXF236, with our Stop Linux system. Them Spying! cover feature. If not, find out how to get hold of this and other past issues of Linux Format by turning to page 70, or if you’re a subscriber check out the archive at www.linuxformat.com. Perhaps it’s my age catching up with me, but I find myself getting more militant over government regulations that further infringe people’s everyday privacy, cost us billions to implement and do nothing to make us more secure. That’s beside gross abuses like the Cambridge Analytics via Facebook and who knows what else…

WRITE TO US

Do you have a burning Linux- related issue that you want to discuss? Write to us at Linux Format, Future Publishing, Quay House, The Ambury, Bath, BA1 1UA or email lxf.letters@ futurenet.com.

www.techradar.com/pro/linux June 2018 LXF237 11 MAILSERVER

Neil says the “cannot just Congratulations, we’re so glad you’ve had such a good get going C experience with Linux, proving that it’s easy to get up newbies”? and running with Linux. It helps that you had a Dell Robin Boardman laptop to play with, as if we were going to recommend any manufacturer, it would be them. You’ve also run into Neil says the classic Wi-Fi adaptor issue too, but you shouldn’t Thanks for your give up on getting the internal adaptor running – it’s letter. People do

very possible a driver is out there somewhere. You could occasionally ping us (isocpp.org) C++ Foundation Standard CREDIT: kick off a search with sudo lshw -C network . about covering C(+++) and I’ll say to you what PaullH udson d said id No C 4 U to me: “There are 2,000-page free books on C on the Recently, I’ve been learning about the C programming internet, so why would anyone read a four-page tutorial language. It’s not fashionable OOP I know, but it is the on it?” Now, you could say that about anything we cover language of the Linux kernel. Because I have in the magazine, but I think it applies more to C than programmed before, understanding data types, anything else. recursion, functions and so on, it hasn’t been too Being just one step up from assembly, it’s hard to hard. However, finding a meaningful project to test cover anything interesting in a short space; and with those skills has proved trickier. Using Gnome 3 and Python and lots of other (arguably) “better” languages missing the xscreensaver open source program for to use, C is pretty specialist these days. displaying my pictures, I’ve been looking at the source Oh, here’s over 80 free books on C: http:// code for the Feh open source program, written in C. freecomputerbooks.com/langCppBooks.html. Some I hoped to be able to see how C is used to detect of links seem to be dead, but you see my point. no keyboard/mouse activity, select a random picture, display this on the screen for several seconds and Wrong! then repeat this, but this is proving to be more than a In LXF233 in Dr Sinitsyn’s Administeria article, it struggle. Could Linux Format help I wondered, states on page 76 that MINIX is now the most widely perhaps running a tutorial on this subject to educate used OS ever (being embedded in Intel processors). I disagree. The MINIX code is in Skylake+ processors, from August 2015 onwards. I think about 700 million LETTER OF THE MONTH PCs have shipped since then and not all will have the later Skylake procs. However, in May 2017 Google reported that monthly active Android users exceeded Presentable us If you drop in to our free two billion devices. Plus Apple has over one billion We have an upcoming Linux event in the backroom of the Ye shipped devices. Presentation Day Bristol 2018 Shakespeare Pub, Victoria So MINIX is not the #1 OS, and is unlikely to catch event on Saturday 9 June, Street Bristol BS1 6DR, 1pm to Android as PC sales continue to decline. between 1pm and 6pm. 6pm on Saturday 9 June 2018, I’m disappointed that Linux Format is saying that It’s being held at the Ye then we can show you Linux MINIX is the most widely deployed OS of all time Shakespeare Pub on Victoria distributions on laptops such when the evidence doesn’t support it. Let’s have Street. I was wondering if you as the popular Ubuntu and accurate facts, please, no Trumpism. could kindly give us a mention Fedora. You may even be able to Daniel Fowler on the pages of Linux Format? pick up a free Linux USB drive Our Facebook presence for for trying and installing from, or Neil says the event where most action is a DVD if not! I’d say we were being a little too tongue in cheek here, happening: http://facebook. Sebastian though the implied assertion was no. 1 on desktop/ com/LPDBristolUK. server systems, but even so would it outnumber legacy/ Our Twitter: http://twitter. Neil says existing Windows installs? We’re intrigued by how many com/LPDBristolUK. Good luck with the day and PCs there are in the world, but it sounds like it’ll be Linux Presentation Day UK: we’re happy to promote your something over two billion (the figure is for 2015 and http://linux-presentation-day. event here in the magazine, 250 million are sold each year). But point taken! org.uk. although we think this is largely Bristol and Bath Linux User preaching to the choir! The main Group (the group we’re from): way Linux on the desktop (we http://bristol.lug.org.uk. have to say that or else people get angry about Android) is going to grow is either through wider Chrome OS availability or Dell starts shipping even more Ubuntu systems!

Just don’t start International Linux install day – asking how many doesn’t seem a bad idea… Linux users are out there!

12 LXF237 June 2018 www.linuxformat.com LUGS! LINUX USER GROUPS The intrepid Les Pounder brings you the latest community and LUG news.

FIND AND JOIN A LUG Leeds Hackspace

Alpinux, le LUG de Savoie Meets on the first and third Lasers, 3D printers and pizza a-go go! Thursday of the month at the Maison des Associations de Chambéry, France. www.alpinux.org ack in March I was working in cutting, drilling and working with wood B Leeds city centre, helping a and metal. Remember a hackspace is Build Brighton Thursday evenings is open night. local outreach centre to not just for hacking electronics, and at www.buildbrighton.com deliver micro:bit sessions. As usual Leeds Hackspace we see a great dirty I tweeted about where I was, and I got space that feels like a working studio. Sandbox Sandbox Digital, 5 Brasenose Road, Liverpool a message from a member of Leeds Moving even further back into the L20 8HL. Open maker night is Tuesday 6-9. Kids clubs Hackspace: “Come over tonight, it’s hackspace and we see vinyl cutters, are Monday (six to eight years) and Wednesday (eight open night.” So I walked over to their used for creating window displays and to 12 years). www.sandboxdigital.co.uk space and in a dark yard just outside bold graphics for artwork. Finally, of the city centre I was greeted with a there’s the beginnings of a Leeds Hackspace Open night every Tuesday 7pm-late, steel door. To the right of the door was photographic dark room for the open day second Saturday of the month, 11am-4pm. an intercom, a window looking into the budding photographer. www.leedshackspace.org.uk space, and a sign… Leeds Hackspace. Leeds Hackspace makes for a great Now in its third iteration, Leeds evening’s experience. If you’re in the Horsham Raspberry Jam Park side, Chart Way, Hackspace is a well-established space area then pop in on their open night. Horsham. www.facebook.com/hackhorsham for makers, hackers and artists. Check its website for more details: Indeed, the space caters for many https://leedshackspace.org.uk. rLab Reading Hackspace Unit C1, Weldale Street, different users. A large communal Reading. Open sessions held on Wednesdays from 7pm. space offers the group the chance to http://rlab.org.uk move around and team up to discuss Huddersfield Raspberry Jam Meet every month at project ideas, and importantly eat Huddersfield Library, typically the fourth Saturday of their dinner because when I arrived a each month. www.huddersfieldraspberryjam.co.uk huge pizza order was being compiled. The communal space also offers Pounder Les Medway Makers 12 Dunlin Drive, St Mary’s Island, space for lots of equipment. Chatham, ME2 3JE. www.medwaymakers.com Oscilloscopes and 3D printers rub

shoulders with classic computers from Photo credit: Cornwall Tech Jam Second Saturday of the month, the 1980s and 1990s. Moving further A nice big social space greeted me alternating between Bodmin and Camborne. inside the space and we reach the as I walked in to Leeds Hackspace. www.cornwalltechjam.uk “dirty” part of the hackspace. Here we So much knowledge from the see industrial machines used for laser helpful makers!

COMMUNITY EVENTS NEWS schools, workplaces and homes. LINUX PRESENTATION DAY There’s more information at: Bristol and Bath LUG is hosting a drop-in https://ep2018.europython.eu. event at the Ye Shakespeare Pub, Victoria Street, Bristol on 9 June. The team will be GLASGOW MINI MAKER FAIRE on hand between 1pm and 6pm to show Glasgow has its first Maker Faire! The Tall anyone how versatile and useful Linux is Ship Riverside plays host to a day of on a range of devices, from mobile makers, stalls and exciting projects. phones to desktops. There’ll be time to EUROPYTHON Going to a Maker Faire is a feast for the talk to the gurus and even take home a Edinburgh plays host to EuroPython 2018 senses. Your mind will be blown by the free USB/DVD. These event are great to between 23 July and 29. Join them for a interesting projects, and stories that each share the knowledge and enthusiasm for week of Python-related workshops, maker has. Learn to solder, laser cut and Linux in the community. So if you’re in training sessions and sprints, attend build junk bots and so much more! The the area, drop in, grab a drink and lean the excellent talks and keynotes, and event takes place on 29 July and more how you can do more with your speak to the many exhibitors who will be details can be found on the website: computer. For more details visit: there supporting the use of Python in our https://glasgow.makerfaire.com. www.linux-presentation-day.org.uk.

www.techradar.com/pro/linux June 2018 LXF237 13 Answers Dr. Jonni Bidwell Got a burning question about open source or the kernel? Attempts to fix your - Whatever your level, email it to [email protected] based faults.

Ubuntu two-step have stopped working with the captive update your 14.04 install. It’s very unlikely Q I have a laptop that I use offline portal at my library – could this be to break anything, and it might even fix with Windows 7 and Ubuntu 14.04 on it. because the distro hasn’t been updated your wireless connection. I can’t help with Besides those two OS partitions, I have in such a long time? that one any more, not without knowledge two other NTFS ones (for data and VMs). Oliver, via the LXF forums of the hardware involved anyway, but I will My 14.04 install hasn’t been updated say without hesitation that captive portal since 2016. Am I right in thinking I can’t Good news, Oliver. Ubuntu 14.04 will Wi-Fi is terrible and you should avoid it upgrade my 14.04 install after 18.04 A be supported until April 2019– the wherever possible. is released? How can I upgrade smoothly LTS releases come with five years of You are quite correct: if you were to do to 18.04? support. So you have a year to sort this out. a clean install of 18.04, you would need to I’m a newbie and don’t really want to That doesn’t mean you shouldn’t do reinstall all your programs (beyond things have to format the Linux partition and anything, and at the very least you should like LibreOffice and Firefox that are installed reinstall everything. My Wi-Fi seems to find a wired Ethernet connection and by default). It’s also very likely that some of those programs are no longer present in the repositories, so you’d need to either compile and install these manually, or find some alternatives. If you do want to upgrade to 18.04, then a clean install is probably the best way to go here, provided all the applications you need are still around. All you’d need to do would be to back up any documents you need from your home folder (or anywhere else on the target disk, an external hard drive is useful if you have a lot of data), do the install (your NTFS partitions can be left untouched), restore your backed up files, The C (aka POSIX) and install all the required programs. Even locale is for computers, on an old laptop (as long as there’s space) that don’t need this shouldn’t take more than a couple of spellchecking; the others are for hours. However, things rarely go according humans that do. to plan, so it makes sense to allocate more time to the task. An alternative route, one which doesn’t involve wiping your hard drive, would be BALL AND (KEY) CHAIN to upgrade first to 16.04. You may run into some difficulties here, or it may go Last year I was looking at the tool on Linux. The (also smoothly. From here you could either Q features of various Linux known as Passwords and Keys) utility stick with 16.04 (which will be supported distributions and I heard somewhere for Gnome does an excellent job of until 2021) or upgrade to 18.04. Again the (DistroWatch, Linux Format or maybe managing keys (GPG and SSH), upgrade may or may not go smoothly, and even YouTube) of a distribution that passwords and certificates. Maybe this you would be left with a few relics of not had the equivalent of Apple’s Mac OS is what you saw? one but two Ubuntus. Keychain built in, but unfortunately KDE Plasma has its own Kwallet, However, you may not want to upgrade I can’t remember which one it was. which does a similar task, but this has to 18.04, at least not right away. It uses Can you help? a habit of being slightly buggy and also the Gnome desktop which, coming from Charles Keane, via email has a tendency of forgetting to auto in 14.04, will require some getting unlock on login, in my experience. Both used to. You can get the lowdown in our I don’t recall ever seeing such a of these integrate with Chromium out awesomely written cover feature. It may A distribution, or indeed why a of the box, and add-ons are available also not run nicely on old hardware. distro would seek to emulate Apple’s for Firefox too. Upgrading to 16.04 may be the best option – it’s cosmetically similar to 14.04.

14 LXF237 June 2018 www.linuxformat.com ANSWERS

If it doesn’t work, or you don’t like it, then try a clean install of one of the lighter 18.04 flavours, Lubuntu, or Ubuntu MATE. I would hold off 18.04 for a couple of months, though… Q Battle for NASeroth I have just read the suggested answer to “NAS club” in your magazine (LXF235) and thought that an alternative Trusty Tahr was great answer may be worth scrutiny. I would and will be supported have suggested they set up a VPN and take for another year. But now is the time the NAS box directly off-line, so that a VPN to start thinking exists between the other site in Germany about upgrading. and the UK site. A box on either end such as a VPN router at either side could do a site-to-site VPN, or alternatively an aggressive IPSEC VPN connection from Germany. Would that not then resolve the visibility to the plain internet, (obviously the VPN server is visible), but should have a A Thanks Stuart. I did think about the password to an HTTPS webpage, with a harder setup, better logging, and better pros and cons of some kind of VPN- nice dynamic DNS URL. Some people are protection/blacklisting options? In the related solution (honest), but decided that very much not happy wrangling a VPN same issue you are talking about snooping, this would require no small amount of connection with certificates and keys, security and so forth, so I would have planning. It’s one thing to say “just set up a then typing an obscure URL to access the thought it’s worth considering. VPN”, and quite another to provide the NAS. You can simplify this , but Some home routers enable this to specifics of that setup. then at the end of the day it’s just a server be set up directly. Perhaps this is worth We also have to think about the tech- that you need a password to access, detailing in a future issue. savvyness of the users on the continent. which of course is exactly like the original Stuart Smiles, via email Most people are happy to type in a NAS arrangement. But you’re right, a VPN is the technically superior way to do it. And we will definitely ORTHOGRAPHICAL ODDITIES look at setting up a VPN in the future. Running a VPN at home won’t really Q I have an embarrassing Breeze GTK theme installed and protect against domestic spying though, problem. When I use other GTK apps look fine. I’ve read and trusting routers’ built-in VPN facilities LibreOffice in KDE Plasma, spell somewhere about changing the SAL_ may not be prudent, either. checking doesn’t work. At first I USE_VCLPLUGIN environment thought this was just my impeccable variable, according to Help>About. spelling, but colleagues started I’m using the Qt4 VCL already. GET HELP NOW! laughing at my work. Obviously, Will de Bewildered, Wiltshire incorrectly spelt words are not We’d love to try and answer any questions underlined, and when I invoke the A Ey up Will. Don’t worry, your you send to [email protected], check manually it just says “The secret is safe with me and our no matter what the level. We’ve all been spelling check is complete”, 20,000 readers. I have the same setup, stuck before, so don’t be shy. However, we’re oblivious to my errors. If I dig around and have run into exactly this issue. only human (although many suspect Jonni in the options, I can see some Regional settings are global throughout is a robot), so it’s important that you include dictionaries installed, but in the Plasma. You’ve probably already found as much information as you can. If actual Spelling dialog, the Text the Language options (System Setting something works on one distro but not Language drop-down is blank. I’m s>Personalisation>Regional Settings> another, then tell us. If you get an error using Arch, and have installed what I Language) in which case you were message, please tell us the exact message assume are all the required packages close to solving this one. and precisely what you did to invoke it. – hunspell, hunspell-en and Also in the Regional Settings is an If you have, or suspect, a hardware hunspell-en_GB – but to no effect. option for Formats, which sets the problem, let us know about the hardware. I know I have my system locale set locale for the desktop, and which for Consider installing hardinfo or lshw. These up correctly (via /etc/locale.conf), some reason defaults to C on programs list the hardware on your which is confirmed when I run occasions. I can help with LibreOffice machine, so send us their output. If you’re localectl on a TTY, but one thing I theming, too. Sadly the 6.0 release unwilling, or unable, to install these, run the notice is that when I run that came just too late to include the new following commands in a root terminal and command in a KDE session, it tells Qt5 VCL, so Qt4 is the next best thing send us the system.txt file too. me the locale is set to C, which is for Plasma users. The trick is to enable uname -a > system.txt surely wrong. The theming seems to the Breeze Qt4 theme, which you can lspci >> system.txt be wrong, even though I have the set by running qtconfig-qt4 . lspci -vv >> system.txt

www.techradar.com/pro/linux June 2018 LXF237 15 Discover another of our great bookazines From science and history to technology and crafts, there are dozens of Future bookazines to suit all tastes

you buy direct from us not available anywhere else super-safe ordering REVIEWS IntelOptaneSSD 800p Intel’s revolutionary 3D XPoint memory tech hits the mainstream. Jeremy Laird tries to look impressed.

e have our hands on Intel’s first mainstream SPECS SSD for PCs based on its 3D XPoint tech (see Capacity: W LXF232), the Intel Optane SSD 800p. But 58GB, 118GB what’s this? Sequential reads of 1,450MB/s? Writes of Package: M.2 just 640MB/s? AIOPs at just 250K read and 140K for Port: writes? All of this is falling well short of the pre-release PCIe v3 x2 marketing hype. What’s going on? It’s complicated… Protocol: We found the 800p to be unremarkable by NVMe conventional SSD standards, and a major letdown given Logic: Intel the hype that accompanied 3D XPoint. Sequential Type: Intel throughput is pretty much in line with Intel’s claims, and The 800p is the first 3D XPoint thus miles off the fastest NAND-based SSDs. mainstream Optane SSD big enough (just) to be Power: 3.75W Granted, Intel has gone with a dual-lane PCI Express used as a boot drive. active, 8mW idle interface for the 800p, which limits peak transfer Life: 365TBW performance compared to high-end NAND drives with Warranty: quad-lane interfaces, but that’s clearly not what’s reckons it’s these shorter queue depths that most Five years holding back the 800p’s sequential write performance, determine the performance of typical client PC Size: which clocks in at a maximum of 650MB/s in workloads. Intel also says performance is maintained 22x80mm benchmarks. That’s barely any faster than a SATA SSD. regardless of how full the drive is, and rates the 800p for 365TB of writes, which is incredibly high. The promise of better things All told, the new 800p is a bit of a mixed bag. The However, 4K random access metrics hint at the 800p’s limited capacity means that even the larger of the two greater potential. The 800p registers 229MB/s for reads available drives is marginal as a boot drive. It’s also and 176MB/s for writes. Those figures are substantially disappointing to see a drive based on such a supposedly faster than the current gold standard among NAND revolutionary memory technology deliver such SSDs, the Samsung 960 Pro, can muster. Broadly mediocre performance. The consequence is that the speaking, then, the focus for this drive is on low latency upsides of this new technology will have to be qualified, and low queue-depth performance, rather than for now. This is, very likely, the most responsive straightforward peak throughput. mainstream SSD you can buy. It’s also quite possibly More specifically, Intel says that the 800p is four to the most robust. But it’s not the fastest all around. five times faster to respond at short queue depths of The extent to which this disappoints probably one and two compared to a NAND-based SSD. Intel depends on how much you bought into the 3D XPoint hype. Realistically, it was never likely to completely deliver on the bombastic claims, and even less likely to OPTANE VS THE COMPETITION do so from the get-go. Certainly, it isn’t as immediately revolutionary as we were hoping.

Intel Optane Samsung 960 Intel 760p Benchmark 800p 118GB Evo 250GB 512GB VERDICT 30GB internal MAN.: Intel PRICE: £142 (118GB); £85 (58GB) 76 89 66 copy (seconds) WEB: www.intel.com/optane Sequential read 1,453 3,019 3,048 FEATURES 8/10 EASE OF USE 9/10 (MB/s) PERFORMANCE 7/10 VALUE 7/10 Sequential write 650 1,494 1,619 (MB/s) An ultra-low latency with extended endurance is offset by 4K read (MB/s) 229 64 75 a high price and average throughput. 4K write (MB/s) 176 191 218 Rating 7/10

www.techradar.com/pro/linux June 2018 LXF237 17 REVIEWS Processor AMD Ryzen 3 2200G Is this CPU all the chip a budget builder needs, wonders Alan Dexter…

SPECS udget builders have never B been so spoiled. After years Socket: AM4 of marginal performance Type: 64-bit increases and terrible integrated Process: 14nm graphics, we find ourselves handling Cores: Four chips that would have been high-end Threads: Four a year ago. We’re talking quad-core Clock: 3.5GHz at decent stock frequencies, with (3.7GHz turbo) capable integrated graphics. Cache: 4MB The Ryzen 3 2200G, like the L3, 2MB L2 2400G (see LXF236), uses Mem: DDR4, architecture more readily found on two channels, AMD’s discrete graphics cards to ECC support power the chip’s 3D graphical grunt. Max PCIe: Where the top-end Vega 64 has 64 8+4 lanes compute units and the 2400G has 11, GPU: Radeon here we’re dealing with just eight. Under that heat Vega 8 That equates to a core configuration spreader beats the heart GPU clock: of 512 unified shaders, 32 texture of a great budget chip, 1,100MHz mapping units and 16 render outputs. and some thermal paste. TDP: 65W In real terms, this means you’re looking at between 30 and 60fps in reasonably up-to-date games at 1080p, with sufficient highlights the one downside of the new chip: the drop tweaking of the game settings. The integrated graphics on from 16x PCI Express lanes down to 8x, to make way for offer here aren’t going to challenge any serious discrete the integrated graphics. However, this drop in bandwidth offering, but they’re powerful enough to enable you to shouldn’t be an issue apart from at the very high end. play modern games at a fraction of the price. This is a Performance-wise, the 2200G loses out to Intel’s Core compromise many are willing to make. i3-8100 in processor speed, but it does have the upper hand when it comes to integrated graphics performance. It’s turbo time! Which means that if you want to play the odd game, but In terms of raw processing, the Ryzen 3 2200G is don’t want to drop serious cash on a separate graphics surprisingly powerful, given its low cost. That C-note card, then this new budget chip from AMD is the way to go. nets you a quad-core processor running at a tasty If gaming isn’t of interest or you’re definitely going to 3.5GHz, with a turbo of 3.7GHz. And it will happily go down the discrete graphics route, then the Intel chip hit that max turbo a lot of the time, as well. It’s worth has the edge over the Ryzen. It’s great to have genuine noting that because this is designated a Ryzen 3 options once again. We did run into driver issues with processor, it doesn’t pack any multithreading Ubuntu 18.04 Beta (Kernel 4.15) and Fedora 28 Beta cleverness, so those four cores equate to four threads, (Kernel 4.16), as installation required software fallback but still, that isn’t bad for a budget chip. mode. Fedora with Wayland has serious performance The Ryzen 3 2200G replaces the Ryzen 3 1200 that issues while Ubuntu – once running – performed well, but precedes it, squeezing a graphics core into its AM4 it did crash with Dirt Rally when AA was enabled. package and upping the operating frequency, while Thankfully, kernel updates are already being rolled out. keeping the price pretty much the same (currently the 1200 goes for £80). Part of the reason for the upping of VERDICT the operating frequency is down to the fact that the first generation chips use two core complexes, each with a pair DEVELOPER: AMD of working cores, while the 2200G uses just a single core WEB: www.amd.com/ryzen complex with a full quad-core make-up. The downside of PRICE: £85 this is that there isn’t as much L3 cache – 4MB down from 8MB – although the latency is improved, so you may FEATURES 9/10 EASE OF USE 9/10 not notice this drop in day-to-day usage. PERFORMANCE 7/10 VALUE 10/10 Since the Ryzen 3 1200 is being retired, that leaves two chips for any budding budget builder to pick from: the Great value, a powerful integrated GPU and a fast-enough 2200G and the 1300X, with the latter costing £130. A CPU. Its only weakness is a lack of PCIe lanes.. quick look at the performance reveals that the 2200G has the edge over its more expensive sibling in all but one test Rating 9/10 we ran, but that particular test is important because it

18 LXF237 June 2018 www.linuxformat.com REVIEWS Zentyal 5.1 Point releases that are a year in the making is enough of a reason to pique Shashank Sharma’s interest. But is his curiosity misplaced?

IN BRIEF ith the current state of most W modern desktop Linux Unlike most distributions, it’s hard to other server imagine a time when one was distributions, required to manually provide the Zentyal features horizontal and vertical refresh rates a graphical for the monitor when configuring the desktop that system. You ran a very real risk of can be used to torching your monitor if you got the fine-tune the values wrong. system. Its USP, While desktop distros have come however, is the a long way since, enabling users to easy-to-navigate complete the installation in a matter web interface of minutes, using Linux to run servers for installing is still a more involved process. software and Thankfully, projects like Zentyal are configuring determined to provide a mechanism various services. to put together a multi-faceted server In addition to with the least amount of hair pulled. the community Installation is fairly straightforward and involves little In addition to the myriad servers, you can even use Zentyal to deploy edition, the more than selecting the destination for the distribution a Jabber instance. project also and providing key details such as keymap and timezone. produces a You can configure the distro either from the desktop or via even pull up logs for the different components such as commercial the web interface. Samba and Mail, and even filter them to a specific date variant based on The web interface will then walk you through installing range from the comfort of a browser. Where possible, the Ubuntu Server. the modules you wish to run on your Zentyal server, such interface even allows for more elements to help narrow ClearOS, as FTP,mail server, mail filter, anti-virus, intrusion the logs even further, limiting them to a specific interface NethServer and detection system and more. When done, you’ll be or protocol, when viewing the network logs for instance. Univention are dropped to the Dashboard, from where you can control all However, this feature also revealed one of the only quite similar and elements of the server. bugs we encountered when testing Zentyal. No matter also feature a The sidebar on the left of the web interface will what parameters we used, we couldn’t get the distro to web interface. automatically grow to accommodate the software you pull up any logs to display. But for this small bug, the install. You can also easily install updates with a single distribution works as intended. click. But note that the updates for the community edition Despite its ease of deployment, the most striking thing are not as thoroughly tested as the updates that are about Zentyal is its self-imposed limitation of catering to pushed to the commercial variant. The project SMBs, which restricts the distribution to offering only a recommends using the commercial variant, which small number of features. You can’t, for instance, use it to includes technical support and offers updates for a period deploy a web server, or even a file manager, without a lot of 4.5 years, for production servers. of manual configuration. This, in our opinion, negates its point-and-click ease of deployment. Point made After an year in the making, the latest release, based on VERDICT Ubuntu 16.04.4 LTS, is chock full of bug fixes, usability and performance improvements, and new features. Chief DEVELOPER: Zentyal S.L. among them is the simplified auto-updater cron job and WEB: www.zentyal.org new slides to help you easily select packages you wish to PRICE: Free (development edition) install. The changelog provides a complete list of changes across the different components of the distribution. FEATURES 8/10 EASE OF USE 9/10 Existing Zentyal users will be able to upgrade to the PERFORMANCE 8/10 DOCUMENTATION 9/10 latest release with a single click and the project is working on packages for Zentyal 5.0, 4.2, 4.1 and 4.0, which will There’s plenty of support to make the most of Zentyal’s SMB provide an upgrade button on the Dashboard itself. tools, but casual users may prefer something like NethServer. Even though the project provides desktop and terminal access, the web interface is designed to function as the Rating 8/10 perfect for interaction with the server. You can

www.techradar.com/pro/linux June 2018 LXF237 19 REVIEWS Linux distribution MX Linux 17.1

Shashank Sharma’s expectations of a modern-day distribution is a lumbering Goliath, which makes this distro fall squarely into the David camp.

IN BRIEF ccording to several studies, A the human brain is much The distribution quicker to form negative is based on conclusions than develop a positive Stable opinion. You can experience this and can trace its phenomenon yourself when you try a origins to the new beer or come across yet another coming together Nicholas Cage film. If you’re of the Mepis impatient, you can find out this and antiX reviewers thoughts about MX Linux communities. by glancing at the verdict box. Along with a The latest release of MX Linux is lightweight and based on Debian Stable, but the responsive project started when the Mepis and environment, antiX communities came together. the USP for MX But don’t let its ancestry cloud your Linux is its user- judgement. The distribution ships live Among its many custom tools is a live USB creator tool borrowed from antiX, and can be used to friendliness and installable ISO images for 32- and create USB device with persistent storage. the array of 64-bit images. Along with XFCE basic and desktop, the distribution boasts of a large selection of You can change the appearance, including the theme advanced applications out of the box, including essential office and and the position of the panel with the MX Tweak tool. custom tools. multimedia software, and even a handful of games. On the MX Package Installer, installed applications are You’ll also You can launch the installer by clicking the icon on the greyed out, and you can use the drop-down list at the top- appreciate desktop. The distribution features a custom installer, right to list only the Installed, Upgradable and Not if you like distros which asks the pertinent questions like the target location installed applications. The applications are sorted into that come with and if you choose to carve space for MX Linux, the appropriate categories such as Games, Graphics, Office custom tools. installer launchest. You must also choose the destination and Torrent. You will find all these custom tools and more for the GRUB bootloader, but that’s it. listed under the MX Tools menu. In a departure from most other desktop distributions, Customisations galore MX Linux features a thorough offline manual, spanning The XFCE desktop features a bottom panel and a sidebar more than 100 pages, and the project also hosts a forum that’s home to essential elements such as the volume board and user contributed video tutorials to help you knob and battery indicator. The launcher features a acclimatise to the distribution. Where available, the user search bar to help you narrow down a specific application manual itself provides links to the video tutorials. without having to navigate through the different The thorough documentation and the default software categories such as Office, Multimedia and so on. set makes MX Linux ideal for newbies as well as seasoned One welcome outcome of its reliance on XFCE, and Linux users. If you’re looking for a quick and responsive perhaps its mixed heritage is that MX Linux is fast, much distribution, but don’t want to switch to either Arch or any more so than most desktop distributions. We almost other rolling-release variant, you’re unlikely to find a more couldn’t believe it when the distribution managed to run versatile distribution than MX Linux. the Snapshot tool without errors, even in a severely limited VirtualBox environment with less than 2GB RAM. VERDICT Another advantage of choosing Debian Stable as its base is that MX Linux is incredibly reliable. Even when DEVELOPER: MX Linux Team you’re horsing around with esoteric tools such as SM WEB: https://mxlinux.org Tube, which can be used to search videos on YouTube. The LICENCE: Various distribution also supports playing various audio and video formats out of the box. FEATURES 10/10 EASE OF USE 10/10 The distro also boasts of several important custom PERFORMANCE 10/10 DOCUMENTATION 10/10 tools, which the official manual refers to as advanced and basic. The latter comprises tools such as package This speedy, fully featured distribution, complete with solid installer, NVIDIA graphics drivers installer and more, support on- and offline, is a masterclass in user-friendliness. whereas complex tools such as Snapshot, with which you can create a bootable ISO of your current installation, are Rating 10/10 identified as advanced.

20 LXF237 June 2018 www.linuxformat.com Teen-angst simulator REVIEWS Before the Storm

Donning a hoodie, a face-full of spots and mooching around the local shopping precinct, Philippa Warr fits in well with the Linux Format team.

SPECS his teen drama has that T challenge peculiar to Minimum prequels of having to OS: Ubuntu provide the build-up to a story which 16.04 64-bit, managed fine without it. Before the Steam OS Storm takes characters from Life is CPU: Intel Strange and digs into their lives a Core i3-2100, few years prior. The main focus this AMD Phenom time is Chloe Price – a gawky ball of X4 945 unresolved grief, an exuder of teen Mem: 4GB rage and a serial player of hooky. We GPU: AMD join her after the death of her father, Radeon R7 250, William, just as class princess, Not everyone wants Square Enix Square

Nvidia GeForce Rachel Amber, crashes into her life. to relive those teen- angst moments.

GTX 650 Before the Storm offers a more Credit: HDD: 14GB streamlined experience than its predecessor. It prioritises conversation over puzzle- melodrama with pantomime villains (as did its Recommended solving and fleshes out the relationship which is at the predecessor). Our feelings of annoyance are heightened CPU: Intel root of most of the action in Life is Strange. partly because the game has played out against the Core i3-6100, backdrop of #MeToo. AMD Athlon Teen tropes On the overtly negative side, character movement – X4 845 One of the things we loved about the original game was especially the running and walking animations – can be Mem: 8GB how it seemed to embrace the tropes of teen fiction. distractingly odd. In fact, characters generally have a GPU: AMD This means it can be overly dramatic, self-serving or very strange lack of physicality in the world. Radeon RX 460, steeped in wish fulfilment. You’ll also find spaces where Accompanying this is a stilted element of the Nvidia GeForce people are figuring themselves out, writing their dialogue. There are some unnaturally long pauses 1050 identities into being, having confrontations they can’t between lines and a propensity to tell, not show. We have in real life, conjuring up escapes from the found our minds wandering during some scenes as frustration of adolescence, being their own heroes. conversations took on a stop-start quality. There are also some ace scenes. Chloe can have a Nods to and teasers for the original game are foray into D&D that made us laugh out loud, there’s a variable. Some add context to story and characters, people-watching improv segment and there are so others seem more about enticing players into picking many little moments of sincerity where the efforts of the up the other game. There are also points where characters to connect with each other feels just right. coherence or logic are pushed to one side in service of There’s also plenty of wish fulfilment. While Life is emotions or aesthetic. Strange wound its storytelling around a central mystery, Before the Storm benefits from being more focused Before the Storm hones in on Chloe and Rachel’s story. and more of a character piece than Life Is Strange.It The first game supported satisfying ambiguities with gets rid of most of the clunky puzzling, provides regard to relationships. This time we went headlong into emotional payoffs for Chloe fans, and puts a teenage girl romance. It was great. Dramatic and sincere and front and centre in a valuable way. LXF absolutely replete with iconic moments. “What? My hoodie was in the wash, The previous time rewind mechanic has been VERDICT okay? Get over it.” replaced with a backtalk challenge. We found this to be mostly miss DEVELOPER: Feral Interactive because you’re WEB: www.feralinteractive.com essentially PRICE: £35 arguing your way through a GAMEPLAY 7/10 LONGEVITY 7/10 scene in an GRAPHICS 7/10 VALUE 7/10 artificial way. Before A streamlined peep at the events which build up to Life is the Storm Strange. Emotionally satisfying, but sometimes clunky.. sometimes wanders into Rating 7/10 simplistic

www.techradar.com/pro/linux June 2018 LXF237 21 SUBSCRIBE Save money today! SUBSCRIBE! Sign up today and get your 6 FREE CableDrops!

FREE GIFT Simply peel and stick CableDrops anywhere you need them!

CableDrops put an end to the insanity of chasing cables that seem to slip and disappear behind every surface. CableDrops affix to desks, walls and nightstands to keep your cables neat, tidy and in place, so they’re always there when you need them. IT’S EASY TO SUBSCRIBE! Click: www.myfavouritemagazines.co.uk/linAPR18 Call: 0344 848 2852

22 LXF237 June 2018 www.linuxformat.com Worldwide subs on p71

PLUS: Exclusive access1 to the Linux Format subs area! MyFavouriteMagazines.co.uk subscribers. to available Only 1) 1,000s of DRM-free PDF back issues! Get instant access back to issue 66 (May 2005) with tutorials, interviews, features and reviews. At linuxformat.com CHOOSE YOUR PACKAGE! PRINT EDITION DIGITAL EDITION PRINT + DIGITAL

FREE GIFT FREE GIFT

Every issue comes with a 4GB DVD The cheapest way to get Linux Get both the print & digital packed full of the hottest distros. Format. Instant access on your editions for one low price. Plus your free CableDrops! iPad, iPhone and Android device. Plus your free CableDrops! Only £18Only £11.25 Only £24 Every 3 months by Direct Debit Every 3 months by Direct Debit Every 3 months by Direct Debit

*Terms and conditions: Please use the full web address to claim your free gift. Gift available to new print and print + digital subscriptions. Gift is only available for new UK subscribers. Gift is subject to availability. Please allow up to 60 days for the delivery of your gift. In the event of stocks being exhausted we reserve the right to replace with items of similar value. Prices and savings quoted are compared to buying full-priced print issues. You will receive 13 issues in a year. Your subscription is for the minimum term specified and will expire at the end of the current term. You can write to us or call us to cancel your subscription within 14 days of purchase. Payment is non-refundable after the 14-day cancellation period unless exceptional circumstances apply. Your statutory rights are not affected. Prices correct at point of print and subject to change. UK calls will cost the same as other standard fixed line numbers (starting 01 or 02) or are included as part of any inclusive or free minutes allowances (if offered by your phone tariff). For full terms and conditions please visit: www.bit.ly/magterms. Offer ends 30 June 2018.

www.techradar.com/pro/linux June 2018 LXF237 23 WE COMPARE TONS OF STUFF SO YOU DON’T HAVE TO!

Shashank Roundup Sharma By day Shashank CMS Made Simple Concrete5 is a New Delhi trial Drupal Exponent CMS Joomla lawyer, but by night he’s an open source vigilante! Content Management Ready to carve your own space online, but can’t decide on which content management system to use? Shashank Sharma has some suggestions.

HOW WE TESTED…

A CMS doesn’t require much more than a properly configured web server and database. You have many choices nowadays depending on the type of website that you wish to create. For this month’s Roundup we’re only interested in CMS options that can help you create a complete website, rather than the specialised ones that are dedicated to blogs and wikis. The choice of database, web server and scripting language makes little different to end users, but we’ve selected only PHP-based CMSs for this Roundup. Along with Apache web server, we’re using MySQL for our database. We’ll test the projects on the or many years now, starting a blog Ruby, Python, Java and others; however, PHP number of features that they F has required little more than setting remains the most popular choice. As much as offer out of the box, ease of up an account on one of the free we would have liked to give representation to installation and whether or not services. But if you decide to create a more the different languages that are available, the they support add-ons to extend complex and content-rich website, you have self-imposed limitation of a fully-featured their functionality. With ever- to make one yourself. This, too, is a CMS that recently pushed out a new release increasing number of people straightforward process – if you’re willing to left us with little choice. and businesses getting online, spend a little time creating the proper With more users connecting to the web proper documentation is also environment. But after you’ve settled on a using various devices of varying form factors, necessary to help novices web server and created the database and your website should render perfectly on all deploy and configure their user to manage it, you still have to decide the different devices. More often than not, CMS. Just as important is the what content management system (CMS) modern CMSs are even optimised for mobile customisation options that you wish to use for your website. devices. The ideal CMS is one that’s easy to each service offers. Depending on your preference for scripting deploy and allows for extensive tweaking such language, you can find a CMS built using that you can mould it to your liking.

24 LXF237 June 2018 www.linuxformat.com CMS ROUNDUP

Ease of deployment Can you install them without help?

ith an ever-increasing number of forks and alternatives popping up, users have the choice of several web servers W and DBMS software to choose from. Most of the CMSs are quite happy if you provide them with the supported instances of Apache web server, MySQL database and PHP. All the projects run a pre-install check, which informs you if any additional Although you don’t have to master any of these to install and libraries are needed or if you should tweak any settings. use a CMS, you must be familiar with a few key concepts so as to prepare the environment for installation. In addition to the there’s no way to make the changes and continue with the software, most CMSs also require specific libraries to be installed installation. The only option is to start the installation afresh. and enabled on PHP. Worse still, the project won’t enable you to reuse the database At a minimum, you’re required to create a database and a user you’ve already created for it, and you must first either empty the for managing the said database, because you’re asked to provide database or create a new one. this information during the installation. All the CMSs in our list In addition to the web-based installation wizard, Concrete5, feature a web-based installation wizard that will guide you through Drupal and Joomla can also be installed using , which is the different steps involved in setting up your own website. a dependency manager for PHP. Unless you’ve worked with it As its name suggests, CMS Made Simple is incredibly easy to before, the easier option is to opt for the web-based installation setup. The best part about the project is its thorough wizard. The reason for this is that the use of Composer for documentation, which ensures even a novice who’s never worked installing these projects isn’t well documented and if you get with a database or web server can set up a website. stuck, you’ll have to resort to a web search for a solution. Exponent CMS requires a special tweaking of MySQL, without which the installation fails. Unfortunately, the documentation VERDICT doesn’t provide a workaround, or even lists this potential problem. If you decide on Exponent CMS, make sure to look up CMS MADE SIMPLE 10/10 EXPONENT CMS 7/10 how to disable Strict mode in MySQL before you begin the CONCRETE5 9/10 JOOMLA 9/10 installation. Although the installer suggests that you tweak the DRUPAL 9/10 MySQL settings to proceed with the installation when it fails, Apart from CMSMS, the other projects don’t provide basic installation details.

Device support Reaching to the masses.

uring his keynote speech at Drupalcon Chicago in 2011, Dries Buytaert, the founder of Drupal, best summarised D the importance of mobile devices for CMSs by observing that if he were to “start Drupal from scratch today, I’d build it for mobile experiences first, and desktop experience second.” This makes even more sense now that several recent studies have shown that upwards of 60 per cent users are relying on their mobile devices to access websites instead of desktops and laptops. There are several responsive themes available for CMS Made Simple, Concrete 5 Responsive web design ensures that websites render well on a and other projects as well. variety of devices. Since April 2015, Google now penalises non- mobile-friendly websites and pages. Thankfully, all the CMSs on All the other projects featured here are conscious of the our list enable you to create responsive websites. This means that importance of mobile devices. Apart from free modules and they support the different elements such as responsive themes themes, Joomla and Concrete5 both make available several and images. The latter is important as otherwise the images won’t commercial add-ons as well, to help you tweak your website for automatically scale to the screen size of the devices. mobile platforms. The CMS Made Simple project hosts several mobile-ready themes and customisations. Community members also share VERDICT their own custom responsive themes and configurations. Exponent CMS similarly provides a number of themes designed for CMS MADE SIMPLE 10/10 EXPONENT CMS 10/10 mobile devices. The project offers the Twitter Bootstrap Theme CONCRETE5 10/10 JOOMLA 10/10 and also provides several modules that you can use to make your DRUPAL 10/10 website mobile ready. Mobile friendliness is a virtue for all the projects on our list.

www.techradar.com/pro/linux June 2018 LXF237 25 ROUNDUP CMS

The user experience Are they easy to use and administer? CMS Made Simple 10/10 Concrete5 10/10 The administrator interface features a The Concrete5 administrative interface MSs are designed to serve one collapsible sidebar that provides quick features a sidebar on the right. The main function: help you create a access to different sections such as User screen features slides for a popular tool, C website with the minimum Management and Layout. Click Site Admin deal of the day on the marketplace and hassle. Once installed, a CMS shouldn’t >Settings – Global Settings to configure featured add-on and theme. get in the way of content creation. But a mail and other essential configuration Once logged in as the administrator, CMS is a complex piece of software. The such as enabling the maintenance mode when you visit your website, the panel at sheer number of elements and for the website. the top features buttons to help you edit configurable options for a typical The top bar also features a quick link to the page, or add new content/pages. The modern website makes administration a the official documentation and what the project supports in-line content editing. difficult task. A good CMS must find the project refers to as unhandled You don’t have to navigate through the right balance between pleasing users notifications. The project insists that you admin interface to edit the content on your and administrators alike. delete the installation files, and publishes a website. Instead, you can do that by From creating users and managing notification if you fail to comply. clicking an element, such as sidebar and their permissions, to extending To navigate back to the Dashboard click Edit. You can also make design functionality with add-ons and home page, click Home under CMS on the changes for each element, such as the performing maintenance tasks such left sidebar. You can create new content background colour, by clicking the element as backups and updates, the using the content manager, which provides and then clicking Design. administration interface must find a a preview so you can test how it will appear The project keeps a record of all the way to help you navigate between the and tweak the design accordingly. changes you make on any given page, and elements logically. If you’ve never used a CMS before, you can revert to a previous version of the Whether it’s with the help of a you’ll feel right at home with CMSMS. page if you want. sidebar, or tiles on the Dashboard or via drop-down menus on the top bar, the CMSs on our list have each found a way to not overwhelm the users with their administrative capabilities.

Documentation and support Users can’t RTFM if it doesn’t exist!

part from the official documentation and forum boards, As with Exponent CMS, Drupal and Joomla documentation the projects featured in this Roundup are so popular, focuses almost entirely on how to get the most out of these A you’ll easily find user-contributed tutorials and guides on projects. Apart from directing users to create a database, and a variety of topics. The older projects, like Drupal and Joomla, are setup a server, there are no step-by-step instructions to assist also the subject of a book or two. novice users. Judging solely by the focus of their documentation, CMS Made Simple impressed us the most with its these projects seem uninterested in attracting new users with no documentation covering all the aspects of setting up the system prior exposure to CMSs and the attendant technologies. for installation. The official documentation provides step-by-step Concrete5 provides to-the-point documentation on a number instructions on installation and configuration and other essential of topics. It also hosts a large number of tutorials aimed at editors, topics such as upgrading, user management, navigating the developers and designers. layout and more. The forums are teeming with activity and apart from general and module specific discussions are also a good VERDICT source for tips and tricks shared by the community members. The Exponent CMS documentation mentions the essential CMS MADE SIMPLE 9/10 EXPONENT CMS 7/10 pre-installation steps, such as creating a database and user, CONCRETE5 7/10 JOOMLA 7/10 but don’t provide steps on how to do so for new users who have DRUPAL 7/10 never worked with these technologies. The website still links to Forums, guides and video tutorials on YouTube are no reason to disregard the an admittedly old and outdated wiki, but it is no longer accessible. needs of new users.

26 LXF237 June 2018 www.linuxformat.com CMS ROUNDUP

Drupal 10/10 Exponent CMS 9/10 Joomla 10/10

The administrative bar at the top of the You’re informed of available patches for Even if a user has administrative privileges, page features several tabs such as the core software as soon as you log in as you can’t use the login screen on the main Content, Structure and Appearance. Unlike the administrator. Unlike other CMSs that website to access the administration the other projects, Drupal creates a local feature a dedicated administrative interface. You must click Site repository of its documentation and interface, Exponent’s administrative Administration after which you’ll be asked provides a link to it on the top bar. functions can be accessed by clicking the to login again. You can alternatively point Click Configuration to set up cron jobs Exponent button. This produces a drop- your browser to http://127.0.0.1/ for maintenance tasks, put the site on down menu which provides access to User sitename/administrator. maintenance mode, import/export Management, Site Management, etc. The The administrative interface of Joomla configuration, edit the site for performance Super-Admin Tools is the catch-all menu is called the Control Panel and features a by enabling caching, and more. for all other functions such as managing row of drop-down menus on the top bar as You can quickly add new content to extensions, performing database backup well as a sidebar. Updates for the core your site by clicking the Content tab. The and switch the site to maintenance mode. software and installed extensions are listed project also produces a number of Like Concrete5, Exponent also support under Maintenance section on the sidebar. important reports, such as possible in-line content authoring and editing. This The nested menus on the top bar are security issues which you can access by may take some getting used to, especially faster ways to navigate the control panel. clicking Reports>Status Reports because instead of buttons, the project For instance, clicking Users on the sidebar You’ll be informed of any updates for often relies on plain-text links such as ‘Add drops you to the users page, where you the core software or any installed module a New Blog Article’ or ‘Edit’. If you have a must click New if you wish to create a new when you click Configuration. You can also content heavy page, you could very well user. Compare this with the top bar, where schedule a cron job for the project to miss these links unless you know what navigating to Users> Manage>Add new automatically check for updates. you’re looking for. user takes you to the same page.

Customisation and themes Variety is the spice of life.

nlike the other CMSs that enable you to log in to the Exponent CMS ships with a handful of themes out of the box administrator account like any other user, for CMS Made and the documentation provides instructions on how to create a U Simple and Exponent CMS, you must manually point the custom theme. But there is no means to download and switch browser to http://127.0.0.1/sitename/admin or http://127.0.0.1 themes from the administrator interface. /sitename/login.php respectively if you wish to log in to the site. Concrete5 makes it very easy to enable separate themes for With the exception of Drupal, all the CMSs volunteer to create mobile and desktop users. The project offers the choice of several sample content during installation, which option makes it easy to free and commercial options and you can install them with a assess the different themes offered out of the box. single click without leaving your website. In addition to nine different designs that are offered out of the To tweak your Joomla appearance, you must either create a box, with CMS Made Simple you can even download more user custom design yourself, or rely on one of the third-party offerings. contributed themes, some of which are sold commercially. Do note however that these are untested and the project makes no VERDICT guarantees about these third-party offerings. Each theme comprises many different elements, called templates, such as CMS MADE SIMPLE 8/10 EXPONENT CMS 5/10 footer, breadcrumbs, search results, and so on, which you can CONCRETE5 10/10 JOOMLA 6/10 drag-drop to a design. For more serious tweaking, such as DRUPAL 10/10 changing the background colour and such, you must manually Drupal and Concrete5 provide the most number of customisation options by edit the relevant files. way of themes and other extensions.

www.techradar.com/pro/linux June 2018 LXF237 27 ROUNDUP CMS Extensions When you’re in the mood to go window shopping…

hen looking for modules to extend the functionality of your Drupal website, you can filter the results based on W the maintenance or development status of the project, version compatibility or specific categories such as Content, E-commerce, Advertising, Education, Media, SEO and much more. This is a good thing too, because without these extensions, the After purchasing extensions from the Concrete5 marketplace, you must download vanilla Drupal website is unlikely to impress anyone, even you! them from the Dashboard > Extend Concrete5 > Add functionality page. Joomla too has a website dedicated to extensions which are split into different categories such as Style & Design, Site CMS Made Simple provides many different plug-ins and Management, Social Web and Photos & Images. modules to extend the functionality of the core software. The administrator dashboard on your Concrete5 website will Unfortunately, most of these extras are stale and should be provide links and introduction to featured add-ons. You must considered unsafe to use. The documentation provides quick create a user account on the project’s marketplace. You can filter introduction to the seven extensions that are part of the default the add-ons based on price, or restrict the results to free installation, but that’s it. extensions. You also get the various categories to choose from as with the other projects. Unlike the others, however, Concrete5 also VERDICT enables you to define a skill lever and restrict results to Beginner, Intermediate, Expert or Bleeding Edge. For each add-on, the CMS MADE SIMPLE 5/10 EXPONENT CMS 10/10 marketplace also makes it possible for users to upload a review CONCRETE5 10/10 JOOMLA 10/10 and provide a rating. Make sure to read the documentation on DRUPAL 10/10 navigating the Marketplace or you’ll only manage to add items to The extension repository for Exponent CMS hosts a handful of themes, and your Cart, but not get much farther than that. mostly outdated add-ons.

Essential features Can you use them out of the box?

ll the CMSs offer extensive user control options which enable you to define the permissions for each registered A user. You can also find additional access control extensions for all projects except CMSMS and Exponent. The projects also boast of additional security features such as blocking specified IP addresses and creating blacklists. It’s advisable to take some time getting to know a CMS before deciding if it’s the right one for you. Even if a CMS does all you want from it, you might still be dissatisfied with its administrative You can think of Drupal and Joomla, with their minimalist post-install offerings, as interface, or vice versa. the of CMSs. They’re both highly customisable. We bring this up because Exponent CMS, although very capable, has a peculiar approach to website design. It identified all The default Concrete5 installation will help you run a blog or a the elements of a typical website as a module. Blogs, forums, media-rich website and also provides a number of important search forms, social media feed, and more are all identified as features. It also offers various SEO optimisation options, along modules. The project also makes it possible to enable and host with Captcha and other spam-prevention measures. You can even modules at different sections on a page, such as the top bar, the add a list of banned words and switch the website to maintenance top, middle or bottom of the sidebar, and so on. mode. With the default Drupal installation, you can do little more As much as we appreciate the freedom of building your own than create static pages. Thankfully, the project installs several website with Drupal and Joomla, the sheer focus of Concrete5 on important extensions out of the box, but these are disabled essential security features and other settings can’t be overstated. by default. Because Joomla doesn’t ship with any meaningful extensions VERDICT installed out of the box, you must manually scavenge the repository for addons that will provide the functionality you need. CMS MADE SIMPLE 8/10 EXPONENT CMS 8/10 The barren offerings of Drupal and Joomla are not necessarily bad CONCRETE5 10/10 JOOMLA 8/10 as they give you the option to mould the website from the DRUPAL 8/10 grounds up to your exact specification. The default CMSMS installation should suffice for most users, even SMBs.

28 LXF237 June 2018 www.linuxformat.com CMS ROUNDUP

CMS The Verdict

he Wikipedia page that lists Open Source Content T Management Systems lists dozens of projects and selecting five test subjects for this month’s Roundup was a pretty tall order in itself. In addition to restricting ourselves to projects that saw a release recently, we also limited our focus to CMSs that could meet the needs of a number of different users, in different capacities. We wanted CMSs that were aimed at individuals, but could just as easily be used by small businesses and even schools. 1st Concrete5 10/10 As websites grow with time, we also wanted our CMS to provide a means to back up the configuration and databases, and Web: www.concrete5.org Licence: MIT License to even import it, if possible. Most important of all, perhaps, was Version: 8.3.2 the availability of plug-ins and the ease of deployment. All CMSs can learn from Concrete5. With ever-increasing bandwidth speeds, projects like Drupal, Joomla and Concrete5 provide an online demo for you to 2nd CMS Made Simple 9/10 experience them, so you can make an informed decision on which one to use on your website. Web: https://cmsmadesimple.org Licence: GPL While one should never be penalised for being different, we’ve Version: 2.28.4 done just that with Exponent CMS. Although the project is robust Aimed at newbies, but its lack of extensions is disappointing. and easy to use, it’s unlike most other CMSs and some users might find this off-putting. The curt documentation and the 3rd Drupal 8/10 limited extensibility are also strong negatives. Joomla and Drupal didn’t really put a foot wrong. The lack of Web: www.drupal.org Licence: GPL official themes for Joomla was reason enough for it to finish out of Version: 8.5.1 the podium. Drupal is not unlike Arch Linux in its robustness and The clear winner if you want a highly customisable CMS. malleability, but its current documentation is grossly inadequate for novice users and this is why it takes the third spot. 4th Joomla 8/10 CMS Made Simple is a treat to work with and is well suited to newbies and skilled users alike. Web: www.joomla.org Licence: GPL However, Concrete5’s focus on SEO, security, and its teeming Version: 3.8.6 marketplace, coupled with in-line editing, sets it apart from the Impressive, but should learn some tricks from Concrete5 to remain relevant. others CMSs in this test. Yet this doesn’t mean that the project is without its fault. In fact, it’s just as guilty as Exponent, Drupal 5th Exponent CMS 7/10 and Joomla for ignoring novice users. In addition, the requirement of first purchasing items from the marketplace, and Web: www.exponentcms.org Licence: GPL then separately downloading them from your own website, is Version: 2.4.2 bizarre to say the least. Documentation and plug-ins are still its major weakness.

ALSO CONSIDER

There are a vast number of specialised CMSs that we couldn’t WebGUI, which is written in Perl, but hasn’t seen a new release cover in this Roundup. One that we found quite attractive was in over two years. Wagtail. Written in Python, the project uses the Django If you want to set up a CMS without having to create a framework and claims to be built by developers for developers. database first, you might want to explore CMSimple, which This was reason enough to not consider it for inclusion, and its stores content in HTML files, and doesn’t require a database. documentation, which is at times outdated, sealed its fate. The project has inspired a few forks in the past few years, We also didn’t want a CMS dedicated solely to e-commerce, but these, much like CMSimple itself, haven’t seen a new but if that’s what you’re after then you should consider release in several years.

www.techradar.com/pro/linux June 2018 LXF237 29 There’s a new Ubuntu LTS in town, with a whole new desktop to entice and amaze you. Jonni Bidwell rolls out the orange carpet…

uiet your busy mind for just a Back then, there was excitement about the aging X.org display server, so Ubuntu moment, dear reader, and tell Canonical’s bold desktop projects: Unity 8, 18.04 is a great distro for brave souls and Q us what you hear. The sound of and convergence. Those have all been early adopters to experiment with the swallows, swifts and wheatears bequeathed to the community now and future display stack (don’t worry it’s not returning to their northern breeding Ubuntu, after seven years going its own the default yet). grounds? No, listen more closely. There’s a way, has returned to the Gnome desktop. Of course, if Gnome’s still not your thing vaguely mechanical gnawing sound from A controversial move, but a pragmatic one there’s no shortage of other desktop the trees over yonder. too. Canonical is heading towards an IPO, flavours to try. We’ll cover the most That’s the sound of a bionic beaver, and and ambitious desktop projects that interesting ones, and of course all the possibly some too, and it can generate no revenue don’t attract investors. exciting changes under the hood, too – the mean only one thing: the latest Ubuntu LTS Furthermore, Gnome 3 has matured new kernel, snap packages, not to mention release is here. As is tradition, our cover and ripened and is no longer the scary Ubuntu’s server, cloud and IoT offerings. has been emblazoned orange, our disc desktop beast that it used to be, and Plus, we haven’t forgotten about the crazy editor has been kept up for days testing the Canonical has done a great job of die-hards still running 32-bit hardware. daily builds, and Jonni won’t stop wittering customising it to be as friendly as possibly There may be no 32-bit install medium, on about Walpurgisnacht. But things have to Unity ex-pats. Gnome is also leading the but that doesn’t mean you can’t reap the changed since the last LTS two years ago. charge towards Wayland, the successor to benefits of the new Ubuntu!

30 LXF237 June 2018 www.linuxformat.com Ubuntu 18.04 LTS Eager beavers There’s a lot of hype surrounding the latest release of Ubuntu, codenamed Bionic Beaver. But what’s new? Let’s find out…

fter 14 years of Ubuntu releases, you might The think they weren’t such a big deal anymore. installer is as A smooth as ever, But make no mistake, this is big news. For one and we liked thing, it’s an LTS release so will very likely be many the artwork, people’s daily driver for a good few of the next five too – a beaver years. Furthermore, a number of those other popular circumscribed by desktop distros are based on Ubuntu LTS, so this intersecting circles. release crystallises their foundations too. And finally, this release sees Ubuntu return to the Gnome desktop after seven years of going their own way with Unity. Install with caution Installing Ubuntu is as easy as it’s ever been. However, this is a new release and so shouldn’t be used on takes out your BIOS (as happened in 17.10), or other systems you’re depending on day to day. You should operating systems. You can use the zsync utility to make sure everything works from the live environment update the ISO with minimal data transfer here (see before you install it. And back up any important data below). This will download only the bits that have before you think about hitting the install button. changed, which should only be a few megabytes. Once Also, don’t use our install disc. Get an up-to-date ISO that’s done, write the refreshed ISO to a disc using your from www.ubuntu.com/download/desktop. This might favourite burning utility or to USB using dd or Etcher. seem like strange advice, especially given all the When you begin the install, you may be pleased to superlatives on the wallet, but within the confines of the find the option of a minimal install. This doesn’t save a covers we can at least be sensible about this. Thanks to huge amount of space (around 500MB), but does away the lugubriousness of getting a magazine printed, this is with most of the bulky applications, leaving only a web not the final release, it’s a daily image from mid-April. browser and core tools. From here you can add We’ve tested it as best we can, but we can’t say if you’ll whatever you like, so it’s great if you have different be stricken by some heretofore undiscovered bug that application proclivities to the Ubuntu defaults.

INSTALL UBUNTU

1 Download the official ISO 23Boot the live medium Test and install If you’re short on bandwidth and Insert your disc or USB drive into Check as much of your hardware as alreadyrunningLinux,copytheISOfrom the appropriate place and then boot your possible from the live environment (extra our disc (it’s in the Ubuntu/ directory), machine. The official image will work with displays, wireless and printers). In install zsync and update the ISO: secure boot (note that our disc will not), addition, make sure you like it, because $ chmod 755 bionic-desktop-amd64.iso but finding the magic key to summon the there’s no point risking your system if $ mv bionic-desktop-amd64.iso ubuntu- boot menu or UEFI settings may take you don’t. If all’s well then press the 18.04-desktop-amd64.iso some trial and error on your part. F2, F10 install icon on the desktop, the installer $ zsync http://releases.ubuntu. and Del are common options. Mac users will happily install alongside (or atop) com/18.04/ubuntu-18.04-desktop-amd64. should hold down C. Select the optical Windows or other Linuxes. If you have a iso.zsync drive or USB and then choose ‘Try Ubuntu more exotic setup then choose the Now write the new image to disc or USB. without installing’. ‘Something else’ option.

www.techradar.com/pro/linux June 2018 LXF237 31 Ubuntu 18.04 LTS Getting to Gnome you Unity is out and Gnome is in. Despite what some would call its chequered history, Gnome’s a feature-packed desktop powerhouse.

ou may have heard terrible things about shipping patched libraries. This ensures compatibility Y Gnome: that it’s a hypermodern desktop across the Gnome ecosystem and avoids reliance on environment more suited to phones than PCs, third-party extensions, but it does mean things like that it forces you to learn abstruse key combinations, global menus and the more advanced features of that it can’t be configured, that it’s written in Unity’s HUD are no more. JavaScript… the list goes on. Though none of these are The Gnome release cadence happens to align nicely really true, the prospect of learning a whole new with Ubuntu’s bi-annual releases, so 18.04 includes desktop environment may be, to say the least, daunting. (most of) the latest version, Gnome 3.28, released in Don’t worry, though – Canonical has put a lot of mid March. This includes some great new features, effort into making Gnome friendly to people used to many of which you can read about in our Hotpicks working in Unity. There’s the familiar colour scheme, section on page 81. Files, which is the default file app indicators, the signature font and window manager in Ubuntu, is based on the version from 3.26, decorations and, of course, the characteristic left-hand but it has received a stylish new look (check out that launcher bar. You can even put icons on the desktop if funky sidebar, people!) and will be familiar to Unity you really want to. However, Canonical has been quite users. Also familiar will be the sponsored Amazon link deliberate in not making these tweaks invasive to the in the sidebar. We recommend replacing this with desktop’s underpinnings: they’re all done through something useful forthwith. A shortcut to the Terminal standard Gnome extensions and themes, rather than is a good and sensible choice.

Get to know the Gnome desktop...

2 4 5 3

1 6

Dock no need to click in the box) to search Apps, here. The button in the bottom left launches 1 Launch and see running applications Docs and more. the all-important Settings app. (denoted by a dot) from here. Calendar and Notifications area Applications menu Activities 4 Click here to control music, see any 6 Click here to open/close a view of 2 Clicking here (or pressing the Super appointments (if you’ve connected an frequently used applications. You can see all key) launches the Activities view (pictured). appropriate service) and see other stuff. installed applications from the selector at the Helpfully, it shows previews of running apps. bottom of this menu. Status Menu Search Box 5 Network settings (including VPN), volume 3 Start typing in the Activities view (there’s controls and application indicators can be found

32 LXF237 June 2018 www.linuxformat.com Ubuntu 18.04 LTS

Characters application, and will work in all Gnome applications (even the Terminal!), but sadly not LibreOffice, although that does have support for some uncoloured emojis using shortcuts such as :yin yang: . Online accounts One of Gnome’s many impressive tricks is its online account integration. You may not want to browse your Google drive files from Files, or see your Facebook and Flickr photos with Photos, or integrate with any proprietary service at all. But if you do, then you can. Gnome’s Text Editor, formerly , enables you to input emoji. The There’s also integration with open source services, first one we pasted in is testament to the level of maturity around here. such as Nextcloud. The Night Light feature has been in Gnome for a We’ve covered the basics of the Gnome desktop in while, but you might have missed it. Eyestrain is a big our annotation (below left) and you’ll find a treasure deal nowadays: we spend too long looking at displays, trove of further information on the next page. If you be they monitors or phones or VR goggles. All too often really want to have Unity back, then you can install it this staring goes on into the small hours, where blue with sudo apt install unity , but we’d strongly advise light begins to cause detrimental effects, both physically against this. It has received some bugfixes in this and psychologically. The best cure is, of course, to take release, but won’t be receiving very much attention at regular screen breaks and go to bed early (yes Jonni!– all going forward. Oddities will occur with increasing Ed), but when that’s not possible having your display frequency, and applications will start breaking, better to change it’s colour temperature at sensitive times should start embracing the future. make it easier on the eyes. Open the Settings panel, and If you’ve ever used Emacs, or tried to quit Vim, then go to Devices>Screen Display>Night Light to configure you’ll know the importance of keyboard shortcuts. You times and temperatures. can happily prosecute your business in Gnome without knowing any of these, but learning these few will make your life easier: INSTALLING EXTENSIONS Super (Windows key) – Bring up the activities view Super-Left/Right – Tile current application left or There are also a great selection of Gnome extensions that provide right (so it fully occupies one half of the screen) new functionality. Only two small hurdles need to be overcome Super-Up/Down – Maximise/Restore current before you can avail yourself of them. Gnome extensions are application installed via the https://extensions.gnome.org website. Before you Super-PgUp/PgDown – Switch virtual desktops can use this (as the website tells you) you’ll need two things: a Super-Shift-PgUp/Dn – Move current application to ‘native host messaging application’ and a browser extension. next/previous virtual desktop The former is found in the chrome-- package There are many more, which you can study at available from the software application and the latter can be found https://help.gnome.org/users/gnome-help/stable/ by following the ‘Click here to install browser extension’ link. Now a shell-keyboard-shortcuts.html.en. whole world of extensions awaits you. One of the most popular, Gnome has been criticised in the past for its lack of you’ll note, is User Themes, which enables you to use themes configurability, and this has traditionally been from sites such as https://gnome-look.org, by extracting them countered with the notion that users shouldn’t need to the ~/.themes directory. Once that’s done you can select them to configure something that’s been well-designed. from Tweaks. There’s some truth in this sentiment, and it’s worth Within the Extensions tab in Tweaks, you’ll notice two already trying to get used to Gnome, before resorting to there: Ubuntu appindicators and Ubuntu dock. These can’t be extensions to ‘fix’ it. deactivated, because they’re a key part of the Ubuntu Gnome That said, there are some things ‘missing’ from desktop. The Ubuntu dock is actually a fork of another popular Gnome (including, but not limited to: minimise buttons, extension, Dash to Dock, which you may want to check out. If you’re a system tray and titlebars on Gnome applications). feeling brave, you may also want to check out what a vanilla Gnome Some of these can be remedied by installing Gnome’s session is like. Just do: Tweaks tool, or extensions (see box, right). You’ll find $ sudo apt install gnome-session Tweaks in the Software application (it’s called GNOME You can select the session when you log in. Look ma, no dock! Tweaks there), and once it’s installed it will enable you to play with many settings that were hitherto only accessible through gsettings keys. There’s good news if you’re down with the youth, or indeed if you just like to embellish your monochromatic letters, numbers and punctuation marks with colourful/ Click the sliding expressive/irreverent , or creative combinations switch, click thereof. Ubuntu ships with the Noto Color Emoji font, install and the extension will the very same used in recent versions of Android, and spring into life. recent enough versions of Fontconfig and to render them. They can be copied and pasted from the

www.techradar.com/pro/linux June 2018 LXF237 33 Ubuntu 18.04 LTS Flavours and spin-offs Don’t worry if Gnome’s not your jam. There are other desktop flavours to enjoy and other Ubuntu-based distros, too.

irst came Ubuntu (2004) and then, one year Raven sidebar, which makes it possible to configure later came , because KDE fans wanted elements without having to go hunting around in settings F the Ubuntu system under their desktop of applets. This is hidden by default in this release, but is choice. Other flavours followed, some of these don’t accessible from an icon in the top right. By default the have a release this cycle, and some are no more (such as Raven bar houses a calendar, audio controls and a Ubuntu Gnome). But here’s a summary of our favourites. notifications area, but you can add other applets to it. A number of titlebar applets are activated by default, including a desktop note taker, a night light control and Budgie is up-and-coming distro Solus OS’s desktop, and Caffeine, which can stop unwanted screen blanking. it’s the newest addition to the Ubuntu flavour family. It Budgie includes the excellent Tilix terminal, which strives to be “a clean and… powerful desktop without comes preconfigured with a drop-down shortcut (F12). unnecessary bloat”. One of its proudest features is the There’s the similarly excellent email client too. If you like widgets on your desktop, Budgie enables you to configure them straight from the welcome screen. THE WIDER UBUNTU ECOSYSTEM Budgie is currently based on Gnome, and so includes many of the same applications in the standard Ubuntu Besides the official flavours, Ubuntu provides the basis for a number release, as well as all the new Gnome 3.28 features. of popular derivative distributions, many of which will be releasing Things are changing though and Budgie 11, will be a updates soon. The most popular is Linux Mint, and we look forward Qt-based affair, which we look forward to very much. very much to Mint 19, which hopefully will be released in June. We were nothing but impressed with Mint 18 (see LXF214), where we saw Ubuntu MATE Mint start to move away from Gnome applications, launching its own MATE started as a fork of Gnome 2, and has been a desktop-agnostic X-apps. The goal here is to avoid the new GTK3 refuge for people who yearn for those days of cascading stylings, most notably headerbars, which broke from tradition. menus, top and bottom panels, and a distinct lack of The rather beautiful ElementaryOS will be getting a version bump flashy desktop effects. The default look in MATE has from 0.4 to 5.0, hopefully in the not-too-distant future. Apart from changed though, which some users may find shocking. confounding our ideas about how versioning should work, this reflects Dubbed Familiar, the new layout does away with the elementary’s growing maturity and stability. Like Mint, the team are Applications, Places and System menus of yore. But working on the next generation of their applications, which are all fear not, the old layout (named Traditional) can be written in Vala and, unlike Mint, embrace modern design paradigms – restored easily. A number of other desktop layouts are headerbars and all. The old text editor, Scratch, has grown up into a available too, including Netbook, Mutiny (haha, a tribute code editor, Code, which we’re particularly excited about. to Unity) and Cupertino (featuring the Plank dock and If you want to test the very latest KDE technologies, the best way making for a macOS-esque experience). is probably through KDE Neon. This is not a distro in the MATE is by no means averse to keeping up with the conventional sense, because it only includes shiny new KDE times, and one of the exciting changes since the last software. This led to a slight oddity when one considered the vintage Ubuntu is the new Brisk menu. This puts MATE on a par of the kernel and repositories from the 16.04 LTS (the idea is to have with pretty much every other desktop environment in a stable base underneath all the Plasma bits). However, this will be having a menu that’s instantly searchable. Said menu remedied, at least temporarily, when it’s rebased to 18.04. can be summoned with the Super key too. Like Kubuntu, Ubuntu MATE includes an optional Global

Keep up with elementaryOS news at https:// medium.com/ elementaryOS. Helpfully, MATE comes with a tweak tool pre-installed, enabling you to choose one of its many layouts.

34 LXF237 June 2018 www.linuxformat.com Ubuntu 18.04 LTS

Menu to put at ease those who miss this feature from Unity. The distro goes one step further too, featuring a HUD (Head Up Display) that enables menu options to be searched by holding down Alt. Kubuntu KDE Plasma is a fabulous desktop that manages to be at once modern and still respective of the traditional desktop metaphor. Kubuntu’s take on it adds some nice touches, with a stylish dark theme and handy shortcuts. If you have a reasonably modern graphics card, then all of the nice effects (which are by no means excessive) will use hardware acceleration and won’t interfere with your work. Kubuntu uses Plasma 5.12 LTS, released in February. But PPAs will be available for Kubuntu users willing to brave installing newer libraries. KDE has, in the past, been seen as the most LXQt 0.12 was released back in October 2017 and KDE Plasma has memory-hungry desktop, but in our testing this we’ve tested it with great results on some of our dusty its own software ignominious crown is very much Gnome’s now (not that hardware. Just because it’s lightweight doesn’t mean it app, Discover. The Geology section it really matters in an age when 16GB of RAM is all but sacrifices anything in terms of style or functionality. rocks – try it! standard). KDE is highly configurable, it comes with a choice of launchers (a ‘classic’ menus, the default Xubuntu and ‘fancy’ menu, and a full-screen launcher a la Gnome). Once the only (fully featured) alternative to Gnome and You can even set up a Global menubar (so application KDE, the Xfce desktop used in Xubuntu has sadly been menus appear in a top panel as opposed to in the eclipsed by the likes of MATE and LXQt. The project application window, a Unity feature) if you want. hasn’t seen a new release since February 2015. But it’s far from stagnant (review the activity at https://git. Lubuntu xfce.org), the slow transition to GTK3 and the long- Lubuntu is the least resource-hungry of the Ubuntus. It awaited 4.14 release is still ongoing, with the vast will install on a Pentium II machine with 128MB of RAM majority of components no longer dependent on GTK2. and 2GB of space, but for daily use 512MB of RAM is recommended. It’s based on the aging GTK2 toolkit, which is a problem because many apps no longer build KDE’SBACKINOURGOODBOOKS with this without significant patching, and this trend will continue over the five-year support period. “KDE has, in the past, been seen as the Lubuntu is transitioning to the Qt5-based LXQt desktop, but this is a complex journey, and the team most memory-hungry desktop, but in don’t want to ship something unfinished (and have to support it for five years). Progress has been good, our testing this ignominious crown is however, and the Lubuntu-next image is available for users wanting a glimpse of the future. It will be very much Gnome’s now” supported for nine months, by which time the project should be more suitable for a general audience. Xfce is also the desktop used by Ubuntu Studio, the Lubuntu Next will require slightly more grunt than its flavour for multimedia and creative types. This release It’s hard to write predecessor, and has slightly larger memory and disk isn’t an LTS, but it’s supported for nine months and this kind of space footprints, but should be fine on machines built in efforts to rejuvenate the Studio community are feature without the last decade. Thanks to the extensive work that went underway. The next release, 18.10, hopes to change some mention into decoupling the KFrameworks helper libraries from things up a bit. Nonetheless, this releases showcases of the desktop backgrounds the rest of KDE, the distro doesn’t bloat itself with some great tools: JACK, Blender, Darktable, Ardour and on offer – here swathes of KDE-specific libraries, as was traditionally many more. It’s the only distro where you’ll find all of is Xubuntu’s the case when installing Qt4 programs. these programs pre-installed. snazzy selection.

Lubuntu uses the LXDE desktop powered by the Openbox window manager for a bells-and-whistles free desktop.

www.techradar.com/pro/linux June 2018 LXF237 35 Ubuntu 18.04 LTS Next-generation Ubuntu There’s plenty of exciting new technology (besides Gnome) in this release, so have a gander and find out what’s what…

ernel 4.14 is an LTS release too, so the kernel for the now-defunct storage service) is team will support it for at least five years. The required, which you can sign up for it by following the K plan was to use this for Ubuntu, but since 4.15 instructions there. This account will also let you log in to was released in January, and makes working with the the (https://ubuntuforums.org) to ever-evolving KPTI patches for Spectre/Meltdown post any questions you may have. somewhat easier than the backported solutions, it was Live kernel patching has been around for awhile (we decided to use 4.15 for Ubuntu. first covered it in LXF200) and it’s useful if you’re in a Kernel 4.15 has been one of the busiest releases for a situation where you can’t reboot, but want to apply long time. Besides frantic patching of Spectre and some kernel update, particularly if it concerns security. Meltdown, it also includes many exciting new features. However, it’s crucial to stress that livepatching isn’t a After extensive reworking, AMD’s DC (Display Code) cure for rebooting in general. Updates to Systemd, for layer has landed, which means owners of Vega and example, will often require a reboot to take effect, and Raven Ridge series cards (including the 2200G desktop updates generally won’t take effect until you’ve reviewed on page 18) can use the open source AMDGPU at least logged out and logged back in again. Major driver without relying on a custom kernel. It also enables kernel updates (for example, upgrades) will still require that driver to work with HDMI audio on other AMD a reboot, and in our experience the community theme snap (see below), wouldn’t show the new session without doing so either. Consider yourselves told. IF IN DOUBT, REBOOT! One slightly controversial new development in this release is the collection of usage statistics. Data on “It’s crucial to stress that livepatching installed packages is collected via the popularity- contest package, which sets up a cron job to update isn’t a cure for rebooting in general. package information daily. This package has been optional on Debian for a long time, and everything is Updates to Systemd, for example, will anonymised and sent over HTTPS. Like other operating systems, when things go wrong you can send a crash often require a reboot to take effect” report to Canonical. In some cases this will take you directly to an appropriate bug report, where you might, GPUs. Laptop users may see a battery life boost thanks if you’re lucky, find a temporary workaround. to improved SATA power management. Canonical invests a lot of work into supporting the kernel (after all Theme refresh it’s at the heart of its cloud, server and IoT offerings, Ubuntu’s long-time default Ambiance theme has been too) so we can expect features from future kernel’s to tweaked for 18.04, giving Gnome even more of a Unity be backported to this one, even after the kernel team look and feel. The lighter Radiance theme has also had a itself cease working on the 4.15 series. bit of a dust up too. Ubuntu’s Communitheme project Ubuntu’s Livepatching service is more of interest to (see https://didrocks.fr/2017/11/09/welcome-to-the- server administrators than desktop users, but they now ubuntu-bionic-age-a-new-ubuntu-default-theme-call- make use of it from the comfort of the Software and for-participation), is well underway, but not ready for Updates application, should they wish. An Ubuntu public digestion. Those willing to endure a few rough Single Sign On account (the same that used to be used edges can try it out, thanks to it being distributed as a snap. It can be installed with sudo snap install communitheme , and sampled by restarting and selecting the communitheme session from the login screen. The community theme started from Adwiata, the default Gnome theme, and aims to be at once a complete replacement to Ambiance and a tribute to the abandoned Unity 8. Read more at Canonical Developer Didier Roche’s blog (http://bit.ly/ubuntu-bionic). And on the subject of snaps… Snap is Canonical’s Configure updates favoured approached to distro-agnostic app packaging, from here. You can similar to and . Besides making life find Jonni’s email easier for developers (by bundling all required libraries address in the back of the mag if with the application) and packagers (by removing them you really want it. from the equation altogether), these formats can offer

36 LXF237 June 2018 www.linuxformat.com Ubuntu 18.04 LTS

some security benefits thanks to leveraging container technologies for increased isolation. All the front-page items on the Software app are Snap apps, but if you search around you’ll still find software distributed in the traditional format. When installing things from the Software ‘store’, the process is the same no matter the . The traditional apt install method is still de rigueur for DEBs, but you’ll need to learn some new command line fu for installing Snaps. We saw above how to use install a theme Snap, but they have some other tricks too. For example, to switch to the dev branch of the communitheme, use $ sudo snap refresh communitheme --edge Replace --edge with --stable to revert to the stable branch. Snaps will be automatically updated by the , but not with Apt. To update them from the command line, use the snap refresh command. SDLpop, an open Ubuntu MATE 17.10 broke new ground by shipping long as you have enough memory), it just means you source version of pulsemixer as a Snap, since it hadn’t been packaged for can’t get a nice ready-to-run install disc. If you’re Prince of Persia, is Ubuntu or Debian. This trend has now made its way into already running 16.04 on 32-bit hardware then you available as a snap. the main distro, which includes a number of pre-installed should be able to upgrade without a hitch. Gnome Snaps: System Monitor, Logs, Calculator and If you want to do a clean install, then there’s a couple Characters. You can see these mounted in the /var/lib/ of options. You can go with one of the other flavours: snapd directory in through the mount command. they all offer 32-bit media, but your best bets are Wayland has been the default display server in Lubuntu, Ubuntu MATE or Xubuntu. If you really want to Fedora since version 25. There was talk of making it run Gnome on 32-bit hardware, you can install it on top such in Ubuntu, but after experimenting with that in of one of these via the ubuntu-gnome-desktop 17.10 the default has been reverted to ye olde X.org. package. Another approach would be to start with the However, a Wayland session is available (just click the i386 server ISO, and then build a custom desktop from cog icon when entering your password) and our brief there. This would be a good option for building a testing found that this worked well. Even if you’re using lightweight desktop with Openbox, i3 or somesuch. the proprietary Nvidia driver, which implements Funnily enough we’ve got a feature about doing just this Wayland via EGLStreams, then Gnome should work just next month. We hope to see you there! fine. You will probably have heard stories about screen shotting, screen recording and remote desktop sessions not working with Wayland, but these are half truths. BEYOND THE DESKTOP These all work as long as the compositor supports them, and the recording applications talk to the We’ve focused on the desktop side of things, but this isn’t how compositor in the right way. Mercifully, Gnome’s Canonical makes its money and is far from the whole Ubuntu story. compositor (, also its window manager) does Ubuntu Core is Canonical’s diminutive distro that’s designed for both of these, and even has a built in screen recorder, constrained devices, particularly IoT things, and containers. Core which you can activate with Ctrl-Alt-Shift-R . uses the same kernel as desktop and server Ubuntu, and leverages Snap packages to provide smooth and secure installations, and The end of 32-bit…? upgrades. Canonical is hoping that Ubuntu Core will become popular As has been foretold, this is the first Ubuntu LTS that for Edge (or Fog) computing. This is the boundary between the cloud doesn’t provide any 32-bit desktop install media. That and real world devices, where devices sit on the edge of low-powered doesn’t mean your pre-neolithic hardware can’t get (for example, sensor) networks and marshall their data to the cloud. Ubuntu 18.04, or even that it won’t run it just fine (as Sometimes less is more, and this adage ne’er rang truer than for containers, embedded systems and IoT. To this end, Canonical now provides a minimal image – and at less than 28MB, minimal it certainly is. This isn’t to be confused with the minimal desktop install we discussed earlier, which still provides such luxuries as a desktop and such fripperies as an installer. Oh no, this is just a tarball of a filesystem that provides very little beyond a working shell. It’s an ideal starting point for constrained situations, where just what is needed, and not a byte more, can be added in. However, it’s not suitable for installing on bare metal, because it’s not capable of . Many official Docker images (including Apache and Mariadb, for example) currently use the tiny distro as a base. At 8MB this is still much smaller than Ubuntu’s offering, but the latter may be more preferable to container wranglers willing to accept a few megabytes in order to leverage the more familiar Apt Ubuntu enables you to send crash reports to help the team see what’s and glibc (as opposed to apk and musl). breaking. Optionally, they can also collect anonymised usage data.

www.techradar.com/pro/linux June 2018 LXF237 37 INTERVIEW Thomas Sigdestad

PROGRESSIVE SESSIONS Jonni Bidwell talks progressive web apps with Enonic’s co-founder Thomas Sigdestad

38 LXF237 June 2018 www.linuxformat.com Thomas Sigdestad INTERVIEW

homas Sigdestad is CTO and co-founder of Enonic, Thomas co-launched T a company that’s grown Enomic back in 2000. from humble beginnings in a garage in downtown Oslo to one of Norway’s most successful open source companies. It had the bold idea of providing people with something useful and usable during the dotcom boom, and that remains very much part of its strategy today. We caught up with him at the O’Reilly Software Architecture 2017 conference in London to talk about the future of cross platform applications: progressive web apps. You may not have heard of them, but the chances are, if you’ve gone anywhere near a major website recently, that you’ve already used one. New technologies enable web browsers to do all kinds of things – things that hitherto were strictly the preserve of native applications. This could mean didn’t like it. Not one bit. I’m less militant up with some interesting customers. We’ve many exciting developments: truly now, but Linux has been my primary OS used Linux for various purposes and in cross-platform applications, an end to ever since then. various guises from day one. We’ve always the scourge of app stores, perhaps even TS: That’s funny. Our product is called used Linux for our hosting. Linux becoming a viable option for people Enonic XP.The XP is short for eXperience What we did that made us unique was bound by application requirements on Platform, but it’s nothing to do with that we built everything using Java. We proprietary OSes. A brave new world Windows XP.When we released it two had an idea – sort of inspired by Bill Gates awaits, so read on… years ago we referred to it as a “web – that Microsoft’s success came from operating system.”If you’re building an piggybacking off IBM. We more or less did Linux Format: Hi… Android app, then you know how to write the same thing with our application server Thomas Sigdestad: So, you’re the same to disk and how the graphics work and and database. We basically got customers people that made Amiga Format? I still remember looking forward to the disks and the first review of the latest game. It IF IT WORKED FOR MICROSOFT… was pretty expensive in Norway though – £7 or £8 I guess. “We had an idea – inspired by Bill Gates – that LXF: That’s us… well, not us personally, Microsoft’s success came from piggybacking but our company. I loved that mag though. My mum used to go mental that off IBM. We more or less did the same thing I’d spend £3 on a magazine. She didn’t understand the amazing value that with our application server and database.” represented. It wasn’t just the quality journalism – the cover disk was a big things like that. There aren’t any other that had invested in those architectures deal: 880K of PD games and demos that dependencies, just an Android version. who wanted our solutions. So stone by would keep me occupied for, well four We had the same idea for servers: when stone we built our business over five years. weeks. Ahh, nostalgia, best not get me you’re building an Enonic app, you only We made a neat CMS, and saw that things started. How did you get into Linux? had to specify which version of XP you were changing in many ways. We had TS: When I was studying I bought a Red were using. So this is an operating system application teams working on one stack, Hat box set from the university bookshop. concept at a much higher level – a server database teams working on another stack I spent a lot of time investigating that. distributed approach. We went with the and website teams working on yet another I remember thinking what was really XP name for marketing reasons, but stack. But they were all ultimately working cool, and what I still think is really cool, maybe in a few years “web operating to create some user experience and is network booting. You just start the systems” will catch on. would have to wire these stacks together machine, and it goes off and fetches an somehow. We then realised that this can image. This was amazing in 1997. LXF: Tell me about your company, Enonic. be done differently. TS: We started back in 2000. We wanted to When you invest in a CMS you have to LXF: I used Red Hat in the early 2000s. be a software company, so we worked for have a full stack, including the database As soon as I had a computer capable of a year making our web portal, and then we and everything else. So we built everything running Windows XP, I discovered that I launched and surprisingly quickly ended from the ground up, in a single piece of

www.techradar.com/pro/linux June 2018 LXF237 39 INTERVIEW Thomas Sigdestad

software. And the CMS is the surface layer you run it you’ll be prompted if you want to up to the developer whether or not that’s of that stack, so now we’re an application add it to your device. If you agree, you’ll get used, though. If part of making that app platform with a CMS as an optional feature an icon on the launcher, just like a regular is that you want hardcore performance, of the stack. But typically that’s what our application. And just like a regular app, you then you might use WebGL or maybe even customers use. Even though we could can look at its information in Android’s app WebAssembly. That’s just one use case make many interesting solutions, we have settings, and uninstall it. You have access to though, and not everyone cares about chosen to focus on three key areas: digital lots of different hardware features that you that. Most business cases only require experiences, progressive web apps and wouldn’t usually expect with a web app. standard web technologies to create apps. back-end services. So a progressive web app isn’t a particular piece of technology, it’s more LXF: How easy is it to write these things? LXF: Let’s talk about progressive web a pattern of what these apps can do and TS: It’s fairly simple to use as a developer, apps. Forgive my ignorance, but what how they work. To summarise: they feel and we believe that two years from now exactly are they? like native apps, they’re cross platform so native app development will become a TS: The short version is they’re web apps you only need to code it once, rather than niche thing, only used when there are where you get the experience of a native building for Android, iOS, web and Windows specific requirements. For example, app, but built with web technology. You can separately. They’re also responsive, so you Google just announced the WebUSB and see an example at http://officeleague. can have different screen sizes, and they Payment Request APIs for Chrome (see rocks. It’s a foosball app that enables have offline support, so there’s resilience https://developer.chrome.com/apps/ anyone to start their own league. It’ll as regards network conditions. The reason app_usb and https://developers.google. work on any modern browser, desktop or they’re called progressive is that the core com/web/fundamentals/payments/). mobile. Everything is driven by JavaScript, parts of this foosball app, for example, These are pretty awesome. For example, if so there aren’t conventional page reloads work on an iPhone, even if they don’t you’re PayPal, then you can create a web which download the application code support the offline mode or some other or native app and register as a payment every time. You get an Elo rating like in features. So you can have progressive provider in a given device. Then a website chess, and you can watch live games, enhancements of your app depending on can just call the payment request API, and which is pretty cool. the capabilities of the client. the user will be given a list of payment What’s also cool is that if, for example, providers – PayPal, Apple Pay, or whatever I’m playing on my phone and I turn on LXF: What about video acceleration? Do – so this removes much of the complexity airplane mode, then the web page detects they use webGL or other trickery to give in carrying out the actual transaction. that I’m offline, but I can still play a game. a smooth experience? Likewise WebUSB opens other The app records it, and the moment I go TS: Yeah, they can basically use whatever new capabilities—so everything from back online the app sends the data back technology your browser is capable of on controlling the camera (every aspect of to the server. Beyond this, the first time the device and platform you’re using. It’s it), the microphone, access permissions, all of these are embedded in the web now. The web was always involved behind the HOW ENONIC CAN SAVE YOU TIME… scenes, but now it’s come to the forefront, it’s absolutely a viable alternative to native LXF: So you started Enonic in the reasonable, but at the time we didn’t applications. dotcom crash, right? But you had a really know who needed what we were good idea, unlike a lot of companies building. We have a better idea of that LXF: App stores have become common who were just putting the word now, but still things are changing very the standard way of getting apps. Even “Internet” into wonkybusiness plans. fast, especially with the cloud. Gnome’s Software tool pretty much TS: Yup, we started in summer 2000 These days our offering is essentially conforms to this norm. How do these and one month later the whole world “You have an idea. We have a platform. work for progressive web apps? fell down. We went straight into Run it in any cloud if you build on our TS: Well, when you visit a web page there platforming, which isn’t the easiest platform”.For typical cases we replace isn’t an involved, so the whole thing to do. In a way we were lucky, SQL/NoSQL, search, app engine, and at “purchase/download from Google Play”, because we were thinking, “Let’s make least parts of the web server. We have or whatever step is skipped. So that’s things dead simple to use”,so we an identity system, you can plug in good for developers and good for users, wanted to make a CMS so simple that others, and we have our CMS. So we because it speeds things up. Twitter is anyone can use it. offer maybe five systems in one. probably the best example of a progressive We had to give users form-based Traditionally, people have been used to web app. It’s three per cent of the size input, and to present this requires quite putting all that together first, before you of the native Android app. There are no extensive coding. It turns out that no write a single line of code. And setting updates: you’re always running the latest small company wanted to invest in this that up, getting all those components to version whenever you visit the website. level of coding, but the big companies talk to one another, can take a lot of So this way you get the best of the wanted this, and since we were already time. If you’re happy with how we’ve set traditional web app world, combined involved with Java we were a nice them up, then you can save all that with the best of the native app world. It’s match for them. We were pretty young time. And you don’t have to worry about just a question of getting web browsers when we started, but we made a maintaining and updating and scaling to support the necessary features. This product that we thought was all of those components, either. initiative is being pushed hardest by Google through Chrome and Chromium.

40 LXF237 June 2018 www.linuxformat.com Thomas Sigdestad INTERVIEW

Thomas explains that progressive web apps feel like native apps.

Firefox is doing a really good job too (see of Netscape it sent a shiver down my that make it even better. Twitter had some https://developer.mozilla.org/en-US/ spine. I knew it was likely my machine teething problems initially when it started Apps/Progressive). Microsoft is involved was going to be brought to its knees to get big, but then it started using some too, so it’s another chance for it to become while whatever applet was loaded. But of these things to improve its search, for relevant on the client side. The company’s that was on the client side, and probably example, and this really helped them to going to have progressive web apps on the my 486 was underpowered even for scale out. But yes, Java is pretty ubiquitous Windows Store. those times. On the server side Java – our platform is based on Java. We’ve enabled all kinds of things to be bigger seen a new trend though, one related LXF: What about Linux? Presumably progressive web apps can run there as well as anywhere else? STAYING UP TO DATE IS EASY… TS: They do, and that’s an interesting point. Linux dominates virtually every other field “Twitter is the best example of a progressive – the cloud, mobile (if we permit Android to be Linux) – but it never made it to the web app. It’s three per cent of the size of the mainstream desktop. But with progressive web apps, desktop Linux could be a viable native Android app. There are no updates: alternative to macOS and Windows. you’re always running the latest version…” LXF: It’s a bit like the browser is becoming the new operating system then? and faster. I’ve heard this is why Twitter to progressive web apps and the web in TS: Yes, at least if you think about it as the was able to scale like it did. general: JavaScript. When you build apps runtime for applications. They’ve become TS: Yes, you could say that, most of the on our platform, you code with JavaScript, the foundation for client applications. It’s huge social media sites are running Java both server side and client side. a little like what Java did for coding server now. Java alone is good because it helps side applications in the late 90s. you with multithreading and stuff like LXF: That’s an interesting point. A lot of that. But the community on top of Java, people aren’t familiar with server-side LXF: It’s funny – back in the day whenever and in particularly the Linux side of that, JavaScript, I’m used to clumsily dumping I saw “Starting Java…” in the status bar creates all these cool open source things JS code in an HTML file, for example, but

www.techradar.com/pro/linux June 2018 LXF237 41 INTERVIEW Thomas Sigdestad

things like Node.js confuse me. Can you commonJS, which lets you do includes, LXF: What’s the tech community like explain how that works? basically. Standard JS doesn’t support in Norway? TS: Essentially, JavaScript was created that. These concepts are the same for TS: Oh it’s really big. One of the biggest by Netscape to do some fancy tricks in the client and the server, but in node. developer conferences, JavaZone the browser. But when you run JS in the js you have just this single . Our (https://javazone.no), is held in Oslo. I browser, it’s a single UI thread, and typically platform has a threaded model. The idea think there were 2,500 developers there you also have this DOM (document object is the same as with any scripting language this year. One thing that’s a bit sad though model) that you manipulate. So that’s though, you kick off a script and start in Norway, is that 90 per cent of what’s typically what you see: there’s an event, doing stuff programatically. And you going on [in the tech world] is consultancy. some JS kicks in, it reacts and changes can take advantage of all the libraries or The government and big companies hire something in the DOM. utilities out there to help you do stuff. people through consultancies. So they On the server side there is no DOM, so then there’s a few different approaches on the server side. There’s the language WHY NORWAY’S THE PLACE TO BE… itself and then there’s a huge movement around Node.js, which works pretty much “The tech community in Norway is really big. the same as in the UI: it’s a single thread, so you end up starting lots of small servers One of the biggest developer conferences, and you have to route the traffic into them, which is fine, and it’s also stateless. JavaZone, is held in Oslo. I think there were It has this same even principle: something comes in, an event is kicked 2,500 developers there this year” off, and then you can do whatever asynchronous trickery you want There’s another nice feature too: pick up all the talent, and the culture for between server and browser. However, When you’re coding client side stuff, in product development isn’t that strong. we wanted people to be able to use all Chrome you can go to Developer Options Nowadays there’s more of a push for the investments that had gone into Java, and find a debug console which makes people to get involved with startups and all the multithreading, and the ability to life easier. With server-side development, such, but there’s still too much of a focus fully utilise the hardware. In addition, you’re often at the mercy of the client, so on consultancy. multithreaded code is easier than async, debugging is harder. But on our platform, But some important companies have it’s simpler to debug and things like that. you can use that same debug console to come out of Norway: Fast Search & So we enable you to code server-side follow the code into the server, which is a Transfer (FAST, now part of Microsoft), JavaScript: you get an initial request, a nice feature for developers. The Javascript Qt, obviously a big one for Linux, Trolltech piece of your code is invoked, and then framework we use in Enonic XP is also (bought by Nokia). So in Norway at least, the JS itself is run. available as a standalone project called the successful companies tend to get Then there’s also an effort called PurpleJS (http://purplejs.io). bought up. So maybe Norwegian investors haven’t quite realised the potential of digital. But there’s definitely lots of skilled people – there’s no shortage of talent.

LXF: Tell us about your talk. I missed it because I have to spend all my time talking to people smarter than me. TS: Well, I wrapped progressive web apps into a Star Wars-themed discussion. Apple was the dark side. It’s good to make these things at least a bit entertaining. The message is that we’re trying to build a platform that helps people create powerful web apps. We think progressive web apps are going to be massive, but most people aren’t aware of that yet. It’s only a matter of time before things kick off. And definitely for native Linux distros, this is going to be really great.

LXF: Awesome, well thanks so much for your time. I think James our photographer is now going to Thomas, seen here without his superhero costume, orchestrate a hero shot out in the lobby but still heroically helping people to create web apps. TS: “Hero Shot?!” Oh no, I didn’t bring my latex outfit!

42 LXF237 June 2018 www.linuxformat.com MAKE YOUR OWN PROJECTS WITH THE RASPBERRY PI Learn the electronics, computing and coding skills you need to make your own projects with the Raspberry Pi, and let your imagination run wild

ON SALE NOW

Ordering is easy. Go online at: www.myfavouritemagazines.co.uk Or get it from selected supermarkets & newsagents IN-DEPTH Quantum Computing Image credit: Getty images images Getty credit: Image Quantum Computing Mats Tage Axelsson introduces you to quantum computing, the coolest tech around. Learn how it works and how you can get started.

uantum computing has caught logic that takes advantage of the two core the attention of large companies, concepts: superposition and entanglement. academics and hobbyists. This When you start exploring these concepts, the Q article will cover the history, the Bloch sphere will help visualise what to do with different ways to make a quantum computer different gates. can use classical and the logic behind programming. You’ll also bit gates together with quantum gates to learn about some programming toolkits that create the algorithms needed. you can use to get started. The mainstream media hails quantum To run a quantum computer, the physics computers as significantly faster than current has to be understood so programmers can models. It turns out they’re only fast in then manipulate and measure the final results. specific areas: cryptography, optimisation, Scientists have observed quantum effects in simulation and database searches. In photons, electrons and isotopes of many cryptography, many algorithms are safe materials. This means engineers use because factorising large prime numbers with superconducting materials such as niobium classical computers will take far too long for and aluminium to construct workable practical use. Shor’s quantum algorithm can quantum computing systems. do it in minutes. Optimisation and simulations The logic gates are made of silicon wafers can benefit from a quantum computer’s and are controlled using microwave emitters. ability to test many solutions at once. These solutions may not be the best in the Database searches are faster by a factor of long run, but they’re the ones that are running four. And with faster database searches, now. To use quantum computers, you need machine learning also becomes much faster.

44 LXF237 June 2018 www.linuxformat.com Quantum Computing IN-DEPTH

he history of quantum computers begins with T quantum physics. In 1900 Max Planck first proposed that light comes in discrete packets called quanta. This discovery later led Einstein to show that Planck was right. When measuring the photoelectric effect scientists could observe packet behaviour. These two discoveries later led to quantum physics. Yet the deeper scientists dove into the quantum nature of things, the harder it got to explain how it works. For quantum computing, the most interesting developments are entanglement and superposition. Superposition is the phenomenon where a particle exists in many positions at the same time. Considering this, scientists concluded that a quantum computer should be possible to build. A quantum computer is one that can do many calculations per operation. To make sense of all the state transitions, physicist Programmers use The cat in the box created the Bloch sphere. the Bloch sphere The famous physicist Schrödinger created a thought Peter Shor discovered Shor’s Algorithm in 1994. This to illustrate how quantum experiment. In it, he describes a cat and a gas container algorithm solves the problem of finding the prime factors gates manipulate inside a box. The gas will poison the cat after the of large numbers. The basis of all encryption is that you the qubits. radioactive decay of an atom that releases the gas. The can’t, in a reasonable time, solve this problem. Quantum process is random so observers won’t know if the cat is dead or alive until they open the box. In quantum physics, this means that the cat is both alive and dead SCHRÖDINGER WAS A CAT PERSON before anyone observes it. In the case of the cat, this is absurd but in quantum physics it’s normal. What “The process is random so observers Schrödinger was saying was that there must be another explanation – one as yet undiscovered. won’t know if the cat is dead or alive Another phenomenon is entanglement, where two particles can have intertwined states. This means that until they open the box. In quantum the state of one particle will always be opposite of the other even when they are apart. In quantum computers physics, the cat is both alive and dead” the software creates entanglement, a CNOT gate creates this state. computers may solve this problem in minutes. Interest in To make use of all the phenomena demonstrated in quantum computers subsequently sky-rocketed. quantum physics, scientists needed a way to describe Shortly after Shor’s discovery, Lov Grover invented what happens on a small scale. To program a computer, the Grover algorithm. This is best known as the database it needs logical operations, described as logical gates. search algorithm, but it’s also useful for other tasks. Quantum gates and classical logic gates are the same only up to a point. Quantum gates add features for changing states and entanglement. ENCRYPTIONMAYBEATRISK It took until the 1970s for the first attempt at a theory to use quantum effects for computers. Shannon One big question is whether encryption systems are at risk with information theory describes classical gates and other quantum computers. The major concern is the RSA encryption aspects of data processing. For quantum computers, scheme. The scheme is secure because it relies on the condition that this is insufficient because it doesn’t specifically factoring a large number into its primes is too time-consuming. describe quantum effects. When trying to find the prime numbers, there are many strategies, Quantum information theory was first attempted in so the simplest one is to guess and try. A trial and error approach 1976. During the 1980s scientists made more progress, isn’t practical, though, since a 2,048 bit number will have millions of in part thanks to quantum computing conferences solutions. Some strategies can reduce the number of possible organised by MIT and IBM. Other interesting solutions, but even the most powerful methods will take years or developments included quantum cryptography and the millions of years. With the right algorithms, a quantum computer first universal quantum computer. could reduce that time to a practical level. Efforts are underway to To make use of all the states of the particle you create other algorithms that aren’t breakable this way. measure, programmers need a formal language. While this is prudent, the risk that a quantum computer can do Quantum information theory needed to improve. The this within 15 years is low. The quantum computers that are available different gates are the foundation for such a scheme. today are both small and hard to program. The frameworks available Keeping track of what the different quantum states for programming are few and far between. As you can see in other are is confusing. First of all, the way it works is counter- parts of this article, you’ll still be setting a few qubit states and intuitive at best. Second, there are many different spin twisting the states. Converting that to a fine-tuned encryption axles to keep track of. The system isn’t complicated, but cracker is, more than likely, a far-off prospect for now. it involves atypical approaches that are tricky to grasp.

www.techradar.com/pro/linux June 2018 LXF237 45 IN-DEPTH Quantum Computing

Through the coming decades, also expensive using current scientists invented new features. technologies. Meanwhile, a Bose-Einstein Quantum error correction and fault- condensate is a gas cooled to millikelvin tolerant quantum computers were among temperatures. When the gas reaches this the major ones. The first demonstration of a temperature all electrons take the same quantum computer took place in 1998. After this, quantum state. Uses for this solution are, so far, limited development accelerated. to simulators – any actual computers are pipe dreams. The interesting types are the different Josephson Bose, Einstein and Joseph walk into a bar junction types – these actually are running in practical To date there are a range of quantum computers in use. setups. IBM’s versions are even available for anyone Researchers are using ion traps, light-based and who registers on the Q-experience web page. microwave controlled Bose-Einstein condensates. D-wave’s machine uses Josephson junctions. These These types need different control mechanisms. The are superconducting Niobium and aluminium-oxide ion traps use an electromagnetic field to trap the ions. gates. At temperatures near absolute zero, a SQUID Lasers create the field and keep the ion trapped and to measures their magnetic properties. A SQUID is a “pump” the state of the electron of the ion. The sensitive magnetometer. The values show the quantum electron will emit light only when the state matches the state of the junction, making the circuit a qubit. The laser’s frequency. principle this computer uses is quantum annealing. This is the logical 1 state, with the logical 0 state is IBM’s solution is Nuclear Magnetic Resonance the opposite. This makes it simple to measure, but (NMR). The qubit is still a Josephson gate. That solution achieving precision is still a challenge. Manufacturing is uses microwave transmitters to interact with the qubit. The difference between the two is that the IBM solution controls qubits to a higher degree. This has made it easier for Canadian company D-Wave to manufacture bigger chips. At the same time, this limits D-wave to fewer applications. For example, an annealing system can’t run Shor’s algorithm or Grover’s. It’s useful for optimisation and machine learning – no wonder Google already has one of its own D-wave quantum computers. More is less work As mentioned earlier, the algorithms in quantum computers are different. To explain what the difference is, you must bear in mind the physics that are involved. As most Linux Format readers will know, a conventional computer uses gates. The system uses Boolean logic to When starting out programmers use a score, like a music score. The picture shows Quirk, an create the algorithms for calculating everything. The online simulator. The circuit is showing a Quantum Fourier transform. most important aspect of this is that it’s deterministic, so we only deal in certainties. The answer is either yes or no – at least on the circuit level. QUANTUM SIMULATORS In contrast, quantum computing involves all answers having a probability attached to them. No answer is To help understand how quantum computers work, there are a large certain – rather, it is probabilistic. For this to be efficient number of simulators. There’s no way that you can simulate one the algorithms must be adapted accordingly. efficiently, but if you want to understand the underlying principles Quantum gates have an effect on one or several then many of these are excellent. The first one that’s worth qubits at a time. When you measure qubits, the system exploring is a Bloch sphere simulator. Without having at least a usually does a complete analysis of the entire system. rudimentary understanding of the Bloch sphere, you’ll have trouble So, if you’re searching for one qubit, that one will stick understanding what the gates do. Learn more about it at : out like a sore thumb in one operation. Note that one http://eecs.ceas.uc.edu/~cahaymm/blochsphere. operation is made up of many shots of the same gates. There are many more simulators – most of them are the results of This is one of the reasons why quantum computers are Ph.D. thesis work. For that reason, most of them are not active, only faster than a conventional one. good starts. The few mentioned here are useful for self-education. The most common scenario is to find the special The JQuantum simulator looks and behaves like a quantum score. number of many, such as a database search. The other Using it is a little cumbersome, but if you’re practising this while most cited case is for breaking encryption. Using reading a textbook then it becomes usable and clear. It also supports Shor’s algorithm, you measure the solution by the your own functions. action of the gates. The gates run the input a fixed This is very useful when you follow a course and you want to test it number of times before finding the answer. That out on your own. The only other way to achieve that is to use your IDE number doesn’t change when the input is a higher and write a quantum program yourself. If you have Python experience, number. A classical computer forces you to test all this is doable, but be warned – the simulation won’t look pretty! possible answers. This means that when the number reaches 2048 you are facing a potential million years

46 LXF237 June 2018 www.linuxformat.com Quantum Computing IN-DEPTH

to solve it. More numbers mean an exponential workload increase. Note the difference is that the effort to solve the problem does not increase in a quantum computer. Let’s have a Bloch party Once you know how many states and transitions you have in each qubit, it’s time to code. Not so fast though – there’s a visual way to describe the gates. The Bloch sphere is the basis for all gates. The graph looks like a music score, so it’s called a quantum score. It looks a bit different depending on the platform but in general, the strings across are qubits. When you want to change the state of a qubit you place a gate on the string. To create entanglement between two qubits you drop the gate on one string and connect it to the other. Here, we’re employing Eclipse to develop our own quantum computing programs. Note that this To describe the quantum state of a particle, you use particular tool-kit is using Python as the supporting . spin, like a spinning ball. More precisely, the angle the “ball” spins. Even though there are no balls that spin in the classical sense, the mathematics describe it well. TAKEACHANCEONME When the equipment measures an electron, it’ll be in spin up or spin down in one axis. The system can only “In contrast, quantum computing measure in one dimension at a time. The three are x, y and z. So, if you measure x, you lose all information involves all answers have a probability about the spin state on the z- and y-axis. When you describe the quantum state, you use an attached to them. No answer is certain imaginary arrow in the Bloch sphere. The top of the sphere represents the qubits logical 0 – rather, it’s probabilistic” and the bottom is logical 1. These are the only two states that the system can measure with 100 per cent use several classical languages. The programming tools certainty. To get a result in a quantum computer you for Python, for example, are available from IBM. Note make many “shots” and get the most probable answer. that the routines prepare scripts for the quantum A matrix contains the coordinates that show the computer – it doesn’t run Python on it. arrows angle. The length of the arrow is always 1. The So get cracking. You won’t create much at first, but values we use to calculate the probability describe the you will have a lot of fun – we guarantee it! components of the axes for the arrow. The Bloch sphere rules the gates and their naming, so keep that in mind when you try to understand. TOOLKITS FROM THE BIG GUYS The available gates depend on the application, and type of quantum computer. But the following are the To program yourself requires the standard called OpenQASM. This is common ones. The Pauli X Gate rotates the state the basis for all development kits. around the x-axis changing the value of Z. This gate is Many groups have developed toolkits using this standard. The best also a bit-flip gate. The Pauli Y GATE rotates around the known ones are from IBM, D-Wave and Microsoft. y-axis, changing both the x value and the z value. This IBM decided to use Python to create Qiskit, and you can download gate is both a bit-flip and a phase-flip gate. this kit from Github. It also has many sources and demonstration So far, the gates only flip the bits and phases. These collections available. You can learn all about the current development don’t deal with superposition or entanglement. The state from there. Hadamard gate puts the qubit in a superposition. To In both Eclipse and Netbeans, all you need to do is import the code make that clear, the qubit will have a 50 percent chance into a project and explore. Don’t forget to install Python 3.5 or higher of being 0 or 1, flipping between X and Z. before you try to compile. IBM’s QE has these examples in their It will act like a dice, only using two in a row will Python toolkit. always give the starting value. More gates that extend When you have the sources installed, you can only run simulations the Hadamard gate are S and its transformed conjugate. on your own computer. If you want to run on a real quantum To use entanglement you use a CNOT gate, usually computer, get an account on the IBM Q Experience. The setup is depicted with a plus sign in a circle and a line down to simple: all you need to do is open an account and get your API token another qubit. The gate flips the target qubit when the from your account. Then copy it into the Qconfig.py file of the project control is 1. you’re working on. There’s a credit system for using the real machines, Those are the basic gates that you’ll encounter as so simulate until you’re certain you’ve got it right. If you’re really clever you start out. On the IBM Q Experience, you have the you may be able to gain expertise level. In that case, you can obtain opportunity to also create subroutines. A better idea, more units to run experiments. though, is to use a development kit. There are many kits If you’re using Visual Studio then you can download the Qvis file available, and you can extend your IDE with them. and add the extension. You still need Python support, though. Eclipse, Netbeans and Visual Studio have modules. They

www.techradar.com/pro/linux June 2018 LXF237 47 ON SALE NOW!

Available at WHSmith, myfavouritemagazines.co.uk or simply search for ‘T3’ in your device’s App Store SUBSCRIBE TODAY AND SAVE! www.myfavouritemagazines.co.uk/T3 Pi USER

Paul Beech is the co-founder of See what crops up Pimoroni, which designs and sells products for makers, educators in Raspberry Fields and creatives. SPREADING Join the Raspberry Pi Foundation and other makers THE WORD for a celebration of making and learning.

It’s a weird joy when someone unning over the weekend of the still need to book, mind) and £5 to any says “Raspberry Pi? Never heard 30 June, Raspberry Fields is a new humans older than this, it’s sure to be a hit of it”. You get to show them R annual event organised by the with the community! what’s possible, what people are Raspberry Pi Foundation at Cambridge It’s being described as a chance for people doing, all the projects, the joy. It’s Junction. With tickets free to under 16 (you’ll of all ages to have a go at getting creative with rare to find someone who can’t technology, and celebrate all that the UK’s suddenly see a way it can make a makers have already achieved and learnt, positive difference. through the many Code Clubs, CoderDojos, From simple servers, old-skool Raspberry Jams or just tinkering at home. arcade machines and media There’ll be chances to learn about the many centres to providing education maker projects being worked on around the and science where it’s needed country, get hands-on with activities, most, but hasn’t been delivered participate in science and technology talks before because it was too hard or and enjoy musical performances. Add a dash too expensive. of free food, face painting, fun performances But hey, not everyone learns and more there’s something for all ages! the way you do, or may like the Find out more and get tickets at way you do things. That’s okay, www.raspberrypi.org/raspberry-fields. because somewhere in the fluffy clouds of the Raspberry Pi Raspberry Pi Foundation We’re not sure community are 10 people doing there’s that

things 10 different ways, just CREDIT: much of a field. itching to tell people all about the things they can make and how to do it. Behind the enthusiasm, behind the caring and sharing, is Box museum Mmmm, JAM a steely-eyed resolve that this is how geekiness should be, and Build a mini museum. Get your fill of maker fun. we don’t want the insular, dismissive knowledge-sharing ringing the wonders of museums to 9 May that we grew up with. children who can’t experience their Cotswold JAM ...... Waterworth Building, It’s a testament to Pi that B collections, Museum in a Box uses Cheltenham Googling “Raspberry Pi + 3D-printed models and figures, combined with 20 May Something” usually gets you a NFC markers and a Pi-powered box, to bring Marlborough Jamming...... Town Hall good result (Try “Cat Flap” or alive collections that otherwise might never be 21 May “Vegetation Monitoring”), and seen. This is a fabulous example of how the Pi York JAM ...... Acomb Explore Library that people are still growing, can enrich lives. You can learn more about the 4 June enthusing and sharing anew six project at www.museuminabox.org. Preston JAM ...Media Innovation Studio 4th flr years on, from under the ground 6 June (Google “Raspberry Pi SoilCam”) Open the box! Leeds JAM ...... Swallow Hill College up to Earth’s Orbit (Search for Ooh, it’s a head. For more JAMs near you check out “Astro Pi”). www.raspberrypi.org/jam/calendar. Maybe the next six years will see a flurry of Raspberry Pi on their way to do science around another planet? It’s about time we had a decent space programme that everyone can join in with. Look out for this logo!

www.techradar.com/pro/linux June 2018 LXF237 49 REVIEWS x86 emulator ExaGear Desktop In his eternal quest for more Pi power, Les Pounder would give an ARM and maybe a leg to run x86 code on his Raspberry Pi.

he x86 CPU is in our IN BRIEF laptops, desktops and in our A virtual T data centres. But for mobile machine devices and the Raspberry Pi, ARM emulator that CPUs dominate the market thanks to offers the ability their power consumption and to run x86 relevant size to processing power. 32-bit code on Applications are compiled to use the ARM CPUs such architecture (ARM/x86) of the device as those found they’re intended to be used on, but in the Pi. It what if you need to use an x86 works with application on an ARM CPU? ExaGear Running x86 applications (Linux and native Linux Desktop from Eltechs is a virtual Windows) on your Pi is made possible thanks to ExaGear Desktop. applications as machine emulator that claims to run well as via “...any kind of software on almost any for Windows hardware” and it does run x86 compatibility, software on the ARM CPU, albeit with some limitations. IDE/text editor for Windows and that ran fairly well, only and provides a Installation is painless, requiring a payment of around stuttering on a few occasions. Zint Barcode Studio worked basic tool that £21 for a single Raspberry Pi 3 licence. Once the payment exceptionally well and in minutes we were producing meets the needs has gone through you’ll be emailed a link to download barcodes. Then we tested Google Sketchup 2016, quite a of those that your copy of the software, and a licence key file. beast of an application that devoured over half of the RAM have to use a on our Pim and took up most of the CPU cycles. Sketchup certain program Up and running worked but it was by no means fluid, often locking up for a with the To run ExaGear Desktop we simply click the icon on the few seconds between activities. It was usable, in a pinch. Raspberry Pi. Raspbian desktop. This opens a special terminal which is We tried to run a few early 2000s games with ExaGear used to execute 32-bit x86 Linux applications. In here we Desktop and a typical Wine setup, but were thwarted in can execute and install x86 applications and native Linux every attempt, so no early 21st century classic gaming apps. For example, Sublime Text 3 work pretty well, session today. We were able to play Alien Trilogy (1996), although they do take a few moments to load, even with but it ran more like a slideshow than a Doom clone. the most powerful Pi. We tried the latest version of Firefox So why bother with ExaGear Desktop? Well, if you have Quantum (32-bit x86) and while it showed promise, it a legacy 32-bit x86 Linux application that can’t be ported then failed to load citing an issue with libgtk3, which even to ARM then this is a handy solution. But the limitation of after installation failed to remedy the problem. ExaGear is that it’s suited to smaller applications, ExaGear Desktop also works with the Wine especially in the case of Windows. Sure, you could load compatibility layer that enables Windows applications to Photoshop from 2005 with this, but it wouldn’t be much be run under Linux. So with that in mind we installed the fun. The ExaGear Desktop forums offer support and Wine libraries and then downloaded a few applications solutions to common problems, and with their help you from www.portableapps.com. Notepad++ is a popular can tweak it to meet your needs. Take advantage of the free trial and test out the applications that you wish to use, before parting with your cash.

VERDICT DEVELOPER: Eltechs ExaGear Desktop WEB: www.eltechs.com offers a free PRICE: £11 Pi 1/Zero, £16 Pi 2, £22 Pi 3 trial of the software and FEATURES 6/10 EASE OF USE 6/10 this is something that should be PERFORMANCE 6/10 VALUE 7/10 undertaken before parting with your This isn’t a perfect solution, but if you really need a piece of money. Check that software to work with Pi, ExaGear Desktop will do the job. your application is supported and runs as well as Rating 6/10 you need it!

50 LXF237 June 2018 www.linuxformat.com Programming package REVIEWS Getting You Started Kit Clumsy fingers and electronic duncery be damned: Alex Cox tests Maker Life’s painless plug-and-play Pi programming package for the rest of us.

he Raspberry Pi is the IN BRIEF perfect platform for Yes, electronics buffs, we are well aware T that this particular setup would (mostly) A complete hardware experimentation. not work. It’s not plugged in, for a start. starter Pi starter That’s sort of the point. But how kit including a Pi many of those ubiquitous mini W v1.1 with boards are being run with absolutely soldered header, nothing done with their headers? a collection of We’d wager it’s the vast majority – LEDs, resistors, and, as Maker Life’s most basic kit so two push ably shows, it’s not actually that buttons, a mini- tricky to drive outputs and read breadboard, inputs, either from a hardware or 16GB pre- code standpoint. installed The Getting You Started Kit comes microSD card, with literally everything you might USB hub and need to, well, get started with the HDMI cable business of driving electronics. with adaptor. There’s a Raspberry Pi Zero W, a Noobs-loaded MicroSD card, all the cables and adapters required to get it powered and components isn’t always clearly explained, forcing you to hooked up to a monitor and peripherals, and a small rely on cartoonish illustrations and a single, jargon-laden selection of components. diagram of the Pi’s GPIO pins to get things all lined up. Small is the operative word here. This isn’t a kit that’s Some additional explanation of what the individual pins about making grand projects. It’s more one that leans are actually for might have added a little longevity to the towards the possibilities, and towards revealing the kit, as would some suggestion of ways to take the simplicity of the code that’s required. In terms of your projects themselves further. As it is, once you’ve finished experimental hardware, you’re given a small breadboard, the third project, the manual abruptly ends, leaving the a handful of 220 ohm resistors, a few LEDs, and a couple rest up to you. of push buttons, along with a pre-soldered pin header on Let’s give the kit its due, though. There’s nothing more the Pi Zero W and a 10-strand female to male pin inspirational than seeing that little LED lighting up for the connector ribbon. That latter package takes a lot of the first time, knowing that you made it happen. That’s the pain out of taking your first steps, perhaps literally if first step on a long road. And if the manual had gone you’re not adept at holding a soldering iron, and means tediously in-depth about the next steps, perhaps kids you’re free to fiddle with what you’re given if you wish. wouldn’t be inspired to get reading and learn more, or play with those variables and see what changes. Read along This kit is compelling enough to make you want more, Any package like this lives and dies on the strength of its to not simply finish with a shrug, and that’s perfect. Maker manual, and Makerlife has done a sterling job at Life’s package is an easy, hand-holding entry into the presenting three projects – versions of a traffic light, a world of hardware control. push-button flashing LED, and a pelican crossing – and done so in a way that makes sense. As the manual goes through the code breakdown, all in Python, it’s clear about VERDICT what you’re doing and why. DEVELOPER: Maker Life While it’s easy enough to plough through the projects WEB: www.makerlife.co.uk just typing in the code – we’d wager an adult could make PRICE: £50 it through the whole lot in an hour, with enough dexterity – the parts between the code, as repetitive as they may FEATURES 8/10 EASE OF USE 9/10 be, are well worded and make this kit fully approachable PERFORMANCE 8/10 VALUE 8/10 by kids. It’s not just about syntax and libraries, either: the Getting You Started Kit really does go from the very A great beginner kit for kids and adults alike, with easy-to- basics, introducing a bunch of core coding concepts as it follow instructions (for the most part) and a neat collection goes, and the use of Python means that it’s fundamentally of components to play with. easy to understand. That said, outside of the step-by-step portion, it’s not Rating 8/10 entirely perfect. The actual wiring of the electronics

www.techradar.com/pro/linux June 2018 LXF237 51 TUTORIALS Process serial data

ARDUINO Team up an Arduino with the Raspberry Pi Les Pounder shows us that the Raspberry Pi and Arduino can be best friends and work together on a project that involves serial data.

he Arduino and Raspberry Pi are fantastic machines, and here we’ll be using an Arduino T to read a TMP36 temperature sensor. We’ll send the data via a USB serial connection to a Raspberry Pi running Python code that will read and OUR interpret the data, then act upon it. This project will show that the two machines can co-exist, and that the EXPERT Arduino can be used to augment the features of a Pi. Les Pounder is a freelance Setting up the Arduino maker who works To install the Arduino IDE go to www.arduino.cc/en/ with organisations Main/Software and select the version for Linux ARM. such as the Download the software and then extract the archive to Raspberry Pi your home directory (/home/pi/) Next, open a This code can be used to read serial data from any serial device Foundation to Terminal window. There should now be a directory connected to the Pi. promote maker called arduino-1.8.5 in your home directory. In the skills.You can Terminal change directory so that we’re inside the application will load and present a template for our find his blog at Arduino directory. code. Delete the template (press Ctrl+A and then the www.bigl.es. $ cd arduino-1.8.5 Delete key) to start fresh. On an Arduino we write the There should be a file called install.sh in the code in the application, compile it and then write the directory, which will install the Arduino IDE on to the Pi. code to the Arduino. This is called flashing. To run the file type the following: Our first line of code creates a variable. This is a data $ sudo ./install.sh storage object that enables us to reference an object by YOU NEED After a few moments the install will be completed. a name and show the contents of the object. In this case The next step is to enable the Pi to access the Arduino we create a variable called sensorPin, which is really the An Arduino device and send code to it, by adding the user Pi to the connection of our TMP36 Vout to the A0 pin of the Uno or group dialout using the usermod command: Arduino. We have to tell the Arduino what data type the compatible $ sudo usermod -a -G dialout pi variable will contain. In this case it’s an integer value, 0. Any model of Finally, reboot the Raspberry Pi. int sensorPin = 0; Raspberry Pi Next, we create a section of code that will be used to with the latest Building the hardware set up the Arduino for the task. This code is run once at Raspbian OS The TMP36 sensor only has three pins, and when the start. Here we tell the Arduino that we wish to use a A TMP36 looking at it face-on (the flat side) they go Vcc, Vout and Serial connection at a speed of 9600 baud. sensor GND. The TMP36 can work with voltages between 2.7V void setup() breadboard and 5.5V, so the 5V supply on our Arduino will provide { Three male- the power to the TMP36, while the GND pin connects to Serial.begin(9600); to-male GND on the Arduino. Lastly, the Vout pin (centre) } jumper wires connects to A0 on the Arduino. For more details For the Arduino to continually run the following code, All of the download the diagram for this project. Using the male- we need to place it inside a loop. In the following step we code and a to-male jumper wires, make these connections and then create another variable that will read the raw data from diagram can connect the Arduino to your Raspberry Pi’s USB port. the analog pin A) and then save it as an integer inside be downloaded the rawdata variable: from http:// Writing the Arduino code void loop() bit.ly/LXF237- To open the Arduino IDE, go to the main menu, click { serial-project Programming>Arduino and after a few seconds the int rawdata = analogRead(sensorPin);

52 LXF237 June 2018 www.linuxformat.com Process serial data TUTORIALS

We’re still inside the loop, and now we need to use a These boards have little maths to convert the raw data into a new variable a serial interface in called voltage that will contain a floating point value. common, so they can all be used in Voltage is our raw data multiplied by 5.0 (the voltage we this project. provided the TMP36; change this to 3.3V if using a 3.3V Arduino) We then use a compound operator to divide the value stored in the voltage variable by 1,024 for the 10-bit analog used in the Arduino. float voltage = rawdata * 5.0; voltage /= 1024.0; A new variable called temperatureC is used to store the output of the equation that will first take 0.5 from the voltage variable before multiplying it by 100, giving us the temperature in Celsius: float temperatureC = (voltage - 0.5) * 100 ; In the last section of code we print the temperature data to the serial console, as well as print the unit of measurement. A delay of one second helps to stop the code becoming cluttered: data = str(data) Serial.print(temperatureC); Serial.println(” degrees data = data[2:7] C”); data = float(data) If you can’t find delay(1000); print(data) your Arduino } In the last section we create a test that will check the as a connected Save the code! Then go to Tools>Board and check value stored inside the data variable against a hard- device, use that your Arduino matches, in this case Arduino/ coded value, in this case 21°C. if the temperature is the dmesg Genuino Uno. Then go to Tools>Port and check that above 21°C then it will print “It is warm”, and if it’s less command to ttyUSB0 is selected. Now click Sketch>Upload to flash then it prints “It is cold”. check what’s happening the Arduino. It should take around one minute. Once if data > 21: behind the done we can move on to the Python code. print(“It is warm”) scenes on the else: Pi. It will show The Python code print(“It is cold”) where devices Open the Python 3 editor, found in the Programming Save the code and then click Run>Run Module (F5) are connected, menu. Click File>New and then save the new file as to run the code. We should now see the temperature and any errors Serial-Data.py. Keep saving often to avoid data loss. data pop up in the Python shell, and the relevant they may have. We start the code by importing two libraries of code. message depending on how warm or cold it is. These are serial, used for serial communications, and So now we’ve learned how to connect an Arduino time, which is used to pace the speed of the project. to a Raspberry Pi, and pull data from the serial port import serial, time using Python. Good work! Next we create two variables – port and baud – that are used to contain the location of the serial port and the speed at which we connect: SERIAL,THEBASISOFAGOODHACK port = “/dev/ttyUSB0” baud = 9600 Serial is one of the most basic forms of communication, so it isn’t Our main loop will constantly check the serial port surprising that other devices also have serial ports. The BBC micro:bit for data at the speed we’ve specified: has a serial interface, and to use the interface with Micropython on while True: the micro:bit, all we need to do is print data to the Python shell, which s = serial.Serial(port) will then output the data to serial – no need for any fancy commands: s.baudrate = baud from microbit import * We then ensure that the data sent is correct and free while True: of errors by checking its parity: print(“LXF ROOLZ OK”) s.parity = serial.PARITY_NONE sleep(1000) s.databits = serial.EIGHTBITS Then we just need to edit the port name and baud speed: s.stopbits = serial.STOPBITS_ONE port = “/dev/ttyACM0” We now read the serial data and pause for a second: baud 115200 data = s.readline() While inside the loop we still need to set the serial port and baud time.sleep(1) speed, then the parity and other error-checking options. We then read The next four lines are used to convert the data the serial data to the variable “data”, then print the variable to the received into a string, then we slice the data that we shell, confirming that our micro:bit is communicating over serial to require from the string. Counting from zero we locate the attached Pi. We’ll put some example code in the download for this the start of the temperature data, and the end. We project to illustrate this. We covered this in more detail in LXF209, then convert the data back to a float before printing where we used a micro:bit as a gesture controller for Minecraft. the data to the shell.

GET YOUR Pi FILLING HERE Subscribe now at http://bit.ly/LinuxFormat

www.techradar.com/pro/linux June 2018 LXF237 53 TUTORIALS Hatari

HATARI Emulate the Atari ST on your Raspberry Pi Nick Peers pulls on a pair of baggy jeans and stripy top, and travels back in time to reveal how to transform your Pi into a fully fledged Atari machine.

ou’ll almost certainly remember the late 80s thankfully the hard work of obtaining any version of TOS when the eight-bit computing revolution has been done for you. Y gradually gave way to the rise of 16-bit Before proceeding, a quick note about legalities: machines. Atari and Commodore stood at the forefront when running emulator software, it’s assumed in most of this revolution, with the Amiga eventually winning out. cases that you own the original computer as well as any OUR But for a while during the late 80s and early 90s, the software you play on it. From a legal standpoint, you Atari ST ran it close. And thanks to the brilliant Hatari should really honour this, but practically speaking EXPERT (http://hatari.tuxfamily.org), you can now resurrect there’s nothing but your conscience preventing you Nick Peers the ST (and its successors) on your Raspberry Pi. from running whatever you like, even if it’s no longer sees his career buried away in your loft somewhere. come full circle First steps Let’s begin by obtaining TOS for Hatari. Open your with this article. You’ll need a desktop environment to run Hatari – we’re web browser and head to www.atariworld.org/tos-rom He started his using Raspbian PIXEL. The latest version of Hatari uses where you’ll find every single version of TOS from the writing career SDL2 to render graphics, so you’ll need to enable the original 1.0 release up to TOS 4.92 for the Atari Falcon. as disk editor OpenGL driver, noting that it’s still experimental and Which one do you need? It depends on what you’re on ST Format may be slightly unstable. It also means Hatari requires a planning to emulate. The original STFM model, which magazine back in Pi 2 or better to run optimally. covers most bases, runs best on TOS 1.4, but you may 1994. It would be To enable the driver, open a Terminal window, type want to download TOS 1.02 for some older games. like coming sudo raspi-config and hit Enter. Select Advanced Those emulating the STE want TOS 1.62, while TOS 2.06 home, if only he Options>GL Driver>GL (Full KMS) OpenGL desktop (both STFM and STE) is a good choice when copying could remember drive with full KMS. Reboot when prompted. lots of files via the ST’s GEM desktop. that far back. From here, installation is simple: open A word to the wise – the TOS 2.06 ROM file has the Pi>Preferences>Add/Remove Software, type ‘hatari’ wrong permissions assigned to it – you need to right- into the Search box and you’ll see one hit: tick this and click the IMG file after extracting it and choose click OK to install it. Once installed, open the Pi>Games Properties>Permissions. Make sure View content is set menu – you’ll see two entries: Hatari and Hatari UI. to Anyone and Change Content is set to Only owner Choose the former option, where you’ll immediately before clicking OK and copying the file across. come across a message about not being able to load If you’re determined to stay the right side of the law a TOS file. and have no Atari gathering dust in the attic, try TOS is the Atari’s operating system, and comes in a EmuTOS instead (http://emutos.sourceforge.net/en). range of revisions and versions depending on which It’s is a free version of TOS that can run on physical 16-bit Atari machine you’re trying to emulate. computers via floppy disk as well as your new Hatari Technically, you should supply this yourself, but emulator, but note it’ll be hit and miss what games and software you’ll be able to run on it. When it comes to downloading each version, choose COMPATIBILITY the English UK link. A zip file will be saved to your 2/3 Downloads folder, ready for use shortly. You now have all ONLY the elements that you need to start configuring Hatari itself. The walkthrough (page 57) reveals the key steps you need to follow.

The Atari STE was Download floppy disk images capable of better As things stand, your Hatari setup is now a fully graphics as this game – Stardust – functional Atari machine – the only thing missing is clearly shows. software. Most games come on floppy disks, and once

54 LXF237 June 2018 www.linuxformat.com Hatari TUTORIALS

again the painstaking process of converting ST floppy You can connect disks into image files recognisable by your Pi has been a real game done by others. All you need to do is locate and controller to Hatari, or use keyboard download these images, which come in MSA, ST or emulation to play STX format. games that require There are a wide range of sites offering images – a joystick. Google “Atari ST ROMs” for a long list. If you can cope with the fact it’s French (Chromium will offer to translate the pages for you), then we like www.planetemu.net/ roms/atari-st-games-st in particular. Here you’ll find some games are listed several times based on who’s submitted the images – try one and then download another if it doesn’t work. As with ROMs, floppy disk images are downloaded in zip format, so you’ll need to extract them first, where you’ll be presented with files in .ST or .STX format (thoughtfully associated with Hatari, so you’ll see a nice four ports can be configured – two regular ST joysticks floppy ST icon to help identify them). These can be plus two additional STE-only joypads. stored anywhere on your hard drive, but we recommend When it comes to using a real joystick, any game By default, your setting up a dedicated folder – say atarist – inside your controller that’s plugged in and recognised by your Pi Atari machine home folder for easy access. should be immediately visible – our wired PC/PS3 emulates a Gioteck controller was detected instantly, for example. colour RGB Play ST games As you’ll have seen when defining keys to simulate a monitor, which There are two ways to load floppy disks into Hatari. The joystick, ST joysticks were basic and only supported enables you to simplest thing to do is simply browse to the folder four directions of movement and one fire button – use switch between low and medium containing your disks and double-click the .ST or .STX the analogue stick and the top fire button to emulate resolutions. the joystick, while the secondary fire button emulates file. Hatari will launch using the configuration you’ve To run high- saved under hatari.cfg and then – after a pause that the space bar key. resolution can be quite lengthy – the familiar green ST desktop will programs such appear or the game will automatically load. Double-click Create your own blank floppies as DTP software, the A drive icon if necessary, followed by the game file to If you’re trying software that appeared on magazine press F12 and start loading it. covermount disks – yes, we’re talking ST Format – then click Atari If you plan to play a game that comes on two floppy chances are they were compressed to enable more screen, then disks, it’s easier to start things off inside Hatari itself: content to be placed on the disk. You’ll need to extract select . press F12 to bring up the configuration screen and click these to a separate “disk” – we’ll cover hard drives in a Floppy disks. Click Browse next to Drive A to load disk moment, but if you simply want to run them from their one into drive A, then repeat with Drive B for disk two. own virtual floppy image, click Create blank image on the Leave Auto insert B selected, then click Return to main menu followed by OK. Keep an eye on the status bar at the bottom of the SOLVE COMPATIBILITY ISSUES screen, which should hopefully indicate the floppy disk is still loading. It can be a slow process, but check out It all sounds so simple, and if you’re lucky you’ll get to play a number the Quick Tip (page 56) for some possible tweaks to try. of games before coming across one that doesn’t appear to work. Start Once done, the game’s main screen should appear and by visiting http://bit.ly/hatari-compat for a non-exhaustive list of ST it’s then a case of navigating it with your mouse, programs that are known to cause problems. Failing that, check the keyboard or – if you’ve got one plugged in and website you downloaded the disk from to see if there’s any specific configured – game controller. configuration you should use. If you’re running an older game, try To set up the latter, press F12 and click Joysticks. switching to ST mode with TOS 1.02 for compatibility purposes. From here you can select whether to disable the port, Avoid allocating more than 2MB of RAM to your virtual ST, because use a “real” joystick or define the keys used to simulate timing issues can cause problems, too. 1MB should be ample for most the joystick, namely up, down, left, right and fire. Up to games. Some games may require a NTSC (US English) TOS rather than the default PAL (UK English) TOS you’ve downloaded – simply swap them out and see if you’re now lucky. Some games and demos are very particular about floppy emulation – press F12, click Floppy Disks and untick Fast floppy access to see if they’re now able to load successfully. Other settings to tweak include unticking Boot Faster and Patch Timer-D under System. If there’s screen corruption, also try different Video timing settings. Switching settings manually can be fiddly, but Hatari makes it possible to save multiple configuration files by changing the name of the .cfg file, enabling you to set up multiple setups (say STFM, STE and Falcon) and switch between them. Hatari will always load the hatari.cfg file by default on startup, but you can quickly switch by You can press F12 at any time to pause Hatari and access its pressing F12 followed by Load config to choose another. comprehensive configuration options.

www.techradar.com/pro/linux June 2018 LXF237 55 TUTORIALS Hatari

Floppy Disks configuration screen. Leave the default wider range of titles, including demos, magazine cover settings – 80 tracks, nine sectors and two sides – as disks, public domain releases and applications. One way to they are, give your floppy a label and click Create. As the number of titles grows, you may get tired of speed up load Next, choose where to save the floppy – your default having to press F12 to swap floppy disks around. Use times is to tick folder is best – and again name it for the game you plan the AltGr+D to swap disks, followed by AltGr+R to Fast floppy to copy to it. Click OK, then Back followed by Drive B: to perform a warm reset or AltGr+C for a cold reset. access under insert it into drive B. You can now either copy the Alternatively, why not connect a virtual hard disk to your Floppy disks compressed file across before double-clicking it to ST – the box reveals the simplest way to add a single 80 in Harari’s unpack the game or use the covermount’s own program MB ACSI hard disk. You can duplicate this blank image configuration. to extract the files to the new disk. Be warned, it’s a slow file to create multiple hard disks, but you can only Another is to switch to Fast process, and you may end up having flashbacks, or connect one at a time. Forward mode perhaps that’s just this magazine’s former disk editor Another option is GEMDOS, which enables you to – press AltGr + X talking. Speaking of which, visit www.exxoshost.co.uk/ mount a folder on your Pi’s storage as a virtual drive, to speed things atari/STF for a complete listing and download links for making it easier to copy files directly to the drive from up slightly. STF’s disks. your Pi storage. Note, however, that you’ll either need a Press it again dedicated hard disk driver or access the drive using to return to Beyond the basics EmuTOS, which supports GEMDOS natively. normal speed. As things stand, you now have a fully working Atari If you find yourself getting into an old game or two, machine, running at decent speed. If all you’re you may want to know how to save your progress. If the interested in is reliving some past glories, you should game itself has a save option, you could always create a have everything you need to play games on your Atari. blank floppy image as outlined earlier and insert it into But you can push the envelope further, too. drive B. Alternatively, you could use Hatari’s own First, look beyond the ST as a mere gaming machine memory snapshots feature, which are obviously quicker. – it was also renowned as a music-making tool and as Start by pressing F12 and selecting Memory. Click the games market waned, major applications continued Save, type a suitably descriptive filename (with the all- to be developed, from video editing and word important .sav extension) and click OK. Return to your processing to desktop publishing. Visit www.planetemu. game, pressing AltGr+K at any time to update the saved net/machine/atari-st where you’ll have access to a file with your latest progress, or AltGr+l to reload your last saved state. You can also snap screenshots at any point – press AltGr+G to take a screen grab in PNG format. Press AltGr+A to record an AVI movie (you’ll see the Rec button turn red in the Hatari status bar), and press it again to stop recording. Finally, press AltGr+Y to start and stop recording your ST’s sound. All recorded material can be found in your home folder. MIDI for musicians Your virtual Atari The ST was a big draw from musicians with its built-in ST can emulate the MIDI ports and was used by major artists including the old high-resolution likes of Queen for The Miracle. If you have a USB-to- mono display, too – two monitors for MIDI cable then you can hook up a MIDI keyboard to use the price of one! with the likes of Cubase. First, you need to verify your cable has been detected by Raspbian. Open a Terminal window and CREATE A VIRTUAL HARD DRIVE type the following: $ lsusb Floppy disks are slow. Attach a virtual hard drive and loading times are You should see your MIDI adaptor listed. Now type quicker and you can switch between programs without having to the following, which should verify at least one MIDI port swap out disks. Hatari supports three type of emulated hard drives: is available. ACSI, IDE and GEMDOS. Of these, ACSI is the most compatible option $ aplaymidi -l and works with all versions of TOS from 1.02 up. ACSI emulated drives exist physically as an IMG file and can be fiddly to set up, plus they require drivers placed on the virtual hard disk to work correctly. Thankfully, Hatari provides you with an empty 80MB hard drive image, which you can download from https:// hatari.tuxfamily.org/hd80mb.image.gz. Extract the hd80mb.image file to a suitable folder, then open Hatari’s configuration, select Hard disks and click Browse next to ACSI HD image to select the file. Reboot your ST and you’ll see a new drive C appear, which you can copy files to. Note that many commercial games will refuse to run from hard disk. For those that do (such as Civilization), just keep your games in separate folders and make sure you save your configuration, so the hard disk is always accessible whenever you start your virtual ST. Armed with the right knowledge you can set up MIDI emulation on your Atari ST – either with proper hardware or virtual software.

56 LXF237 June 2018 www.linuxformat.com Hatari TUTORIALS

If they’re available, open Hatari and press F12, then Make a note of the client numbers and then type click Devices. Click the two Browse buttons under the following: Enable MIDI emulation and point them to whichever $ aconnect Click Hatari midi entry appears under /dev/snd. Tick Enable MIDI Substitute with the client number of VMPK screen and tick emulation and restart your virtual ST. Output and with the client number of the Fullscreen to run If you don’t have a MIDI device, try a software MIDI first Virtual Raw MIDI port. Now repeat the command, it full-screen synthesiser instead. First, install Virtual MIDI Piano this time substituting with the Virtual Raw by default or Keyboard (search Pi>Preferences>Add/Remove MIDI port, and with Synth input port – for press AltGr+F to Programs for ‘vmpk’). Next, launch QSynth from example, like this: switch between full screen Pi>Sound & Video followed by VMPK. In VMPK select $ aconnect 128 28 and windowed Edit>Connections, click the Output MIDI connection and $ aconnect 28 130 mode. Press choose FLUID Synth to connect the two. Hit the virtual Now open Hatari, press F12 and click Devices, then AltGr+M to keys and you should hear sound to verify that it’s point it towards the correct connection. Tick Enable capture the working correctly. MIDI emulation, and you should be able to use your mouse in Now open a Terminal window and type the following: virtual synthesiser to input music into sequencing windowed $ sudo modprobe snd-virmidi software like Cubase while listening back through mode. $ aconnect -i -o Qsynth. Job done!

CONFIGURE YOUR VIRTUAL ATARI ST

Copy TOS files Setsystemtype 1 Open File Manager. Double-click the downloaded TOS zip 2 Now open the Pi menu and select Games>Hatari. Click OK file to open it in Archive Manager, then drag the .img file into your at the Could not load TOS file screen. When the main menu Downloads folder. Once done, press F4 to open a Terminal appears, click System. By default, Hatari is configured to emulate window pointing to the Downloads folder and type the following theSTFM,butyoucanselectadifferentAtarimachinefromthe (substitute tos102uk.img with the image file): list.TickBootfasterbypatchingTOS&sysvarsregardlessof $ sudo cp tos102uk.img /usr/share/hatari whichmachineyouchoosetospeedloadingtimesslightly.

Select ROM and RAM Select floppy disk and save configuration 3 Return to the main menu and click ROM. Click Browse to 4 NowclickFloppydisksfollowedbyBrowsenexttoDefault select the TOS image you copied across in step one – make sure floppy images directory to select the folder you’ve stored your it matches the Atari machine you’re emulating. Click Back to main disk images in. Tick Fast floppy access to help speed up loading menu again, then click RAM. By default, 1MB is allocated, which times, but note that some disks may not work (in which case is sufficient for gaming – drop this to 512K for some older games untickingthismayhelp).ClickBacktomainmenufollowedby if they refuse to load. Save config to save your setup.

GETMOREFUNPROJECTS Subscribe and save at http://bit.ly/LinuxFormat

www.techradar.com/pro/linux June 2018 LXF237 57 TUTORIALS MOREUTILS Command-line gems A lesser-known collection of useful Unix tools to increase productivity on the terminal sounds like an exciting prospect, says Shashank Sharma.

ne of the reasons for the soaring popularity of Unix back in the day was its rock-solid O design philosophy, which comprises a set of rules that shaped how Unix and its myriad tools were developed. Among these principles is one that OUR continues to inspire budding developers: do one thing and do it well. EXPERT As stated, the idea was to create tools and utilities Shashank that provided a single useful functionality, but did it well. Sharma Many of the popular command-line tools used routinely is a trial lawyer in by Linux users are all descendants of the original tools Delhi and an avid written for Unix based on this design principle. Arch Linux user. Taking a cue from the simplicity and effectiveness of Each of the tools included in moreutils feature a dedicated man page, He’s always these original utilities, Joey Hess (https://joeyh.name) but not all are as detailed as the one for ifdata. on the look-out decided to create and collect a variety of such simple for geeky tools. You can find a complete list on the project’s You can find the moreutils package in the software memorabilia. website, and even nominate your favourite tools for repository of most Linux distributions. Run the sudo apt inclusion in the moreutils package. install moreutils command for installing it on Debian or Ubuntu and derivative distributions. The su -c ‘ install moreutils’ command can similarly be used to THE MORE IN MOREUTILS install it on Fedora. The most recent version of moreutils is 0.62; however, most distributions still carry version Here’s a quick introduction to some of the others moreutils packages 0.60 or older in their software repositories. If you want that make working with the shell fun: the latest release, you must grab the source from the project’s Git repository and compile it yourself. ts Use this tool to add a timestamp to the beginning of each line of Open a terminal and run the git clone git://git.joeyh. the stdout output. This can help you monitor how long it takes for a name/moreutils command. Next, install the xsltproc command to run, before passing control to the next command. You and the docbook-xsl packages using the software can even use the ts tool to timestamp the logs produced by a server. repositories. With that done, navigate into the moreutils directory created by the Git command and run the zrun Text editors are incapable of making sense of compressed files, make and make install commands. but zrun can decompress archives given to it on the fly and currently As of writing, moreutils comprises 15 different tools works with various formats including gzip, bzaip2 and xz. By default, across four different categories: zrun deletes the decompressed temporary file once you’re done. This means that all the changes you made in the editor will be lost, unless Category Tools you manually save the content to a new file. Working with pipesmispipe, pee, vipe, sponge

ifdata There are many tools that you can use to find out information Error handling errno, ifdata, isutf8, mispipe about network interfaces, the number of input/output packets and Editing text files combine, isutf8, ts, vidir so on. One of the most popular of these is ifconfig, but it often chronic, ifne, lckdo, parallel, produces data that’s unsuitable for most users, especially if you Launch programs zrun want to use it in a script. With ifdata, you can easily determine all this information and more. Refer to the man page for the many different command options that Thankfully, the simplicity of these programs is such can be invoked with ifdata. One of the most basic is the ifdata -p that you only need a little time with any of them to wlp4s0 command, which will display the configuration of the understand the purpose and function. As we don’t have specified interface. room enough to cover each of these tools in detail, we’ll take a look at several, starting with the editing tools.

58 LXF237 June 2018 www.linuxformat.com Terminal TUTORIALS

vidir $11}’ will print only three columns as specified in the This simple tool can be used for editing the names of awk command, but first, the entire output will be directories and filenames from the convenience of a opened in the configured editor, from where you can You can run text editor. If no directory is specified when invoking edit the output and then when you save the file and exit the echo the command, then the tool lists the contents of the the editor, the remaining output will be piped to awk. $EDITOR command current directory in the configured editor. The As with the other tools discussed above, vipe only to know the specified files or the contents of the directory are works with temporary files and doesn’t create any current default listed as a new tmp file. additional files for you to worry about. text editor. Since all vidir does is open the files and directories in The export a text editor, you must remember to hit Save and then sponge EDITOR=”/ exit the editor for the changes to effect. So, if you were Another useful tool that works with pipes is sponge, usr/bin/vi to delete a file from the list in the text editor, the which can be used to soak up the standard input and command can corresponding file will be automatically removed from write it out to the specified file. This is best understood be used to set you system when you save and exit the editor. with the help of an example. Assume you have a file vi as the As the tool merely presents the filenames in a text which contains five unsorted numbers between one and new default. editor, a lot of what you can do with vidir depends on 10. The steps involved in sorting this file, and saving the the configured default $EDITOR on your system. For content to the same file would be as follows: instance, you can do more with vi than with nano. $ sort numbers.txt 1 combine 2 You can use the combine utility to identify the common 5 elements between two files using several logical 7 operators such as NOT, AND, OR and XOR. 9 The command accepts two filenames, separated $ sort numbers.txt > sorted-numbers.txt by the logical operator you wish to use for comparison: $ mv sorted-numbers.txt numbers.txt combine file1 file2 . If you want to view only Here, the first command merely outputs the sorted the contents that common to both file1 and file2, you numbers. You must use two additional commands if you can do so with the combine file1 and file2 command. want to store the sorted numbers in the same file. Using the AND logical operator, the tool will only output However, with sponge the above can be achieved with a the common text in both the provided files. single command: sort file-numbers.txt | sponge file- You can similarly use the NOT operator to get the numbers.txt . content that’s in file1 but not in file2. The XOR operator Instead of creating temporary files, the sponge utility can be used to view the contents that are unique to takes all the standard input. You can even use the -a each file. switch with sponge if you want to append the standard One interesting use of combine is to use it to input to the file instead of overwriting it: $ sort file- compare the output of a verbose command such as numbers.txt | sponge -a file-numbers.txt . dmesg . The first time you run the command, pipe the We’ve only discussed a small handful of the 15 tools output into a file: dmesg > dmesg-output.txt . When you that currently comprise the moreutils package. The next run the same command, you can pipe the space restrains prevent us from discussing these tools command to combine and have it only list the changes in even more detail, but truthfully what you can achieve since the last time you ran the same command: with these tools is limited to your own use and creativity. $ dmesg > dmesg-output.txt Unlike many other command-line tools that have a $ dmesg | combine - not dmesg-output.txt mass appeal, the tools included in moreutils are Assuming you’ve plugged in a USB drive between intended for those who work extensively with the shell running the two commands, the second command will writing scripts and such. Even so, the usefulness and only produce the entries regarding the new USB device simplicity of these tools cannot be overstated. and nothing else. The use of – in the second command above tells combine to read stdin as the first file and dmesg-output.txt is the second file. vipe If you’ve spent any time at all working with the shell, you must have already used pipe (|) to use the stdout of a command as the default input of another. For instance, the command ps aux | grep firefox can be used to isolate the entry related to firefox from the entire output generated by ps aux command. With vipe, you can edit the output of the first The zrun diff command, before it’s pushed to the second command. archive.gz archives. gz command The syntax of the command is straightforward: can compare command1 | vipe | command2 . Continuing with the two compressed example we just used, ps aux | vipe | awk ‘{print $1, $2, archives.

ENHANCE YOUR TERMINAL-FU Subscribe now at http://bit.ly/LinuxFormat

www.techradar.com/pro/linux June 2018 LXF237 59 TUTORIALS CherryTree

PROJECT MANAGEMENT CherryTree: Keep your notes organised Bobby Moss is here to help your thoughts blossom into tasty ideas that you can garnish your projects with.

ll projects start with an idea. But before any of us can put our ideas into action, they need to A be fleshed out. What do we know? What do we need to research? What are the steps we need to take to make our idea happen? Let’s pause dramatically for a OUR moment to ponder these questions… Don’t worry, you haven’t just stumbled across a TED EXPERT talk we’ve transcribed onto these hallowed pages by Bobby Moss mistake. In this tutorial we’ll be covering note-taking develops applications, and while they may not be the most middleware APIs exciting tools in the world, you’ll find them useful if for a global IT you’re creating your latest YouTube masterpiece, consultancy and starting a new business, jotting down what you heard Developers are far from left out by CherryTree, where you can create its clients. In his during class or writing your magnum opus, for example. syntax highlighted notes for a wide variety of programming languages. spare time he Not only do note-taking apps keep useful information worksonfree in one place, they help you to structure your thoughts that node you can create more nodes, duplicate the software projects, into something you can put into action. They can also node you’re current editing or create sub-nodes. tinkers with old link to information on various websites you might want As you break down your idea you’ll often find that the hardware and to refer back to, and in a more useful way than your web top node provides an over arching summary, while the records quirky browser’s huge, unsorted list of old bookmarks. sub-nodes are smaller components written up in more Linux podcasts. We’ll be taking a closer look at CherryTree, an exciting detail. For example, a parent node for baking a cake new entry into the open source world that’s full of cool might contain a recipe with different ingredients, editing features. As you may have guessed from the quantities and cooking times. name, it also takes the novel approach of organising However, you’re not restricted to that way of your notes into a logical tree structure so you can break structuring your thoughts. For example, if you right-click If CherryTree complex ideas down into simpler component parts. Insert today’s node you could keep a time-stamped isn’t in your daily log of your progress for each project, and so long distro’s package Branching out as they’re created under the same node they’ll stay manager you Speaking of logical tree structures, the first thing you’ll grouped together. You can also colour-code different should be able to download an notice when you create your first node is the little cherry projects in the node properties to make them easier to installer and the next to it. Each “node” in this case is a branch in a tree reference later. original source with a little text snippet attached to it. If you right-click code tarball Ready for text from www. Once you’ve created your nodes you’ll notice as you giuspen.com/ select each of them that you’ll have a text file with the cherrytree. node’s name as its title in the bottom-right panel. They’re always rich text by default, but you can also select Plain text and Automatic syntax highlighting for CherryTree’s rich code projects. text editor can Disappointingly at the time of writing, the main handle tables, toolbar is exactly the same, regardless of which option embedded files you choose when you create your node. This means and check-lists, that if you click an option that only works for rich text making an already great note-taking nodes, the first indication you’ll get is an angry app better. message box telling you it isn’t supported. Fortunately,

60 LXF237 June 2018 www.linuxformat.com CherryTree TUTORIALS

CherryTree is still under active development, so the help you to quickly and easily locate and display notes interface may be a little more intuitive when you try this you need to see, rather than manually working your way out for yourself. through a large tree structure each time. The usual basic formatting options that you would From the Search menu you can choose to hunt expect in a word processor like LibreOffice Writer are all through the current node’s contents, your entire tree present and correct on the main toolbar. These enable structure or simply find a node with a particular name. you to create different levels of heading and change the In addition, by pressing Ctrl+F on any node you can do a fonts, highlight colours, alignment and formatting in regular expression search or whole word search within your notes. the current node, and you can also restrict this to just Additionally, you’ll notice that you can create three the text that is currently selected. different types of list from the toolbar using the three Finally, you’ll notice that there’s a breadcrumb view icons just to the right of the magnifying glass. While the that appears at the top of text editor panel. This helps editor is smart enough to pick up when you’re trying to you jump between recently edited nodes regardless of created bullet or numbered lists as you type them, this where they’re located in your tree structure, so you is where you’re most likely to create check-box lists of don’t have to keep searching for them each time. tasks you need to complete from. The next group of icons focuses on inserting external elements into your notes. If there’s a diagram or CHERRY KNOCKING spreadsheet you want to link to the current subject, you can insert an image or file using the appropriate icons. If you find CherryTree isn’t well-suited to your workflow, there are The hyperlink tool can also be used in conjunction to plenty of other great alternatives. One such example is the Zim page anchors to create detailed contents pages for desktop wiki, which provides a cleaner and more intuitive interface longer notes, or even to jump quickly between related but with slightly less functionality. Zim also saves your notes in a notes when you need to. folder structure rather than a single .ctb file, which makes it much Another tool that’s worth highlighting is the Table easier to publish your notes on a web server for other people to be insert tool. Clicking this icon in the toolbar opens up a able to view without needing extra software. Just like CherryTree, you window that enables you to define how big or small it should find Zim easy to install directly from your . will be, or import existing data from an external CSV Another great example is Turtl, which advertises itself as a free, into your note. This can be helpful when you need to fully open source, secure and private rival to the much-better-known track useful real-world items you’re collecting for a Evernote. Unlike CherryTree this application will sync your notes project or even the amount of money you’ve spent on across devices using a symmetric encryption key that only you have your idea so far. access to. Turtl also has client apps for Windows, Mac, Linux and Android for the service it hosts, with an iPhone app under active Notes in bulk development as we went to press. You can download the Turtl client So far we’ve looked at how to create and edit individual from https://turtlapp.com. notes that you’ve created manually, but what about SimpleNote is a similar project, although it originally started out as when you need to migrate data between different note- an iPhone app that has since grown into a service with working clients taking applications? across all the major desktop and mobile platforms. Annoyingly, You’ll be glad to hear that CherryTree is well-prepared there’s no RPM package, so Fedora and OpenSUSE users will need to for exactly this situation. From the import menu you can build from source or install the provided Debian package with alien. see a huge list of different note-taking applications you However, it’s still worth pulling down from https://simplenote.com to can import old data from. tinker with because of its minimalist-style interface, excellent search However, the importer is a dual-purpose tool that you tools and markdown support. can also use to bulk import new data into CherryTree instead of having to manually create nodes and type everything in from scratch. Simply select the Import folder of plain text files option. This will prompt you for the parent tree node you’d like to use as a starting point, and then generates a new tree structure based on how you’ve laid out your text files and subfolders. You can then manually prune and edit the tree however you like afterwards. Similarly you can import data from HTML websites if you use the Import folder with HTML files option instead, and the process for doing this is exactly the same. To extract your data from CherryTree for use with other programs there’s also a comprehensive Export menu that will output all your notes as a website, PDF document or folder structure full of plain text files, depending on your choices. Zim desktop wiki provides a cut-down alternative to CherryTree that’s very However, the most useful function within CherryTree straightforward to publish on shared drives and web servers. has to be its comprehensive search tools, which can

WE s TASK MANAGEMENT Subscribe now at http://bit.ly/LinuxFormat

www.techradar.com/pro/linux June 2018 LXF237 61 TUTORIALS WordPress

WORDPRESS Buildadevserver for testing purposes Will Meister uses the LEDE/OpenWRT framework, a cheap travel router and a little ingenuity to create a cheap-to-run development server.

ohn Lane’s groundbreaking article in LFX234 install and configure WordPress blogging software. showed just how far embedded Linux has When it comes to getting the most bang for your buck, J come over the past ten years. Thanks to the it doesn’t get much better – or louder – than this. ready availability of high-spec systems-on-chips (SoCs), we’re surrounded by hardware that’s capable of running Weapon of choice OUR our favourite OS. Which begs the question: why aren’t First, you need to choose a router. LEDE/OpenWrt’s more people hacking smart appliances? compatibility page lists nearly a thousand devices, many EXPERT One reason may be that most of us haven’t realised of them long out of production. We chose the GL.iNet Will Meister how much is possible. John’s intro showed how LEDE/ MT300A because it combines 128MB of onboard RAM built his first OpenWrt could enable new, creative applications for a and a half-decent MediaTek processor with low cost and website when home router. This article picks up where he left off, with a small footprint. It represents the minimum spec for Mosaic 0.9 was step-by-step instructions for repurposing a cheap travel our application. hot. He still thinks router as a development server. In addition, we’ll apply We’ll be installing loads of packages, so if you’re that HTML is the some key LEDE/OpenWrt concepts along the way. unfamiliar with PuTTY and scp (secure copy), take best thing since some time out now to read the friendly manuals. It’s no sliced bread Who needs a devserver? fun wrestling with unfamiliar software on your own Devservers are essential tools for the professional web computer while trying to wrangle a remote machine! developer. Such tools enable designers to model the To confirm that the new router is working properly, complex interactions of, say, a social media feed without follow the manufacturer’s instructions for initial setup, risking public exposure. Semi-pro developers tend to be but don’t get too comfy with those slick configuration nervous about setting up such systems, no matter how screens. Our first step will be to replace the OEM keen they are to move beyond static pages. But what if software with generic LEDE/OpenWrt. their development server was cheaper than a pair of Check your device against the compatibility table at Do you really jeans, and small enough to fit in a pocket? the OpenWrt website, download the appropriate need an FTP We’re going to assemble an LEDE/OpenWrt-enabled firmware to your own computer, then follow the daemon on your devserver on a tiny ‘travel router’ costing £20 or £30. prompts in the router’s web interface to upload it and devserver? In We’ll use common resources to deliver LAMP-type trigger the re-flash. (We used lede-17.01.4-ramips- a LAN context, functionality. (LAMP is an acronym for the industry- mt7620-gl-mt300a--sysupgrade.bin to secure copy standard combo of Linux with the Apache webserver, update our MT300A.) The router reboots at the default (scp) is easier to MySQL database and PHP server-side scripting LEDE IP of 192.168.1.1. For access via LEDE’s LuCI GUI, set up and more language, although we’ll need a substitute for the point your browser at the new address. convenient, too! resource-hungry Apache.) And, as a grand finale, we’ll This is a good moment to connect the new router’s LAN port to your existing router via a short Ethernet lead and to set a memorable new root password. Getting access Let’s configure the new router for internet access. This is where those CLI skills come in! Launch a terminal on your own computer and do the following: route -n The response will look like this: Kernel IP routing table A successful Destination Gateway Genmask Flags Metric re-flash will soon install LEDE on Ref Use Iface your router. 0.0.0.0 192.168.1.254 0.0.0.0 UG 1024 0 0

62 LXF237 June 2018 www.linuxformat.com WordPress TUTORIALS

wlan0 169.244.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 wlan0 192.158.1.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0 Take special note of that Gateway setting in the second line. It’s the IP address of your existing broadband router. (BT broadband routers mostly seem to be set to 192.168.1.254.) Your new router will need that address to access the Internet. Launch PuTTY from the terminal and start a new session. Enter the IP address of the new router (not the gateway) and log in as ‘root’ using the password you set earlier. If the login is successful, you’ll see an OpenWrt logo in text and a command prompt. To set the gateway, type a UCI command: sed -i ‘s,^tmpdir.*,tmpdir = “/tmp”,g’ /etc/my.cnf If PHP’s status page shows that uci set network.lan.gateway=192.168.1.254 mkdir -p /srv/mysql MySQLi is fully Depending on setup, you may also need to type: mysql_install_db --force configured, your uci set network.lan.dns=192.168.1.254 /etc/init.d/mysqld start LUMP stack is up Then save the change: /etc/init.d/mysqld enable and running! uci commit network mysqladmin -u root password ‘YOUR_MYSQL_ROOT_ Reboot the new router, then log in again via PuTTY, PASSWORD_HERE’ and use OpenWrt’s package manager to install the Invoke the MySQL daemon and enter your password: nano CLI text editor, thus: root@Arduino:~# mysql -uroot -p When making opkg update Enter password: changes to opkg install nano mysql> show databases; OpenWrt, it’s If you get errors, there’s a configuration problem. faster to reload Google is your friend! When you have nano loaded, you’ll You should get a response like this: the relevant be able to review all your network config options at one +------+ module than pass by doing: | Database | to reboot the nano /etc/config/network +------+ whole system. LEDE/OpenWrt enables configuration via either UCI | information_schema | To reload the text commands or by editing files, just as you like. | mysql | network, type | test | /etc/init.d/ network reload Configuring the webserver +------+ If you struggled with the overlaying process (see boxout, right), you’ll appreciate the convenience of uhttpd, the LEDE/OpenWrt webserver. This runs the LEDE web DOES YOUR ROUTER HAVE THE ROM? interface and is quite capable of serving your pages, too. We’ll instruct uhttpd to listen for traffic on port 81 and to LEDE/OpenWrt is tiny, enabling it to operate from a router’s meagre respond to such requests with pages from a particular storage. The MT300A described in this article offers just 16MB of directory. At the PuTTY command prompt, type: flash ROM, but that’s enough for LEDE plus a LAMP stack. However, it uci set uhttpd.llmp=uhttpd isn’t enough for WordPress, which runs to about 20MB. If you don’t uci set uhttpd.llmp.listen_http=81 want to shell out for more expensive hardware, you can extend your uci set uhttpd.llmp.home=/srv/www device’s available ROM via a technique called overlaying. It’s not for uci commit uhttpd the fainthearted! To enable overlaying, you’ll need a spare USB Next, still in PuTTY, type: memory stick in ext4 format. Note that the stick won’t be accessible mkdir -p $(uci get uhttpd.llmp.home) to other devices. Once you have your stick formatted, follow the That odd-looking bracketed statement tells LEDE/ instructions at https://wiki.openwrt.org/doc/howto/extroot. OpenWrt to set up a new directory corresponding to the entry in uhttpd’s configuration file. Use the echo command to publish a ‘Hello World!’ web page: echo “

OpenWrt rocks!

” > /srv/www/index.html ...restart uhttpd... /etc/init.d/uhttpd restart Now point your browser at 192.168.1.1:81. You should see the message you typed a few minutes ago. Installing MySQL and PHP With the webserver up and running, the MySQL and PHP installations are just sequences of PuTTY After extrooting, the commands. MySQL first: router has access opkg install mysql-server to 2Gb of ROM. sed -i ‘s,^datadir.*,datadir = “/srv/mysql”,g’ /etc/my.cnf

www.techradar.com/pro/linux June 2018 LXF237 63 TUTORIALS WordPress

Lastly, set a blank value for the doc_root variable in Bloggers rely /etc/php.ini: on WordPress doc_root = “” ‘permalinks’ This will make it easy to access PHP on your to create devserver, although we definitely wouldn’t recommend memorable, doing it on a production platform! SEO-friendly To test the new installation, add an index.php page to URLs. However, uhttpd lacks the the /srv/www directory:: echo “” > /srv/www/index.php into heavier taking shape... Restart uhttpd again and point your browser at servers, so your 192.168.1.1:81/index.php. If you see a lengthy PHP devserver won’t status page with all its MySQLi entries in place, your handle those 3 rows in set (0.00 sec) LAMP stack (or should that be LUMP?) is complete. permalinks properly. But Just type exit in MySQL when you’re done. Installing WordPress everything Thanks to LEDE/OpenWrt’s parsimonious approach Assuming you extended your router’s flash ROM (see else about WP should be fine… to memory usage, PHP installation is more involved: sidebar), you can use your new LAMP stack as a opkg install php7 php7-cgi php7-mod-mysqli php7- platform for WordPress. mod-pdo php7-mod-pdo-mysql Go to http://wordpress.org and download a copy of Then use UCI to add basic PHP settings to uHTTPd’s the software to your own computer. Unzip it and rename config file: wp-config-sample.php to wp-config.php. uci add_list uhttpd.llmp.interpreter=’.php=/usr/bin/ Launch a terminal (not another PuTTY session!) php-cgi’ and use scp to copy the unzipped WordPress to the uci set uhttpd.llmp.index_page=”index.html index.php” /srv/www directory on the new router: uci commit uhttpd scp -r /home/[yermamaspc]/Downloads/wordpress/ OpenWrt’s version of MySQL doesn’t automatically [email protected]:/srv/www/ integrate with PHP, so you’ll need to append a whole LEDE/OpenWrt doesn’t support PHPMySQL, so new MySQLi section to the PHP configuration file at you’ll need to manually configure the MySQL database /etc/php.ini corresponding with the settings from for your WordPress site. Fortunately, it’s a piece of cake: MySQL’s /etc/my.cnf file. Here’s how ours came out: mysql -u root -p [MySQLi] CREATE DATABASE wp_dev; mysqli.allow_local_infile = On CREATE USER ‘wp_dev_user’@’localhost’ IDENTIFIED mysqli.allow_persistent = On BY ‘YOUR_WP_USER_PASSWORD_HERE’; mysqli.cache_size = 2000 GRANT ALL ON wp_dev.* TO ‘wp_dev_ mysqli.max_persistent = -1 user’@’localhost’; mysqli.max_links = -1 Use Putty and nano to make corresponding changes mysqli.default_port = 3306 to the wp-config.php file in /srv/www/wordpress so mysqli.default_socket = /var/run/mysqld.sock that the DB_NAME , DB_USER and DB_PASSWORD mysqli.default_host = 127.0.0.1 entries match those you just entered into mysql. mysqli.default_user = root Finally, invoke the WordPress installer script from mysqli.default_password = ‘YOUR_MYSQL_ROOT_ your browser: http://192.168.1.1:81/wordpress/ PASSWORD_HERE’ wp-config.php. From here on, you can treat your new mysqli.connect_timeout = 60 devserver as you would any other WordPress platform, mysqli.trace_mode = Off but don’t miss the Quick Tip on permalinks.

Here’s the first WordPress post on your development server, ready to grab your audience.

64 LXF237 June 2018 www.linuxformat.com FORTHEGNUGENERATION BUYYOURISSUETODAY Available from all good newsagents & supermarkets

FREE DVD! NEW UBUNTU 18.04 LTS

www..co.uk

THEESSENTIAL MAGAZINE FOR THE GNU GENERATION YOUR ULTIMATE GUIDE

B[l[b kf oekh :eYa[h ia_bbi š CWij[h LW]hWdj NEW UBUNTU! iYh_fj_d] š F[h\[Yj YedÒ]i \eh 7di_Xb[  Fkff[j

SPECIAL REPORT Ruby isn’t dead 3 FEATURES We will do everything OF rvive iro “Matz” Matsumoto DISC MISSING? ASKYOUR 18.04 RETAILER CLOUD, CONTAINERS, CORE ON SALE DESKTOP, IOT, SERVER + EXPERT OJECTS TO TRY TUTORIALS NOW Super-size Pi storage > Git: Master version control > Make an assistant AI 47hZk_de0:?OYe\\[[cWa[h with Mycroft Core > Security: Stop root attacks MX inux 17.1 Security distros ALSO INSIDE » Kernel in-depth erfully built distro that Tested: Four of the best secure » TerraMaster’s

obably never heard of distros in the Linux universe new NAS tested

new NAS es ed ’ rob bly never he rd o d s ros n heLnux un verse t t a a f i t i t i i

»Terr M s er’s

TheTh wonded r ullyll bub l d s ro h TesT edd:FFour o hebbes secure

a a t f i t i t t att t f t t

» Kernel n-dep h

i t

MX Linux 17.71 ecurity distros

S AL OIN IDE S S

with MycroftCore

> ecurity: top root attacks S S

47hZk_de0:?OYe\\[[ cWa[h > Make an assistant AI

> Git: Masterversioncontrol

> Super-size Pi storage OR SUBSCR E & SAVE INE AT:

myfavo i gazines.co.uk/sublud

PECIAL REPORT S

iYh_fj_d] F[h\[Yj YedÒ]i \eh 7di_Xb[  Fkff[j iYh_fj_d] š F[h\[Yj YedÒ]i \eh 7di_Xb[  Fkff[j

B[l[b kf oekh :eYa[h ia_bbišCWij[h LW]hWdj NEW UBUNTU! TUTORIALS Virtualise an app

DOCKER Deploy your first virtualised app lt took a lot of convincing for a lethargic Mayank Sharma to power down his virtual machines and learn to virtualise apps instead.

ven if you’re totally disconnected with the realm of mortal beings, you’d still surely have E heard of Docker and how it can solve all your IT problems. If you have somehow managed to isolate yourself from experiencing the fruits of Docker’s OUR goodness, here’s your chance to absolve yourself. Traditional virtualisation technologies provide full EXPERT hardware virtualisation. This is to say that the virtual Mayank Sharma machine or hypervisor takes chunks of physical is a technical resources such as CPU, storage, RAM and then slices author who them into virtual versions like virtual CPUs and virtual spends much of RAM. It then uses these virtual peripherals to build his time playing virtual machines that behave like regular physical Each command in the Dockerfile spins up a new container and Linux games computers. The isolated virtual environment is useful commits a new image layer before moving to the next command. like there’s no for testing a new distro, but is an overkill when all you tomorrow. need to virtualise is a single program. Docker very scalable and enables you to run multiple This is where Linux containers, through Docker, offer containers from the same image. an attractive alternative. Docker enables you to bundle While Docker is available as a package in the official any Linux app with all its dependencies and its own repositories of all popular distributions, it’s best to fetch environment. You can then run multiple instances of the the latest version from the official Docker repository. containerised app, each as a completely isolated and Fire up a terminal and fetch the official download script separated process, with near native runtime and execute it with curl -sSL https://get.docker.com/ | performance. That’s because unlike VMs, containers sh to install Docker. Once it’s installed, start the Docker share the same host system kernel. This also means service with sudo systemctl start docker and make that you can host more containers than VMs on any sure it starts on subsequent boots with sudo systemctl given hardware, because of its lighter footprint. enable docker . Now type docker run hello-world to test the The language of Docker installation. The command downloads a special image Docker is a container runtime engine that makes it easy from the official Docker registry that will greet you if all to package applications and push them to a remote goes well and explain the steps it took to test your repository, from where other users can download and Docker installation. use them. Let’s get familiar with some Docker Now’s let’s jump straight in and start a new Docker terminology. Docker containers package software in a container with the following command: complete filesystem that includes everything an $ docker run -it --name alpha-silo ubuntu /bin/bash application needs to run. This ensures the app will With this command, we asked Docker to start a new always run the same way – irrespective of the container with an image called Ubuntu. The -i makes To use Docker as environment Docker is running on. the session interactive and the -t allocates a terminal. a non-root user, A Docker image is the definition of a container. It’s a The container is named alpha-silo and runs the /bin/ add your user collection of all the required executables, files, bash command once it’s started. to the docker environment settings and more, that make up an When we issue the command, the Docker daemon group with application along with its dependencies. The image is a will search for Ubuntu images in the local cache. When it something like read-only version of your application that’s often doesn’t find one it then downloads the image from sudo usermod -aG docker compared to an ISO file. To run this image, Docker Docker Hub. It’ll take some time to download and bodhi creates a container out of it by cloning the image. This is extract all the layers of the images. Docker maintains what then actually executes. This arrangement makes container images in the form of multiple layers. The

66 LXF237 June 2018 www.linuxformat.com Virtualise an app TUTORIALS

good thing about this arrangement is that these layers can be shared across multiple container images. This makes the system very efficient. For example, if you have Ubuntu running on a server and you need to download the Apache container based on Ubuntu, Docker will only download the additional layer for Apache as it already has Ubuntu in the local cache, which can be reused. Once this container has been started, it will drop you in a new shell running inside it. From here, you can interact with the shell just as you would on a normal installation. However, because containers are designed to be extremely lightweight, you only have access to a custom image that you can then use to spin additional Use the docker barebones environment. containers. So if we exit the container and type history command against When you are done, you can exit from the shell by $ docker commit -a “Mayank Sharma” alpha-silo an image to bring typing exit or pressing Ctrl+D. Outside the container, loaded-silo up the list of you can use the docker ps command to list all the Docker will roll the customised container alpha-silo commands used containers and check the status of your last container. with the updated repos and the Apache web server into to create it. By default, the command only lists running containers. a custom image called loaded-silo. In the command, the Append the -a option to the command to list stopped -a option is the name of the author of the image. Then containers as well. To start the container again, you can comes the name of the container being imaged (alpha- use the docker start command, such as docker start -ia silo) followed by the name of the new image (loader- alpha-silo . silo). The new loaded-silo image is now stored as a The -i option will, as before, start the container in separate image on the server along with the others as interactive mode and the -a option will attach to a you can verify with the docker images command. You terminal inside the container. If you start a container can now use this image to spin new containers. without any option, such as docker start alpha-silo , Docker will launch it in the detached mode, which is to Real-world containers To access say that it wouldn’t latch the container onto the terminal As we’ve said earlier, a Docker container is an instance networks and just keep it running in the background. of a Docker image. Docker pulls images from outside the You can open a terminal inside a detached container repositories that live inside registries. The default local server, with docker attach, like docker attach alpha-silo . To Docker repository is Docker Hub, which has a bunch of containers route detach the terminal but keep the container running in official and user-contributed unofficial repositories, network traffic the background, press the Ctrl+P+Q key combination. each of which in turn contains a number of images. through the docker0 virtual To execute a command inside a running container, use So head over to https://hub.Docker.com to browse interface on the docker exec, such as docker exec alpha-silo pwd to through a library of pre-built Docker images. To get host server. print the current working directory inside the container. familiar with Docker, we’ll use it to install the Remember we said containers are designed to be lightweight? If you list all the processes running inside our Ubuntu container with the docker alpha-silo exec DISTROS OPTIMISED FOR DOCKER ps -elf command, you’ll notice that it’s running bash and nothing else. That’s why when we exit from the shell A Docker container includes both the application along with all its by typing exit, the action stops the container as well configuration and dependencies. So you can streamline a distro to since it is the only process running in the container. host containers only. The community has latched on to this, which is The docker stop alpha-silo command will gracefully why you have several stripped-down container-oriented distros such stop the container after stopping processes running as Container Linux, RancherOS and Atomic Host. While you can run a inside it. When you no longer need the container, you container on top of a regular distro, these fine-tuned distros have can use docker rm to remove/delete it, such as docker become the norm for running containers in a production environment. rm alpha-silo . The table (on the next page) lists some Each of these distros comes with its own set of features that make frequently used Docker commands and their uses. them suitable for different kinds of deployments. Container Linux (formerly known as CoreOS), is a production-ready operating system Flesh out the container that’s built from scratch for hosting containers. One of its advantages We’ve just created a minimal container named alpha- is that it automatically detects a new Docker container as soon as it silo using the base Ubuntu image that doesn’t do much. comes online in the network. The distro also uses Google’s To get more out of this container, you can either Kubernetes to manage the Containers. Then there’s RancherOS that download another image that uses the same base is interesting because it is essentially made up of Docker Containers. image, but has more stuff baked in. You can also It boots up with a container called System Docker, and then gives manually add software to the base image, just as you users the ability to create new containers with User Docker. would on a regular install. Start an interactive shell If you run Red Hat-compatible servers with either CentOS, Fedora inside the container and type: or RHEL, there’s the Atomic Host project that creates tailored builds $ sudo apt update; apt install net-tools apache2 -y for these Red Hat servers for integrating Docker into your network. This command will update the repositories and install There’s also Alpine Linux, which started out as a fork of the LEAF the net-tools and the Apache web server inside the (Linux Embedded Appliance Framework) project. Its creator now container. One of the cool things about Docker is that it works for Docker, which uses the distro to build its packages. enables you to save your customised container as a

www.techradar.com/pro/linux June 2018 LXF237 67 TUTORIALS Virtualise an app

WordPress blogging app. The WordPress image on the specified settings. You can confirm that the MariaDB Docker Hub doesn’t include a database installation. So container is running with docker ps . You can publish we’ll first have to install a MariaDB database in a You can also break the process into two steps, which your custom separate container and then ask the WordPress is what we’ll do for WordPress. First we’ll just download images on the container to use it. the WordPress image with docker pull wordpress and Docker Hub if Start off by making a new directory where you wish then build a container for it, with: you have an to store the files for WordPress and MariaDB for $ docker run -e WORDPRESS_DB_ account with example in your home directory: PASSWORD= the service. $ mkdir ~/wordpress -d --name my_wordpress $ cd ~/wordpress --link db4wp:mysql Then pull the latest MariaDB image with: -v $(pwd)/html:/var/www/html $ docker run -p :80:80 wordpress -e MYSQL_ROOT_PASSWORD= Make sure you set the -e WORDPRESS_DB_ -e MYSQL_DATABASE=wordpress _db PASSWORD variable to the same password as that of --name db4wp the MariaDB database. The --link db4wp:mysql option -v $(pwd)/database:/var/lib/mysql links the WordPress container with the MariaDB -d mariadb container so that the applications can talk to each other. The -e option sets the environment variables for the The -v option does the same function as it did for the container, such as the database password and its name. database and makes sure that the container’s contents Replace with your own. The --name option under the /var/www/html directory are persistently defines the name of the container. The most interesting stored in the /html folder under the current directory option is -v “$(pwd)/database”:/var/lib/mysql . It asks on the host. Docker to map the two specified locations that are The -p :80:80 tells Docker to pass separated by the colon (:). On the right is the /var/lib/ connections from the servers’ HTTP port to the mysql directory that exists within the container and is containers’ internal port 80. Replace used to store the database file. The command asks with the public IP address of your server. Instead of a Docker to place the files under the /database folder in public IP address, you can also just use -p the current working directory on the host to ensure that 127.0.0.1:8080:80 , to tell Docker to forward the the data persists even after we restart the container. container’s port 80 to port 8080 on the local host. To The -d option tells Docker to run the container in the access the WordPress installation, open a browser on a detached daemon mode in the background. computer in the same network as the server running This command will download the latest version of the the Docker daemon and head to http://:8080. Use docker inspect wordpress to get all the settings for the WordPress container. To check the log file for our WordPress container, run the docker logs -f wordpress command. You can stop a container with docker stop , start it again with docker start or restart it with docker restart . But if you have to change a parameter, like the port mapping, you’ll first have to stop a container, then You can find remove it and then start another one with the new all kinds of parameters with the docker run command. information including Docker Compose Dockerfiles for While the Docker CLI is very well documented, it isn’t most images hosted on the the most intuitive mechanism for creating containers. Docker Hub. This is why you need to use the docker-compose tool to define and run containers. The tool makes it particularly easy to roll multiple containers. It’s essentially made up COMMON DOCKER COMMANDS of a human-readable YAML data serialisation language that lists the characteristics or options of one or more Command...... What it does containers that can then be brought to life with a single docker info ...... Displays details about the Docker daemon command. docker ps...... Lists all running containers To demonstrate its advantages over the Docker CLI, docker inspect...... Displays the configuration of a container we’ll recreate our MariaDB and WordPress containers docker logs...... Displays the standard output from a container with Docker Compose. First install the latest version by docker exec...... Executes a command in a running container pasting a cURL command mentioned in the Docker docker images ...... Displays local images Compose documentation (https://docs.docker.com/ docker run...... Initiates a new container compose/install/#install-compose). When you’ve got docker pull/push...... Downloads/uploads images from/to a Compose up and running, change into the ~/wordpress remote registry folder and create the docker-compose.yaml file: docker start/stop ...... Starts or stops a container $ cd wordpress docker rm...... Removes a container $ vi docker-compose.yaml docker rmi...... Removes an image dbase4wp:

68 LXF237 June 2018 www.linuxformat.com Virtualise an app TUTORIALS

DOCKERFILE COMMANDS

Command...... What it does FROM ...... Specify the base image RUN ...... Used to execute a command during the build process CMD...... Executes a command within the container WORKDIR ...... Sets the path where the command, defined with CMD, is to be executed ADD ...... Copy a file from the host machine to the new docker image The Docker Store (store.docker.com) is geared towards enterprise users and in addition to free images, also hosts commercially ENTRYPOINT...... Default command that’ll be executed supported images. whenever a container is created with the image image: mariadb ENV...... Defines environment variables environment: EXPOSE ...... Exposes a specific port between the MYSQL_ROOT_PASSWORD: container and the outside world MYSQL_DATABASE: wordpress_db USER ...... Sets the user or UID for the container volumes: created with the image - ./database:/var/lib/mysql VOLUME...... Enable the container to access a directory on the host machine my-wp: MAINTAINER...... The name of the image maintainer image: wordpress volumes: - ./html:/var/www/html RUN apt-get -y upgrade ports: - “8080:80” ## install the build-essential metapackage links: RUN apt-get install -y build-essential - db4wp:mysql Remember, however, that while you can place the environment: Dockerfile anywhere you want, when you build an image WORDPRESS_DB_PASSWORD: from it any files and directories in the same location or The options are the same as before, only more further down the filesystem in the sub-directories gets verbose. Save the file and then type docker-compose up included in the build. It’s a good idea to create a -d to create both the containers. Use docker-compose directory especially for placing the Dockerfile. Once a logs -f to monitor the output of the containers. Dockerfile is written, you can use it to create an image: $ docker build -t custom_ubuntu CreateaDockerimage This command will build an image in the current As we know every Docker container is an instance of a directory called custom_ubuntu based on the Docker image. Sure, there’s a huge repository of pre- instructions in the Dockerfile. When it’s done, you can built Docker images available in Docker Hub and confirm the image is available along with the other elsewhere. But just as we manually fleshed out the images using the docker images command. You can Ubuntu image earlier, we can automate the process now use this custom image to build containers. and ask Docker to build us a custom image using a There’s a lot more you can do with Dockerbuild. In base image. fact, this tutorial has barely scratched the surface of To build a Docker image we need to create a Docker, but we’ve covered enough ground to get you Dockerfile, which is a plain text file with instructions and going. If you’ve followed through to the end you arguments to assemble an image. Refer to the table should now be equipped with the tools and the know- (above) for a list of commands that go inside a how to experience the goodness and convenience of Dockerfile. You don’t have to use every command. In Docker containers. fact, here’s a fully functional Dockerfile: $ vi Dockerfile ## specify the base image FROM ubuntu:artful ## enable the Universe repository There are several RUN sed -i ‘s/^#\s*\(deb.*universe\)$/\1/g’ /etc/apt/ open source apps sources.list like Rancher that enable you to ## update the repositories manage a Docker deployment via RUN apt-get -y update a point-and-click graphical user ## install any available upgrades interface.

ENHANCE YOUR FOSS-FU Subscribe and save at http://bit.ly/LinuxFormat

www.techradar.com/pro/linux June 2018 LXF237 69 BACK ISSUES BACK ISSUES MISSED ONE?

ISSUE 236 ISSUE 235 ISSUE 234 May2018 April 2018 March 2018

Product code: Product code: Product code: LXFDB0236 LXFDB0235 LXFDB0234

In the magazine In the magazine In the magazine We reveal how Beat back Steer your to build and code a Raspberry Pi those surveillance tentacles with friends to the best OS in the world robot. Discover the five best NAS our in-depth guide. We road-test five and get them started with Linux, distros worth considering, turn up conference tools, go on a Python fast! We have a perfect beginner’s the heat with a Pi-controlled heating text adventure, improve your photos kit and guide. Plus hack your router block, off-load some of your work on and optimise their file sizes, master with LEDE, file managers, Prey to other computers, and keep track remote computing and set up a security, build a Pi garden monitor of a project’s progress with Watson. retail site based on WordPress. and relive your Amiga days!

DVD highlights DVD highlights DVD highlights Choose from Arch Linux 17.1, 3.5 and Parrot 3.1 and more Elementary OS 0.4 64-bit and Arch 32, ArchLabs and Arch Pi! with our packed privacy toolkit! Legacy 32-bit.

ISSUE 233 ISSUE 232 ISSUE 231 February 2018 January 2018 December 2017

Product code: Product code: Product code: LXFDB0233 LXFDB0232 LXFDB0231

In the magazine In the magazine In the magazine Get all the Discover how Don’t put up hardware advice you need to build you can streamline your distro and with default Ubuntu – find out how your own Linux-based PC. Then make it leaner and faster than ever you can easily tweak it to your create Android apps, customise before. We review five Gnome heart’s content! Five desktops are your Gnome desktop and set up a distros, take a deep dive into Wi-Fi tested, we get Microsoft’s take on Pi-based music player. We review tech, explore sound options in FOSS, learn how to build your own password managers and talk to Ann Linux, and check out block coding distro, keep your data safe and get Mwangi of ThoughtWorks. on the Raspberry Pi. 10Gbps Ethernet!

DVD highlights DVD highlights DVD highlights Got a 64-bit system? Then install Choose from five compact 32-bit Try out nine remixed desktops for Mint 18.3 Cinnamon or Fedora 27! distros – ideal for older hardware! Ubuntu, plus the Lubuntu 32-bit.

To order, visit myfavouritemagazines.co.uk Select Tech from the tabs of magazine categories, then select Linux Format. Or call the back issues hotline on 0344 848 2852 or +44 344 848 2852 for overseas orders.

Quotetheissuecodeshownaboveandhaveyourcreditordebitcarddetailsready

70 LXF237 June 2018 www.linuxformat.com UK subs NOT FROM THE UK? turn to SUBSCRIBE! p.22 Don’twaitforthelatestissuetoreachyourlocalstore– subscribe today and let Linux Format come straight to you!

3 GREAT WAYS TO SUBSCRIBE Print, digital, and print + digital bundles!

USA RESTOFTHEWORLD EUROPE From $15 From $15 From €15 every 3 months every 3 months every 3 months IT’S EASY TO SUBSCRIBE! Click: www.myfavouritemagazines.co.uk/linAPR18 Call: +44 344 848 2852 Lines open 8AM–7PM GMT weekdays, 10AM–2PM GMT Saturdays*

Savings compared to buying 13 full-priced issues. You’ll receive 13 issues in a year. You can write to us or call us to cancel your subscription within 14 days of purchase. Your subscription is for the minimum term specified and will expire at the end of the current term. Payment is non-refundable after the 14-day cancellation period unless exceptional circumstances apply. Your statutory rights are not affected. Prices correct at time of print and subject to change. *UK calls will cost the same as other standard fixed line numbers (starting 01 or 02) and are included as part of any inclusive or free minutes allowances (if offered by your phone tariff) For full terms and conditions please visit http://bit.ly/magtandc. Offer ends 30 June 2018.

www.techradar.com/pro/linux June 2018 LXF237 71 TUTORIALS Syncthing+Encfs

SYNCTHING+ENCFS Get hold of encrypted cloud storage for free takes a walk in the cloud – installing and configuring the software, and setting up backup procedures, security and usability options.

loud file storage is a popular option. Commercial solutions lack privacy, are C insecure, sacrifice control of data, often require installation of invasive software, and involve a subscription purchase. Part one (see LXF236) described OUR an architecture to set up a free cloud service backup, encrypted both in transit and when data’s at rest. EXPERT This article covers installing and operating the free Brian Mork cloud service in three parts: setting up the encryption Midnight Commander shows files transferred to the bridge computer. has used Linux service; setting up synchronisation, and then operating On the left, the equivalent encrypted files are ready to sync off-site. for 23 years, and the tools. has authored metadata well. When one file is changed, it’s not dozens of articles. SetupEncFS possible to reach into the volume and change one file. Now he has far When EncFS encrypts files, it keeps the same directory Instead, the entire volume must be resynchronised as too much data. structure, file time stamps and sizes. This could enable one logical unit, and retrieving a file requires retrieving someone to guess at what the files are. If someone is the entire volume. Because of this, the limits of EncFS able to get multiple copies of a file after small edits or a are mitigated using other methods. file with known content, it’s easier to figure out the On the bridge computer, install EncFS using the If you don’t encryption key. A bad guy could even replace your data standard apt-get commands. At the time of writing, want to type with an old version of your data and you wouldn’t know, version 1.7.4 is available. The first two commands here a password to but this is stopped by one-way sync to the offsite nodes are optional, but it’s good to update your distro sets and re-start EncFS, and syncthing’s purpose of reconciling differences. carry out software upgrades first: and are willing However, trying to synchronise files when this $ sudo apt-get update to store your metadata isn’t available is difficult. For example, $ sudo apt-get ugrade password on consider a VeraCrypt volume, which obscures the $ sudo apt-get install encfs the computer, try the EncFS option – extpass=’cat Off-site encfspw.txt’, computer BRIDGE COMPUTER MAC where encfspw. storage txt stores your password. rsync

Syncthing EncFS Midnight Cmdr encrypted Real files Virtual files Linux files encrypted clear text

Filezilla Syncthing’s RsnapShot clear text Here’s the Off-site architecture to WIN files aggregate, encrypt, computer backup, and off- storage site your files. First Hard-link EncFS is installed, .stversion files incremental then Syncthing backups is overlaid.

72 LXF237 June 2018 www.linuxformat.com Syncthing+Encfs TUTORIALS

EncFS in the normal (forward) mode makes virtual plain text files available at a mount point you specify. Any clear text files dropped into the mount point will be stored in the encrypted directory (and will vanish from the clear text directory whenever EncFS stops). On the bride computer, create a mount point where all your clear text data files will be visible and synchronised into. Then create a directory where EncFS will maintain the encrypted versions. You can put the encrypted files in a sub-directory of the off-site synchronised directory, but this isn’t necessary; they can be the same. For the first-time setup, it’s important to run EncFS before Syncthing is linked to the clear text virtual directory. This is because when Syncthing sets up a link, it’ll create the semaphore .stfolder file in the sync root folder. You want that file to be “caught” by EncFS and propagated into the encrypted directory. Don’t let Syncthing create it at the mount point when EncFS isn’t running or this semaphore will be falsely present for Syncthing to find – even when EncFS isn’t running. The $ sudo umount /home/pi/cleartextfiles Syncing web GUI .stfolder must never be present at the underlying There are additional options available with the on the bridge computer. mount point or else Syncthing may synchronise EncFSctl command line program, such as changing the 137,393 files in “nothingness” onto all the nodes on the clear text sync password associated with an xml file. 11,341 directories, ring (aka delete all files from your work computers!). totalling 143GB. $ mkdir /home/pi/cleartextfiles Setting up Syncthing $ mkdir /mount/pi/USB1TB/sync_offsite/encrypted The right side of the diagram (see bottom left) $ encfs /mount/pi/USB1TB/sync-offsite/encrypted / highlights multiple programs that could be used to home/pi/cleartextfiles aggregate files from work computers onto the bridge Creating new encrypted volume. computer. Syncthing is unique among the options because it’s able to aggregate files onto the bridge Using command {… more program output clipped …} computer behind the scenes without intervention. line options, Syncthing is Now you will need to enter a password for your Syncthing is distributed as an executable without library capable of filesystem. You’ll need to remember this password, as dependencies. Helpfully, the program comes zipped logging many there’s absolutely no recovery mechanism. However, the with instructions and examples. You can find the activities. When password can be changed later using encfsctl. appropriate download at https://syncthing.net. enabled, the log New Encfs Password: The instruction files that come with the distribution is visible from Verify Encfs Password: and other on-line documentation web site are pretty the Actions, $ easy to use. The biggest concern may be where to put Logs menu, The first time you run EncFS, it’ll create a the Syncthing executable file. You can do something as when enabled. configuration file (clear text encfs6.xml) on the left simple as putting it in your home directory. Refer to the encrypted side of the diagram (below left) and the xml online documentation for information if you want more file will be propagated to your off-site along with the help to set up Syncthing. encrypted files. That is good because this file and your For a Raspberry Pi bridge computer, download the password are necessary to unencrypt the files! You may ARM edition. There are several ways to run it at boot wish to manually save this file elsewhere, too. You could time, based on your specific installation. To use the even print out a copy on a piece of paper. It’s required to auto-start feature of the LXDE desktop manager, create decrypt files, but without your password it can’t be used a run-syncthing .desktop file in the ~/.config/ to decrypt your files. autostart/ directory: Automating EncFS at boot time is problematic. Any automatic method would need to store your password somewhere on the bridge computer. Instead, manually FILESYSTEM CHOICE run EncFS whenever the bridge computer is started using the same command as the first run. When the xml You might use a big USB drive to aggregate your encrypted files file is found you’ll be prompted for the password. This before syncing to off-site. A FAT32 filesystem would be the most does require restarting EncFS if the bridge computer compatible (Linux, Mac, Windows). That didn’t work for us because ever loses power. This can be done via the ssh if you we also wanted to store an Rsnapshot repository in the same configure a ssh server to come up at boot time. partition, which requires hard links, which FAT32 doesn’t offer. In $ encfs /mount/pi/USB1TB/sync_offsite/encrypted / addition, the 4GB individual file size limit of FAT32 may be an issue. In home/pi/cleartextfiles this case, an ext3 format may be what you want. If you use a Linux EncFS Password: filesystem on a removable drive, remember that file permissions may If you want to quickly see if EncFS is running, just be maintained. If the USB drive is later used on multiple systems that browse to the clear text directory and see if files are don’t have the same usernames, expect to use root to manually visible. If they are, EncFS is running. To stop EncFS, just change the ownership and group information. unmount the clear text view:

www.techradar.com/pro/linux June 2018 LXF237 73 TUTORIALS Syncthing+Encfs

[Desktop Entry] synchronisation set, the remote site will still have a copy Type=Application in the .stversions directory. You can access Name=Run Syncthing You may also want a desktop icon on your bridge a Syncthing Icon= computer to run the Syncthing web browser control control panel Exec=syncthing –no-browser panel. With the LXDE desktop manager, put the from any StartupNotify=false following into a syncthing-control .desktop file. network Again, be sure EncFS is running before enabling [Desktop Entry] connected Syncthing to create the .stfolder during its first run, and Type=Application computer. Use before putting anything else into the clear text directory Name=Syncthing Control Panel the Actions, on the bridge computer. Nothing should be stored at Exec=epiphany 127.0.0.1:8384 Settings, GUI the clear text virtual mount point. The mount point is Icon= tab to change only for EncFS to catch files, encrypt them, and store If you want to stop Syncthing, you can pause or 127.0.0.1 to any IP addresses them elsewhere. delete individual directories from the GUI control panel. that are allowed Syncthing will run in the background and collect files Using the GUI, you can also drop a node off-line or stop to use the from your work computers. In part one of this tutorial, the entire Syncthing program. To stop Syncthing without GUI, including three different paradigms for selecting the right files the GUI, you can run a process monitor like “top” and 0.0.0.0:8384, from your work computer were described. simply kill the Syncthing process. which allows You’ll know the aggregation is working when files The screenshot on page 73 shows the Syncthing web anybody. Be start to appear in the clear text directory. They are really GUI on the bridge computer. The directory “photos” is sure to specify stored encrypted elsewhere, but you can see the up to date collecting data from the local work a username and unencrypted version in the aggregation directory. computers. Behind the scenes, EncFS is encrypting the password! photos and storing files into the “Encrypted Offsite” Take it to the bridge directory, which is a mounted 1TB USB drive. The Once the aggregation is working, set up an additional Encrypted Offsite directory is up to date because it Syncthing ring linking the bridge computer encrypted needs no files from other sources, while the directory to the offsite computer(s). For the offsite sync geographically remote backup site called raspberryi- ring, select the “Send Only” option in Advanced Settings gary is 96 per cent synchronized with 3.19GB to go. on the bridge computer so no changes at the remote Notice the .stversion and .stignore directories are site come back to you. Send the Folder-ID to your friend not transferred across a Syncthing link because they’re via email or phone call at the remote site and add their meta data unique to each syncthing node. You can, remote computer device as an authorized sync node. however, make copies with modified filename so The remote site should specify “trash can” version Syncthing will back them up as “normal” files. control. This way if data gets deleted out of the Recovering lost data Knowing how to recover saved data is important. If MANUALLY AGGREGATE FILES Rsnapshot keeps saves on the bridge computer, the answer is trivial. Simply browse into the saved volume, With EncFS running, instead of having Syncthing do the aggregation, choose the date stamp you want and copy the files you you can aggregate files onto the bridge computer clear text directory want to where you want. manually. Just be sure EncFS is running first to “catch” them. For There are two ways to recover files from the remote example, you can push files to the bridge computer using an rsync site backup computer. One is to manually access the bash script under Linux, on a Mac, or the Windows 10 bash shell: encrypted files on the remote computer and simply set -x copy the files back to the bridge computer’s encrypted ssh [email protected] test -f /home/pi/cleartextfiles/_encfs-is-mounted directory where they should be. This can be done with && rsync -rltv --delete-after ~/Documents/$1 programs such as Midnight Commander or ssh/rsync. [email protected]:cleartextfiles/Documents You may be able to get files from the sync directory on The set command is optional; it simply enables you to monitor in the remote computer, or you may have to look in the the terminal window any bash commands that execute. The second .stversions directory on the remote computer for the line uses the bash AND function (&&). The left side ssh command back-up version of files. executes to test if a semaphore file (_encfs-is-mounted) is present in Based on the exact cryptologic initialisation vector the desired folder (analagous to the syncthing .stfolder at the sync option you chose for EncFS, decrypting files properly root level). This ensures EncFS is running before copying files. If the requires you restore files to identical encrypted path file is present, the right side executes and pushes file updates to the structures, compared to the paths originally used. This aggregator using rsync. The ~/Documents subdirectories named on is because with advanced EncFS options, the encryption the command line (or the entire ~/Documents directory if a may depend on the full pathname to the file. command line $1 variable is not entered) is pushed to the Pi In order to get clear text copies of the files, the cleartextfiles directory. unencrypted xml file that EncFS created in the bridge Midnight Commander is also suitable to aggregate files onto the computer encrypted directory must also be recovered. bridge computer. The screenshot on the first page shows Midnight If you didn’t save a separate copy of the EncFS xml file, Commander running in the Windows 10 bash shell that comes with be sure that is one of the files you retrieve from the off- the OS. The right panel shows the clear text directories aggregated site. Before EncFS will decode the files, you must have a onto the bridge computer; notice the semaphore file tested for in the clear text copy of the xml file to use. above command line rsync push. The left panel shows the same files You can also recover data using Syncthing. If the stored on the bridge computer terrabyte external USB hard drive. .stfolder is deleted on a synchronising computer, synchronisation will stop. You’ll get a synching error

74 LXF237 June 2018 www.linuxformat.com Syncthing+Encfs TUTORIALS

message Error on folder “ffff” (xxxxx-yyyyy): folder marker missing . If you were using it, also check the CHAFF FILES integrity of the other synching file, .stignore. It’s possible to manually recreate .stversion and For an extra measure of privacy, you can intermingle different sets of .stignore. If you’re using the optional ignore file, encrypted files into the encrypted directory. Just be sure to move the recreate .stignore first so there will be no file leakage first .xml file out of the way (rename or move to a different directory) when Syncthing resumes. Note that you’ll have to use before creating and using the second encryption set. Only one xml file a text editor to make the .stignore file because the can be used at a time. GUI option will be greyed out while the .stfolder is Putting different encryption sets overlapping into the same missing. Once .stignore is intact, then simply use mkdir directory structure makes the encrypted files look like one big to recreate .stfolder. collection, although the intermingled files are encrypted with different With the two synching dot files intact, there are two files and different passwords. ways to recover files. Assume that you accidentally Only the files that match the xml file and password being used deleted or corrupted a bunch of other files and that the will appear in the clear text directory. Each xml file you create and error has propagated all the way to the off-site use enables decryption of a unique subset of all the encrypted files. computer, which still has good copies in its .stversions For example, you could distribute one big encryption set and hand directory. Here’s how to recover the encrypted versions. out different xml files to different people to access only certain Use the synching GUIs, except step two requires SSH subsets of the files. access to the remote computer or a friend you can call The encfsl showcruft {encrypted-dir} command will display all the on the phone to do the remote copy. files in the encrypted directory that cannot be decoded, but without 1 Allow any unrelated files to sync to the off-site an xml file and a matching password, all files will show as not valid. location, then pause the bridge computer offsite sync This means you can hide a needle in a haystack – say 10,000 files ring and the offsite computer sync ring. decrypted with one xml file and two or three files decrypted with a 2 Copy a COPY of the file or files out of the .stversions second xml file and password stored somewhere else. Nobody would directory on the off-site computer back to their original know a second xml file was in play unless they knew passwords to locations in the off-site directory structure. If you’re decode one set or the other. doing individual files then see the narrative below about how to find the equivalent encrypted file path and name. convert the encrypted files back to clear text and they’ll 3 Change the offsite computer sync ring to Send Only, be sync’d back to your work computers unless you and change the bridge computer off-site sync ring to paused the clear text sync rings. Send/Receive. We’re not sure why the EncFS man pages indicate 4 Un-pause both computers and let the files sync. that you need to use the environment variable ENCFS6_ You may have to use the off-site GUI override button CONFIG to decode data from a remote computer (“the to force all changes from the remote site back to the cloud”). It’s not necessary if you put the xml file where bridge computer. expected – in the real data encrypted directory. 5 Again pause both the bridge and offsite sync. Put the However, you can put the xml file anywhere and use an bridge back to Send Only and the Off-site back to Send/ environment variable: Receive. Unpause both computers. $ ENCFS6_CONFIG=/somewhere_else/.encfs6.xml encfs ~/recovery_files/encrypted ~/cleartextfiles Speedy renaming If two sequential changes to a file were made in succession and fully propagated, trash-can versioning can’t get back to the “last good” version. However, if you use Syncthing versioned backups you can get hold of older versions. Syncthing will have modified the encrypted filenames by appending a date-time stamp of when the backup was done. To avoid manually renaming all the encrypted file after recovering them and before EncFS can use them, the following script may help by stripping the last 16 characters off the filename. For this article we copied it from the Syncthing user forum. See the Syncthing help forum for further explanation: #!/bin/bash for file in $(find /yourpath/ -type f – regextype posix- awk –regex “.*~[0-9]{8}-[0-9]{6}.*”) do mv $file ${file::-16} done Because Midnight Commander, or rysnc, or Syncthing This screenshot displays the Syncthing GUI of the remote site. Eight files are being synchronised, pulls files back to the bridge computer, EncFS will with more in the queue.

IMPROVE YOUR LINUX SKILLS Subscribe now at http://bit.ly/LinuxFormat

www.techradar.com/pro/linux June 2018 LXF237 75 TUTORIALS Administeria

ADMINISTERIA Wesay:apoxon both your houses! More details emerge on Meltdown and Spectre, before Valentine Sinitsyn encourages you to turn up the security heat with nftable-based firewalls.

ack at the start of January, a group of security affected, which is bad news for AMD users on desktops, B researchers disclosed several side-channel servers and mobile. Possible adverse effects range from attacks against the majority of x86 processors the network credentials being stolen to installing produced over the past decade. Shortly afterwards, persistent malware that survives BIOS reflashing. All of those vulnerabilities were code-named Meltdown and the vulnerabilities require local, physical access and the OUR Spectre. This is a relatively old story, of course, so why majority of them require an attacker to have obtained are we devoting page space to it here? local administrator rights first. EXPERT Well, in March 2018, a small research company You may notice that we’re not giving you any Dr Sinitsyn named CTS Labs, based in Israel, revealed multiple technical details. That’s because, at the time of writing, is a lapsed KDE critical vulnerabilities in the latest AMD Zen processors. there are none, and this already sets AMD’s case aside committer. He Following tradition, these vulnerabilities were code- from the Meltdown story. CTS Labs did publish a likes building named Masterkey, Ryzenfall, Fallout and Chimera. The whitepaper, but it contained only the most generic Linux clouds and bugs come in a few varieties, and are able to put into descriptions. The details were said to be communicated writing articles. motion a dozen attack vectors in total. AMD’s EPYC, toAMD–adaybeforetheannouncement – and Ryzen, Ryzen Pro and Ryzen Mobile chips are all another security lab, Trail of Bits, which confirmed the vulnerabilities exist. CTS has also stepped off “responsible disclosure” principle, and the company’s TO DEVOPS OR NOT DEVOPS? CTO, Ilia Luk-Zilberman, published an open letter explaining why he thinks giving a vendor no time Have you ever heard about the DevOps thing? I bet you did. Not advantage, while keeping the details private, is a better because it’s something great or particularly bad. I’m seeing this word approach to take for consumers. Yet interestingly, the in every second mailing list I’m subscribed to. legal disclaimer indicates no guarantee for the absence Does it mean that Administeria shouldn’t take on administering of direct or indirect economic interests in the matter. things anymore? That’s a good question. The world around us is CTS claims the bugs are the result of AMD changing, and the IT is changing particularly fast. Many if disregarding “fundamental security principles”.AMD not all jobs have become multifunction, so why should developers and managed to put out details of its own analysis two days system administrators be an exception? later http://bit.ly/LXF237amd (1). With more details I agree that developing software and making it run smoothly in yet to be published, what can you do about it? Simple: production implies a slightly different mindset. But I don’t see why plan for your own security; use proper tools; and never you can’t combine these mindsets in a single person. Take a systems stop learning, both for your fun and safety. administrator and teach them some software development patterns. Take your backend developer and tell them what load average means and how do you run tcpdump. They’re both engineers so they’ll enjoy learning new stuff. Of course, learning takes time. If you just merge your operations and development teams together, they won’t develop necessary skills by magic. And time is money, so be prepared to pay some of this money now to return this investment in the future. This may sound like I’m a DevOps advocate. Actually, I’m not. As any methodology, it might not work well for everyone. If you don’t expect your investment to return, don’t do it. Or maybe start slowly: let your developers know how things work inside the computer, and after some time they’ll be able to handle round-the-clock on-calls. That’s the route I take with Administeria. Do you think if it’d work? Email me: [email protected]. Vulnerabilities Map, found at https://amdflaws.com, summarizes confirmed and possible exploits across AMD systems.

1) https://community.amd.com/community/amd-corporate/blog/2018/03/21/initial-amd-technical-assessment-of-cts-labs-research

76 LXF237 June 2018 www.linuxformat.com Administeria TUTORIALS

Nftables: firewalls made slick Intoday’sdangerousworld,wewantournetworkperimeters to be thoroughly secured. Luckily, Linux has just right tools for the job…

e all value Linux for being free, stable and secure – but it doesn’t become secure by W magic. As explained in a previous article (see LXF232), you can make it secure with the right tools. In practice, we often expect the distribution’s vendor to step in and help, but our initial observation still stands: security tools are the cornerstone of your system. Your firewall is a good example. Desktops or small office servers often run with little- to-no explicitly configured firewall rules. This is fine because these systems generally don’t employ complex access control policies. Things will be different for enterprise networks, where you want your accountants but not sales staff to access the employees’ database. Whenever it comes to firewalls, a seasoned Linux administrator would certainly remember iptables. It’s served us well for nearly two decades, but now there’s a slicker alternative: nftables. you write in a high-level userspace language. The Nftables wiki is difference between these two is how the respective the authoritative Filtering in the kernel virtual machines are implemented and what this high- resource for all your nftables- Broadly speaking, it’s best to drop unwanted packets as level language is. related needs. early as possible. However, unless you’re mitigating a DDoS attack, it’s okay to discard packets as they Tables and chains traverse the Linux networking stack. For these From the userspace perspective, nftables consists of purposes, the kernel implements something called the nft command and the supporting libnftnl library. Netfilter hooks: The kernel part typically ships as modules (nf_tables.ko int ip_local_deliver(struct sk_buff *skb) and friends), unless you’re on a really old Linux { distribution. If not, both libnft and nft should also be ... available in your package manager’s repositories. The return NF_HOOK(NFPROTO_IPV4, NF_INET_ newer you distribution is, the smoother your nftables LOCAL_IN, experience will be. net, NULL, skb, skb->dev, NULL, Just like iptables, nftables chains firewall rules first, ip_local_deliver_finish); then groups them into tables (hence the name). } However, unlike iptables, there are no predefined tables The ip_local_deliver() kernel function reassembles or chains, such as filter or INPUT. Instead, nftables IP fragments (which is irrelevant for now) and delivers recognises base chains that are attached to kernel the packet to a higher-level protocol handler: for hooks, and non-base chains, which are mere containers example, TCP. Most of this really happens in the ip_ for the rules. Non-bases chains are only available from local_deliver_finish() function, which is called only if all base chains (via jumps), and they are here to keep your Netfilter hooks registered for the IPv4 protocol at the ruleset organised. NF_INET_LOCAL_IN hook number return success This is not the only difference, though. Chains in (either NF_ACCEPT or NF_STOP ). nftables may have several associated actions, but they A single hook may have several functions attached. lack the packet/byte counters by default. This is for When you register a function for the hook, you also performance reasons. Incrementing an integer every supply a priority value. Entries with lower (often time a packet hits the rule may not sound like a big deal. negative) priorities are called first. However, most computers today are multiprocessor, so With Linux 4.2, nftables has introduced a new NF_ care should be taken to synchronise these increments. NETDEV_INGRESS hook. Following the classic “earlier In some scenarios, this so-called synchronisation is better” mantra, it runs as soon as the packet enters penalty becomes noticeable, so it makes sense to try Linux networking stack. This happens just after packet and avoid paying for such a performance cost unless taps (such as tcpdump) get a chance to inspect the absolutely necessary. packet, thus making nftables stand closer to tc or even This is how you create a table with nftables: XDP (see LXF231 for more details). $ sudo nft add table inet filter While firewalling is (literally) hooked into the kernel, it $ sudo nft list tables would be unfeasible to try and code a new kernel table inet filter module per a ruleset. So nftables and iptables both We call it filter and put the table in the inet address build a generic infrastructure to interpret the rules that family, which marries IPv4 (ip family) and IPv6 (ip6).

www.techradar.com/pro/linux June 2018 LXF237 77 TUTORIALS Administeria

Furthermore, note the code above is a shell command – that’s why we need to quote the semicolons. Adding a non-base chain is easier: you just don’t attach it to any hook: $ sudo nft add chain inet filter ssh However, the most striking and noticeable change is certainly in the syntax. Whereas iptables relies on a The syntax you use Previously, separate tools were in charge for IPv4 and clumsy getopt()-style one: -p tcp --dport 80 , nftables to write nftables IPv6, which was inconvenient on dual-stack hosts. sports a much more readable DSL borrowed from scripts is the same This is how you add a base chain to this table: tcpdump filters. as in nft table list, besides counter $ sudo nft add chain inet filter input { type filter hook values, obviously. input priority 0 \; policy drop \; } Beautiful syntax Again, the name can be anything. Chains in nftables In the iptables world, it’s quite common to have a large belong to different types, such as filter, route or nat. The script configuring the firewall rule by rule. Many front- type defines how packets traverse the chain. Say, for end tools such as Shorewall (http://shorewall.org) take example, that only the first packet in a flow goes into the this route. The problem is installing rules this way is not nat table, yet filter chains see every single packet. Table atomic, and for a split second your ruleset appears in type support varies between families: there is no route the half-configured state. It may happen, for example, in arp: , for instance. that ports you want to be closed are open, which could Hooks and priorities directly map to their kernel result in a security breach. counterparts. Here, we attach the chain to the very This is not how you do it with nftables. First, changes same hook we saw in the ip_local_deliver() kernel to how rules are stored internally in the kernel facilitates function above. The nftables wiki (https://wiki. atomic rule replacement. Second, instead of issuing nftables.org) lists possible hooks and typical priority multiple commands, you store the ruleset in a file which values, but you can always look up enum nf_ip_hook_ you supply to nft - f . This command loads new rules priorities or similar in the kernel sources to build the into the kernel and then performs a swap, so you never most up-to-date picture. see the firewall half-configured. The ruleset looks much The reason why you can’t just use arbitrary serial like a script, and it is in fact quite common to make it values (1, 2, 3) here is because this priorities order executable with a shebang, like this: chains with other kernel subsystems such as conntrack #!/usr/sbin/nft -f or NAT. They aren’t really part of iptables (turns out that # Your configs may span multiple files this is a common misconception), so nftables reuses include “common.nft” them flawlessly. define local_net = 192.168.0.0/24 A policy is a verdict for non-matching packets. It’s define bittorrent_ports = { 6881-6889, 6969 } optional and defaults to “accept”. Note that later, lower- table inet filter { priority chains can drop accepted packets, but not vice chain input { versa (despite what the documentation may say). type filter hook input priority 0; policy drop ... } BPFILTER:NEWGUYONTHEBLOCK } You see that includes, variables and comments are Nftables are often seen as new-generation iptables, which is mostly all supported. To refer to a variable, you prefix the name true. However, things change fast in the IT world and sometimes with $, much like in Bash or Perl. become obsolete before they go mainstream. Note the curly braces in the “bittorrent_ports” We don’t know if this would happen to nftables or not. But as these definition. This is how you create a set, which is a words are written, there’s an ongoing discussion in the Netfilter fundamental nftables data structure. Sets are how community regarding something called bpfilter. As of February 2018, nftables treat multiple values such as IP addresses. the project is still in the early proof-of-concept (PoC) stage. Yet both They’re viewed as if they were a single entity – we’ll Alexei Starovoitov, the main man behind eBPF, and David S. Miller, the see an example below. They work well for disjoint Linux networking subsystem maintainer, are already on the author’s values, but nftables also has intervals for continuous list, which suggests bpfilter isn’t a simple toy. ranges: please take a closer look at the first element in Both nftables and eBPF implement a kernel-based virtual machine. bittorrent_ports . A lot of efforts went into eBPF recently (see LXF232), which brought it For iptables, ipset provides similar capabilities; here, features like Just-in-Time (JIT) compilation, code validation and even it comes built-in as the first class citizen. There are also hardware offload. Reusing all of these for packet filtering seems a maps, dictionaries (also known as verdict maps) and natural move. Current PoC hooks into XDP (that’s “as early as concatenations, but they are advanced features that possible”) but other placements could be added in the future. we’ll set aside for today. Nobody argued the idea of reusing eBPF VM. However, current Above is the first syntax that nftables supports, and bpfilter emulates the old iptables API. This raised concerns from it’s also what you get when you dump a table with the Harald Welte, a core Netfilter/iptables developer, who suggested it’s a nft list table command. Another example (below) is the step back and bpfilter should build on the nftables API instead. David syntax we used for the command-line examples, Miller counter-commented that iptables are far more popular so far, without the nft prefix: so this increases the test coverage. #!/usr/sbin/nft -f add table inet filter

78 LXF237 June 2018 www.linuxformat.com Administeria TUTORIALS

add chain inet filter input { ... } This is not the same as multiple nft commands MOVING AWAY FROM IPTABLES (think atomicity). Moreover, two syntaxes are not exclusive. Quite often, you begin with add table followed Nftables may look sweet, but as an administrator, you probably have by flush table to start fresh. Otherwise, the rules in a lot of config scripts that use iptables. And as a good administrator, your script are merged with what’s currently in the you’re unlikely to move to something new if it means you’ll have to kernel, which is rarely the desired behaviour. rewrite everything from scratch. Bits were essential because they build the Those are valid concerns, and nftables comes with a migration path infrastructure. Yet infrastructure doesn’t tell bad traffic for those running xtables firewall. The latter is just a smart way to say apart from the good one. For this, we need to add some “iptables, ip6tables and ebtables” in one word, so if you use any if rules: that is, expressions and associated verdicts. these, congratulations – they’ve got you covered. Nftables approaches the migration from two angles. The one is rule Express yourself translation, and you can apply it to the whole rulesets such as those Much like the rest of the nftables syntax, expressions generated with iptables-save, or single rules. The latter is a good way read naturally, such as tcp dport 22 or ip saddr != to learn nftables by example: you feed in iptables syntax and get the 127.0.0.1 . Each expression begins with a type that’s then nftables equivalent: followed by a value to check. Type can be a protocol $ sudo iptables-translate -A INPUT -m conntrack --ctstate such as ip , ct for conntrack operations (stateful ESTABLISHED,RELATED -j ACCEPT firewalling) or meta . The latter facilitates checking nft add rule ip filter INPUT ct state related,established counter meta information: network interfaces, packet marks and accept so on. Basic arithmetic and comparison operations are This feature should be available for distributions shipping iptables supported for values, along with some more complex 1.6.1 or higher; on Ubuntu Xenial, you are out of luck. ones, such as hashing. You can have more than one Another option is to use the compat backend. You call the iptables- expression per verdict, in which case all of them must compat command instead of plain iptables, and the rules are be true for the rule to match. translated transparently. Note that certain iptables features could be For your convenience, nftables defines symbolic missing, and it isn’t a good idea to mix and match iptables-compat names for common constants, for example, TCP flags. and iptables together. Compare tcp flags & (syn | ack) == syn to tcp flags & 0x6 One final remark: these tools are just helpers. Subtle differences in == 0x2 ; which one is better? Those constants are bound operation could be crucial for security, so always take thes time to to a data type, and you can get all the information from evaluate the result. nftables itself, using the nft describe command: $ sudo nft describe ct state ct expression, datatype ct_state (conntrack state) complete the example. Here, we permit established and (basetype bitmask, integer), 32 bits related traffic so the workstation can originate outgoing pre-defined symbolic constants: connections wherever it wants. It’s not secure, but will invalid 0x00000001 do in the majority of cases. Then we enable SSH new 0x00000008 connections from the local network. In a real world, you ... would also want to permit localhost traffic. Try this with other expressions as you encounter Now you have an understanding how Linux filters This is a Netfilter them to see nftables internal treatment. In addition, packets, from the guts of the kernel up to high-level packet traversal consult the nft(8) man page for details. rules syntax. Nftables offers some advantages over the flowchart. This This is what a basic workstation’s ruleset can look like: predecessors: atomicity, flexibility and readability, to uses xtables naming, yet the ct related,established accept name a few. But remember that it’s you, not tools or overall scheme tcp dport ssh ip saddr $local_net accept their syntax, which makes the system secure. Always remains valid for Paste this into the script above around the ellipsis to follow best security practices and stay safe! everything else. CREDIT: Jan Engelhardt, http://inai.de/images/nf-packet-flow.svg (CC BY-SA 3.0) BY-SA (CC http://inai.de/images/nf-packet-flow.svg Jan Engelhardt, CREDIT:

IMPROVE YOUR LINUX SKILLS Subscribe now at http://bit.ly/LinuxFormat

www.techradar.com/pro/linux June 2018 LXF237 79 Not your average technology website

EXPLORE NEW WORLDS OF TECHNOLOGY GADGETS, SCIENCE, DESIGN AND MORE Fascinating reports from the bleeding edge of tech Innovations, culture and geek culture explored Join the UK’s leading online tech community www.gizmodo.co.uk twitter.com/GizmodoUK facebook.com/GizmodoUK THE BEST NEW OPEN SOURCE SOFTWARE ON THE PLANET

HotPicks Alexander Tolstoy is still recovering after the many hours spent Gnome Amarok Shotwell RawTherapee playing Tower game Krita Krunner-translator Dementia Stacer (see page 85). We can Qsoundrec Tower game Battle for Wesnoth certainly see the appeal.

DESKTOP ENVIRONMENT Gnome Version: 3.28 Web: www.gnome.org

he Gnome team releases a new build every six months or so. This means you can expect each T new 3.x version on a fairly regular basis. For this month’s Hotpicks we’ve decided to highlight the latest and greatest Gnome 3.28 version for two reasons. First, because there’s a lot to enjoy there, and second, The upshot is that if you love Gnome and the way The app grid in due to the inescapable fact that Gnome has steadily that the distribution does things, then you’ll definitely Gnome features large and detailed become one of the most popular desktop environments be happy with this release. Impatient readers will be icons that will lately. It’s certainly the default choice for Ubuntu and glad to know that before updated packages are released please your eyes Fedora, which are, of course, the two main heavyweights for your distribution, you can test them immediately via in the Linux world. live images. These are based on openSUSE Tumbleweed The list of new and changed features is pretty or daily Ubuntu builds. extensive. Some of these features will be noticed immediately, while for others it’s more likely that they’ll Get to know the Gnome interface... make their presence known over time. The distinctive Cantarell font has received a bit of a spring clean and now looks neater thanks to tweaks in 2 spacing. There are also two extra weights for the font. A 1 3 much more radical change is the removal of desktop objects. While most Gnome users already ditched the habit of placing icons on their desktops, it was still possible to enable this feature back in , but now it’s gone (use Nemo instead of Nautilus if you’re missing desktop icons). So from now all file management is centred around the Nautilus window. We really liked the new tagging capability in Nautilus, which can now mark files and folders with stars. These can later help in sorting and searching tasks. 5 4 Moving on, there are few more pleasant surprises in Gnome 3.28, including Boxes and Photos. Boxes can now automatically download ISO images of various Perfectly clean desktop folders, and use this rating system to quickly operating systems for you, while Gnome Photos is now 1 The Nautilus file manager doesn’t support find your favourite elements. capable of importing files from SD cards and USB desktop icons any more, and so your system’s wallpaper will be on show for all to see. Even better photos drives, and then group them into albums. It means that 4 This simple app features decent editing in certain scenarios you no longer need to install third- A smarter way to close tabs capabilities, including a useful shadow/highlight party software in order to get things done. Specifically, 2 Apart from various fixes in the underlying enhancement tool. Photos now offers the basic features of Rapid Photo codebase, Nautilus now enables you to close tabs with the middle click of your mouse Metered bandwidth Downloader (www.damonlynch.net/rapid) and using . 5 Use this to disable background network Boxes is sometimes more convenient than some classic Rank your files! usage. For now it just prevents Gnome from virtualisation solutions, such as Virtualbox. 3 Now you can assign stars to your files and checking for updates.

www.techradar.com/pro/linux June 2018 LXF237 81 HOTPICKS

The left panel in MUSIC PLAYER Amarok can do virtually everything and even includes Amarok a file manager. Version: 2.9 Web: https://amarok.kde.org

marok has finally seen a new release after A nearly three years of silence. Those following the trends in classic Linux desktop music players might already know that the aging Qt4-based Amarok had been superceded by Clementine (a fork of the older Amarok 1.4) years ago, whereas lately some tags of your music files (select one more tracks and find extra fuss was devoted to the brand new Babe player, the tag editor in the context menu), and discover online which we reviewed in LXF230. media sources, such as Last.fm or Magnatune. Beside The player’s most distinctive feature has always been the fact that there’s nothing Amarok can’t do that, say, (and still is) its integration of numerous features into Clementine can’t, we really liked the familiar, bold one mission control-like window. In fact, using Amarok Amarok progress bar, the unusual volume control made us want to maximise the window in order to give spinner and the visually pleasing analyser animations. each panel and frame enough space to fit all the Version 2.9 fixes dozens of bugs that have built up content. The central area in Amarok is a QtWebkit- since 2015, and also brings the player into the modern powered browser part that displays song lyrics and the world, making it possible to compile and build, and to artist’s page in Wikipedia. We thought this approach co-exist with other music players. For instance, Amarok assumes that a user won’t be leaving the player is now fully compatible with Ffmpeg 3 and supports minimised, but instead wants to find out more music library synchronisation with , information about the track that’s ‘now playing’. Clementine, and even Apple’s iTunes. With This trend of encouraging you to do more with your such great compatibility, why not giving Amarok a try music continues elsewhere. Amarok also asks you to fix on your desktop?

Here, we’ve made PHOTO EDITOR the roses brighter without losing the subtle details that are present in RawTherapee the gerberas. Version: 5.4 Web: www.rawtherapee.com

awTherapee is designed for the processing of R RAW files captured by D-SLR cameras. Within Double-click an image in the browser and wait a the settings of such cameras there’ll be an second while it’s loaded. RAW images are usually pale option to specify the format of the saved files, and and you’ll need to apply manual colour correction to instead of the standard JPEG you can select RAW. These make it look more vivid and bright. Luckily, files take up more disk space, but contain significantly RawTherapee has the magic Auto levels button right on more information taken from the sensor of the camera. the Exposure tab that you start with by default (see the In short, it’s like a negative of a photograph, only in right-hand side panel next to the image). Other tabs digital form. RawTherapee is able to make sense of the have their own sets of controls for fine-tuning details data within RAW files: adjust colour levels, fix exposure such as sharpness, white balance, retinex, geometry problems, save details in shadows and highlights, and much more. It certainly takes some time and skill to remove noise and some other common photo defects. start producing good results. But it’s worth doing It’s widely thought that in the hands of someone who because all the best and award-winning images that we knows what they’re doing, a manually processed RAW all admire on the many online photography contests are file will have a better quality than the JPEG that’s baked made in RAW processing software. by a camera in automatic mode. RawTherapee interface RawTherapee supports most proprietary RAW is dark (like a darkroom for working with film) and full of formats, including Pentax and Sony’s Pixel Shift, and numerous sliders, tabs and buttons. But once you Canon’s Dual-Pixel. If you’re unsure, you can always try become used to it you’ll see that the application works to open files from your camera with RawTherapee and in two main modes: as an image browser and an editor. see if it works (it should!).

82 LXF237 June 2018 www.linuxformat.com HOTPICKS

Shotwell PHOTO MANAGER automatically organises your library using events. The folder Shotwell structure also remains the same. Version: 0.28 Web: https://wiki.gnome. org/Apps/Shotwell

hile it’s hard to ignore the rapid development of W Gnome’s Photos, there’s an even more powerful image-collection manager available. The latest version of Shotwell arrived six months later than planned, but it’s finally here and it’s great! Not only does Shotwell fix over 60 bugs, the application now performs more efficiently. It sports a the modest needs of the average user. Select an image faster RAW import plug-in, better support for images in Shotwell and use the buttons below it to rotate, crop, with alpha-channel (transparency) and a new full-screen align horizon, and remove red eye. A magic ‘fix mode for the Shotwell image viewer. everything’ button is also there – only it’s called Auto Of course, the whole bundle is much more than just Correction, perhaps to lower your expectations. It won’t an image viewer. You’ll appreciate the program’s power be able to restore shadows and highlights, but it’s good features when it comes to importing shots from your enough for simpler, auto levels-type adjustments. camera or smartphone, especially if you want to arrange Shotwell now supports the Meson build system, your files in date-based albums, add tags, events and which is the one that the Gnome project recently moved rate your images using stars. All this extra metadata will to. However, you can build Shotwell with a classic come in handy as your image library grows in size – it’ll sequence of $ ./configure && make && sudo make become much easier to navigate through your extensive install . Unlike many other apps that depend on other photo collection. bleeding-edge components that you might not possess, Along with cataloguing features, Shotwell also has a Shotwell is very tolerant and enables you to quickly build simple image editor. It’s no rival to Gimp, but still meets its code with very few dependencies.

IMAGE EDITOR Krita Version: 4.0 Web: www.krita.org

rita has long been considered as a rival of Gimp, K but over time the program has grown into something bigger and, some would say, more capable. We’ve previously looked at Krita in LXF217 and LXF227, but since then a lot has been added to this application. This is thanks to the generous help of Krita’s backers, who have funded its rapid development. Krita 4.0 is a bold release with plenty of new features. colouring in comics. The new Colorize Mask tool makes Got a burning The program now has vector capabilities that sit it possible to roughly mark parts of your drawing with desire to create alongside its usual bitmap image-editing tools. colours. Your artwork is then automatically colorised to a comic strip? Krita makes this Furthermore, it’s moved from the ODG format to SVG a surprisingly high level of precision. ambition possible. and has became fully compatible with . That Elsewhere, the program’s default brushes have been means you can copy and paste vector drawings and totally overhauled – and of course, you can create shapes between the two apps seamlessly. Krita enables customised brushes, too. Back in LXF227 we looked at you to fill and create outlines of any shape, select stroke G’MIC, which enables you to create a range of image width and style, join and intersect shapes, rotate and effects. Krita 4.0 now integrates with G’MIC seemlessly, resize everything. So you no longer need a separate so there’s no longer need to attach it separately. Indeed, vector editor for basic vector drawing tasks. G’MIC grants Krita users with access to dozens of As you’d expect, Krita ships with some great sets of artistic and creative layer effects, and it’ll take you quite vector objects that are ideal for creating cartoons and a while to browse through all of them. comics production (we really liked the new speech Getting the latest Krita release running is done via the balloons!) and new tools for speeding up the process of Appimage package, available from the project’s website.

www.techradar.com/pro/linux June 2018 LXF237 83 HOTPICKS

PLASMA EXTENSION KRunner-translator Version: 1.0 Web: https://github.com/ naraesk/krunner-translator

ou may be surprised to know that the number install , locate the new Y of standalone translation applications is limited. Translator item in KRunner’s Even if we’re talking about a front-end to some settings. Some preliminary setup is well-known public services such as Google, Yandex or required to make the extension work. The Baidu, there are only a few decent programs that we plug-in supports the Glosbe multilingual online can recommend with any degree of confidence. dictionary and the Yandex Translator API. The latter will It takes a minute One of them is KRunner-translator, a Plasma 5 work once you create an account at Yandex and receive or two to set extension that adds an extra feature to your KDE an API key, which you then need to paste into the things up, before enjoying instant Plasma desktop. The KRunner aspect is a virtual Swiss KRunner-translator configuration window. Enable all the translations right Army knife, whose many powerful capabilities are necessary check boxes and then you’re all set. in the search bar. hidden under a simple search bar (access this by Next time you need to translate something, use the pressing Alt+F2). following syntax in the KRunner input field: . For example, if you switch user sessions, calculate numbers and more type ‘de knowledge transfer’, you’ll get something like thanks to its straightforward plug-in nature. KRunner- ‘Wissensvermittlung’ in return. Don’t forget to set the translator adds language translation capabilities, which default source language in the plug-in’s settings. You can work well in case you need to interpret a phrase or also select the primary and secondary source languages, quickly look up an unknown word in foreign language. which should ensure that KRunner interprets your input Here’s how it works. field correctly. You can also instruct the plug-in what Once you install the plug-in via the standard language you want a phrase translated into by using the sequence of $ cmake . && make && sudo make following convention: ‘fr-en Au revoir’, for example.

It’s like a small part MIND-MAPPING TOOL of MS Visio has been placed into a brand Heimer new application. Version: 0.0.0 Web: https://github. com/juzzlin/Heimer

quick search for mind-mapping software on A the usual open source hubs revealed that there are over 900 projects with such features, yet it’s likely that the average Linux user won’t have heard of most of them. That’s fine of course – the 21st century computing world is full of exciting things, and there are text in it and when you’re done just press the big ‘+’ icon only so many hours in the day, so there are bound to be below to create a child note. This way you can easily programs and tools that slip under our radar. make a tree of notes, and furthermore each note can Perhaps this is a good-enough reason as any to try have any number of descendants, not just one. out Heimer, a simple program that enables you to place To make your diagram look neat, you can drag notes ideas, objects and concepts into some kind of order. around the canvas and arrange them so they’re more This makes it possible to put them in context and show readable. Heimer can save your projects in its own .dem their relationship with others. format (which has a simple XML foundation) and that’s Specifically, Heimer creates hierarchical diagrams pretty much about it. In time, more editing features will that clearly show relationships among elements that sit be added to the program’s functionality, but right now within your collection of objects. The tool is in the early it’s already able to arrange nodes of your project and stage of its life (which explains why it’s at version 0.0.0 give you clarity over the elements you’ve chosen to at time of writing), but it’s still very capable of putting visualise. You could see the lack of advanced features as things in order. Once you create a new project a plus point: nothing gets in your way in organising (File>New), you’ll see a single label with a text input field elements of your tree, so you can use Heimer for inside, just like a desktop sticky note. You can place any recording instant ideas and doing quick notes.

84 LXF237 June 2018 www.linuxformat.com Games HOTPICKS

I get to the top ENDLESS BROWSER GAME - I’m too tired to rock... Tower game Version: GIT Web: https://github.com/ bmqb/tower_game

xperience soon tells you how different things E match, and in the case of open source games on Github this means that the most common pair is an open source game engine and a collection of proprietary games based on it. At least this is the conclusion you’ll come to, after exploring the best-rated button, the crane releases the block. If the block items in your search results. lands on the top of the previous one without falling off, A good libre web-based game that can run on a you’ll proceed to the next storey. The more floors you desktop is also a rare gem, because most of these build the more the crane sways, so that it becomes games are designed for Android and iOS. Nevertheless, harder to judge when’s the best time to release the we’ve found a splendid time killer with the down-to- next block. If you hit the previous floor precisely, the earth name of Tower game. This is a Chinese project game gives you a bonus score; several precise hits with a Readme.md file that requires translation if you also contribute to your score. There are no time limits want information on the installation process, and there to the game, so you can spend as long as you like are also some Chinese words present within the game. waiting for the perfect moment to release a block! However, this doesn’t create any problems because Of course, these badly designed towers can’t exist Tower game has an online demo page, and playing the in real life. Nor can any building be tall enough to game is simplicity itself. reach planets made of . But this silliness just Your goal is to build an ever-growing tower using adds to the fun. Despite the obvious simplicity, this standard floor blocks. Each block is held in place by a game is addictive and you’ll want to play it to both swaying crane cable and once you click the left mouse beat your own records and compete with friends.

STRATEGY WARFARE GAME Battle for Wesnoth Version: Even without any 1.13.12 units crushing Web: www.wesnoth.org each other, the picturesque maps are begging to attle for Wesnoth is a classic, turn-based be explored. B strategy game in which you play as a fantasy race and fight enemy armies with your units. It sits between Heroes of Might and Magic and Age of Wonders, although you don’t necessarily need to know these two games to fall in love with the magic world of Wesnoth and the Great Continent. The game offers single player campaigns and network multiplayer matches. In each case your goal is to build a powerful army and seize villages that produce gold. The game is less about economy and more about warfare, so that gold is the only available resource that you need to buy more units and to pay their salaries. There are six races in Battle for Wesnoth: humans, Each unit can climb up the career ladder and elves, orcs, dwarves, undead and drakes, and seven become stronger and bigger. This definitely smaller auxiliary races. Each has its strengths and contributes to the game’s enduring appeal. Indeed, weaknesses that you can use in your strategy. You fight Battle for Wesnoth has been going since 2003 and is your battles on a map built up of hexagonal tiles. Your actively maintained. We got lost in the world of army consists of various units and a leader. You could Wesnoth for a long time and still can’t escape thanks think of it like playing chess, only except with colourful to the balanced gameplay and appealing graphics. orcs, elves and dwarfs instead of monochrome figures. Who knows, we may never be able to leave!

www.techradar.com/pro/linux June 2018 LXF237 85 HOTPICKS

Oh no, don’t SYSTEM CLEANER remove our precious Python Stacer modules – please! Version: 1.0.9 Web: https://github. com/oguzhaninan/Stacer

his month’s Hotpicks leads with Gnome 3.28, T which contains a new monitoring app called Usage. It doesn’t have many advanced features, so we’ve found a more capable program for monitoring and cleaning up your system: Stacer. The official project page says this is an optimiser for Ubuntu, Systemd-powered services, kill processes, manage but we managed to run and use it on a few other non installed software packages, and of course clean Debian-based Linux system and it worked just fine. cache files and various sorts of system junk. Stacer is a trendy Electron-based desktop program, If your Linux distro doesn’t use the Apt package which shares a similar design with Etcher, an ISO image manager, then Stacer won’t be able to manage your flashing tool that we reviewed in LXF213. Both use dark software, and for Systemd luddites the service colours by default and offer the easy-to-install AppImage manager feature will be missing as well. packages that make them portable. However, the The most interesting part of Stacer was its System modest USB flash tool is nearly 80MB and takes at least Cleaner tool, which tackles package caches, crash five second to start up, whereas the feature-packed reports, application logs and caches and the Stacer is only 29MB large and starts noticeably faster. wastebasket. Cleaning application caches can be Stacer’s dashboard displays CPU, memory and hard dangerous, because Stacer just wades through your disk usage, while a column of monochrome icons sit dot files and by default wants to shred everything. along the left edge of the window. Apart from the That might not be ideal, so take care. Thankfully, dashboard there are six other sections that enable you Stacer can be directed to only clean certain items, to control your auto-start items, enable or disable and taking this selective approach worked just fine.

Qsoundrec stores SOUND RECORDER records inside your home dir, so you won’t accidentally Qsoundrec delete it! Version: GIT Web: https://github.com/ vfspirit/qsoundrec

any readers will be familiar with having to use a M heavyweight program to complete the simplest of tasks. For example, cropping photos in Gimp, or transcoding video from one format to another via Kdenlive. Predictably, we’re faced with a similar situation when working with audio files, too. interface is straightforward, with the main part of the Even though Linux offers enough applications that window containing a list of your audio files, and a row enable you to record sound from a microphone, of playback control buttons above accompanied by a combine several tracks in one composition, add effects separate Remove Record button. Everything feels like and eliminate noise, we often need a simpler program a well-designed sound recording mobile app, although that can record sound from the microphone and save it Qsoundrec shows a classic desktop-oriented design. in your preferred audio format. The Edit>Settings menu contains a number of So for example, the Gnome desktop ships with a basic preferences that you can change: the audio simple phonograph out of the box, but then we came codec, its container, and the level of sound across Qsoundrec, which is also simple, elegant, compression (output quality). The free Ogg Vorbis extremely easy to use, and also suitable for any codec is used by default, but there are many other operating system thanks to the cross-platform Qt options available, too. The sound source is library. This is perhaps the main advantage of determined by your Pulseaudio settings, which can be Qsoundrec, because it’s undoubtedly convenient for changed in many different ways, depending on your everyone to have one reliable application on any desktop. For instance, when working in KDE Plasma, workstation, regardless of the OS. The Qsoundrec Qsoundrec uses the current Phonon settings.

86 LXF237 June 2018 www.linuxformat.com

CODING ACADEMY HUGO Build a static site with support for themes Mihalis Tsoukalos uses the Hugo framework to create secure web sites with static files. You’ll be up and running before you know it!

o is a popular systems programming language of Hugo you’re using by executing hugo version . The that can be used for much more than simply next section will explain how you can use Hugo to G working with systems software. One such develop web sites. example is Hugo. The official description of Hugo is that it’s a configurable static site generator. It can help you The Hugo process OUR develop a web site that’s composed of static files Hugo requires that you execute certain commands for EXPERT without the need to have a database in place or other starting a project for a new web site, adding one or more types of resources that are used when creating dynamic web pages to it, download and use a theme, and so on. Mihalis web pages. As a result, you’ll need to execute hugo new site Tsoukalos followed by a name for creating the structure for a new is a technical Go Go, Golang web site, and hugo new followed by other arguments author, a UNIX So, Hugo is a tool written in Go that enables you to to create a new page or a new theme. The philosophy administrator, a create web sites which are composed of static files. of Hugo commands is based on the way the Go programmer and Although Hugo is written in Go, you don’t need any Go compiler operates. a mathematician. knowledge to use Hugo. After creating some basic content, you’ll need to edit He is the author Please note that when you’re searching for the Go the main configuration file of a Hugo web site in order to of Go Systems programming language, you should use the keyword make changes to the naive default version of it. You’ll Programming and Golang instead of just Go, because Go is a common also need to edit the text files of the pages of the web is writing word and you might not end up with the kind of site you’ve created, so that you can add data to them. Mastering Go. information you want. Put simply, you’ll have better luck After you’re done configuring and adding data, you’ll finding what you want by Googling for Golang Hugo need to test your web site before deploying it to an instead of just Go Hugo. At the time of writing the latest external web server and making it available to your Hugo version is 0.37.1, which is built with Go version 1.10, and this is the latest Go version. You can install Hugo on a Debian or Ubuntu Linux system by executing the first of the following three commands: $ sudo apt-get install hugo $ which hugo /usr/bin/hugo $ ls -l /usr/bin/hugo -rwxr-xr-x 1 root root 12980032 Feb 6 2016 /usr/bin/ hugo The last two commands verify that the Hugo binary Hugo enables you to create file, which is called hugo, can be found on your Linux menus in you system. However, because your Linux distribution might web sites. You not have a ready-to-install package for Hugo or the can learn more latest version of Hugo, you might need to visit https:// at https:// gohugo.io/getting-started/installing and install Hugo gohugo.io/ manually. A reliable and quick approach would be to content- fetch Hugo from GitHub as described in the preceding management/ Web page, instead of downloading a tar file. menus. This shows the structure of a Hugo site, and how to add new posts and After a successful installation, you can see the version start the Hugo web server to test the operation of a Hugo web site.

88 LXF237 June 2018 www.linuxformat.com Hugo CODING ACADEMY

desired audience. If you add new elements to an existing Here are the Hugo web site, you’ll need to upload it again for those two pages of the smallSite changes to take effect. project using Last but not least, you should install and activate a the Simplicity Hugo theme before being able to test a Hugo web site. Hugo theme. The A small site developer puts data into these In this section you’ll see how you can develop a simple two web pages. web site named smallSite with just two web pages. So, let’s begin by executing the following commands on your Linux machine: $ hugo new site smallSite $ cd smallSite/ $ hugo new posts/aWebPage.md $ vi content/posts/aWebPage.md The first command creates the basic directory structure of the new Hugo site, whereas the third equivalent because on UNIX systems the IP address of command adds a new web page to that site. The last localhost is 127.0.0.1. However, if you try to visit any one command, which is optional, enables you to change the of them, you’ll get an empty page instead! The reason Learn more contents of the web page you’ve created. Note that the for this is that at its current state smallSite doesn’t have about Hugo at hugo new site command generates some handy a theme applied to it, which prevents it from displaying https://gohugo. output that gives useful information for first-time users pages. In the next section you’ll learn how to add a io and about of Hugo. After that you’ll have a directory structure that theme to a Hugo web site! Go at https:// will look like the following: The screenshot (below left) shows the output of golang.org/. $ tree some of the commands used in this section. There are many Hugo themes at . https://themes. |— archetypes Understanding templates gohugo.io/ and | default.md Hugo uses templates to change the appearance of a you can see the |— config.toml web site that are called Themes in Hugo terminology. development |— content You can find the full list of Hugo themes at https:// site of Hugo | posts themes.gohugo.io. at https:// | aWebPage.md The Hugo theme that will be used is named github.com/ |— data Simplicity and can be found at https://themes. gohugoio/hugo. |— layouts gohugo.io/simplicity. Follow the next commands to |— static download and start using the Simplicity theme: |— themes $ git init; cd themes $ git clone https://github.com/eshlox/simplicity.git 7 directories, 3 files Now that you grasped the basics, go on and create another web page named posts/pageNo2.md. Please PROSANDCONSOFSTATICSITES notice that the .md file extension stands for Markdown. As mentioned before, should you wish to change the The main advantage of a web site with static files is security because actual contents of these two web pages, you should edit it’s much most difficult – if not impossible – to hack a static web site them using your usual text editor. when you have a properly configured web server. So, no more worries The single most important file of each Hugo project about SQL injections or easy-to-guess passwords! The second is called config.toml and this is located inside the root advantage of static sites is speed, provided that the visitors don’t directory of each Hugo project. The file contains have to deal with an extremely busy web server. Additionally, static important configuration information about your Hugo web sites have easy indexing and fast transferring tools in case you web site. Its current contents are the following: want to transfer your web site into another web server. Finally, static $ cat config.toml web sites have a lower cost of development because they can be baseURL = “http://example.org/” developed much faster. languageCode = “en-us” However, static web sites also have their disadvantages. The biggest title = “My New Hugo Site” downside of a static web site which has been created using Huge is Notice that all lines in config.toml that begin with the that you need to upload your sites all the time, even when making tiny hash character (#) are considered comments. The first changes. The second drawback of static web sites in general is that line defines the domain name of the web site, whereas you can’t use a database with them, which means that it’s not the third line defines the title of the web site. possible to feature web pages with dynamic data. Additionally, Hugo enables you to test your web site locally dynamic web sites are more capable than static web sites and offer without having to deploy it first using its own web server the full range of capabilities of the web. Finally, there’s always a that can be started by executing hugo server -D in the chance that you’ll end up with a static web site that doesn’t meet your root directory of your Hugo web site. original requirements, which means that you’ll have to create a The preceding command will produce some output dynamic web site instead! that will inform you about your web site as well as the Despite of the drawbacks, if the security of your web site is your HTTP address of the Hugo web server – by default Hugo biggest concern, you should definitely consider using a static web site listens to either http://localhost:1313/ or – the speed benefits that you’ll receive will come at no extra cost! http://127.0.0.1:1313/. Notice that these two URLs are

www.techradar.com/pro/linux June 2018 LXF237 89 CODING ACADEMY Hugo

$ ls simplicity/ TOML or JSON format to your content files – both LICENSE i18n static aWebPage.md and pageNo2.md currently use the Twoofthe README.md images theme.toml YAML format. For the YAML format, the front matter is benefits of archetypes layouts webpack.config.js everything between the opening and closing --- lines, as Go are that data package.json yarn.lock in the next example code taken from aWebPage.md: it generates exampleSite src --- static binary $ ls -l simplicity/exampleSite/config.toml title: “AWebPage” files and that it -rw-r--r-- 1 mtsouk staff 1036 Mar 12 11:21 simplicity/ date: 2018-03-12T09:52:02+02:00 supports cross exampleSite/config.toml draft: true compilation. After downloading the Simplicity theme, we’ll have to --- This means that tell Hugo to use that theme by editing ./config.toml. If So, front matter is embedded in a content file and your executable files have no you have trouble remembering what you need to do to supports a plethora of variables including draft, dependencies use a given theme, there’s a relatively easy solution. expiryDate and publishdate. If the draft variable is set and that you Almost every theme comes with an example site that to true in a document, that document won’t be can create contains a valid config.toml configuration file. For the rendered unless you execute hugo with the -D or binary files for Simplicity theme, that config.toml file can be found at --buildDrafts flag. The expiryDate variable defines the architectures simplicity/exampleSite/config.toml. date and time that a page will stop being published. other the one So, you’ll need to add the following line at your own Finally, the publishdate variable gives a date and time in you’re using. ./config.toml for the smallSite site, in order to use the the future that defines when that page will be rendered Simplicity theme: and published. theme = “simplicity” Unfortunately, the limited space of this tutorial The screenshot on page 89 shows two different means we can’t go into more details about the pages of the smallSite site when applying the Simplicity remaining front matter variables. For the full list of front Hugo theme to it. If you try to use a different theme, say matter variables visit https://gohugo.io/content- the Osprey theme (https://themes.gohugo.io/ management/front-matter. osprey/), without customising it first then you might not achieve a very good output. This means that some A real web site Hugo themes will have a better default look. Our next web site will have an /about page as well as a Hugo has some strict rules, just like Go does, so if blog page, which practically is a basic page that will list you use the same key in config.toml more than once, all the available blog posts in order for the visitor to be you’ll see an error message similar to the following able to read them. Almost all themes generate that page when you try to start the Hugo web server: automatically. This site is going to use the Hugo Paper $ hugo server -D theme, which can be found at https://themes.gohugo. Error: While parsing config: (6, 1): The following key io/hugo-paper. was defined twice: title Execute the following commands that create the new rMacBook:smallSite mtsouk$ vi config.toml Hugo project and download the desired theme: You can find more information about the various $ hugo new site blog; cd blog/themes options of the hugo server command by executing $ git clone https://github.com/nanxiaobei/hugo-paper hugo help server . The -D option used earlier on tells Then, we’re going to create a static page as well as Hugo to include content that’s marked as “draft” – this two blog posts. Note that one of the two blog posts will new term gives us a great opportunity to talk about the have an image, too: various types of Hugo content. $ hugo new about.md But first, let’s talk about front matter. Hugo has a $ hugo new post/First-Post.md feature that enables you to add front matter in YAML, $ hugo new post/Second-Post.md The final version of config.toml is the next: baseURL = “http://hugo.mtsoukalos.eu/” languageCode = “en-us” title = “A Hugo Web Site for Linux Format!” theme = “hugo-paper” You can now build your site by just executing hugo or hugo -D , which is more appropriate because the two blog posts are Drafts, and you can see the results of the hugo -D command in the ./public directory: $ hugo $ ls -l public/ total 288 -rw-r--r-- 1 mtsouk staff 2487 Mar 13 21:52 404.html This shows the -rw------1 mtsouk staff 131063 Mar 13 21:41 LXF235.jpg root page (http:// localhost:1313/) of drwxr-xr-x 5 mtsouk staff 160 Mar 13 21:52 the blog site categories as well as the drwxr-xr-x 3 mtsouk staff 96 Mar 13 21:20 css about page (http:// drwxr-xr-x 4 mtsouk staff 128 Mar 13 21:20 img localhost:1313/ -rw-r--r-- 1 mtsouk staff 2452 Mar 13 21:52 index.html about/) as served by the -rw-r--r-- 1 mtsouk staff 516 Mar 13 21:52 index.xml Hugo web server. drwxr-xr-x 3 mtsouk staff 96 Mar 13 21:52 page

90 LXF237 June 2018 www.linuxformat.com Hugo CODING ACADEMY

CREATING NEW HUGO THEMES

Here we’ll talk about the structure of a Hugo project to better understand what goes where. The archetypes directory holds files for preconfigured content types that will be used by the hugo new command. Using these files promotes consistency among your web pages. The content directory contains the content of your Hugo web site you create – this directory might have an internal structure in order to differentiate between the different types of content. The data directory is for storing configuration files. The layouts directory stores HTML files that will be used by Hugo for rendering your content into a static web site. In the static directory you can put any static files you like, including CSS, Javascript and image files. The public directory is where Hugo puts the files that need to be deployed to a web server. Last, the themes directory is for putting your own themes or existing themes from www.github.com. Hugo also enables you to create your own themes with the help of the hugo new theme command followed by the name of the theme. Hugo themes follow the structure of a Hugo web site: the default layout file of a theme is located at layouts/_default/single.html. You This shows the http://localhost:1313/post/first-post/ and the http:// can find more information about the various options of the hugo new localhost:1313/post/second-post/ pages. Notice that the first page displays a block of Python code, whereas the second page contains an theme command by executing hugo help new theme . image stored in the static/ directory of the Hugo project.

-rw-r--r-- 1 mtsouk staff 458 Mar 13 21:52 sitemap. Setting up the hugo.mtsoukalos.eu subdomain xml involves changes to one or more DNS servers as well as drwxr-xr-x 5 mtsouk staff 160 Mar 13 21:52 tags creating a user account on a Linux server for storing the The screenshot (see left) shows the home page and static files of the Hugo web site. However, these actions the about page of the web site whereas the screenshot are omitted because they depend on your hosting (above) shows the look of its two blog posts. The post/ service. So, after setting up a domain or a subdomain First-Post.md post also contains some Python code and a UNIX user account, you should continue by formatted and displayed in a clear way. executing the following Hugo command, which depends on your web server name and UNIX user account: Other Hugo commands $ rsync -avz --delete public/ anAccount@machine:~/ Hugo supports a number of additional commands apart hugo from the ones that were used so far in this tutorial, The screenshot (below) reveals the output of the including benchmark, check, config, convert, env, gen, deployment stage using the preceding command, which import and list. also shows the structure of the public directory. The hugo benchmark command builds a site many Remember to execute the hugo or the hugo -D times while analysing the process in order to create a command first to deploy the latest versions of your benchmark. The hugo convert command is used for static web pages! converting a front matter to a different format. The That’s it – you’re now ready to start developing your hugo list command is used for displaying the content own secure and fast web sites in Hugo! of your Hugo web site: $ hugo list drafts posts/pageNo2.md posts/aWebPage.md You can find information about all the supported Hugo commands and subcommands at https:// gohugo.io/commands. Deployment phase This is the phase where you put the files that were generated by Hugo into an actual web server that uses This shows how to deploy the static an actual domain name, in order to be viewed by the files of a Hugo web desired audience. The first thing that you should change site into a remote before deploying a Hugo site to a real HTTP address on server using rsync. a real web server is the baseURL value in the config. Notice that rsync is clever enough toml file. For the purposes of this tutorial, we’re going to update only to use the http://hugo.mtsoukalos.eu subdomain for the files that have deploying our Hugo site. been changed.

IMPROVE YOUR CODE SKILLS Subscribe now at http://bit.ly/LinuxFormat www.techradar.com/pro/linux June 2018 LXF237 91 CODING ACADEMY Clone your sites

WORDPRESS Quickly create and clone your websites If you need the tools to create cloned, multiple sites into subfolders for easy management, then Kent Elchuk will get you over all the obstacles.

he purpose of this tutorial is to guide you T through the process of using the Wordpress feature known as multisite. First, let’s make sure we know what that is. A Wordpress multisite is an aspect of Wordpress that enables you to run multiple OUR Wordpress sites all on a single installation using a single EXPERT database. Think of it as various sites located in subdomains or subfolders. We can log into a site at cat. Kent Elchuk example.com and dogs.example.com and manage is a full-time web them separately as if they were separate installations. From the master Dashboard the Network Admin has full control and developer and Multisites have many possibilities for usage: imagine can do everything from making new clones to installing plugins. Linux enthusiast a website with various categories and locations. A whose spare time multisite will enable the admin to make it unique to each reads /* That’s all,stop editing! Happy blogging. */ includes category or location. In addition to it being practical, it as follows: programming can be beneficial for SEO (search engine optimisation) /* Multisite */ and hydroponic because the parent site could link to the sub-sites and define( ‘WP_ALLOW_MULTISITE’,true ); food production. be the start of linking something that will pick up from /* That’s all,stop editing! Happy blogging. */ viewers in various locales. When a multisite is used, After that, in the Wordpress admin located at http:// there will be a master admin that can log into the main localhost/wordpress-multisite/wp-admin,wegoto installations of plugins and run any multisite. Meanwhile, Tools>Network Setup. After that, we click Install. After the master admin can create new multisites and create the click, we will see two pieces of code that we can add admins for any multisite. to the .htaccess and wp-config.php files. In our root Now, a quick briefing on cloning. Wordpress has folder on an Apache server, we change the .htaccess file several plugins that can clone any one of the sites. This to resemble the line below. If it’s not there, we can makes it simple and easy to make carbon copies of sites create it and add the following lines: that other people can manage. Although a new clone RewriteEngine On will retain all the original text and images, any new RewriteBase /wordpress-multisite/ content and images will be specific to that particular RewriteRule ^index\.php$ - [L] multisite instance. Now that we have the gist of how a multisite # add a trailing slash to /wp-admin functions and why it’s useful, let’s go through the steps RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ to getting our own up and running. Note, however, that $1wp-admin/ [R=301,L] we’re not just limited to using multisite with new sites. Yes, we can take our Wordpress site that’s already up RewriteCond %{REQUEST_FILENAME} -f [OR] Backing up and running and convert it use multisite. To make this RewriteCond %{REQUEST_FILENAME} -d a database article useful for everyone, this article will cover how it’s RewriteRule ^ - [L] is easy with done from an installation from scratch. RewriteRule ^([_0-9a-zA-Z-]+/)?(wp- phpMyAdmin or (content|admin|includes).*) $2 [L] mySQL console. Create a new multisite RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L] Files can easily We can install the basic Wordpress after we download it RewriteRule . index.php [L] be zipped and and set up the database. Once Wordpress is working, we Meanwhile, below is the relevant code for the saved in a can open wp-config.php and make some subtle wp-config.php file. secure place. changes. We add the following code above the line that define(‘MULTISITE’, true);

92 LXF237 June 2018 www.linuxformat.com Clone your sites CODING ACADEMY

define(‘SUBDOMAIN_INSTALL’, false); Making a new site will create a bare define(‘DOMAIN_CURRENT_SITE’, ‘localhost’); bones site for a define(‘PATH_CURRENT_SITE’, ‘/wordpress- new subfolder. It’s multisite/’); basic, but at least define(‘SITE_ID_CURRENT_SITE’, 1); it’s a start. define(‘BLOG_ID_CURRENT_SITE’, 1); To always be able to find these codes in the future, we just go to Network Admin>Settings>Network Setup. Now that we have a working multisite, we can create new ones. Our original website is located at the URL localhost/wordpress-multisite. Thus, if we click Sites from the left-hand menu, we can see that URL. For learning purposes, let’s create a new site to see how this works. All we need to do is click the Add New recommended time of 60 seconds. In addition, the button to the top. The three key pieces to add in the text plugin may show some errors writing to a log file. boxes are the URL, site title and email address. Then we Even though we have these warnings, the clone is just click Add site and we have a new one. more than likely successful. However, if we want to If we go back and view the sites now, we can see remove the max_execution_time warning issue, we can localhost/wordpress-multisite/new has been added to create a simple PHP file and output PHP info. The the list. If we hover over the listing and click Visit, we can simple one-liner is shown below. see it looks exactly as the original. If we click Dashboard, Admin>Dashboard. Then from the top. Then, we open the file with an editor like we can select Sites and go to any of our existing ones. vim or nano and do search for that line with max_ When we make new sites in this manner, each one execution_time. Then, we change the time to 60. Having will begin from a simple, default setting. Therefore, if we used this plugin on multiple occasions, even with sites change our original site and other sub-sites, the main with many images, pages and posts, clones are typically page post will still be that Hello World post. In many done in a few seconds and much less than 30 seconds. cases, this may suit our needs. At other times, we may Thus, we shouldn’t panic and be that concerned with want a copy of something we actually built. For that to this max_execution_time warning. happen, we need to install a cloning plugin that will do With that said, we must keep mind that a clone will just that. copy the actual images in addition to all text that exists in the site which will be clones. As far as the log file issue Send in the clones goes, we just need to change permissions on the To install the plugin, we need to go to the Network wp-content/plugins/ns-cloner-site-copier/logs folder. Admin dashboard, hover over Plugins and click Add To do this, we just navigate to that folder with the New. On the right side of our page, we can search for command line and change permissions. That code is plugins. A word like cloner or NS cloner will reveal the shown below. NS Cloner plugin. cd /var/www/html/wordpress-multisite/wp-content/ After we see the NS Cloner plugin, we can select plugins/ns-cloner-site-copier Install Now. For manual installations, we can download it chmod -R 777 logs from https://en-ca.wordpress.org/plugins/ns-cloner- site-copier. After that, we can unzip the file and move the folder into the wp-content/plugins folder. For MANAGING USERS manual installations and online installations, we can see its presence in the installed plugins list located in the One key advantages of using Wordpress multisite is that we can Network Admin. We can find it at Plugins>Installed create sub-sites and have them managed by someone else. So our Plugins. After that, we can select Network Activate, if mulitsite could be a series of smaller sites operated by individuals in a necessary. If it’s activated, a new item will show on the given location. One example where sites would be managed by local Network Admin dashboard with NS Cloner as part of users could be an information site about a local activity, such as the label. At time of writing, the title is NS Cloner V3. hiking. Every sub-site would be managed by a user from the given Let’s not waste any time and give it a whirl. To begin location that would make that sub-site informative for that location. with, we just click NS Cloner V3. Then, we can see all To keep this simple, all we need to do is make admins for each one sorts of text and imagery relating to this plugin. To cut to of our sites and let them manage the rest. Let’s clone a new site and the chase, go down to Select Source and choose one of call it ‘clone’, and make the URL http://localhost/wordpress- our existing sites; whether it be the original or one we multisite/clone. Now, any one of the users for that single site can created with multisite. open http://localhost/wordpress-multisite/clone/wp-admin and The next step is to add a title. For simplicity, we can login with the respected privileges. call it First Clone. Just below that, we write a URL. Let’s When using multisite with multiple admins for each sub-site, all we call it first-clone. After that, we just click Clone. After we need to know is that the Network admin for the original account can click Clone, it will likely clone rather quickly. What could maintain everything; including new sites and clones. Meanwhile, any happen with default PHP settings is that we’ll probably privileges on each separate clone or site will only work in that instance. see a warning about max_execution_time that has a

www.techradar.com/pro/linux June 2018 LXF237 93 CODING ACADEMY Clone your sites

Now that we can clone and make new sites without enables us to make changes to the individual site. If we cloning, let’s take a little look behind the scenes to see deactivate it the site won’t show up in a browser and it’s exactly what’s happening. Basically, there are changes gone if we delete it. However, keep in mind that if we to files and folders located at wp-content/uploads. If deactivate a site, we could still see it in a browser when we don’t have that folder on a local Linux box, we can logged in to the admin, but it can’t be seen in another create it and give it permissions of 777. The code is browser for which we’re not authenticated. shown below how to set that up, if necessary. $ cd /var/www/html/wordpress-multisite/wp-content Search and replace $ mkdir uploads When we clone a website with NS Cloner, it’s likely we $ chmod 777 uploads want to make text and image changes to the new clone. When we add images to any of our sites, they’ll Images are a snap. All we need to do is upload new go into a tree of folders located in the Uploads folder. images and remove undesired images for that Site The original site will store images in a folder like dashboard using the Media link form the main left uploads/2018/04. This is the current year and current menu. However, text can be another story. month. The cloned sites and new sites will store images Let’s go back and rethink a little about the cats and in a path like uploads/sites/2/2018/04. Thus it dogs idea we had looked at earlier. Assume that we follows that they are in sequence from when they are want to change all the text of a new clone and replace made. For example, a clone with a path like uploads/ the word dog with the word cat. For example, we may sites/3/2018/04 was the clone that was made after want to do this because we have various titles and text the uploads/sites/2 clone. in the posts and pages that have that word. Doing this will save invaluable time. Setting the table To make a start on this, we want to go to the Network Asides from images, new database tables are created Admin and install a search and replace plugin. This is every time a clone is made or a new site is created the same procedure as we had performed with the NS without cloning. Let’s look into how this works. For the Cloner plugin. One plugin that does this well can be original site, the database will use tables with a prefix found at https://wordpress.org/plugins/search-and- like wp_options. replace. After the plugin is installed, we want it to make When new sites are made, they will use new, copied sure it’s activated for the network. Once that’s done, we tables with a prefix like wp_2_options. Each new site will can use it on any sub-site. So, let’s go give it a go and use one number more than the last number. This make some changes to our latest clone. database numbering makes it easy to match the files in Once we select our desired site dashboard, we can the uploads folder with the database, just in case more access the Search and Replace tool from the left menu. experienced users want to make changes at the It’s located at Tools>Search and Replace. Once we click database level. In addition, we may want to know which that, we can choose the tab that says Search & Replace. folders and database tables to remove if we want to To do this successfully, we add the word we want to find, clean up old installations, since these won’t disappear followed by the text replacement. After that, we select when we remove a site from the Network Admin. all tables, uncheck Dry Run and select Save changes to Now that we have some copies and clones, let’s Database. Finally, we click Do Search & Replace. just a little and take a look at how we can When using search and replace, caution should be manage the sites. We know how to access a site exercised because some strings will also be changed. dashboard. Now, let’s take a quick glimpse of some of Thus, let’s say we wanted to change dog to cat. Words Wordpress has a multitude of the other links for the Sites list in the Network Admin. like hotdog will change to hotcat. If we look at the details cloning tools, These other options will enable us to do various tasks after we make a switch, we can see all changes and if including NS asides from going to the dashboard. We can deactivate there’s the odd one that is off, we can fix it. Alternatively, Cloner. After we a site, archive, mark as spam, delete and visit a site. we can do a dry run before making database changes to make that perfect When NS Cloner is used, we have the cloning option too. see if we want to make a change to a page, post or title master site, the rest can clone Even though we have a decent list of options, the before making the changes permanent. exactly as we like. main feature we will use is Dashboard because it At this point we’ve basically covered the main details for building our web using multisite. We can set it up, manage all text and images on our microsites and remove any we don’t need. Those skills are invaluable. To tie this whole exercise together, let’s go back to our original site and make a few custom changes to the look. We can use the default Wordpress theme and make it look as good as any other DIY builder. Let’s focus on making a multisite that we can use that will look professional. We can do this with a simple copycat approach, rather than try to be so custom that coding and extensive image editing is involved. The go-over approach So, let’s go back to our original installation in the sites list. For now, we can also delete the others from the list because we’ll want to clone the original. We can delete each site one at a time, or select the checkbox next to

94 LXF237 June 2018 www.linuxformat.com Clone your sites CODING ACADEMY

HOWTOINSTALLWORDPRESS

Before we begin, let’s download it from wordpress.org. Since Wordpress uses a database, we need to set up a mySQL database with a user and password. Then, we unzip the file and can rename it wordpress-multisite. We can upload it to web hosting or copy and paste it to our localhost at /var/www/html on our Linux machine. Next, open a web page in a browser that matches our folder. In this case, that would be localhost/wordpress-multisite. On a host it would be something like http://example.com/wordpress-multisite. Follow the instructions, such as adding our database name, username and password. The default prefix is wp_ but we can change it. We can see how PHP is configured with a couple of words of code. It On a home server we may need to edit wp-config-sample.php and will tell us where the configuration file resides and the current settings. add the database name, username and password and save it as wp-config.php if the server has trouble writing the file. Near the end each one (except the first one). Then click the Bulk of the installation, we add a site title, username and password for the Actions drop-down, select Delete and click Apply. After admin area. We don’t want to confuse this username and password that, you’ll be taken to a new page – click Confirm. with the database setup because it has nothing to do with that. These Now, let’s give the original site a quick makeover and credentials are so that we can log into the site and control the load the dashboard for the original site. To swap the content, theme and other features using a browser. main image, go to Appearance>Themes>Customize. As soon as we enter these characters and select Install Wordpress, You’ll see a list of tab options. For starters, let’s click we’ll be guided to the admin login for which we can enter the Header Media. If we look on the left, we can see that we username and password to login. can swap the image. To see the size of the current header image, we can use Firefox and right-click the large image on the right and choose View Image Info. html/wp-content/themes/twentyseventeen/ With Image Info, we have a few items in the list. We template-parts/footer/site-info.php. Alternatively, we want to select the item from the list with a name like can go to Appearance>Customize and choose http://localhost/wordpress-multisite/wp-content/ Additional CSS. The code below will hide it from the themes/twentyseventeen/assets/images/header.jpg. Twentyseventeen theme we’re using. Now, we can see its size and make a new image that is div.site-info{display: none !important} exactly the same size. Our image size is 2,000 x 1,200. That pretty much makes it look ready and usable. After we create this image, we choose the Add New Now, there are just two things we may want to change. Image option image within Header Media, as previously We can create and edit categories from the dashboard discussed. We make a simple change, do a small crop, at Posts>Dashboard. After that we may want to create and click Publish. Now, if we refresh our main site at menus. Menus can be created at Appearance localhost/wordpress-multisite we can see the new >Customize>Menus. They can be managed at header image. Although that new header looks more Appearance >Menus. Now that we have the decent look appropriate to our needs, the site still has too much stuff and are satisfied with the basic site, we can clone the we don’t need: the tagline Just another Wordpress site site until our heart’s content. So there we go. We can and everything on the sidebar except the categories. now make large multisites with a single database. The To change the tagline, we go back to Header Media sky’s now the limit for our next creation. and choose the Site Identity tab. Then we simply change it or remove it. While we’re here, we may as well change the site title too. Then, we click Publish. To remove the stuff on the right, we go to our main menu and select Appearance>Widgets. We can select any drop-down we want and remove it. In our case, we will keep categories because each site will have a list. If we ever want to put one back, we can drag from the left to the Blog sidebar and order them as we please. Much better, now let’s make a new home page. To do this, go to Appearance>Customize or Appearance> Themes>Customize and select Homepage Settings. Then we choose Static Page. Under Homepage, we select Sample Page followed by Publish. We can alter this page content on the dashboard by choosing Pages>Edit for our chosen page. Then, we just click Update and our changes are done. Now, let’s change the footer text. We can change that Making a folder and changing permissions can be done in a flash. When we want to write files to in the theme template. In our case, that file is var/www/ a folder, it needs the permissions of 777; otherwise the file won’t exist.

IMPROVE YOUR CODE SKILLS Subscribe now at http://bit.ly/LinuxFormat www.techradar.com/pro/linux June 2018 LXF237 95 On the disc Distros, apps, games, books, miscellany and more…

TINY AND PORTABLE

Slax 9.4.0 32- and 64-bit NEIL lax is a lightweight, portable distro S designed to be run from a USB stick. BOTHWICK We know what you’re thinking: that The transition from Windows or doesn’t seem unusual as almost all of the distros MacOS to the initially mysterious on our DVDs can be copied to a USB stick with yet eventually fulfilling world of dd or Etcher. And so yes, you can do the same Linux can be a difficult one, as with Slax, but the disadvantage of this method can choosing the best is that it takes over the entire USB stick – no distribution for it. Creating a matter how compact the distro or capacious distro for that situation is even the USB stick. more fraught with obstacles. If you use the Slax method to install it on a Allow me to explain… USB stick, the rest of the stick remains usable, I think we’re all agreed that and in a very useful way, too. Slax can use a there’s no point in a distro trying persistence file or directory to store files and Lightweight and portable, but with all the to pretend it’s something it isn’t. settings. This means that the next time you essentials – Slax is a computer in your pocket. Linux and Windows are boot from the stick you’ll have everything you fundamentally different saved last time, even if last time was on a this directory to the root of your target USB computing beasts and a new different computer. stick. Then open a terminal and change directory user has to come to terms with All you need to do it boot Slax from the DVD, to your new slax directory. From here run the that. Equally, there’s no point in or a copy on a USB stick, insert a separate USB following code: trying to make a distro behave stick and navigate to the /run/initramfs/ $ cd boot like a Windows clone because memory/iso directory on the live Slax system. $ sh bootinst.sh that would be a dead end. The Here you’ll find a directory called slax –copy This will make the USB stick bootable; you user still doesn’t know Linux, can now reboot and select the USB option from except to think that it’s like your computer’s boot menu. If you formatted Windows, and would have just as the USB stick with the FAT filesystem (or did not much of a shock trying any other format it because it was supplied this way) your distro as the shock we were changes will be saved to a file called slax/ trying to avoid initially. changes/changes.dat. Because of the limits of The ideal situation is a friend the FAT filesystem, this file cannot exceed 4GB in who knows Linux to guide the size, so you’re limited to saving that much data. new user into the different If you format the USB stick with a native Linux environment (although that can filesystem, such as ext4 (although some argue be a way of losing friends… just that ext2 is better for flash drives) the changes sayin’). In such a case, the ideal will be saved to the directory slax/changes and distro is the that one the the only limit on what you can store is the experienced friend knows and capacity of your USB stick. uses regularly. Copy one folder and run this script, and you’ll A welcome side effect of the small size of Slax The next best thing is a distro have a Slax live USB stick that will save files is that we were able to fit both 32- and 64 bit that does its best to ease the and settings between runs. versions of it on the DVD. transition while still making that transition, so the new user isn’t in a permanent newbie state but IMPORTANT NOTICE! becomes a more experienced DEFECTIVE DISCS: For basic help on running the disc or in the unlikely event of your user. Hopefully, they’ll be one Linux Format coverdisc being in any way defective, please visit our support site at who’s able to help other friends www.linuxformat.com/dvdsupport. Unfortunately, we’re unable to offer advice on cross the great divide between using the applications, your hardware or the operating system itself. Windows and Linux.

96 LXF237 June 2018 www.linuxformat.com IDEAL FOR WINDOWS AND MACOS USERS AND MORE!

GNU EMACS MANUAL Zorin OS 12.3 64-bit I’ll now risk alienating half of our readership by Book irst-time Linux users can find it a stating that I use Emacs to edit text, of the F bewildering experience, because so then risk upsetting Month much is different (of course it is, that’s most of the remainder the point). so Zorin OS tries to make the by saying I only use it to transition as painless as possible. edit text. Emacs is an incredibly powerful platform It’s not a distro pretending to be a different based around a text editor that OS, just trying to make migration easier. This is can do so much more than edit an important distinction because it means Zorin text. That’s why it has a 600+ is still a “proper” Linux distro, one that you can page manual. If you’ve ever use when new to the OS and continue using as wondered what all the fuss is about, you can find out. From you become more confident, and maybe more Easier to come to terms with for Windows users, the arcane, but quite logical, demanding, too – a distro suitable for both but still a proper Linux OS, Zorin OS tries to give keyboard commands to the use grannies and geeks! the best of both worlds. of macros and even reading email – it’s all in here. Ubuntu is a trademark of Canonical Limited. We are not endorsed by or affiliated with Canonical Limited or the Ubuntu project. THE BIONIC BEAVER OF DISTROS 64-bit READING MATTER

Advanced Bash Ubuntu 18.04 ‘RC’ Scripting Guide Go further with shell scripting.

t’s time for everybody’s (well almost) Ubuntu 18.04 is an LTS (Long Term Support) Bash Guide for Beginners I favourite distro again. Unfortunately, release. Normal releases are only supported for Get to grips with the basics Ubuntu’s production cycle and ours nine months, so updates stop appearing soon of Bash scripting. were rather put of sync this time around and the after the next version comes out, but LTS Bourne Shell Scripting final release was just too late for the DVD so we releases have five years of support. This means First steps in shell scripting. used the release-candidate kernel freeze period. that you will receive bug fixes and security The Cathedral and We don’t normally do this, but this one is very updates until 2023. the Bazaar close to the final version, and all that’s likely to However, it doesn’t mean you’ll receive Eric S Raymond’s classic text explains the advantages of differ between this version are some translation upgrades to the latest software, because the LTS open development. updates and possibly the odd late bug fix. is meant to be a stable release. This is the Naturally, any of these will be available as Debian definition of stable, in that things stay The Debian Book updates so after the first update you’ll have the much the same with no surprises. This does not Essential guide for sysadmins. full release version. make the other releases unstable! Dive Into Python Everything you need to know. As close as Introduction to Linux possible to A handy guide full of pointers the final for new Linux users. release of Ubuntu Linux Dictionary 18.04, this is The A-Z of everything to do with Linux. the second release to Linux Kernel in a Nutshell use a Gnome An introduction to the kernel desktop as written by master hacker the default. Greg Kroah-Hartman.

The Linux System Administrator’s Guide Take control of your system.

Tools Summary Overview of GNU tools. GNU Emacs Manual Six hundred pages of info! DOWNLOAD Producing Open Source NEWTOLINUX?STARTHERE YOUR DVD Software We answer your questions, insert the DVD and open index.html Everything you need to know. What is Linux? How do Iinstallit? IMAGES! Programming from the Is there an equivalent of MS Office? Get code and DVD images at: Ground Up What’s this command line all about? www.linuxformat.com Take your first steps. /archives

www.techradar.com/pro/linux June 2018 LXF237 97 The #1 open source mag

Future Publishing Limited, Quay House, The Ambury, Bath, BA1 1UA Email [email protected] EDITORIAL Editor Neil Mohr LXF238 [email protected] Ubuntu installer Jonni Bidwell Art editor Efrain Hernandez-Mendoza will be on sale Operations editor Cliff ‘Eternal’ Hope Group editor in chief Graham Barlow Tuesday Senior art editor Jo Gulliver Editorial contributors Tim Armstrong, Mats Tage Axelsson, Neil Bothwick, 5 June 2018 Sean Conway, Alex Cox, Kent Elchuk, Matthew Hanson, Jeremy Laird, Brian Mork, Les Pounder, Mayank Sharma, Shashank Sharma, Valentin Sinitsyn, Alexander Tolstoy, Mihalis Tsoukalos Cartoons Shane Collinge Cover illustration magictorch.com ADVERTISING Media packs are available on request Commercial director Clare Dove [email protected] Senior advertising manager Lara Jaggon [email protected] Advertising manager Michael Pyatt [email protected] Director of agency sales Matt Downs [email protected] Ad director – Technology John Burke [email protected] Head of strategic partnerships Clare Jonik [email protected] INTERNATIONAL LICENSING Linux Format is available for licensing. Contact the International department for partnership opportunities: International licensing director Matt Ellis [email protected] Tel +44(0)1225442244 SUBSCRIPTIONS & BACK ISSUES Web www.myfavouritemagazines.co.uk Email [email protected] UK 0344 848 2852 International +44(0)3448482852 CIRCULATION Discover how to build a… Head of newstrade Tim Mathers PRODUCTION AND DISTRIBUTION Head of production UK & US Mark Constance Production project manager Clare Scott Advertising production manager Joanne Crosby Digital editions controller Jason Hudson Production controller Nola Cokely Custom desktop MANAGEMENT Chief operations officer Aaron Asadi Media operations director Zack Sullivan AlreadytiredofthenewUbuntuGnomedesktop? Editorial director Paul Newman Head of art & design Rodney Dive Thenbuildyourownwithourcompleteguide! Commercial finance director Dan Jotcham Printed by Wyndeham Peterborough, Storey’s Bar Road, Peterborough, Cambridgeshire, PE1 5YS Distributed by Marketforce, 5 Churchill Place, Canary Wharf, London, E14 5HU www.marketforce.co.uk Tel: 0203 787 9001

LINUX is a trademark of , GNU/Linux is abbreviated to Linux Wine is not an emulator! throughout for brevity. All copyrights and trademarks are recognised and respected. Where applicable code printed in this magazine is licensed under the GNU GPL v2 or later. See www.gnu.org/copyleft/gpl.html. Butwhatdoesitmean?Wetestthelatestv3.x We are committed to only using magazine paper which is derived from responsibly managed, certified forestry and chlorine-free manufacture. The paper in this magazine was sourced and produced from sustainable managed forests, featuresandshowyouhowtogetthemostfromit. conforming to strict environmental and socioeconomic standards. The manufacturing paper mill holds full FSC (Forest Stewardship Council) certification and accreditation Disclaimer All contents © 2018 Future Publishing Limited or published under licence. All rights reserved. No part of this magazine may be used, stored, transmitted or reproduced in any way without the prior written permission of the Google TensorFlow publisher. Future Publishing Limited (company number 2008885) is registered in England and Wales. Registered office: Quay House, The Ambury, Bath BA1 1UA. All information contained in this publication is for information only and is, as far as we are aware, correct at the time of going to press. Future cannot accept any WetrytomakeourRaspberryPisevensmarterby responsibility for errors or inaccuracies in such information. You are advised to contact manufacturers and retailers directly with regard to the price of products/ services referred to in this publication. Apps and websites mentioned in this running the machine-learning TensorFlow on it! publication are not under our control. We are not responsible for their contents or any other changes or updates to them. This magazine is fully independent and not affiliated in any way with the companies mentioned herein. If you submit material to us, you warrant that you own the material and/or have the necessary rights/permissions to supply the material and you automatically grant Future and its licensees a licence to publish your submission in whole or in part in Improve Wordpress any/all issues and/or editions of publications, in any format published worldwide and on associated websites, social media channels and associated products. Any material you submit is sent at your own risk and, although every care is taken, neither Future nor its employees, agents, subcontractors or licensees shall be liable for loss You’ve built your site, cloned your site and made a or damage. We assume all unsolicited material is for publication unless otherwise stated, and reserve the right to edit, amend, adapt all submissions. theme.Nowit’stimetomakeitrunasfastaspossible. All contents in this magazine are used at your own risk. We accept no liability for any loss of data or damage to your systems, peripherals or software through the use of any guide. Many DVDs died to bring us this magazine.

Future is an award-winning international media group and leadingdigitalbusiness.Wereachmorethan57million Image editors international consumers a month and create world-class content and advertising solutions for passionate consumers Fiveofthebestopensourcephotoandimageeditors online, on tablet & smartphone and in print. go under the Roundup microscope for further scrutiny.

Contents of future issues subject to change – we might still be on the wine. Future plc is a public company Chief executive Zillah Byng-Thorne quoted on the London Stock Non-executive chairman Richard Huntingford Exchange Chief financial officer Penny Ladkin-Brand (symbol: FUTR) www.futureplc.com Tel +44 (0)1225 442244 98 LXF237 June 2018

9000 9001