03

0 74820 58049 3 US$ 15.99 CAN$ 17.99 Issue 208 Mar 2018 BackBox Specialty for security audits TUNING TERMINAL Jotting notes with notes with Jotting Joplin space Pioneer adventure network the USB over USB/IP with

• • Tutorial • FOSSPicks

Spice up the light around Spice up the light around TV with Lightpack your Rasp Pi Tricks

newest Fedora newest FEDORA 27 FEDORA We test drive the the drive test We MARCH 2018 ou know about ou know about

This new phone This puts your first privacy Eelo

INSIDE! Double-Sided DVD Double-Sided DisplayCAL free task-management tool free Stay productive with a Stay productive To-Do Managers To-Do

with

– Meltdown and Spectre Meltdown and maddog – Get better colors on your monitor your Get better colors on

– Do y vs apt-get – Apt  the new Debian package tool? the new

WWW.LINUXPROMAGAZINE.COM

5

better Bash

Tips and tools for a Tips and tools for private cloud

Personal server for a server for a Personal YunoHost What’s New in Fedora 27 in Fedora New What’s

TERMINAL TUNING TERMINAL

DVD FREE

LINUX PRO MAGAZINE ISSUE 208 MARCH 2018 Terminal Tuning YunoHost Fedora 27 To-Do Managers BackBox Linux Lightpack KiCAD Apt versus apt-get DisplayCAL

EDITORIAL Welcome REMEMBERING THE RULE

Dear Reader,

The recent action by the US Federal Communications So instead of working to solve the problem at a national or Commission to reverse previous policy and rescind net international level, with broad-reaching policy decisions neutrality received lots of attention. Of course the geeks by government-appointed czars and kingpins, the other didn’t like it, but a sizable majority of ordinary citizens approach is to just act locally, within your own community, didn’t like it much either. In fact, many wondered who did and support municipal broadband. like it, aside from broadband service providers and those Most municipal broadband systems are funded through who believe the way to help America succeed is to yield to bonds and do not receive direct government subsidies. the wishes of broadband service providers. If you follow They function very much like companies, but the differ- the high tech news, you know that much has already been ence is: The customers and the shareholders are the same written on this decision – including in this magazine, so I people. They don’t face the weird dilemma that broadband won’t dwell on it for long. companies must face, where the customers and the share- What I really want to mention is a report from researchers holders are different people, and the best way to return at the Berkman Klein Center for Internet and Society, at value for the shareholders is to yank around the custom- Harvard University. The authors studied 40 community- ers, which is basically what is happening with the end of owned ISPs and compared them to similar plans offered net neutrality. by commercial providers. The result was that municipal Acting locally is often a more reliable way of affecting pub- broadband providers typically charged less and offered lic debate. You might not have a chance against an army of more transparent pricing, with fewer gimmicks. lobbyists in your national capital, but at your local city hall, This might seem obvious – why wouldn’t governments, who the field really is a little closer to level. And if enough small just want to break even, be able to provide Internet service towns and cities take up the challenge of providing their for less than businesses, who are trying to make a profit? own Internet service so they can get it their own way, the Plausible as this may seem, the USA runs on a deeply held commercial Internet providers might just wake up one day conviction that businesses do things more efficiently than and remember another rule they probably learned in busi- governments. ness school. “Oh yeah…the customer is always right.” Unfortunately, as illuminating as this study on municipal broadband might seem, it does not totally resolve the business vs. government (capitalism vs. socialism) ideo- logical divide. The capitalists would readily argue that business is better because it promotes competition. In Joe Casad, some cases, they are probably correct, based on time-hon- Editor in Chief ored rules learned in business school and the tendency of governments to move lumberingly. But the fact is, there isn’t much real competition in the broadband ISP market, so broadband isn’t a very good example of a free market. The gulf between these sweeping ideological viewpoints has led to the present state of dysfunction. One party gets in power and imposes net neutrality. The other party gets in and eliminates it. The next time the power structure in Washington shifts, the net neutrality pendulum will swing back again – unless Congress does something about it first, and (the truth be told) Congress really doesn’t do very much.

Info [1] City-Owned Internet Services Offer Cheaper and More Transparent Pricing: https://​­arstechnica.​­com/​­tech‑policy/​ ­2018/​­01/​­city‑owned‑internet‑services‑​offer‑cheaper‑and‑​ more‑​transparent‑pricing/

LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM ISSUE 208 MARCH 2018 3 MARCH 2018

NEWS COVER STORY

08 News 16 Terminal Tuning WHAT'S INSIDE • Dell Kickstarts 2018 with a Brand New Tired of the same old Bash? We explore Linux Laptop some helpful tools for extending and • Linus Torvalds Rips Intel for Meltdown expanding your shell experience. This month we present some and Spectre Flaws interesting utilities for enhancing • LibreOffice-Based CODE 3.0 Released your command-line experience. • Google Announces Kubeflow to Bring Other highlights include: Kubernetes to Machine Learning • YunoHost – A cool Linux • Critical Flaw in phpMyAdmin alternative that easily installs an array of important server 12 Kernel News applications (page 22). • Implementing Digital Rights • Lightpack – Check out this Management In-Kernel • Improving Lighting Controls weird technology that lights • Updating printk() up the wall behind your TV (page 56). Over at LinuxVoice, you’ll learn about the new apt package tool and how it REVIEWS differs from apt-get. We’ll also show you how to calibrate your monitor 22 YunoHost 32 To-Do Managers with DisplayCAL (page 78). YunoHost offers a wide range of services Busy people have busy calendars full of on a proven Debian platform that you can appointments and tasks. Linux to-do- host yourself. managers help manage the clutter in a controlled way. SERVICE

3 Comment 6 DVD 96 Featured Events 97 Call for Papers 28 Fedora 27 98 Preview Fedora Linux is a favorite of developers, sys admins, and tech-savvy users. We check out the latest release.

4 MARCH 2018 ISSUE 208 LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM LINUX MAGAZINE MARCH 2018

IN-DEPTH MAKERSPACE

42 Command Line – unoconv 56 Lightpack A hidden utility in the LibreOffice toolbox, Ambilight lights up the wall behind unoconv offers a wide array of import Philips TVs with LEDs mounted on the and export filter options. device to enhance the onscreen visual impression. All you need is Lightpack 46 Programming Snapshot – and a Rasp Pi. Protectli What is making the lights on the router 60 KiCad flicker so excitedly? An intruder? We KiCad helps you design printed circuit investigate with pfSense on a Protectli boards with up to 32 layers and supplies micro appliance and a screen scraper to schematics and assembly diagrams in email the information. the popular Gerber format.

50 BackBox Linux TWO TERRIFIC Specializing in security and forensics, DISTROS BackBox Linux is ideal for vulnerability DOUBLE-SIDED assessment, but it also works well as an DVD! everyday desktop distribution. SEE PAGE 6 FOR DETAILS

66 Open Hardware – eelo Mandrake creator, Gaël Duval has big plans for a free-licensed phone.

54 Charly’s Column – Tsung Charly uses the Tsung load generator instead of human users as beta testers.

84 FOSSPicks Ocenaudio 3.3.6, Otter Browser, Joplin, WeeChat 2.0, Mailspring, Siril 0.9.7, SuperTuxKart 0.9.3, and more! 71 Welcome 78 DisplayCAL This month in Linux Voice. If you’re tired of inaccurate colors on your monitor, try calibrating and 72 Doghouse – Security profiling using a colorimeter and A serious security problem requires DisplayCAL. your attention.

74 apt vs. apt-get The apt command-line utility is a successor to the well-known apt-get, 92 Tutorial – USB/​IP offering simpler installation and USB/​IP lets you use USB devices maintenance for the DEB packages connected to other machines as if used with Debian, Ubuntu, Knoppix, they were plugged directly into and many other Linux distros. your computer.

LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM ISSUE 208 MARCH 2018 5 DVD This Month’s DVD On the DVD Fedora 27 Fedora is a Red-Hat-sponsored, all-Free Linux alternative with a reputation for the cutting edge. Many of the enterprise innova- tions that will one day make their way into Enterprise Linux get their start in Fedora. Fedora 27 features the Gnome 3.26 desktop, with improved Display and Network configuration panels and a better system search feature. The latest Fedora also comes with support for color emojis, as well as many im- provements with LibreOffice 5.4 and Fedora Media Writer.

NetBSD 7.1.1 The NetBSD “Unix-like” is part of the famous BSD family of OS distributions that predated the development of Linux. The BSDs are known for stability, security, and a loyal community of users. NetBSD 7.1.1 is a security/​critical update of NetBSD 7.1, which introduced Linux compatibility improve- ments, a new driver for the Google Computer Engine, better TWO TERRIFIC support for NVidia graphics cards, and other enhancements. DISTROS DOUBLE-SIDED DVD!

Additional Resources [1] Fedora 27 Release Notes: https://​­docs.​ fedoraproject.­ ​­org/​­f27/​­release‑notes/ [2] Fedora 27 Installation Guide: https://​­docs.​­fedoraproject.​­org/​­f27/​ install‑guide/­ ​­index.​­html [3] NetBSD 7.1.1 Release Announcement: https://​­www.​­netbsd.​­org/​­releases/​ formal‑7/­ ​­NetBSD‑7.​­1.​­1.​­html [4] NetBSD Guide: https://​­www.​­netbsd.​­org/​ docs/­ ​­guide/​­en/​­index.​­html [5] NetBSD Documentation: Defective discs will be replaced. Please send an email to [email protected]. https://​­www.​­netbsd.​­org/​­docs/

6 MARCH 2018 ISSUE 208 LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM

NEWS Updates on technologies, trends, and tools

THIS MONTH’S NEWS

Dell XPS 13 Developer 08 Edition • Dell Kickstarts 2018 with a Brand New Linux Laptop • Linus Torvalds Rips Intel for Meltdown and Spectre Flaws Dell Kickstarts 2018 with a Brand New

A Community Version of Linux Laptop 09 LibreOffice Online • LibreOffice-Based CODE 3.0 Dell is one of the only major PC vendors that sells Linux preloaded systems. The com- Released pany has announced a brand new laptop from the XPS 13 family that runs Ubuntu Linux. The 7th generation XPS 13 Developer Edition (9370) is powered by Intel’s 8th A Multicloud Solution for generation Quad Core processor and features a brand new chassis and a new display. 10 Machine Learning These machines are a result of Project Sputnik, which started back in 2012 and • Google Announces celebrated its 5th anniversary last year. Kubeflow to Bring Dell XPS 13 Developer Edition features 8th Generation Intel Quad Core, i5 (US Kubernetes to Machine and Canada only), and i7 versions. It comes with three different configurations for Learning memory – 4GB, 8GB, or 16GB Dual Channel SDRAM. Users can get up to 1TB of • Critical Flaw in storage. The system also comes with a choice of the UltraSharp 4K Ultra HD phpMyAdmin (3840×2160) InfinityEdge touch display or the FHD (1920 x 1080) InfinityEdge dis- play. It comes with a USB Type C port for transfer and two Thunderbolt 3 ports with PowerShare, DC-In, and DisplayPort. It also has a built in SD card reader. Dell’s engineering teams work with partners to develop drivers for supported Linux distributions. These machines comes with the LTS release of Ubuntu and offer a com- plete out-of-the-box experience with full support for touch screen. Although Ubuntu is the officially supported OS, users can wipe the hard drive and install any OS of their choice without worrying about the hard- ware warranty. High demand for the system means that Dell is also making it available in some European countries, including the UK, Ireland, Germany, Austria, France, Italy, Spain, Switzerland (French and German), Belgium, Netherlands, Sweden, Norway

and Denmark. Themes on Unsplash Photo by NordWood

Linus Torvalds Rips Intel for Meltdown and Spectre Flaws

Linus Torvalds, the creator of the Linux kernel, is not known for mincing words when it comes to core technology. The world is still recovering from the shock waves of Meltdown and Spectre vulnerabilities, which affect almost every platform, including Intel, AMD, and ARM64. The news just broke that SPARC is also affected. Out of all these companies, Intel gets the most criticism. Intel is the dominant player, so their chips dominate the market, which means more affected users. The company

8 MARCH 2018 ISSUE 208 LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM NEWS Linux News

MORE ONLINE

Linux Magazine knew about the vulnerabilities for months. www.linux-magazine.com More than one team of researchers found the flaw and informed Intel about it. ADMIN HPC What’s the possibility that it was also http://hpc.admin-magazine.com/ known to spy agencies and state-spon- HPC Compilers • Carla Guillen and sored hackers? Reinhold Bader Intel is facing the public's wrath, and its If you compile on an expensive CEO sold all of his stock in the company supercomputer, it’s a good idea to select the (which is allowed by the bylaws) before the languages and compilers with particular care. vulnerability went public. We report on tried-and-proved tools used on However, Torvalds is concerned about only one thing: technology. Torvalds wrote in SuperMUC, a supercomputer at the Leibniz on the Linux kernel mailing list: Supercomputing Center in Germany. “I think somebody inside of Intel needs to really take a long hard look at their CPUs and actually admit that they have issues instead of writing PR blurbs that say that ADMIN Online everything works as designed. http://www.admin-magazine.com/ .. and that really means that all these mitigation patches should be written with Project management with Phabricator “not all CPUs are crap” in mind. Oliver Frommel Or is Intel basically saying “we are committed to selling you shit forever and ever, Bug trackers are the least thing that can be and never fixing anything”? deployed to combat chaos in daily IT work. Because if that’s the case, maybe we should start looking towards the ARM64 The free Phabricator software provides this people more. service and many others. Please talk to management. Because I really see exactly two possibilities: Automated compliance testing with InSpec – Intel never intends to fix anything Martin Loschwitz OR Don’t equate compliance through certifica- – These workarounds should have a way to disable them. tion with security, because compliance Which of the two is it?” and security are not the same. We look at Many kernel developers have refrained from sharing their views on the subject be- automated compliance testing with InSpec cause they either work for Intel or an Intel partner, so it’s great to see Torvalds openly for the secure operation of enterprise IT. talking about it. Correctly integrating containers Thomas Fricke LibreOffice-Based CODE 3.0 Released If you run microservices in containers, they are forced to communicate with each other – Collabora Productivity, a UK-based company that offers a cloud-based LibreOffice and with the outside world. We explain how solution, has announced the release of CODE 3.0. to network pods and nodes in Kubernetes. CODE is the community version of LibreOffice Online, which is available free to anyone who wants to run LibreOffice in their own cloud. In a press release, Collab- ADMIN DevOps Focus ora Productivity stated, “CODE is the LibreOffice Online solution with the latest de- http://www.admin-magazine.com/DevOps velopments, perfect for home users that want to integrate their own online Office Docker Forensics • Chris Binnie Suite with their preferred File Share and Sync solution. It allows editing of richly format- The handy auditd package can help track ted documents directly from a web browser, with excellent support for all popular of- down weaknesses in your system before, fice file formats, including text documents (docx, doc, odt, …), spreadsheets (xlsx, xls, during, or after an attack. ods, …), and presentations (pptx, ppt, odp, …).” Michael Meeks, general manager of Collabora Productivity, told us that 3.0 is an interesting release in which they have started to bring parts of the rich Libre- Office functionality to the browser. Combined with collaboration, it’s easy to de- ploy and powerful to use. “In the Office world, people have a choice of any two of feature-depth, collaboration, or web deployment. We’re starting to provide all three,” said Meeks. CODE 3.0 comes with many new features, including full-feature editing dialog, as seen in the desktop version of LibreOffice. The main purpose of CODE is to provide users early access to the very latest feature additions and updates to Li- breOffice Online, to enable them to develop, test to make it better, and contribute back to LibreOffice. Collabora sells a CODE-based commercial version called Collabora Online.

LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM ISSUE 208 MARCH 2018 9 NEWS Linux News

Google Announces Kubeflow to Bring Kubernetes to Machine Learning

After Kubernetes and TensorFlow, Google has now released Kubeflow, a new open source project that makes it easy to consume machine learning (ML) stacks with Kubernetes. Kubernetes is being touted as the cloud Linux, and an increasing number of people are employing it in different use cases. Machine learning is one of the fastest growing use cases for Kubernetes, but it’s quite a challenge to get the entire machine learning stack up and running. “Building any production-ready machine learning system involves various compo- nents, often mixing vendors and hand-rolled solutions. Connecting and managing these services for even moderately sophisticated setups introduces huge bar- riers of complexity in adopt- ing machine learning,” said David Aronchick and Jeremy Lewi, project manager and engineer, respectively, on the Kubeflow project. “Infra- structure engineers will often spend a significant amount of time manually tweaking deployments and hand rolling solutions before a single model can be tested.” Kubeflow solves this problem because it makes using ML stacks on Kubernetes fast and extensible. It’s hosted on GitHub, and the repository contains three components: JupyterHub, to create and manage interactive Jupyter notebooks; a TensorFlow (TF) Custom Resource Definition (CRD) that can be configured to use CPUs or GPUs and adjusted to the size of a cluster with a single setting; and a TF Serving container. Kubeflow is a multicloud solution. If you can run Kubernetes in your environment, you can run Kubeflow.

Critical Flaw in phpMyAdmin A security researcher has found a critical flaw in phpMyAdmin that allows an attacker to damage databases. According to Hacker News, “The vulnerability is a cross-site re- quest forgery (CSRF) attack and affects phpMyAdmin versions 4.7.x (prior to 4.7.7).” The vulnerability was discovered by researcher Ashutosh Barot. Barot wrote in a blog post, “In this case (phpMyAdmin), a database admin/Developer can be tricked into per- forming database operations like DROP TABLE using CSRF. It can cause devastating in- cidents! The vulnerability allows an attacker to send a crafted URL to the victim and if she (authenticated user) clicks it, the victim may perform a DROP TABLE query on her database.” On its advisory page, phpMyAdmin wrote that “by deceiving a user to click on a crafted URL, it is possible to perform harmful da- tabase operations such as deleting records, drop- ping/truncating tables, etc.” The phpMyAdmin project has already released a patch and suggests users either apply the patch to the existing installs or upgrade to phpMyAdmin 4.7.7 or newer. phpMyAdmin is an open source tool for man- aging MySQL over the web. It supports a wide range of functions, including management of da- tabase, tables, columns, relations, indexes, users, permissions, etc. via the user interface, in- stead of using a command-line interface. This ease of use has made phpMyAdmin a very popu-

lar tool for hosting providers. Foltolia.com Ponomareva, Image © Yevgeniya

10 MARCH 2018 ISSUE 208 LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM

NEWS Kernel News

Zack’s Kernel News

Implementing Digital protection, then you need secure boot Rights Management without an unlockable bootloader and a In-Kernel pile more bits in userspace. If you do all Content providers are always interested that, only then do you have full content in ways to stream audio and video in protection. And yes, then you don’t re- such a way that the data cannot be cop- ally own the machine fully.” ied by the recipient. Sean Paul recently Pavel replied, “This patch makes it posted a patch that the Chrome OS team more likely to see machines with has been using for three years to control locked down kernels, preventing devel- content on Exynos, MediaTek, and Rock- opers from working with systems on chip hardware. The patch can be used to their own, running hardware. That is turn content protection entirely off, it evil and [a] direct threat to the Free can request that content protection be software movement.” enabled by the hardware driver, and it He added, “Users compiling their own Chronicler Zack Brown can actually stream protected data. kernels get no benefit from it. Actually it reports on the latest news, The patch was received with suspicion looks like this only benefits Intel and Dis- by kernel developers. ney. We don’t want that.” And he con- views, dilemmas, and Pavel Machek specifically said that he cluded, “it does not belong in kernel.” developments within the couldn’t see any case where a user would Alex Deucher suggested that the patch Linux kernel community. set the feature to anything other than might be useful for “sensitive video “off.” He also asked, “If kernel imple- streams in government offices where you By Zack Brown ments this, will it mean hardware ven- want to avoid a spy potentially tapping dors will have to prevent user[s] from up- the cable to see the video stream.” He dating the kernel on machines they added that it was not just Intel and Dis- own?” And wondered, “If this is merged, ney who would benefit, but also “just does it open kernel developers to DMCA about every SoC manufacturer and threats if they try to change it?” Google and Amazon and a ton of other Daniel Vetter made the case that this companies and organizations.” particular patch would only encrypt Alex suggested that if the kernel folks data over a cable, using High-band- didn’t want a patch like this, then they width Digital Content Protection should also remove support for en- (HDCP). It wouldn’t implement any crypted filesystems and encrypted vir- other aspects of content protection and tual machines. To which Pavel replied, was thus a generic data security feature. “Encrypted filesystems benefit users. En- He added, “If you want to actually lock crypted video is designed to work down a machine to implement content against users. In particular, users don’t have encryption keys for video they gen- Author erate. I’d have nothing against [a] fea- The Linux kernel mailing list comprises the ture that would let users encrypt video core of Linux development activities. Traffic with keys they control.” volumes are immense, often reaching Meanwhile, Sean pointed out that his 10,000 messages in a week, and keeping patch only enabled features that were up to date with the entire scope of already present in the machine’s hard- development is a virtually impossible task ware. He wasn’t implementing any- for one person. One of the few brave souls thing new, just giving the kernel the to take on this task is Zack Brown. ability to control hardware features

12 MARCH 2018 ISSUE 208 LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM NEWS Kernel News that were already present. He said, could be used to benefit regular users, with many versions of the patch coming “those registers exist and _can_ be while completely failing to satisfy the down the pike. The basic issue is used for HDCP; it’s just that now you large content providers. In that case, printk() is not safe to call everywhere in know about it. Having all of the code Linus would be likely to simply repur- the kernel. The reason is that the call to in the open allows users to see what is pose the hardware to do the user-bene- output its log messages, console_un- happening with their hardware; how is ficial thing, in complete disregard of the lock(), may loop forever, which means this a bad thing?” original intent of the hardware. that if printk() is called in an atomic And along the same lines, Daniel I would guess that, as it stands, the (uninterruptible) context, it could lock also said to Pavel, “you can’t claim to code is DOA, and the Chrome OS people the system. This isn’t really a danger, speak for the entire kernel and FLOSS will have to keep maintaining it on their since kernel code knows to avoid that community of users and developers. own codebase for the foreseeable future. situation. But it does mean that printk() The feature is optional: It does not en- may not be called to log messages that force additional constraints on users Improving Lighting really should be logged. but exposes additional functionality al- Controls Sergey’s patch offloads the entire ready present in hardware, for those Enric Balletbo i Serra posted a patch to question to another , whose pri- who wish to opt in to it. Those who adjust the way Linux controls back-lit mary purpose is to recognize and break wish to avoid it can do so, by simply screens. As he pointed out, the human out of loops, returning control to the sys- not making active use of it.” eye perceives changes to light levels tem. There are also certain emergency At this point, Alan Cox came in, say- differently in low-light situations. He circumstances, like during a system ing that he was speaking for himself at felt that the CIE 1931 lightness formula panic, where normal no lon- this time, and not for his employer, Intel. represented the proper way to calcu- ger take place, and printk() must con- He said: late Linux screen behavior during user tinue to log messages even without its configuration. He said, “This patch dedicated thread. “The upstream policy has always adds support to compute the bright- As with everything having to do with been that we don’t merge things ness levels based on a static table filled bootup and shutdown, the code is in- which don’t have an open usable with the numbers provided by the CIE sane. Hence, the many versions submit- . Is the HDCP encryption 1931 algorithm.” ted for review. feature useful on its own? What do There were a few technical comments. Petr Mladek preferred a separate ap- users get from it? Daniel Thompson felt the data table proach from Steven Rostedt, in spite of If this is just an enabler for a lump could be made smaller, and Pavel Ma- that code being complex and prone to of binary stuff in Chrome OS, then I chek felt the table could probably just be false bug reports from people who don’t think it belongs; if it is useful generated on the fly. But Enric replied, couldn’t figure out what it was doing. standalone, then it seems it does be- “This was discussed a bit in previous On top of that, it didn’t fully solve the long?” RFC which had the code to generate the problem of locking the system. However, table on the fly […]. The use of a fixed Petr preferred it because, as messy as it He also added in response to Alex’s table or an on-the-fly table is something was, it represented a more modular ap- scenario regarding secure government that I’ll let the maintainers decide. I’ve proach that was still less complicated communications, “Last time I checked no strong opinion on the use of the fly and insane than Sergey’s code. HDCP did not meet government security table.” Tejun Heo said he didn’t care which requirements – which is hardly surpris- Other technical comments revolved approach got in; he just wanted some- ing since you can buy $10 boxes from around the relationship between the ac- thing that would work (i.e., not lock the China to de-HDCP video streams.” tual amount of light and the way a system). But he felt both patches were Daniel pointed out that everything human would perceive it, and how best way too complicated. going into Chrome OS was open source to adjust those numbers. Meanwhile, although Steven’s ver- and said that Chrome OS had very strict But there were no outcries against the sion theoretically could still lock the requirements about what could go into patch. Everyone seemed in agreement system, no one has been able to reli- the userspace side of things as well. that human perceptions should be given ably reproduce such a case. Steven That was the end of the discussion. It preference in Linux over those of other came in at this point to remark, “I still looks as if some very heavy hitters are animals, even in spite of New Zealand’s don’t believe there is one. And it’s all opposed to this going into the kernel. 2015 legal recognition of animals as hand waving until there’s an actual re- Although in a case like this, it’s impos- sentient beings. Hopefully a dolphin- port that we can lock up the system sible to predict what Linus Torvalds will centric version of Enric’s code will be with my approach.” ultimately decide. Like Alan says, if coming soon. Sergey objected to Steven’s ap- there’s a legitimate use for the code, proach, because he said it required Linus would be more likely to include Updating printk() calling printk() from a CPU that was it; while if the only use is to lock people Sergey Senozhatsky posted a patch to not in atomic mode. But he said, “what out of their own systems, Linus would give the printk() system call its own happens if there is NO non-atomic CPU refuse. It’s also possible that someone thread of execution on the running sys- or that non-atomic simply misses the might notice a way that this hardware tem. This has been an ongoing effort, console_owner != false point?”

LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM ISSUE 208 MARCH 2018 13 NEWS Kernel News

The bottom line, Sergey said, was that served. This is because people usually packets, which then tries to allocate the code had to do the exact right thing don’t report those issues to the up- more memory and so on. It’s just that at the exact right time on the exact right stream community. Especially vendors there’s no one else to give that flushing CPU, and the exact right time was a van- that use outdated kernels, that are ap- duty too, so the ping-ponging that your ishingly tiny window. prox 1-2 year(s) behind the mainline. patch implements can’t really help But this, in fact, was the case that And I don’t see why it should be differ- anything.” Steven felt had not yet been proved. He ent this time. It will take years before Tejun concluded, “You argue that it asked if anyone could confirm that vendors pick the next LTS kernel, isn’t made worse by your patch, which there was indeed a way to lock the sys- which will have that patch in it. But may be true, but your patch doesn’t tem like that. Before going with Ser- the really big problem here is that we solve actual problems and is most likely gey’s more complex approach, Steven already know that the patch has some an unnecessary complication, which wanted real evidence that his own not- problems. Are we going to conclude gets in the way for the actual solution.” quite-as-complex approach was truly that ‘no emails === no problems’? Steven looked at Tejun’s scenario, but insufficient. With all my respect, it does seem like, said, “WTF! You are printing 10,000 Sergey replied that at his company the in the grand scheme of things, we are printk messages from an con- engineers encountered this problem going to do the same thing, yet expect text??? And to top it off, I ran this on my fairly frequently; he posted some info a different result.” box, switching printk() to trace_ about how it came about. He said in conclusion that Steven’s printk() (which is extremely low over- But Petr was still skeptical. He said, patch did not meet the real world needs head). And it is triggered on the same the “console_lock() owner is able to he was encountering at his own com- CPU that did the printk() itself on. Yeah, sleep. Therefore there is no risk of a soft pany, and that Steven’s code resulted in there is no hand off, because you are lockup. Sure, many messages will get worse behavior than the current version doing a shitload of printks on one CPU stacked in the meantime, and the con- of printk(), given that it would sleep and nothing on any of the other CPUs. sole owner my get then passed to an- longer, cause userspace applications to This isn’t the problem that my patch was other owner in atomic context. But do time out, and still allowed the system set out to solve, nor is it a very realistic you really see this in the real life?” lockup that Sergey wanted to fix. problem.” As he put it, “My current view is that Finally, Sergey did post some Well, the discussion is ongoing. We Steven’s patch could not make things traces showing a lockup. But Steven have multiple people accusing each worse. I was afraid of possible deadlock, didn’t find these convincing. He said, other of not reading what they’re writ- but it seems that I was wrong. Other “The traces I’ve seen from you were ing, curses flying back and forth, and than that, the patch should make things from non-realistic scenarios. But I have people generally talking past each other. just better because it allows you to pass hit issues with printk()s happening that There’s no end in sight. the work from time to time a safe way.” cause one CPU to do all the work, where And yet, even in the heat of frustration But Sergey replied, “we are not look- my patch would fix that. Those are the and disagreement, both sides are still ing for a solution that does not make scenarios I’m talking about.” taking each other seriously and trying to things worse. We are looking for a solu- Steven and Sergey went back and forth address each other’s concerns. Steven tion that improves the thing.” for a bit, each growing more and more has begun to think that Tejun’s scenario And Petr replied that they should just frustrated with the other. is a bug in another part of the kernel push the code into the kernel and see Other people started jumping in at code and has begun trying to diagnose what shook loose. If there were bug re- this point, and eventually Tejun re- that. At which point, possibly, both Ser- ports, then the kernel developers could turned, preferring Sergey’s approach gey and Tejun would agree that Steven’s act on them. But he didn’t want to pre- because he, too, was seeing the lock- code addresses the only real problems emptively try to patch a bug that no one ups and needed them to be addressed. that remain. Meanwhile, both Sergey would ever encounter, at the cost of in- He said to Steven, “I tried your v4 and Tejun have been trying to post real- creasing code complexity. To which Ste- patch and ran the test module and world scenarios, process traces, and ven agreed wholeheartedly. could easily reproduce RCU stall and code that reveal the bug that Sergey’s Sergey began in earnest to try to de- other issues stemming from a CPU get- code attempts to fix, but that Steven’s sign a sequence of events to trigger the ting pegged down by printk flushing.” does not. lockup that he believed was there. But He continued, “this isn’t a theoretical And of course, this debate has been he also remarked, “I don’t even under- problem. We see these stalls a lot. Pre- ongoing for quite a while already, with stand what our plan is. I don’t see how emption isn’t enabled to begin with. multiple patches, and multiple debates, are we going to verify the patch. Over Memory pressure is high, and OOM occurring over several years. There’s no the last 3 years, how many emails do triggers and printk starts printing out way to know where this will lead or how you have from Facebook or Samsung OOM warnings; then, a network packet it will pan out. The code is already in- or Linaro, or any other company re- comes in, which triggers allocations in sanely complex. The patches to fix it are porting the printk-related lockups? I the network layer, which fails due to more complex still. And workloads that don’t have that many in my Gmail memory pressure, which then gener- reproduce the problems may or may not inbox, to be honest. and this is not be- ates memory allocation failure mes- be related to what the developers are cause there were no printk lockups ob- sages, which then generates netconsole trying to fix. nnn

14 MARCH 2018 ISSUE 208 LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM

COVER STORIES Terminal Tuning

Useful helpers for the shell Terminal Tuning Some users have been working at the command line for years and wouldn’t change a thing about it, but others ride a wave of constant innovation. We explore some helpful tools for extending and expanding your shell experience. By Christoph Langner

he Bash shell is one of the central building blocks of any Linux system. Beginners are often a little lost, but they know they’ll never become experts without some basic knowledge of the mystical command line. Advanced Tusers love the convenience of navigating their Linux life using simple and practical text commands. For many users, the Bash shell is like everything else in Linux: Sure it’s great, but it could always get better. With a few tricks and some useful helper tools, you can add new capabilities and features to the venerable Bash shell. This article explores some favorite termi- nal tuning tricks. Better History Bash stores each command in the ~/.bash_history file. You can display the command history by typing history. Bash searches the history if you press Ctrl+R in the termi- nal and then enter a search term. If you repeat the Ctrl+R key combination, the shell jumps to the next hit; Ctrl+Shift+R takes it in the other direction. Searching helps you dig up old commands so you don’t have to type them again. The search function always sorts the hits from new to old. The last entered com- mands always appear first when searching with Ctrl+R. Artful use of the Bash search feature can lead to some time-saving tricks. For in- stance, if you enter a long command that you don’t want to have to type again, add a short comment string to the end of it using a hash tag. For example, instead of long command, enter long command #quick. The shell interprets the text after the hash tag as a comment and does not execute it. However, if you want to access the command later, just type Ctrl+R and quick, and Bash will jump to the desired command. Hstr Perhaps you think it would be more convenient if the most frequently used com- mands were to appear first instead of last. Exactly this and much more is possible with Hstr [1], also known as the Bash and Zsh Shell History Suggest Box, a special tool designed to let you “easily view, navigate, search, and manage your command history.” Not all distributions include Hstr directly in the package archives; for example, Ubuntu requires you to integrate a PPA. Installation instructions for several Linux dis- tros are available on the Hstr GitHub project page [2]. After you set up Hstr, transfer its default configuration to the configuration file for the Bash shell and reload it so that the changes takes effect without a new logon Listing 1: Hstr Configuration (Listing 1). Hstr uses the hh command.

$ hh ‑‑show‑configuration >> ~/.bashrc Now when you launch a command search in the shell using Ctrl+R, Hstr will start automatically: Instead of just one command, you will see an Ncurses interface with $ source ~/.bashrc the most frequently entered commands. If you type in a search term, Hstr filters out

16 MARCH 2018 ISSUE 208 LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM COVER STORIES Terminal Tuning

marked as favorites with Ctrl+F and brought back to life by changing the Hstr sort order with Ctrl+Shift+7. Better Lists The ls command, which lists the content of a directory, is one of the most com- mon Bash commands. If you’re looking for more information, try extending the simple ls command with ls ‑alh. The ‑alh options turn the simple list into a complete overview, including file permissions, owner- ship, file size, and more. The command also out- puts hidden files and directories. The ls command also supports colors, but usually only color highlighting for directories and links. The al- ternative Exa [3], which is written in Rust, offers signifi- cantly more convenience. Only a few distributions offer Exa in their package sources, although you will find it in the Arch User Repository (AUR). If your distro doesn’t pro- vide a package for Exa, check out the project homepage,

the corre- sponding hits and sorts them ac- cording to their frequency (Figure 1). Use the arrow keys to scroll through the list; pressing the Enter key executes the currently selected command. Use a tabu- lator to transfer the command to the shell so that you can still make changes. If a command with security-critical data slips into your history (e.g., the password when transferring data with ftp), you can remove this command from the Bash history by pressing Del. Figure 1: Hstr sorts the Bash history by frequency of execution, not Frequently used commands can be chronologically.

Table 1: Exa Important Options Switch Long Form Comment Display Options ‑1 ‑‑oneline Shows each file and folder in a new line ‑l ‑‑long Displays metadata, such as file permissions and size ‑R ‑‑recurse Lists the contents of subdirectories recursively (depth option: ‑‑level=) ‑T ‑‑tree Displays a tree structure (depth option: ‑‑level=) ‑‑color Color output is never, always, or automatic ‑‑color‑scale Highlights the display of the file size in color for large files Filtering and Sorting Options ‑a ‑‑all Shows hidden files and folders ‑d ‑‑list‑dirs Treats directories like files ‑r ‑‑reverse Reverses the sort order ‑s

LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM ISSUE 208 MARCH 2018 17 COVER STORIES Terminal Tuning

alias ll='exa ‑bghHlS'

and place the alias in the ~/.bashrc file. The preceding alias would let you call the command by simply typing ll. Exa’s ability to display entire folder structures recursively in a tree view is also practical (Figure 3). To display a tree, supplement the call with exa ‑‑tree or exa ‑T. You can limit the tree depth with the ‑‑level= option, where is the number of levels you want to dis- play. Alternatively, switch off the tree view and let Exa list just the subfolders with the ‑R or ‑‑recurse switch. Again, you can restrict the depth with the ‑‑level option. The shortcuts for sorting the output also make everyday life in the shell eas- Figure 2: As an alternative to ls, Exa provides more information and ier. For example, to find the largest files presents the output in a clearly arranged format with colors. in a folder quickly, call Exa with:

where the developer provides a zipped binary for 64-bit sys- exa ‑lr -‑sort=size tems, which you can simply copy as exa to /usr/local/bin/ or ~/bin/. The ‑r switch reverses the order of the output so that the larg- The output of the exa command corresponds to the output of est files are at the beginning of the list. ls, except that Exa adds more colors to the overview (Fig- ure 2). For example, it highlights archives in red, images in Better Unpacking light purple, videos in dark purple, backup copies in gray, and Linux users often have to deal with file archives in ZIP, RAR, or directories in light blue. Exa gets even more interesting when tarball (tar.gz, tar.bz) format. The commands for unpacking you enable further options (see Table 1). For example, with exa these archives are as different as the formats: unzip, unrar e, ‑bghHlHlS, Exa displays the file permissions, including file tar xzf. sizes, affiliations, and the last modification data, in a neatly The tar command, in particular, regularly challenges users sorted list. with its cryptic syntax. Particularly annoying is an archive full Other colors help you keep track of things such as file per- of files that are not stored in a separate subdirectory when un- missions. If you decide on a version of the command you like packed but instead clutter the current folder. Such shortcom- best, create an alias for it with ings are addressed by the Dtrx [4] unpacker – the abbreviation stands for “do the right extraction.” All the popular distributions have Dtrx in their package sources; under Ubuntu, the installation includes a number of tools for unpacking. On the other hand, with Arch, you have to install the neces- sary tools yourself. As a wrapper, Dtrx is not able to unpack archives itself, but it composes the required syntax for you. You only have to remember dtrx to unpack an archive. Figure 4 shows Dtrx in action: The badly built bad‑tarball.tar.xz tarball does not contain a base subdirectory, so all the data will end up in the current folder when unpacking with tar xf. Ad- ditionally, tar adopts the file permis- sions without changes – in this case, you are not allowed to edit the files without first modifying the permissions using Figure 3: The Exa tree view allows you to keep track of even the most chmod or a file manager. Dtrx corrects all branched directory structures. of this in one command.

18 MARCH 2018 ISSUE 208 LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM COVER STORIES Terminal Tuning

Better Terminal Perhaps you are looking for an alterna- tive to the terminal emulator itself? If so, it’s worth taking a look at Tilix [5]. The Tilix terminal emulator outperforms most other terminal applications and of- fers some interesting enhanced features. For example, Tilix allows you to divide the window into several sub-terminals. You can display the current workload in an Htop window zone, output system in- formation in the second window zone, and continue working as usual in the main section (Figure 5). You can arrange the individual sub-windows by dragging and dropping or by pulling a sub-win- dow out of the application window as a new terminal. Palette Pick Some users like to deploy different col- ors in the terminal to highlight text and organize the information. Many termi- nal programs provide color profiles, which you can enable in the settings with just a few clicks of the mouse. If you want colors but you’re weary of the Figure 4: Dtrx automatically corrects read and write permissions during drab, elementary color palette used with unpacking and ensures order by creating a subdirectory. COVER STORIES Terminal Tuning

Figure 5: The modern terminal emulator Tilix offers many useful functions. For example, you can divide the window into several sub-windows.

most terminal emulators, you might want to try Nord [6], Info which the project website describes as “an arctic, north-bluish [1] Hstr: https://​­github.​­com/​­dvorka/​­hstr color palette.” Nord is specially designed “to achieve optimal [2] Hstr Installation: focus and readability for code syntax highlighting and UI.” https://​­github.​­com/​­dvorka/​­hstr/​­blob/​­master/​­INSTALLATION.​­md The Nord palette “consists of a total of sixteen, carefully se- [3] Exa: https://​­the.​­exa.​­website lected, dimmed pastel colors for an eye-comfortable, … yet [4] Dtrx: https://​­brettcsmith.​­org/​­2007/​­dtrx/ colorful ambiance.” [5] Tilix: https://​­github.​­com/​­gnunn1/​­tilix The Nord pastel color profile is available for numerous [6] Nord: https://​­github.​­com/​­arcticicestudio/​­nord programs, from classic terminal applications and Putty (also [7] Awesome Shell: https://​­github.​­com/​­alebcay/​­awesome‑shell for Windows) to corresponding profiles for editors or development environ- ments (Figure 6). On its GitHub page, the project links to the different appli- cations. Conclusions If you’re looking for something more than the usual shell, the tools and exten- sions described in this article will bring some extra power and flash to your com- mand-line experience. When you’re ready for more shell enhancements, you might want to check out Awesome Shell [7], which calls itself “a curated list of awesome command-line frameworks, toolkits, guides, and gizmos.” For almost all your applications and needs, there is a tool in the open source ocean to help Figure 6: If you prefer an “artic, north-bluish” color palette in the you – you just have to find it. nnn terminal, try out Nord.

20 MARCH 2018 ISSUE 208 LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM

REVIEWS YunoHost

Self-hosting solution YunoHost for the private cloud With Simple Means

YunoHost offers a wide range of services on a proven Debian platform that you can host yourself. By Ferdinand Thommes

unoHost [1] is a Linux distribu- Sandstorm [3], UBOS [4], or the recently the Jenkins [13] CI server, Mattermost [14] tion that offers a basic server discontinued arkOS. All of these projects as an alternative to Slack, the Piwigo[15] platform with single sign-on for have the goal of letting the user operate photo gallery, and many more. hosting web, mail, XMMS, and a server and install web services in the But that’s not the end: The Apps in Yseveral dozen other services. According easiest possible way. Progress section offers several apps you to the project website, YunoHost’s goal is YunoHost is based on Debian and is can test, but without any guarantees. to provide “…a server operating system available for download for the i386, aimed at making self-hosting accessible AMD64, PowerPC, and ARM architec- Which Platform? to everyone.” tures. A demo site [5] lets you test the YunoHost will run on the 3, YunoHost comes with the nginx web user interface in advance. and even on earlier versions of the Rasp server, MariaDB, mail transfer agent Pi. On the small scale of a home net- Postfix, and the IMAP server Dovecot, Well Equipped work, the Rasp Pi might be satisfactory, including the Rspamd spam filter. The The range of official apps for various but if you are concerned about perfor- Metronome IM XMPP server, OpenLDAP, web services includes 21 packages [6], mance and throughput, the limits of the Dnsmasq, and the SSOwat transparent which you can install with just one click. Rasp Pi are quickly evident. You can also authentication system for single sign-on This list encompasses well-known ser- install YunoHost on a local computer are also available, as is Let’s Encrypt for vices such as WordPress, Nextcloud, (see the “Installing on Your PC” box) or creating SSL certificates. Roundcube, and DokuWiki, as well as on a VServer with a professional hosting YunoHost also provides a community lesser known tools such as the Baikal [7] service provider. If Debian is already repository of validated helper scripts to CardDAV server, the RainLoop [8] web- running on the computer on the base install other services and applications. The mail application, and the ZeroBin [9] en- system, you can use a script to set up repository, which is hosted on GitHub, crypted paste service. YunoHost [16]. provides customized versions of the ap- The list of unofficial apps [10] devel- You can also use a VirtualBox, VM- plications preconfigured to integrate into oped and maintained by the community ware, or KVM virtual machine as the YunoHost’s single sign-on environment. is much longer: It includes around 100 basis for your tests. An image for the vir- YunoHost is similar to other personal programs, such as a sync server for tualization-focused Vagrant development

server systems, such as FreedomBox [2], Firefox [11], the Gogs [12] Git service, environment is also available [17]. Lead Image © Dmitriy Shpilko, 123RF.com

22 MARCH 2018 ISSUE 208 LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM REVIEWS YunoHost

Installing on Your PC To install under VirtualBox or on a 32- or 64-bit PC, download the appropri- ate ISO image from the project web- site. Leave the default disk-partition- ing values. The install, including an update, takes just a few minutes to complete; the system then automati- cally reboots to a command line. Now log in as root with a password of yuno‑ host and start the post-install routine by calling yunohost tools postinstall. The routine requires the main domain, as well as the future administrative password, and then configures all ser- vices accordingly.

Installing on Rasp Pi To install YunoHost on a Rasp Pi, first download the image for the ARM plat- form and store it on an SD card, prefera- bly a Class 10 card with at least an 8GB Figure 1: A first look at the back end shows all categories, including the capacity. Be sure to choose the target de- area where you configure the services on the host. vice carefully; otherwise you will lose the data on a partition that your com- by default, the browser displays the mes- poses that the domain registrar first puter needs. The dd command is fine for sage that the connection is not secure. adapts the DNS A record so that it writing the data, as are graphical tools You can ignore this message in a private points to the domain’s IP address. It like Etcher under Linux or Rufus under environment and allow an exception to usually takes 24 hours or longer for the Windows. The corresponding ARM ver- reach the interface (Figure 1). change to propagate. sion for the Rasp Pi is based on Rasp- If you want to grant other users ex- The first step in the interface is to set bian 8 “Jessie.” ternal access to services, you should up a domain under which you can ac- After copying the image to the SD use your own domain. Use the yuno‑ cess the server (Figure 2). Guided con- card, insert the card into the slot on the host domain cert‑install command to figuration in the browser is easier for Rasp Pi and connect the Ethernet cable, create an SSL certificate with Let’s En- most users than working with SSH in a the power supply, and, optionally, a dis- crypt and install it so that it secures terminal. The first question is whether play and a keyboard. The boot process the connection via HTTPS in the fu- you already have a domain that you takes about 90 seconds. ture. However, this approach presup- want to use. The example assumes that The next step is to determine the Rasp Pi’s IP address. If you have con- nected a display, the computer will show you its IP address. If no display is connected, the hostname ‑i command on the computer’s console helps. Alter- natively, you can find the address via the router’s web interface. Under Win- dows, you can use the Advanced IP Scanner [18] program to display IP ad- dresses logged on to the local network. You can do the same under Linux with on-board tools:

$ sudo arp‑scan ‑‑localnet | U

grep Raspberry

You now have to finish the installation. Without a display, continue via SSH or call the http:// address in a browser to continue graphically. Since Figure 2: If you want to allow users to access the services on the host, YunoHost uses a self-signed certificate configure a domain.

LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM ISSUE 208 MARCH 2018 23 REVIEWS YunoHost

The first step is to update the system. Import new packages from both the Debian server and YunoHost (Figure 3) under the System update category. Be sure to update the system at regular in- tervals, because only an up-to-date server system offers sufficient security. For all actions, you will see a status dis- play at the top right-hand corner of the screen that displays the actions currently running. A list of actions in progress is dis- played when you mouse over the items. Next, you should create at least one user to log in to the user area. After- wards, start installing applications. For this test, the first choices were Baikal, Wallabag, and Nextcloud. The installa- tion and basic configuration required only one mouse click (Figure 4). To test the installed applications, log Figure 3: I recommend periodically updating the system to patch secu- in as the previously created user and ac- rity vulnerabilities in the installed packages. cess the services (Figure 5). The initial configuration of the apps I installed you don’t have a domain, so the second work, which may take a few minutes. proved to be very good. For example, option is the right choice. You will then find yourself in the admin- Nextcloud already had the required However, if you want to use a self-de- istration interface. LDAP information. fined local domain, such as yunohost. local, enter it along with the IP address in the /etc/hosts file. Under Windows, you will find the corresponding file under %SystemRoot%\system32\drivers\etc\. DNS Knowledge To provide services beyond the host ma- chine, adjust the router’s DNS settings. A look at the documentation [19] is helpful. However, beginners can follow the example and use one of the two Yu- noHost domains for a start. Multiple do- mains are possible, and you are allowed to mix your own domains and subdo- mains with YunoHost domains. In the example without your own do- main, enter the desired subdomain in the dialog and select one of the two domains offered to you. When assign- ing names, keep in mind that everyone who logs into the server uses this de- fault domain. In the example, ft is used as a subdo- main. The default domain is ft.nohost. me. A first attempt with yunohost as a subdomain failed, because the system was not able to complete the configura- tion – but for no apparent reason. Time for a Cup of Tea After creating a server administration Figure 4: Wallabag was chosen for the test; the package comes from password, you’ll need to set up the net- the company’s official repository.

24 MARCH 2018 ISSUE 208 LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM REVIEWS YunoHost

In any case, I recommend that you protect the security of SSH access with a key instead of the root password and then generally prohibit the use of pass- words for SSH. As soon as user access is working, you should also prohibit logging in as root in the /etc/sshd.conf file. Conclusions Opinions differ on self-hosting systems such as YunoHost: Some people think that such systems are created by lazy admins who are not familiar with server administration and thus endanger Figure 5: You can log in to all apps using single sign-on. themselves and the Internet. On the other hand, many users need this kind Full of Apps yunohost.backup. The system offers of system to manage data on the net- The easy installation steps only apply to many more commands, options, and work without external help. the company’s official apps. For the far parameters via the command line than The present system makes it much larger number of custom apps, which through the web interface. You can easier to set up a well-provisioned come from and are managed by the com- view these command-line options with server, but responsible use still re- munity, you’ll find an Install user-de- yunohost ‑h. quires some knowledge, including se- fined app submenu at the end of the offi- In the initial configuration, administra- curing SSH access, configuring DNS cial apps list. tion via SSH is only possible as root, since settings, and configuring a certificate Enter the application’s GitHub URL. the system manages the users via LDAP. with Let’s Encrypt. You can find the GitHub URL with the A script and some other tricks help users On a Rasp Pi, the system performs ex- information provided for the app. For ex- reach the system via SSH [20]. cellently. Well-considered details, such ample, I installed the Piwigo photo gal- lery, which had the URL https://github. com/YunoHost‑Apps/piwigo_ynh (Figure 6). In the Domains category, it is possible to define additional domains, change the standard, and add certificates. In the test, I created a subdomain of my own domain as the second domain, which worked fine after DNS was set to the IP address defined in /etc/hosts (or alter- natively on the router). Tools The Services category allows you to start and stop system services. Behind the Tools tab, you will find the settings for the firewall, as well as tools for diagnosis and system messages. You can also change the root password. The Backup category lets you back up the system, user data, and applications (Figure 7). This function is still consid- ered experimental, but it worked per- fectly during the test, including restoring the data (Figure 8). Access via SSH You can check the results for yourself using SSH. The complete configuration of the server is under /home/yunohost.conf/, Figure 6: If the packages from the official repository do not meet all and the backup is located under /home/ your needs, you can turn to community software.

LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM ISSUE 208 MARCH 2018 25 REVIEWS YunoHost

as a preconfigured Fail2Ban [21] to pro- tect against intrusion or user administra- tion via LDAP, are surprising positives. The large selection of apps covers all areas of web services. YunoHost is suitable for home offices and small businesses. The distribution, which is very solidly set up with Debian as a base, might also work for larger as- signments. The fact that YunoHost is free software and under active development means that it could have a very bright future. nnn

Info [1] Download: https://​­yunohost.​­org/ [2] FreedomBox: https://​­en.​­wikipedia.​­org/​­wiki/​ ­FreedomBox [3] Sandstorm: https://​­sandstorm.​­io [4] UBOS: https://​­ubos.​­net/ [5] Demo: https://​­yunohost.​­org/​­#/​­try [6] Standard apps: https://​­yunohost.​­org/​­#/​­apps [7] Baikal: http://​­sabre.​­io/​­baikal/ [8] RainLoop: https://​­www.​­rainloop.​­net/ [9] ZeroBin: http://​­www.​­linux‑magazine.​­com/​ Figure 7: Specify which data you want to include in the backup. ­Online/​­Blogs/​­Productivity‑Sauce/​ Host‑Your‑Own‑Secure‑­ ​Pastebin‑​with‑​ ZeroBin [10] Community apps: https://​­yunohost.​­org/​­#/apps [11] Firefox sync server: https://​­github.​­com/​ ­YunoHost‑Apps/​­ffsync_ynh [12] Gogs: https://​­github.​­com/​ ­YunoHost‑Apps/​­gogs_ynh [13] Jenkins: https://​­github.​­com/​ YunoHost‑Apps/­ ​­jenkins_ynh [14] Mattermost: https://​­github.​­com/​ ­YunoHost‑Apps/​­mattermost_ynh [15] Piwigo: https://​­github.​­com/​ ­YunoHost‑Apps/​­piwigo_ynh [16] Manual installation: https://​­yunohost.​­org/​­#/​­install_manually [17] Vagrant box: https://​­github.​­com/​ YunoHost/­ ​­Vagrantfile [18] Advanced IP Scanner: www.​­advanced‑ip‑scanner.​­com/ [19] Documentation: https://​­yunohost.​­org/​­#/​­docs [20] SSH as user: https://​­forum.​­yunohost.​­org/​­t/​­ssh‑​ disconnects‑after‑successful‑login/​­256 Figure 8: The test succeeded in importing the data from the backup [21] Fail2Ban: back into the system. https://​­en.​­wikipedia.​­org/​­wiki/​­Fail2ban

26 MARCH 2018 ISSUE 208 LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM

REVIEWS Fedora 27

What’s new in Fedora 27 New Hat Fedora Linux is a favorite of developers, sys admins, and other tech-savvy users. The new release sports a new Gnome and other useful enhancements. By Swapnil Bhartiya

he Red-Hat-sponsored Fedora “Fedora Workstation appeals to our tra- Dell Precision 5720 AIO, a custom built project recently released Fedora ditional default user base in many ways, PC with Intel i7 Core 4780k and GTX 27, and I couldn’t wait to take a but will have a greater focus on software 1070 Ti, VirtualBox, VMWare Fusion, look. Fedora Linux holds a very developers and content creators – and, and Parallels Desktop. All of my systems Tspecial place in my heart. In fact, Fedora as the name implies, on people who have a minimum of 16GB and maximum was the distro that led me to the desktop don’t want to do all of their computing of 64GB of RAM, so I have really not Linux world. And I’m not the only one from their phone.” According to Miller, tested it on an underpowered system. In- who holds Fedora in high regard: Linux has always thought of stallation was flawless on each of the creator Linus Torvalds uses it as his pri- its target user as someone who could bare metal systems and virtual ma- mary distro. Linus once told me in an in- also be a potential contributor. chines. terview, “One of the reasons I like Fe- I tested Fedora 27 on multiple ma- I do have some mixed feelings about dora is they tend to be fairly good about chines – Dell XPS 13 Developer Edition, , the Fedora installer. It’s not new kernels.” He also said he appreci- ated the efforts the Fedora community, especially Red Hat, put towards kernel development. “They do have lot of ker- nel engineers. So one of the reasons I ended up going with Fedora is just that they do a good job on the side I cared about.” Fedora Linux comes in three editions: Workstation, Server, and Cloud. This ar- ticle will focus on the Workstation edi- tion, but it is important to know that, in the case of Fedora, “workstation” does not mean “end user.” Fedora’s target au- dience is people like Linus Torvalds – de- velopers and power users who are look- ing for early versions of the latest Linux updates. Or, as Fedora Project Manager

Matthew Miller once explained to me, Figure 1: The installer offers no clear instructions about creating a user. Lead Image Craig whitehead, Unsplash.com

28 MARCH 2018 ISSUE 208 LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM REVIEWS Fedora 27

Gnome has done some impressive work for those who use multiple dis- plays. Fedora now supports fine-grained configuration for all connected monitors using the redesigned display settings. A preview of the content showing on the connected monitors lets you set resolu- tion or scaling for best experience. Some of the advanced display features require the Wayland display server protocol, which is now available as an option on the login screen along with the aging X11. The only downside of using Way- land is that it may give you a hard time if you are using any dedicated GPU cards, but Fedora is not known for out-of-the- box GPU support. (My Fedora systems never survive updates if I use non-free drivers for NVidia cards, so I resort to using integrated graphics for my Fedora machines.) Figure 2: You can easily configure online services on Fedora 27. The system settings utility, which is simply called Settings (Figure 3), has a very intuitive and could be confusing to the Gnome Software package tool, as brand new user interface that replaces a new user. For instance, the option for well as Google Drive integration for the good old grid style. I like the refresh- creating a system user is easy to miss Gnome’s Files file manager. ing look, which cuts down on clicks, but (Figure 1). The inconsistency in the but- Fedora 27 includes the latest stable re- I struggled to find the monitor settings, ton placement, and the instructions and lease of Gnome, version 3.26, which which were buried in the devices set- warning display in an almost unreadable brings some changes to the UI and many tings. font color, fall short of expectations for a improvements under the hood. As some- That’s when I noticed an improved cutting edge distro. one who uses 4K or HiDPI monitors, I search in Gnome (Figure 4). Not only like the options available through Fe- does it show more items as a list, it can First Impressions dora/​Gnome. You can choose tiny fonts also search system functions like shut- Once you manage to install Fedora suc- and icons with massive screen real es- down, logout, etc. My only gripe with cessfully, you will see a welcome screen tate (akin to four 1080p monitors on the Gnome search is the lack of content that offers to configure keyboard layout same screen) or scale the full screen search, where I can search for an item and fine-tune privacy settings. You can down to a boring 1080p. like SSN and it shows a preview of the also disable location tracking, disable automatic problem reporting, and enable access to non-free software. The wizard offers Gnome integration with online services, including Google, Nextcloud, Microsoft, and Facebook (Figure 2). If you forget to create a sys- tem user during the installation process, you will also have to create a user. Fedora is known as a Gnome distribu- tion, although alternative Fedora “spins” versions are available for other desktops. Red Hat is the leading contributor to the Gnome project, and Gnome is the de- fault desktop environment for , so the investment in Gnome is quite evident. The close con- nection between Red Hat and Gnome means that Fedora users get early access to many of Gnome's new features and functionalities. For example, in previous years, Fedora users got a early look at Figure 3: The Settings utility has a new user interface.

LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM ISSUE 208 MARCH 2018 29 REVIEWS Fedora 27

Figure 4: The search feature is much improved.

document that has my SSN. (I like the The Gnome Tweak Tool, which is after Ubuntu abandoned the Unity way Spotlight does this on Mac OS.) simply called Tweaks, has an interesting desktop, which placed the buttons on Speaking of Mac OS, Fedora 27 brings change. Tweaks is designed to let the the left side. You can also choose to dis- emoji support to desktop Linux (Fig- user customize the desktop with a few play the battery percentage for laptops ure 5). Users can now embed color emo- advanced configuration options. Tweaks and disable the touchpad when typing. jis in their documents, but, unlike Mac now has an option that lets you move This last feature is quite handy, as I get OS, Gnome does not provide dedicated the windows buttons to the left. I won- annoyed on my Dell XPS 13 when my keyboard shortcuts. You have to open the der if they are doing this for Ubuntu cursor hops from one place to another new Characters application and then drag users who are switching back to Gnome while I am typing. and drop any emoji into your document. The good news is that developers are working on an emoji picker that can be integrated with other applications. The default Gnome web browser of Gnome, called Web, now lets you sync your passwords, bookmarks, and browsing history using Firefox Sync, which is integrated with the desktop. No worries about forgetting your pass- words. I wish there was a system-wide sync service so that once I log into my user account on Fedora, my emails, contacts, calendars, passwords, etc. are automatically synced – that way I don’t have to reconfigure them every time I upgrade to a new Fedora release. On the positive side, Gnome’s calendar, mail, and contacts have partial support for of- fline work; the changes get synced when you get connected. Figure 5: Choosing emojis in Fedora.

30 MARCH 2018 ISSUE 208 LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM REVIEWS Fedora 27

External Hardware Support A Bit about Developers and system-wide crypto policies, making life Fedora automatically detected my net- Sys Admins easier for sys admins. The developers worked Brother laser printer, and it was Fedora 27 also comes with some signifi- have removed support for insecure ready for printing without the need for cant improvements for developers. The SSH-1 protocol and upgraded Samba to additional drivers. Gone are the days of debuginfo metadata packages have been version 4.7. Fedora 27 is the first Fedora desktop Linux users struggling with split up into smaller sub-packages, mak- version to include Samba AD domain printer drivers. My wireless Apple key- ing it possible to install just the debu- controller support. board and touchpad also worked without ginfo for one specific sub-package or li- For developers or sys admins who any issues; the only minor issue was brary. The new Fedora also comes with work on ARM systems, the good news is function key mapping on the keyboard, version 2.26 of glibc, which offers many that Fedora 27 includes disk images for but I am used to that by now. I had to in- new features, including a per-thread 64-bit ARM devices like Pine64 and stall exfat drivers to access my Panasonic malloc cache that significantly improves Raspberry Pi 3. GH5 camera storage, which required the malloc API family of functions on more extra work than expected. I had to certain multithreaded workloads. Uni- Conclusion manually add rpmfusion repositories in code 10.0.0 includes improved support Fedora has taken some flack through the order to get exfat. Unfortunately, Gnome for character encodings, character type years from users who do not understand software was not able to find fuse‑exfat, info, and transliteration tables. Fedora 27 its primary purpose. Fedora Linux is a so I had to resort to the good old CLI: also ships with Node.js 8. cutting edge distribution that’s designed Sys admins may be aware of Fedora’s for developers and sys admins who want $ sudo install fuse‑exfat effort to achieve modularity. Modularity to keep an eye on new technologies com- makes the life cycle of applications inde- ing into the enterprise space. It’s not I mounted the camera and opened the pendent of the platform and other appli- meant to play Steam games with the lat- .RW2 raw images that even Windows 10 cations and, as a result, makes the sys- est NVidia cards; you can do that with can’t open. Gnome has come a long way tem less likely to break with an applica- Fedora, but that’s not its target market. with its support for high resolution pre- tion or system upgrade. Most of Fedora’s new features are geared views of raw images. Fedora 27 also brings improved support towards developers and sys admins, be- I also was able to play .mov files from for SSDs. If you create new partitions cause that is Fedora’s target audience. the camera. And the most refreshing im- using LUKS encryption, they will auto- If you’re strictly a desktop user, how- provement was out of the box support matically be configured to use TRIM, ever, you might still have an interest in for MP3, since the patents on MP3 have which increases the lifetime of SSDs with- Fedora because of its tight integration expired. Red Hat legal gave Fedora per- out affecting encrypted data security. with Gnome; Fedora remains the distri- mission to ship MP3 encoding in Fedora, The new Fedora also offers improved bution that introduces the latest and so users can now enjoy MP3-encoded Kerberos support, including the new greatest features from the Gnome world. songs without any issues. Kerberos Cache Manager (KCM), which, Fedora has come a long way and is a I can easily mount my iPad Pro, according to the developers, is “better distro that is well suited for a wide range iPhone X, Pixel 2, and Galaxy Note 8 to suited for a containerized environ- of use cases. I use it for my work – and transfer files. ment.” OpenSSH Server now adheres to so does Linus. nnn REVIEWS To-Do Managers

To-do managers regulate appointments and tasks Organizational Talent

Busy people often keep busy calendars full of appointments and tasks. In order to keep an eye on things, Linux to-do-managers help manage the clutter in a controlled way. By Erik Bärwaldt

ellow sticky notes on your desk Time management applications also On the window’s left side, there are al- are becoming a thing of the past. need to make it possible to integrate ex- ready several baskets with sample data, Word has spread that computers ternal sources, such as documents manage appointments and proj- that you need to complete a task. An Not Considered Yects far more flexibly and reliably. In- easy-to-understand interface and the Under Linux, there are additional task stead of relying on a jumble of little option to create backups are important managers available. I have left out some notes, you can refer to a carefully man- features for any viable task management of these – even quite well-known ones – aged digital to-do list. However, time- solution. I have picked five candidates due to lack of updates or free licenses. management applications vary consider- out of the very extensive pool of GTD Tasque [6] has long been one of ably, so we decide to take a closer look software (see the “Not Considered” box) Gnome’s standard applications. How- at BasKet [1], Getting Things Gnome and tested them for practicality. ever, apart from a small improvement in Romanian localization, there has been (GTG) [2], Makagiga [3], RedNotebook no further software development for [4], and Task Coach [5]. BasKet years. Tracks [7], a web-based GTD man- The BasKet [1] task management sys- ager with a built-in web server, was last Basic Information tem, optimized for the KDE desktop, is updated more than two years ago. Large project management systems are included in the software repositories of ThinkingRock [8], a very extensive Java often based on a client-server architec- most major Linux distributions. The ap- program, doesn’t offer a free license for ture. Small Getting Things Done (GTD) plication uses baskets to manage tasks the current 3.X versions, and there is managers usually only run on the desk- and appointments; the program primar- only one commercial version. top. The option to map out larger projects ily acts as a digital notepad or index card The iKog [9] command-line task man- and integrate external resources is usually box. When first launched, the main win- ager consists of a Python script. The last missing. However, to-do managers also dow appears somewhat cluttered due to files offered for download are from 2011. need to manage different task groups, the short descriptions in the large dis- My guess is that this software is no lon- ger maintained.

some of which consist of individual tasks. play segment on the window’s right side. Lead Image © Javarman, 123RF.com

32 MARCH 2018 ISSUE 208 LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM REVIEWS To-Do Managers

If several users work on one computer system, you can password protect bas- kets to prevent other users from access- ing them. To assign a password to a bas- ket, use the dialog in the Basket | Pass- word menu, which also provides pass- word protection for subordinate task lists. BasKet also allows you to back up and restore your personal data via the Basket | Backup & Restore menu option. Select the appropriate directories in a clearly ar- ranged window according to your wishes and then create a basket (Figure 3). In order to use the existing data for other purposes or to import into BasKet from third-party applications, the pro- gram offers some format converters. The data import can be called up via the Bas- Figure 1: BasKet can be very flexible with different source documents. ket | Import menu option; the converter handles Tomboy [10], KNotes [11], - Cards [12], and Sticky Notes [13] for- mats. The export possibilities are less ex- tensive: The software only exports per- sonal datasets to simple HTML or the program’s own archive format.

GTG The GTG [2] to-do application was origi- nally developed for the Gnome desktop, but it also runs in other work environ- ments. It is included in most software re- positories and can therefore be easily in- stalled using the . The software is partly written in Python and Figure 2: Completed tasks can be checked off by clicking; they are then partly in JavaScript. GTG also has an shown scored through. add-on for Firefox and Thunderbird, which enables additional scheduling in a which show that BasKet integrates un- Once you have created an appoint- web browser. Unfortunately, there are no structured data very flexibly into the ment, click on Tags in the menubar and ports for other platforms. baskets: images as well as links (Fig- choose To do!!!. A small box with a GTG starts with an inconspicuous list ure 1). Users can edit images with third- blue border appears to the left of the view that presents tutorials as tasks. A party programs. The individual elements appointment entry; you can click on click on one of the entries opens the ac- form a frame in the display area and can this as soon as you have completed the tual task window, which provides an ini- be grouped freely. task (Figure 2). tial overview of the GTG functions (Fig- For a to-do list, define a new basket in BasKet does not offer automatic re- ure 4). the left window area by clicking on New minders or automatic deletion of com- The actual program window consists (far left). Then in the dialog box, assign pleted tasks. You therefore have to keep of a menubar with four buttons and an a name and define the layout. A single- an eye on the baskets. In order to track input field, which allows for a quick se- column display in the right-hand pane is the progress of task elements, click on suitable for to-do lists. If the job consists the small triangle to the left of the task of several tasks, you can click on the description and on the Progress option in basket and define subtasks via New | the context menu. An empty progress New Sub-Basket. In the right pane, enter bar appears in the line, which is filled in the individual data by clicking in the free 25 percent increments by clicking on it. area and selecting the Text option from This shows at a glance how much of the the context menu. For example, BasKet task has been completed. You can assign records the appointment including the priorities to tasks using the same ap- Figure 3: BasKet also offers to corresponding activities. proach. back up your personal data.

LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM ISSUE 208 MARCH 2018 33 REVIEWS To-Do Managers

menu deletes primary and secondary tasks. The second icon from the right side of the buttonbar marks a task as “not to be completed.” It then disap- pears from the task list and appears at the bottom of the checked tasks list. GTG synchronizes its data with Gnote [14] or Tomboy [10]. synchronize, select the data in Tomboy or Gnote and then transfer to GTG. You can access the sync function in GTG via Edit | Synchroniza- tion Services. GTG has a modular structure and can integrate plugins. The Edit | Plugins menu option calls plugins that are al- ready integrated. A separate pop-up win- dow lists existing extensions; you can enable them by checking the boxes to Figure 4: The GTG user interface is very simple. the left of the plugins. After restarting the software, you will find additional en- lection of functions and provides an You can display a task with several tries in the menubar and the buttonbar input line. steps via Tasks | New Subtask. The data to match the plugin functions (Figure 6). To create a new task, select New Task you enter is indented below the main Because GTG is a very compact desk- in the Tasks menu or click on the New task. If several subtasks are defined for a top application, the program is not capa- Task icon top left. In the subsequent primary task, the entire list is opened by ble of exchanging data with other sched- pop-up window, enter all relevant data clicking on the small minus symbol to ulers or project managers. A freely con- as free text and select the task’s start the left of the main task and can be re- figurable reminder function with acous- date by clicking on the drop-down moved at any time using the plus sym- tic or optical signals is also missing. menu to the right of the Starting on bol. This gives you a better overview of input field to access a calendar. In the extensive task lists. Makagiga Due for field, determine the task’s com- Remove tasks from the list by clicking Makagiga [3], a to-do manager for the pletion date. on the Select as completed button at the desktop written in Java, is available After you click on the drop-down top of the program window in the but- under the free Apache 2.0 license. menu to the right of the date field, a cal- tonbar. You can view these tasks again Makagiga comes in three versions for endar is available. The entry automati- later by selecting View | Closed Tasks Linux (32- and 64-bit systems, as well cally lands in the main window’s list Pane (Figure 5). as a portable version) and requires a area, it appears with a Start date and Right-clicking on an entry and select- Java Runtime Environment (JRE) on Due on date. ing the Delete option from the context the installation system. It does not

Figure 5: GTG displays completed and pending tasks in the same window. Figure 6: GTG is expandable with plugins.

34 MARCH 2018 ISSUE 208 LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM REVIEWS To-Do Managers

startup. Clicking on the feed shows the titles of the latest messages in a list view. Clicking on a message opens it on the right in a new tab; you can navigate be- tween the messages with the help of the arrow keys (Figure 9). Makagiga lets you extend the virtual desktop with plugins [16] (Figure 10). For an overview of the available plugins, click on Plugins | Tools in the Tools menu. A list of the available plugins now opens on the virtual desktop, some of which are already installed (Installed) or permanently implemented (Built-In). Figure 7: The heavyweight among personal GTD managers: Makagiga. Clicking on Get More Plugins above the list opens an additional dialog that matter whether you use OpenJDK or tomatically stores all the content before lists further plugins hosted on Source- Oracle’s JRE. closing and shows you the same tabs Forge. To add one of the plugins, click on Makagiga’s functionality goes far be- and folders when you restart so that you it and then on the Install button in the yond that of a plain vanilla to-do manager: can continue working seamlessly. dialog’s lower left corner. A pop-up win- In addition to a pinboard and an appoint- In order to provide topic- or task-spe- dow shows brief information about the ment calendar with corresponding to-do cific news quickly and clearly, many extension; reclicking on Install down- lists, the software also provides an RSS websites offer their own RSS feeds. Mak- loads the plugin and integrates it into reader and can be extended with various agiga provides a built-in RSS reader. Makagiga. plugins. The range of plugins extends from Setting up a new feed is very easy: At the same time, the routine displays simple text-viewer modules for certain for- Copy the feed address to the clipboard a short note on how to call the plugin. mats to a wiki tool for viewing and editing and paste it into the Makagiga setup dia- You can also remove an existing exten- wiki texts, a graphics program, and an log. You can do this via New | Add RSS sion from the plugin list by clicking on electronic topographic map based on Feed. After inserting the link, click on the the red X icon to the right of the plugin OpenStreetMap [15]. You can download Preview button at the window’s bottom and confirming the uninstall in another plugins from the repository and integrate right. Makagiga now loads the latest feed dialog. them into the task folders in Makagiga. message and displays it in the Preview Makagiga implements time manage- Automatic integration with the uniform in- area. If you use the Create button bottom ment in the form of to-do lists and, a cal- terface means that there is no need for right, the link appears on the left side of endar. You can activate both via the time-consuming installation work. the program window in the RSS Feeds Tools menu; they then appear as sepa- The software is available as a 33MB 7z section (Figure 8). rate tabs on the right of the virtual desk- archive, which you unpack and drop into At startup, the software updates the top. The Add Task: input line lets you a directory. Then call Makagiga via java feeds and tells you how many messages enter tasks in to-do lists and expects a ‑jar makagiga.jar. Since the program di- it received for each feed since the last short description of the task. Clicking on rectory also comes with icons and a small script called makagiga.sh, which creates a starter, it integrates into a menu structure without any problems. After the call, Makagiga starts surprisingly quickly, showing a program window with an empty pinboard ( Figure 7). When you create a new folder or tab via New (top left), it appears on the right in the pinboard, where Makagiga has al- ready preconfigured a to-do list and wid- gets. You can stick your notepads (wid- gets) to the pinboard, and add a second page to the bulletin board by clicking on 2 below the tabs. The content of the tabs on the right varies, depending on the folders on the left in the tree view. When you enter content in your vir- tual desktop, you do not have to save it Figure 8: Makagiga’s functionality goes beyond the simple to-do list. separately. When you quit, Makagiga au- Among other things, the software integrates RSS feeds.

LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM ISSUE 208 MARCH 2018 35 REVIEWS To-Do Managers

Figure 9: RSS feeds keep you up to date on specific topics.

the + symbol to the right of the line alarm functions for the individual tasks most major Linux distributions. The soft- adds the new task to the overview. in Settings. Color gradients are available ware comes with a clear-cut user interface You can open the calendar via the Set in the to-do list or messages in the sys- that requires practically no training. Red- Date/​Time link right in the overview tem tray when a time limit is reached. Notebook is designed as a journal applica- line. Select the desired date and time for tion and therefore has an extended range completing the task. After you click on RedNotebook of functions compared to plain vanilla task OK, the data is placed in the to-do list. In Developers have been working continu- planners: The program also includes a cal- the Priority column, specify the priority ously on the GPLv2 software RedNotebook endar with a small word processor that with which Makagiga should handle a [4] for several years now. RedNotebook is provides basic formatting options and vari- task. In the Tools menu, also define the available in the software repositories of ous export options for the finished texts.

Figure 10: Makagiga even replaces maps with an OpenStreetMap plugin.

36 MARCH 2018 ISSUE 208 LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM REVIEWS To-Do Managers

After you start the application, you will find yourself in a window divided into four parts. A horizontal menubar appears at the top and a buttonbar is below it. In the program window’s left- hand area, there is a vertically ar- ranged calendar and below it a word cloud (Figure 11). To the right is a large section for text input and editing. The buttonbar controls the calendar and the display area separately. A special feature of RedNotebook is the word cloud: Certain words appear from the text that you have keyworded with the help of hashtags. The words appear in different sizes, depending on how fre- quently they occur. If you click on one of the words, the software searches for it in the text body to the right of the picture and then dis- plays it with a yellow background. Since the software has good online Figure 11: RedNotebook organizes tasks using a word cloud (left). documentation, you can easily familiar- ize yourself with the two operating this purpose, there is an input field on RedNotebook also shows the entry on modes, Edit and Preview, which you can the left of the program window between the window’s right side. Thus, you do select on the buttonbar. the calendar and the keyword and selec- not have to flip through the calendar After startup, I recommend that you tion lists. Type the search term into this view with the arrow keys to jump to an first delete the sample text in the editing input field; the display disappears while entry with the search word. area. To do so, enable the editor in the typing and a small list view with the re- RedNotebook users format texts in edit buttonbar by clicking on the Edit button. sults of the search term appears in its mode; only a few formatting options are On first use, changing from the Edit to place. The list has only two columns appropriate for the program’s purpose. the Preview button is somewhat confus- with the date of the entry and the loca- To select a formatting option, click on ing, because the software is actually in tion where the search term appears in the Format button in the program win- edit mode and not in display mode. The the text. dow’s upper right corner and select the previously grayed out Template, Insert, Clicking on one of the entries immedi- desired format from the context menu. and Format buttons are now enabled, to- ately changes the calendar view and You cannot enter fonts or special for- gether with options. shows the month and year of the entry. matting options, such as tables, indents, When entering text, select important words that you want to index for the word cloud by prepending a hashtag. Your selections appear immediately in red letters in the text to attract attention. When you save the journal and exit the program, the word cloud updates. The keywords appear in the word cloud the next time you start the software. By the way, you do not necessarily have to use the Save dialog via the Jour- nal | Save or Journal | Save as menu, be- cause RedNotebook automatically saves the newly generated content. The more often keywords appear in the text, the larger they are in the word cloud. The same applies to the selections: RedNote- book displays frequently selected words in a larger typeface (Figure 12). In order to quickly find entries with certain keywords in a well-filled calen- dar, use the highlighting function. For Figure 12: Important words are indexed in RedNotebook.

LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM ISSUE 208 MARCH 2018 37 REVIEWS To-Do Managers

file after displaying an overview, which includes the formatting, but not the ad- ditional headers or footers with page numbers. RedNotebook also lets you back up the data via Journal | Backup. After specify- ing a target path, the program creates a zip archive where the filename consists of the current date. The zip archive con- tains plain text documents with special tags. If you want to edit the documents later, you cannot use a conventional text editor. Task Coach Task Coach [5] is one of the standard task managers under Linux, thanks to years of development and mainte- nance. The software appears in the re- Figure 13: The Task Coach settings dialog is very extensive. positories of almost all the major dis- tributions. The latest version and the or footnotes, but you can draw lines, in- tions will open after you enter a name. source code are also available from the sert manual line breaks, or optionally in- Once you have designed your template, project site [5]. The program, released sert images and links via the Insert but- click on the Save button to add it to the under the GNU GPLv3, offers many ton. The list function lets you create lists list. After restarting the software, your functions of a professional task man- with partially indented contents. You can new template will appear in the list. agement tool, and learning to use it also transfer files to the editor page by RedNotebook can export your journal does not take long. first selecting them from a file manager to various file formats and is thus cross- Before using Task Coach for the first via Insert | File and then dropping them application and even cross-platform ca- time, it is a good idea to complete the into the editor window as direct links. pable. In addition to LaTeX and simple basic configuration in the Settings dia- Finally, in display mode, you can ac- text, HTML and PDF are also available log. Select Edit | Settings. In the configu- cess files using distribution-specific as export formats. In a separate export ration window, the Task Appointments third-party programs, such as image dialog – accessible via Journal | Export – and Task Reminders tabs are especially viewers. The Template button takes you the software exports entries from a freely relevant. You can define various options to some examples that allow you to selectable period to the desired target for the reminder function and time inter- quickly create and format text. This is format in five steps. vals (Figure 13). where you will find templates for a You can specify filter criteria to ex- To use Task Coach effectively, I rec- phone memo, a report, or a travel report. clude certain keywords from the export; ommend that you first create individual You also can add your own templates. you can also decide whether to use plain categories. Then assign the tasks to be If you select Create New Template from text or keep the markup in the target for- created at a later date to each category. the Template menu, a help page listing mat. Finally, choose a target path for the The dialog for creating a category lets the template’s various formatting op- backup. The software creates the target you enter free text as a description and

Figure 14: Tasks can be scheduled in great detail in Task Coach.

38 MARCH 2018 ISSUE 208 LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM REVIEWS To-Do Managers also link attachments. Once you have the associated work data. The Notes ble when it comes to exporting: You can created a category, assign the corre- and Attachments tabs let you add user- choose between HTML, CSV, text, or sponding tasks to it in the next step. defined texts and integrate files. Click- iCalendar data formats. This ensures The task dialog is far more complex ing on the Close button terminates task good compatibility with other appoint- than the category dialog. Press the New entry and transfers the results to the ment management systems, as numer- task button directly above the task main window (Figure 14). ous applications support the iCalendar pane in the program window. The in- When you launch the program later format [17]. terface is similar to the category dia- on, the software automatically checks log: In the Description tab, assign a the individual categories and tasks for Conclusions name for the task and, if necessary, a deadlines. When it identifies due dates, The to-do managers discussed in this arti- description as free text. You can also Task Coach displays a small window cle cover a wide range of tasks (see Table assign priorities. that reminds the user of the appoint- 1 for an overview). If you need a plain old In the Dates tab, define the start date, ment. Task Coach offers the option of task manager without an automatic re- the planned due date, and the actual marking this task as completed, to minder function, BasKet, RedNotebook, closing date. You can also configure a avoid the software reminding you again or GTG. The first two stand out because reminder time. later. Click on the Mark task completed they can also handle unstructured data. In the Prerequisites tab, you define button (Figure 15). In response, Task Task Coach, on the other hand, fo- subtasks that Task Coach lets you enter Coach places a checkmark to the left of cuses on professional time management in a similarly designed dialog. Subtasks the task in the main window and high- and offers a reminder function and need to be processed first as a prerequi- lights the task in green. Task Coach warnings to a large number of employ- site for the main task. The Progress tab marks overdue appointments in red if ees in the case of overlapping appoint- lets you enable a progress bar, and the they have not been marked as com- ments. Makagiga serves users who need Categories tab assigns categories to pleted. a complete virtual desktop for highly tasks. Task Coach displays the categories The buttonbar with its quick func- complex tasks and want to use different that have already been entered. tions, located directly above the two list third-party sources. nnn In the Budget tab, enter a working areas for tasks and categories, also lets time quota, as well as an hourly rate or you mark a task as inactive. In such Info a fixed budget. The time-tracking fea- cases, the reminder function is automati- [1] BasKet: tures make Task Coach suitable for cally deactivated. It is also possible to https://​­github.​­com/​­kelvie/​­basket freelancers and service providers who hide inactive and completed tasks (i.e., [2] GTG: https://​­github.​­com/​ implement customer projects and remove them from the lists). ­getting‑things‑gnome therefore require precise scheduling If you want to assign new dates to sev- [3] Makagiga: and invoicing. The Effort tab collects eral similar tasks, you can also define an http://​­makagiga.​­sourceforge.​­net existing task as a [4] RedNotebook: http://​­rednotebook.​ template. ­sourceforge.​­net Task Coach also [5] lets you import and Task Coach: http://​­taskcoach.​­org export data. The [6] Tasque: software supports https://​­wiki.​­gnome.​­org/​­Apps/​­Tasque CSV or plain text [7] Tracks: http://​­www.​­getontracks.​­org format for importing [8] ThinkingRock: to-do lists. Task https://​­www.​­trgtd.​­com.​­au Figure 15: Task Coach also has a reminder function. Coach is more flexi- [9] iKog: http://​­www.​­henspace.​­co.​­uk/​­ikog/ [10] Tomboy: Table 1: Overview of To-Do Managers https://​­wiki.​­gnome.​­org/​­Apps/​­Tomboy BasKet GTG Makagiga RedNotebook Task Coach [11] KNotes: https://​­www.​­kde.​­org/​ Cross-platform No Yes Yes Yes Yes ­applications/​­utilities/​­knotes/ Calendar No Yes Yes Yes Yes [12] TuxCards: http://​­www.​­tuxcards.​­de Subtasks Yes Yes Yes Yes Yes [13] Sticky Notes: Memory function No No Yes No Yes https://​­store.​­kde.​­org/​­p/​­1127372 Tagging No Yes No Yes No [14] Gnote: Automatic backup Yes No Yes Yes Yes https://​­wiki.​­gnome.​­org/​­Apps/​­Gnote Data import Yes Yes Yes No Yes [15] OpenStreetMap: Data export Yes Yes Yes Yes Yes https://​­www.​­openstreetmap.​­org Backup Yes Yes Yes Yes Yes [16] Makagiga plugins: Links Yes Yes No Yes Yes http://​­makagiga.​­sf.​­net/​­plugins.​­php Attachments Yes Yes Yes Yes Yes [17] iCalendar: Templates No No Yes Yes Yes https://​­de.​­wikipedia.​­org/​­wiki/​­ICalendar

LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM ISSUE 208 MARCH 2018 39

IN-DEPTH Command Line – unoconv

Customizing file formats with unoconv Flexible Import/Export​ A hidden utility in the LibreOffice toolbox, unoconv offers a wide array of import and export filter options for use at the command line. By Bruce Byfield

ibreOffice is designed to save, im- compilers, and the API is used to create expressions. The command structure as- port, or export one file at a time, extensions, as well as to provide support sumes that you are exporting the file(s) using standard filter settings. The for formats not visible in the LibreOffice to PDF format, which is probably the File menu allows you to choose desktop window, such as the obsolete most widely used operation for the com- LPDF export options, but for most other LibreOffice 1.0 file formats. mand. The extension is the quickest way types of files, you must use the default Unsurprisingly, unoconv requires access to specify the type of file, although alter- filter settings. If you want to save multi- to LibreOffice’s resources. The easiest way natively you can use the option ‑‑doc‑ ple files, or adjust the filter settings, you to provide this access is to install unoconv type (‑d) [TYPE], specifying document, need to shift to the command line and on a system that already has LibreOffice graphics, presentation, or spreadsheet. run unoconv [1], a little known Python installed. However, as detailed in the man Formulas, databases, or charts are not script that gives you greater control, page, you can also use the ‑‑connect (‑c) supported by unoconv – no doubt due to both with a wide array of import and ex- option followed by a comma-separated list lack of demand, since these types of port filter options. to define and connect to the location of a documents have existed in LibreOffice Unoconv is short for Universal Network remote LibreOffice instance or ‑‑listener and its predecessor OpenOffice.org for Objects (UNO) conversion, a reference to (‑l) to have unoconv detect one. over a decade. If you prefer to see confir- the UNO API used by both LibreOffice Unoconv’s basic command structure mation that the command has been suc- and OpenOffice [2]. Bindings for UNO are (Figure 1) is: cessfully carried out, you can also add available for most C++, Java, and Python up to three ‑‑verbose (‑v) options – unoconv [FILE].EXTENSION without at least one, unoconv only dis- Author plays error messages, and the only sign Bruce Byfield is a computer journalist and Other files can be added, either in a of a completed conversion is the return

a freelance writer and editor specializing space-separated list or by using regular to the command prompt. Photo by Hudson Hintze on Unsplash in free and open source software. In addition to his writing projects, he also teaches live and e-learning courses. In his spare time, Bruce writes about Northwest coast art. You can read more of his work at Figure 1: Unoconv’s basic command structure. The ‑‑verbose option has http://​­brucebyfield.​­wordpress.​­com been added to show the script’s operation.

42 MARCH 2018 ISSUE 208 LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM IN-DEPTH Command Line – unoconv

Still another interesting option is to set the output file to the same format as the original, then add ‑‑template (‑t) [FILE] to add styles from another file to the out- put – a command-line version of the Load Styles feature in the Styles and For- matting window on LibreOffice’s desk- top interface. Import and Export Filter Settings For many users, the default filter settings are all that is needed. However, you can Figure 2: A few of unoconv’s supported formats. Unoconv supports doz- adjust both import and filter settings to ens of formats, some of which are not listed in the desktop interface. your own preferences, using ‑‑export (‑e) [SETTING] or ‑‑import (‑i) [SETTING]. If you want to change the export for- tions. If a file’s attributes matter, you Among other purposes, this ability can mat, add the option ‑‑format= (‑f). The can add ‑‑preserve so that the output be used as an easy method for adjusting supported formats for both exports and file has the same attributes as the orig- the character encoding or date formats imports are displayed by running unoconv inal file. For batch conversions, you in the original file. ‑‑show. Supported formats include text, might want to use ‑‑output (‑o) to Filter settings are added directly after CSV, dBase, HTML, PDF, several versions place all the output files in a separate ‑‑export (‑e) or ‑‑import (‑i), with a of Microsoft Office formats, StarOffice directory, rather than have them mixed separate option for each setting. For text formats (LibreOffice’s original ancestor), together with the original files. The and CSV files, these settings are intro- common graphic formats, and, of course, output file can also be password pro- duced by FilterOptions= and completed current LibreOffice formats (Figure 2). tected by adding: by a comma-separated list unique to the In addition, unoconv also includes format. In the list, settings can be left several different housekeeping op- ‑‑password= [PASSWORD] blank (,,) or at the end of the list omit- IN-DEPTH Command Line – unoconv

ted altogether, forcing the use of the de- quote-all-text-cells, and save-cell-con- If researching all the settings is more fault settings. tent-as-shown. work than you want to undertake – es- By contrast, PDF and graphics exports pecially for a single operation you are and imports are added after ‑‑export CSV Text File Import unlikely to repeat – the default filter for (‑e) or ‑‑import (‑i), with a separate op- CSV files have four basic settings. In PDF export should be acceptable for tion for each setting. In other words, to order, they are the field separator, the most purposes. set a password and set the highest image text delimiter, the encoding, and the first resolution to 300dpi in a PDF file, the line in the file to convert to or from a Graphics Export Settings command would include: spreadsheet. For example, Unoconv’s graphic support for export- ing includes .jpg, .png, .gif, and .eps ‑‑export PermissionPassword=abcdef U ‑‑export FilterOptions=44,34,76,2 file formats, entered in lowercase let- ‑‑export MaxImageResolution=300 ters. All these formats support Height, will set commas as the field separator, a Width, and Resolution settings, making A complete list of standard import and double quotation mark as the text delim- unoconv a convenient way to stan- export settings is available online [3], iter, UTF-8 as the encoding, and the first dardize all the illustrations for an arti- but it is far too long to mention here. line in the file to the second. In theory, cle or a book. In addition, each format However, different types of files have at the end of the settings, you could add supports other settings (Table 2). As their own set of filter options. the date format for each column, so that: with PDF export settings, the man page lists only the settings for graphic for- Text Export and Import ‑‑export FilterOptions=U mats, leaving you to research valid set- For text import, the most common set- 44,34,76,2,1/5,2/5,3/5 tings on your own. ting to customize is the encoding. A sin- gle value can be entered, such as would specify that the date formats for The Conversion Toolbox the first three columns would be YY/​ Unoconv does have a few gaps in its ‑‑import FilterOptions=76 MM/​DD. Any other columns would use functionality. Its man page lists several the date format already specified for specialized scripts that you might need, which would set the encoding to UTF-8. them. including asciidoc-odf for converting However, for exporting text from a plain text to the Open Document Format spreadsheet, the FilterOptions fields are PDF Export Settings used in LibreOffice and other free office encoding, field-separator, text-delimiter, Unoconv does not import PDF files. applications [5] and docbook2odf for However, its settings for PDF export are converting DocBook XML to Open Docu- Table 1: Common PDF Export Settings numerous. The man page gives only a ment Format [6]. EmbedStandardFonts list of settings without a full explanation However, in many cases, unoconv of- EnableCopyingOfContent of any of them. However, a full explana- fers exact imports and exports for com- EnableTextAccessForAccessibilityTools tion, as well as valid options for each mon free office formats. It combines the setting, is available online [4]. advantages of sensible and easy-to-use EncryptFile As a quick reference, you can also open defaults with thorough flexibility – if ExportBookmarks LibreOffice and click File | Export to PDF only you take the time to research the ExportNotes to study the options in the PDF dialog possibilities. Especially if you need to do ExportNotesPages window. For instance, on the General tab, batch file conversions, unoconv remains FirstPageOnLeft the drop-down list of choices for Reduce one of the best hidden utilities in the InitialView image resolution shows the valid setting LibreOffice/​OpenOffice toolbox. nnn MaxImageResolution for MaxImageResolution=. Other options, OpenInFullScreenMode such as EnableCopyingOfContent=, can be Info PageLayout completed with True or False, or, like [1] unoconv: PageRange Changes, with 0 for off and 1 for on. With https://github.com/dagwieers/unoconv research, you should be able to use many OpenInFullScreenMode [2] UNO API: https://api.libreoffice.org/ of the available settings. Some, like Embed‑ PageLayout [3] Standard import and export settings: StandardFonts only need to be listed. Each PageRange https://​­wiki.​­openoffice.​­org/​­wiki/​ setting should be entered with a separate RestrictPermissionPassword ­Documentation/​­DevGuide/​ ‑‑export option, if only to make revision ­Spreadsheets/​­Filter_Options Zoom of the command easier. Some of the most com- [4] PDF export: Table 2: Unique Settings for Graphic Formats monly used PDF export http://​­wiki.​­services.​­openoffice.​­org/​­wiki/​ ­API/​­Tutorials/​­PDF_export .jpg ColorDepth, Quality settings are listed in [5] asciidoc-odf: http://​­github.​­com/​ .png Compression, InterlacedMode Table 1. Their names should make most of ­dagwieers/​­asciidoc‑odf .gif Transparency, InterlacedMode their purposes reason- [6] docbook2odf: http://​­open.​­comsultia.​ .eps ColorFormat, Compression, Preview, Version ably clear. com/­ ​­docbook2odf/

44 MARCH 2018 ISSUE 208 LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM

IN-DEPTH Programming Snapshot – Protectli

Home network monitoring with pfSense, Protectli, and a screen scraper Servile Guardian What is making the lights on the router flicker so excitedly? An intruder? We investigate with pfSense on a Protectli micro appliance and a screen scraper to email the information. By Mike Schilli

t’s a shame that no routers simply box is about four display the network packet ad­ by four inches in dresses that pass through them on size and passively an LED display. Because I’m curi­ cooled, so there is Ious about what’s going on in my home absolutely no fan network, on the advice of a work col­ or other noise. league, I bought a micro appliance from The installation the Chinese company Protectli (Fig­ is a piece of cake – ure 1) [1], which runs the FreeBSD- simply load the based open source firewall pfSense. The distribution from the pfSense Com­ munity Edition website [2] onto a bootable USB stick, insert an Figure 1: The Protectli micro appliance used as a mSATA disk and router. RAM into the Pro­ tectli’s small case, and after , say single packet, create statistics or even in­ yes to the installation prompts. Badda- tervene when needed, and block certain bing badda-boom, pfSense’s web GUI is communication attempts according to up and running (Figure 2). predefined firewall rules. If I want to know why router lights are flickering, I Guardian at the Gate only need to call the pfSense GUI to see The Protectli appliance is directly who is streaming Spotify, watching Net­ connected to the Internet-facing flix, or ordering on Amazon (Figure 2). interface (in my case, a DSL In addition to traditional terminal- modem to the ISP). On the based tools such as pftop, the firewall LAN side, it provides ac­ GUI also offers very elegant add-on cess to the Internet for all devices connected to my Author home network (in my Mike Schilli works as a software engineer case, a series of in the San Francisco Bay area, California. routed subnets). Each month in his column, which has Equipped with a been running since 1997, he researches four-core Cel­ practical applications of various eron, it’s power­ programming languages. If you go to ful enough to mschilli@perlmeister.​­com he will gladly look at every answer any questions.

46 LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM IN-DEPTH Programming Snapshot – Protectli

Figure 2: Finally, a device to monitor all of your home’s network traffic.

Listing 1 [5], which uses the selenium module installed using pip3 to simulate a browser, searches for and finds these ele­ ments using the find_element_by_name() function. For the webdriver.Firefox() call to work with the system’s Firefox browser, the needs the geckodriver program, which is available as a TAR file [6]. You need to unpack this and dump the binary that falls out of the archive into a path that can be found somewhere in $PATH. The script opens the browser, takes you to Figure 3: Pie charts for server and client ports. the login page, autofills the form fields, and then clicks on the Login button. packages such as ntopng, so you can However, the first hurdle between a The selenium module is often used for browse through pie charts and HTML ta­ command-line client and the juicy net­ testing WebGUIs and makes it really bles to find out who uses the most band­ work data is the width or contacts computers in dubious login page so defi­ countries (Figure 3). antly presented by Unfortunately, there is no official API pfSense. A look at for the GUI, only a FauxAPI [3], which the HTML code runs as an add-on package on the pf­ (Figure 5) reveals Sense distribution and provides limited that the two fields access to the firewall’s internals. for accepting the username and Keys for Protectli password are To check at regular intervals what is dubbed username- happening on the Protectli box, I fld and password- thought it would be easy to write a fld, and the sub­ screen scraper [4] that logs in periodi­ mit button goes by cally and automatically to the box’s the name login. login page (Figure 4) and scans and The Python mails the data displayed on the dash­ scraper quickly board. thrown together in Figure 4: First hurdle: Login.

LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM ISSUE 208 MARCH 2018 47 IN-DEPTH Programming Snapshot – Protectli

Figure 5: The login page’s source code contains fields for the username and password.

easy to simulate a user sitting in front of a web user Listing 2: mail.py

interface. 01 #!/usr/bin/python3 After the pfSense login screen, the pfSense dashboard 02 page (Figure 6) with the firewall overview data is saved 03 import smtplib in the saved.png file by the new screen scraper by calling 04 import yaml save_screenshot() as a trigger. The values to be filled in 05 from email.mime.multipart import MIMEMultipart are read by the script from the creds.yaml file, which is read from disk; the data is then stored as a username and 06 from email.mime.text import MIMEText password accessible in the creds dictionary (Figure 7). 07 from email.mime.image import MIMEImage 08 from email import encoders One Man Went to Mow 09 Listing 2 is used to periodically send the collected data to 10 creds = yaml.safe_load(open('creds.yaml', 'r')) an email address. It bundles the PNG file created by List­ 11 12 attachment = 'saved.png' Listing 1: dash-scraper.py 13 body = "The latest pfSense Dashboard.î

01 #!/usr/bin/python3 14

02 15 msg = MIMEMultipart()

03 from selenium import webdriver 16 msg['From']=creds['from_email']

04 import yaml 17 msg['To']=creds['to_email']

05 18 msg['Subject']='pfSense Status' 19 06 driver = webdriver.Firefox() 20 msgText = MIMEText( 07 21 '%s

' 08 creds = yaml.safe_load(open('creds.yaml', 'r')) 22 % (body, attachment), 'html') 09 23 msg.attach(msgText) 10 driver.get('https://192.168.241.1') 24 11 25 fp = open(attachment, 'rb') 12 user_field = driver.find_element_by_name("usernamefld") 26 img = MIMEImage(fp.read())

13 pass_field = 27 fp.close driver.find_element_by_name("passwordfld") 28 img.add_header('Content‑ID', "<{}>".format(attachment))

14 29 msg.attach(img)

15 user_field.send_keys(creds['pfsense_user']) 30

16 pass_field.send_keys(creds['pfsense_password']) 31 server = smtplib.SMTP(creds['smtp_server'], 587)

17 32 server.starttls()

18 driver.find_element_by_name('login').click() 33 server.login(creds['smtp_user'],creds['smtp_password'])

19 34 server.sendmail(creds['from_email'],

20 driver.save_screenshot('saved.png') 35 creds['to_email'], msg.as_string())

21 driver.close 36 server.quit()

48 MARCH 2018 ISSUE 208 LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM Figure 6: pfSense firewall status information. ing 1 into an email as an attachment appends the screenshot in MIME format and sends it via an SMTP server. To and adds an email content ID header read the security-relevant username and with the name of an imaginary file in password variables for the SMTP server, square brackets. line 10 retrieves the same YAML file as Figure 8 shows how the mail arrives in before and stores its contents in the Gmail. Called as a cron job once a day, creds dictionary. this keeps the home owner up to date The script then builds an HTML body – with what’s happening on the local net­ with introductory text and an IMG link to work. nnn the attached image, so that a webmail client can display it graphically. As of Info line 31, Listing 2 establishes a connection [1] Protectli micro appliance: https://​­www.​ to the SMTP server, whose address is ­amazon.​­com/​­gp/​­product/​­B01GIVQI3M also retrieved from the file as creds.yaml [2] pfSense Community Edition download: the smtp_server: mail.provider.net https://​­www.​­pfsense.​­org/​­download/ entry. The script uses port 587 and trans­ [3] pfSense FauxAPI: mits the data in TLS-encrypted form. It https://​­github.​­com/​­ndejong/​­pfsense_ fauxapi [4] Jarmul, Katharine, and Richard Law- son. Python Web Scraping, 2nd ed. Packt Publishing, 2017 [5] Listings for this article: ftp://​­ftp.​­linux‑magazine.​­com/​­pub/​ ­listings/​­linux‑magazine.​­com/​­208/ Figure 7: Sensitive data in the [6] geckodriver: https://​­github.​­com/​­mozilla/​ creds.yaml file. geckodriver/­ ​­releases/​­tag/​­v0.​­19.​­0

Figure 8: The screen-scraped dashboard arrives by email.

LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM IN-DEPTH BackBox Linux

Ubuntu derivative BackBox Linux for security analysis (In)secure?

Specializing in security and forensics, BackBox Linux is not only good for a vulnerability assessment, but thanks to its lean substructure, it is also suitable as a desktop distribution. By Erik Bärwaldt

any security-related Linux derivatives focus on a spe- cific area of IT security and only take other problems intoM account marginally, or not at all. In contrast, the Italian Ubuntu derivative BackBox Linux, which has been in con- tinuously development for several years, addresses most of the security- relevant issues faced by administrators of small and medium-sized networks. You can pick up the approximately 2.5GB ISO image from the BackBox project page [1] for both 32- and 64-bit architectures. Here, you can choose whether you want to download the image directly or via BitTorrent. You can either specify a donation amount or enter 0 in the corresponding field. As the minimum system requirements, the developers specify a computer with 1GB of RAM and 10GB of free space on Figure 1: The Xfce desktop does has no surprises; only a couple of entries

mass storage. The screen resolution in the start menu indicate the distribution’s peculiarities. De Martin, 123RF.com Lead Image © Andrea

50 MARCH 2018 ISSUE 208 LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM IN-DEPTH BackBox Linux

with many popular pre- The graphical Vidalia control panel, installed programs, in- which provides a great deal of interest- cluding LibreOffice ing information about Tor in a visual for- 4.2.8, Firefox 50.0.2, mat, automatically establishes the con- Gimp 2.8.10, and Thun- nection to the service (Figure 3). derbird 45.5.1. However, In the Anonymous menu you will multimedia programs also find a launcher that calls a script such as VLC and Audac- to erase the memory before switching ity are missing, and you off. Switch this function on or off in won’t find a Games sub- the terminal after entering your au- menu. thentication data. For this purpose, in the Unlike other IT security distribu- Services folder, BackBox tions, BackBox does not provide the offers the option to start Firefox web browser with add-ons by or stop various services default. You will therefore want to re- and processes with a install and configure uBlock Origin, mouse click. These in- Ghostery, or HTTPS Everywhere to clude the Apache web stop unmanageable tracking by adver- server, the Tor anony- tising agencies. mization network, the Pidgin, the preinstalled chat client, PostgreSQL database, optionally supports encrypted commu- and the SSH daemon. nication using the OTR plugin, but you The status of these ser- have to install this extension manually. Figure 2: Preconfigured services can be launched vices can be easily deter- In the Thunderbird email client, I also by clicking in BackBox’s start menu. mined with a mouse click recommend setting up add-ons such as (Figure 2). Enigmail, which allow messages to be should be at least 800x600 pixels; both a You can use the BleachBit delete tool simply encrypted with OpenPGP or USB memory stick and a DVD can be to remove unnecessary and obsolete GnuPG. used as boot drives. data, which mainly includes rotating log- Much like Ubuntu, the system starts files, but also temporary storage or histo- Core up automatically without intervention ries that show a user’s behavior on the The core of BackBox is the Auditing on booting. If you press a key in the computer. BackBox offers two starters: menu, with 16 groups of security-related first five seconds, a selection menu ap- one for users and one for administrators applications. In addition to tools for pen- pears in which you can specify the lo- with extended permissions. etration tests, you will also find many calization, if needed. After a short In the Anonymous menu, you can programs for network and web app anal- time, an Xfce v4.11 desktop appears in start, stop, or determine the current sta- ysis, as well as forensic tasks. It also a conventional design with a horizon- tus of the anonymous service by clicking contains well-known sniffers and vulner- tal panel at the top of the screen (Fig- the like-named scripts (e.g., anonymous ability analysis programs. ure 1). start). The anony- At first glance, three unusual catego- mous script lets you ries stand out in the start menu: the generate an incor- Anonymous, Auditing, and Services sub- rect MAC address menus indicate the distribution’s univer- for one of the net- sal applicability for security-related work interfaces in- tasks. On the desktop itself, in addition tegrated into the to the obligatory recycle bin and some system. The service icons for existing drives and folders, also lets you mod- there is also a launcher to install the sys- ify the hostname tem on the mass storage device. and finally starts Clicking on the launcher activates the Tor anonymiz- Ubiquity, Ubuntu’s default installation ing service. wizard, which appears in brighter col- The entire script ors on BackBox than on the original runs interactively Ubuntu. in the terminal. To open an Internet Software connection secured BackBox Linux is based on Ubuntu by a Tor network, 14.04, with kernel 4.4 underpinnings click on Vidalia in Figure 3: The Tor anonymization service can be con- and systemd. The distribution comes the Internet menu. veniently managed with Vidalia.

LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM ISSUE 208 MARCH 2018 51 IN-DEPTH BackBox Linux

applications such as Pho- relevant software up to date at all times. toRec, TestDisk, Scalpel, Therefore, Synaptic lists more than and Foremost. The same 48,000 packages for the BackBox system menu also has applica- (Figure 5). tions for file and partition analysis. Conclusions With BackBox, you get a solid operating All-Rounder system. On the one hand, it is suitable as a Thanks to the lean Xfce specialized Linux derivative for security desktop, BackBox is al- audits and anonymous Internet surfing ready very efficient with with Tor. On the other hand, it can also be resources by nature. For used as a general Linux desktop. The sys- example, with its graphi- tem is based on Ubuntu 14.04 LTS and cal desktop and all com- therefore comes with the complete Ubuntu monly started services, software inventory. Additionally, the devel- the system only occupies opers provide their own repository, which about 500MB of RAM, is primarily used to keep BackBox’s inte- which means that it runs grated safety-relevant tools up to date. smoothly, even on Because of its slim Xfce desktop and low poorly equipped com- system requirements, the Italian Ubuntu puters. Because most of derivative explicitly addresses users of the supplied tools start older hardware who work with limited re- in the terminal, they do sources. Therefore, the distribution should Figure 4: BackBox has the right software for not require any addi- be of interest to all users who are looking many problems. tional memory. for an everyday system that also takes Thanks to the low hard- many security aspects into account. nnn The developers also incorporated ware requirements, BackBox is also suit- some unusual tools into the system: For able as a solid all-rounder for daily desk- Info example, tools from the Automotive top use. For this reason, the developers [1] BackBox download: https://​­backbox.​­org Analysis submenu can be used to read implemented the graphical Synaptic front the CAN bus of motor vehicles, whereas end for package management, which also Mobile Analysis deals with smartphones makes it easy to install updates. Find us on and tablet PCs. The Android and iPhone Package management already specifies submenus group the respective applica- all package sources, including those Facebook tions by system type. from third-party providers and the Tor http://www.facebook.com/linuxpromagazine The Wireless Analysis submenu, Project, so you can keep your security- which distinguishes between Bluetooth and WiFi applications, is similarly laid out. Under WiFi | Cracking, you will find programs for checking WiFi en- cryption, such as Aircrack-ng. The Scan- ning submenu combines applications for detecting WiFi networks, including the Kismet program. Various applications for LAN analysis offer significant benefits: Password crackers, some of which can be used for specific file types, make it possible to trace password strength. With network sniffers such as Ettercap and Wireshark, you can also quickly identify weak points in the intranet by recording data transfer (Figure 4). In addition to software that exclusively deals with computer and data security, you will find tools for reconstructing data in various subgroups in the Foren- sic Analysis menu. This includes – espe- Figure 5: Thanks to Synaptic package management, BackBox can be cially in the Data Recovery submenu – easily updated and extended with additional software.

52 MARCH 2018 ISSUE 208 LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM

IN-DEPTH Charly’s Column – Tsung

The sys admin’s daily grind: Tsung More Lust for Load How many users can the database take? When does a CMS throw in the towel? In order to explore performance limits, Charly Kühnast uses the Tsung load generator instead of human users as beta testers. By Charly Kühnast

f I want to test how much load a XMPP is still one of the services that to clients with different performance (perhaps even distributed) system Tsung can deploy to cause unrest on its characteristics by using weighting. I can can take, I launch a load generator. test servers. On top of this, Tsung supports also configure several back-end servers. Some time ago, I praised Siege [1] in HTTP with and without TLS, WebDAV, IPv4 and IPv6 are allowed for the con- Imy column, which I still consider to be a SOAP, PostgreSQL, MySQL, AMQP, nections, also in mixed mode. good barrage tool. However, most load MQTT, and LDAP. All protocols are inte- The details of the requests that Tsung generators fire unrealistically from all bar- grated via a plugin engine, so further uses to stress the servers can be configured rels and do not simulate the behavior of a protocols can follow at any time. within a wide range. In order to simulate real user. Tsung [2] can do this better. realistic user behavior, the software does Tsung evolved in several evolutionary Planning the Attack not torment the servers with constant fire steps from a tool that ran load tests Using XML on request, but instead makes well- against Jabber/​XMPP servers. Under the Using XML configuration files, the Tsung planned pauses, just as a human user fear-inspiring name of idx-Tsunami, it user designs their load test scenarios in would if he or she were looking at the con- was given multiprotocol capabilities. detail. For example, you can stipulate tent of a website and then clicking on it. Since 2014, the development of idx-Tsu- that the requests should not only origi- nami has petered out. Tsung has simply nate from one machine, but that several Reception Center taken the basis and continued develop- load generators (or clients) should play a If you want to make it even more realis- ing Tsunami’s codebase. key role. I can assign more or less work tic, use the supplied recorder: After start- ing, it records the behavior of one or more users, and Tsung replicates this session later. For example, variables can be brought into play when simulated users enter data in a search mask. I can bundle a group of requests into one transaction. Tsung understands this term as a logically related request, for ex- ample: A user calls the website, authenti- cates themselves (say, using OAuth), then accesses the sub-page using the search function, and submits a search query. Statistics Reveal All to the Administrator In addition to the existing evaluations of the load behavior for the back-end servers, Tsung also generates reports on the perfor- mance of such transactions (Figure 1). These statistics are, as expected, more use- ful for the behavior of the systems in pro- duction than synthetic flak tests – and Figure 1: In this report, Tsung has the transaction time per call on the y that’s exactly what I like about Tsung. nnn axis and the sequence of the benchmark on the x axis. Info Author [1] Siege: Charly Kühnast manages Unix systems in the data center in the Lower Rhine region of https://​­www.​­joedog.​­org/​­siege‑home/ Germany. His responsibilities include ensuring the security and availability of firewalls [2] Tsung: and the DMZ. https://​­github.​­com/​­processone/​­tsung/

54 MARCH 2018 ISSUE 208 LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM

MAKERSPACE Lightpack MakerSpace Raspberry Pi media center with DIY ambient light Let There Be Light

Ambilight lights up the wall behind Philips TVs with LEDs mounted on the device to enhance the onscreen visual impression. With Lightpack and a Rasp Pi media center, every TV can be upgraded with ambient light. By Christoph Dyllick-Brenzinger

he Ambilight technology, origi- costs $89, for which you receive 10 pre- nally developed by Philips, assembled LED strips, an unobtrusive lights up the wall behind the control unit, an AC power supply with television set by monitoring adaptors, cables, and mounting accesso- the colors in the current image and gen- ries. All components can be attached eratingT the appropriate color to extend with double-sided adhesive tape without the image content beyond the monitor causing damage to the TV. surface. The “extended” image is easier On the software side, Boblight [5] and on the eyes, because the field of vision is Hyperion [6] are two popular solutions. enlarged for the viewer. Thanks to Hyperion’s less complicated An Ambilight system basically com- configuration, you can achieve the de- prises three components: at least three sired results faster. Therefore, the ambi- edges (left, right, and top) on the back of ent light system setup in this example the TV for strips of RGB LEDs, a control comprises Lightpack PC, Hyperion, and unit that ensures the individual LEDs a Raspberry Pi. light up accordingly, and a signal to the control unit provided by software that Setup continuously analyzes the video image. When attaching the LED strips to the If you don’t want to buy a Philips Am- back of the screen, be careful not to bilight TV, but you already watch movies block the connections and any attach- and TV series on the Kodi multimedia ment points that can be used on the TV. platform, you can upgrade to ambient In the Lightpack packaging, you will find lighting in a DIY project with either a adhesive pads and cable ties that facili- Raspberry Pi with Raspbian, a Kodi dis- tate cable management (Figure 1). tribution like Open/​LibreELEC, or a Lightpack's manufacturer recom- Linux PC. Various preexisting solutions mends that the strips should be applied such as Lightpack [1], Lightberry [2], or in the “Andromeda” pattern, which AmbiLED [3] remove the need for fur- promises the most uniform illumination ther programming possible (Figure 2). Gradually mount the For the test, I chose the Lightpack PC LEDs in a clockwise direction, starting at [4] package by Woodenshark, which the bottom left-hand side of the TV made the best overall impression. It orig- housing; then, connect the strips to the

inated from a Kickstarter campaign and control unit in the same order. 123RF.com Lead Image © Nelli Valova,

56 MARCH 2018 ISSUE 208 LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM Lightpack MAKERSPACE

Raspbian system how to install the am- bient lighting system.

Hyperion To set up Hyperion, download an instal- lation script offered on the project page, make it executable, and then call it with root privileges:

$ cd /tmp

$ wget https://raw.github.com/U

hyperion‑project/hyperion/master/U

bin/install_hyperion.sh

$ chmod +x install_hyperion.sh

$ sudo ./install_hyperion.sh

The program then prompts you to reboot the system. Hyperion imports the installation rou- tine together with a unit for systemd, but the service cannot start successfully yet. Figure 1: The complete Lightpack kit mounted behind a TV set. A classic Because the system does not automati- PC delivers the image data. cally detect how many LED strips it is supposed to control and where they are To make the as- located, you have to carry out the rest of sembly of individ- the configuration manually. ual modules as For the LED setup, download the easy as possible, program HyperCon [7] (suitable for all lay the screen dis- current operating systems) onto your play-side down on computer. Hyperion and HyperCon do a soft surface so not necessarily have to run on the that the relevant same system: The configuration file points remain eas- written by HyperCon can be copied to ily accessible with- the media center computer at a later out the fear of stage. scratching the The Java application does not re- screen. After con- quire an installation procedure, but it necting the power does require the Java Runtime Environ- supply unit and ment version 1.7 or later, which comes Figure 2: In the “Andromeda” arrangement, you USB cable, you with the Raspbian “Stretch” distro with attach the LED strips clockwise from the bottom left. need to teach the the Pixel desktop. Listing 1 shows how to view the Java version and then Listing 1: Launching HyperCon launch the application. You need to be $ java ‑version in the same directory as the JAR file for this step. java version "1.8.0_65" Java(TM) SE Runtime Environment (build 1.8.0_65‑b17) In the HyperCon application window, Java HotSpot(TM) Client VM (build 25.65‑b01, mixed mode) first change Type to Lightpack. The Serial $ java ‑jar HyperCon.jar # input field (Figure 3) then appears below it. This serial Listing 2: Finding the Lightpack Serial Number number does not corre- $ dmesg spond to the sequence of digits printed on the [...] back of the control; in- May 19 13:41:05 homie kernel: [ 1.001954] usb 1‑3: New USB device strings: Mfr=1, Product=2, SerialNumber=220 stead, you need to look

May 19 13:41:05 homie kernel: [ 1.001955] usb 1‑3: Product: Lightpack it up in the Raspberry Pi’s kernel log (List- May 19 13:41:05 homie kernel: [ 1.001956] usb 1‑3: Manufacturer: lightpack.googlecode.com ing 2). However, this May 19 13:41:05 homie kernel: [ 1.001957] usb 1‑3: SerialNumber: 12345678901234 only works if you have [...] previously connected

LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM ISSUE 208 MARCH 2018 57 MAKERSPACE Lightpack

share/hyperion/effects/ and not only under /storage/hyperion/effects (List- ing 3).

Video Grabbing If the colors of the LEDs do not yet match the screen content, the software has to evaluate the video signal. Add-ons for a Rasp Pi media center with a Kodi installation like Boblight [8] or AmbiBox [9] analyze the video signal supplied by Kodi and transmit the control signals to the Hyperion service. Instead of picking up the video sig- nals in the application software, Hy- perion can also evaluate the X server image directly. Ambilight thus sup- Figure 3: HyperCon makes creating a configuration file for the Hyperion ports all screen content. Hyperion service easy. comes with the hyperion-x11 module, which you launch with the X server by the Lightpack control unit to the Rasp the home directory. Next, copy it with creating the hyperion‑x11.desktop file Pi via USB. root privileges to /etc/hyperion/ and re- in the ~/.config/autostart/ folder and After entering the serial number, re- start the Hyperion service: adding the contents of Listing 4. duce the number of LED strips to 10. To After restarting the system, the LEDs do this, first enter 4 in the LEDs horizon- $ sudo cp ~/hyperion.config.json U respond to changes in the screen con- tal field under Construction; then, enter /etc/hyperion tent. To try this out, simply move a win- 2 for LEDs left, LEDs right, and Bottom $ sudo systemctl restart hyperion dow that is not too large and with the gap; accept the remaining values and brightest possible background (e.g., a click Save. All LEDs should now light up and flash file manager) back and forth on your Now create the configuration file by in several colors. The flashing colors desktop. clicking Create Hyperion Configuration show you that Hyperion is communi- and save it as hyperion.config.json in cating successfully with Lightpack. To Optimization ensure that the service will load auto- The most difficult part of the configura- Listing 3: Hyperion Effects Paths matically at system startup, enable it tion is defining the order and position // EFFECT PATH in systemd: of the LEDs in the "leds" section of the /etc/hyperion/hyperion.config.json "effects" : $ sudo systemctl enable hyperion configuration file. The entry for a single { LED (or, in the case of Lightpack, for an "paths" : If the service cannot be started imme- LED strip) is shown in Listing 5. [ diately, you might have an incorrect Each entry can be assigned uniquely "/storage/hyperion/effects", setting in the configuration file. In hy‑ by the index value. A pair of coordi- "/usr/share/hyperion/effects" ] perion.config.json, check that Hyper- nates defines the position, or rather }, Con also searches for the effects in /usr/ the area, in which the system should react to the con- Listing 4: Desktop File Listing 5: Single LED Entry tents displayed [Desktop Entry] [...] on the screen. The values run Version=1.0 { from 0.0000 to Encoding=UTF‑8 "index" : 4, 1.0000. The in- Name=Script "hscan" : { "minimum" : 0.7000, "maximum" : 0.9000 }, formation in List- Type=Application "vscan" : { "minimum" : 0.3000, "maximum" : 0.5000 } ing 6 shows the

Exec=hyperion‑x11 }, setting for the Icon= [...] upper left corner Terminal=false of the screen.

StartupNotify=false However, in the case of the devices Hidden=false Listing 6: Upper Left Corner I used in the lab GenericName= "hscan" : { "minimum" : 0.0000, "maximum" : 0.1000 }, test, the order of GenericName[en_US]= "vscan" : { "minimum" : 0.0000, "maximum" : 0.1000 } the connections

58 MARCH 2018 ISSUE 208 LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM Lightpack MAKERSPACE on the control unit and the index number did not match; thus, I had to reposition either the connections or the LEDs accordingly: I opted for the latter to keep the cable routing and arrangement on the control unit as clean as possible. The Lightpack kit Figure 4: Hyperion divides screen content into areas and uses them to determine the contains 10 LED strips, color signal sent to the LEDs. and the control unit controls each of these by reference to a the screen content. However, the like to experiment with media center dis- unique index. It makes sense to isolate a brightness of the LEDs, and thus the tributions and avoid modern smart TVs certain area in the configuration file and intensity of the effects, may leave with all the extras, this task should not assign it to the various lighting elements much to be desired. deter you. nnn one after another. If necessary, you can also control With the LED configuration from luminance with the hyperion.con‑ Listing 8: JSON transform Section Listing 7, the active area for the first fig.json configuration file. The "transform" : LED strip is in the upper left corner of section (Listing 8) is re- "transform" [ the screen. First place all other LED sponsible for the intensity of the color { strips on the bottom right area, and effects. An optimal setting requires a [...] then apply the changes by restarting successful balance between saturation {"hsl" : the Hyperion service: ("saturationGain") and brightness { ("luminanceGain"). "saturationGain" : 1.0000, $ sudo systemctl enable hyperion Tests have shown that brightness val- ues above 1.5000 have a counterpro- "luminanceGain" : 1.0000, Once you have assigned all elements, the ductive effect: The colors appear rather "luminanceMinimum" : 0.0000 alignment can be corrected by means of pale, if not white. The best way to find }, coordinates. Figure 4 shows a simple out the optimum configuration for your [...] configuration. The values are then trans- requirements is to conduct your own ferred to the appropriate LEDs. experiments. Author Color Intensity Conclusions Christoph Dyllick-Brenzinger is technical di- In practice, the system should now With a Rasp Pi, the relatively inexpen- rector of datamate Service GmbH, which light the area behind the TV to match sive Lightpack, Hyperion software, and develops preconfigured desktop PCs and a little configu- server solutions in solid wood housings for Listing 7: LED Configuration ration work, private and commercial customers. [...] you can save yourself the { Info cost of an Am- "index" : 0, [1] Lightpack: http://​­www.​­lightpack.​­tv bilight TV. How- "hscan" : { "minimum" : 0.0000, "maximum" : 0.1000 }, [2] Lightberry: http://​­lightberry.​­eu ever, Lightpack "vscan" : { "minimum" : 0.1000, "maximum" : 0.1000 } [3] AmbiLED HD: only “lights up” http://​­www.​­ambiledhd.​­com }, content played [4] Lightpack PC: https://​­store.​­lightpack.​­tv/​ { back by the products/­ ​­lightpack "index" : 1, Media Center, "hscan" : { "minimum" : 0.9000, "maximum" : 1.0000 }, not conven- [5] Boblight: https://​­code.​­google.​­com/​ ­archive/​­p/​­boblight "vscan" : { "minimum" : 0.9000, "maximum" : 1.0000 } tional television }, programs. [6] Hyperion: http://​­hyperion‑project.​­org { The biggest [7] HyperCon: https://​­github.​­com/​ "index" : 2, task is reworking ­hyperion‑project/​­hypercon

"hscan" : { "minimum" : 0.9000, "maximum" : 1.0000 }, the configuration: [8] Kodi Boblight add-on:

"vscan" : { "minimum" : 0.9000, "maximum" : 1.0000 } The file created http://​­kodi.​­wiki/​­view/​­Add‑on:XBMC_ Boblight }, by the setup tool

[...] requires some ad- [9] Kodi AmbiBox add-on: justments. If you http://​­kodi.​­wiki/​­view/​­Add‑on:AmbiBox

LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM ISSUE 208 MARCH 2018 59 MAKERSPACE KiCad MakerSpace Design printed circuit boards with KiCad Boardwalk

KiCad helps you design printed circuit boards with up to 32 layers, checks for optimal placement, and supplies schematics and assembly diagrams in the popular Gerber format for submission to PCB manufacturers. By Harald Zisler

iCad was originally launched grams, depending on the format. KiCad as simple schematics soft- comes with numerous features and, un- ware; today, it supplies blue- like the free versions of commercial coun- prints for components used terparts such as Eagle Light Edition or at the CERN nuclear research center in Target 3001!, there are no restrictions on Geneva,K Switzerland. Accordingly, its use and scope. See the “Basics” boxout CERN’s scientists are actively involved if you are a newcomer to the field. in the development of KiCad, which is The program is available for many dis- available for Linux, FreeBSD, Mac OS, tributions. You can download the latest and Windows [1]. version from the project page, where you Schematics created with this program also will find the source code if you want are suitable for importing into other pro- to compile the software yourself.

BASICS In KiCad, you create the schematic first. After checking it carefully, you then design the printed circuit board (PCB), which brings the components and their “footprints” together – footprints being the connection geometries of the various components. Components can be wired (conventional, through-hole devices) or surface-mount de- vices (SMDs): Wired components are located on the upper side of the printed circuit board, with the soldered side and the conducting paths mirrored on the underside. SMD components are soldered directly on the PCB surface, revealing the circuit diagram in the printed conductors. Information about components can be found in libraries [2] maintained by volunteers [3].

BACKPORT As root, add the package source for KiCad to the /etc/apt/sources.list file; then, update the package data and install the software and the associated help files:

# echo "deb http://httpredir.debian.org/debian jessie‑backports main contrib non‑free" >> /etc/apt/sources.list

# apt‑get update

# apt‑get ‑t jessie‑backports install kicad Lead Image © Shamain, 123RF.com

60 MARCH 2018 ISSUE 208 LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM KiCad MAKERSPACE

Figure 2: After creating a project, a multitude of functions become available in the main window. Figure 1: After the first call, the KiCad program window looks quite empty. project. To do this, the first set of files (see Table 1), and either click on the the individual components are no lon- Users of Debian-based systems who use spiral notepad icon in the toolbar on the ger grayed out. an older version of the distribution can ac- left or take the classic File | New Project In the File menu, you can open exist- cess backports (see the “Backport” box). route. ing projects or create new ones. You can The Unstable and Testing branches already For the sake of clarity, create a new also create or read archives. Under contain the latest version of the software. folder (in Figure 2, this is first), assign Browse, you have the option of editing a name to the project (e.g., first here), files with a text editor of your choice, Creating a Project and press Save. The left column of the which is determined under Preferences, When you run the program (Figure 1), program window contains a tree view where you can also configure the lan- you are prompted to create a PCB design of the project and its components with guage for the user interface and the PDF viewer. Additionally, you can de- Table 1: Project Files fine paths and set up keyboard short- Extension Content cuts (called hotkeys). Table 2 shows the .pro Entries for project management shortcuts for the main window. Each Shared tool also has its set of hotkeys. .kicad_wks Adjustments to the worksheet KiCad manages projects and calls up a .net Netlist number of tools, which you can access ei- .cmp Component assignments in the footprint schematic (create with the ther from the Tools menu or directly in the Pcbnew board layout editor; import into Eeschema) toolbar (Table 3). The Help menu offers a Eeschema (Schematic Editor) manual and a tutorial for beginners. *_cache.lib Copies of the parts used in the schematic .dcm Documentation of the component library (information about com- Small Circuit ponents) A design for a small 5V power supply .lib Component library with information on design and connections is a good example of how to trace all .sch Schematic file without components the important work steps. Click on the Pcbnew (Printed Circuit Board Editor) fp‑lib‑table List of footprint libraries Table 2: Hotkeys .kicad_mod Footprint file with description Shortcut Function .kicad_pcb Printed circuit board with board layout Ctrl+O Load project .pretty Directory of the footprint library folder Ctrl+S Save project Output Files for Printed Circuit Board Production Ctrl+N New project .drl Drilling data in Excellon format Ctrl+T New project from a template .gbr Gerber file for producing the printed circuit board Ctrl+E Eeschema – schematic editor .pos Positioning instructions for insertion machines Ctrl+L Schematic library editor Output Files for Documentation Ctrl+P Pcbnew – printed circuit .dxf Plot in DXF format board editor .pdf Plot in PDF format Ctrl+F PCB footprint editor .plt Plot in HPGL format Ctrl+G GerbView utility .ps Plot in PostScript format Ctrl+B Bitmap2Component utility .rpt Report file (text) Ctrl+C PCB calculator .svg Plot in SVG format Ctrl+Y Pl editor

LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM ISSUE 208 MARCH 2018 61 MAKERSPACE KiCad

Table 3: Components the desktop with components, you can and enter the reference and the value Symbol Task either click Place | Component or choose (Figure 6). For example, for a resistor, the third symbol from the top in the right you might choose Resistor: R1, 100 Ohm. Eeschema schematic editor vertical toolbar. These entries appear later in various lists Click in the schematic sheet to posi- and in the layout for assembly. tion the component. You will now see Once all the components are on the Schematic library editor the Choose Component selection dialog desktop, connect them either by selecting (Figure 4). Click OK to position the com- Place | Wire or by clicking the fifth icon ponent. Each component used appears from the top in the right-hand toolbar. Pcbnew printed circuit board editor in the History of the Choose Component KiCad shows some weaknesses here: You window, making it easy to reuse compo- always need to drag from an unconnected PCB footprint editor nents. To find a component, enter a pin on one component to an already oth- search term in the Filter field. erwise connected component. As long as you hold the component Where three lines meet, the program GerbView with the mouse cursor while placing, creates a node. If two connections cross you can rotate it through 90 degrees by and you want to connect them, you click pressing R. If you insert an incorrect Place | Junction. If the component label- Bitmap2Component utility component, you can remove it by press- ing is not to your liking, you can right- ing Ctrl+Z or right-click and choose De- click, select Move Value, and place the PCB calculator lete Component. text in a better place. You can edit components you have al- Make sure all components in the sche- ready positioned by selecting the ele- matic are completely referenced and pro- Pl editor ment with the left mouse button and vided with values before using Tools | then right-clicking to open a context Annotate Schematic and Tools | Generate menu (Figure 5). A prompt often appears Netlist File to generate the result. If nec- new project you just created and start (Clarify Selection) asking what exactly essary, print or plot the schematic from Eeschema. If you see any error mes- you want to edit. In this dialog, select the File menu. sages, they only appear on the first the component. In the next step, use Tools | Assign call, so you can simply ignore them. Adding the required data for the com- Component Footprint to merge the com- Click on the first icon, Page settings, ponents you place uses the context ponents with their footprints. These geo- and set up your project (Figure 3). To fill menu, as well. Select Edit Component, metric properties include the assignment of the connections and housing dimen- sions. The program returns error mes- sages the first time it is called, but you can continue working after restarting this step. On the left-hand side of the window are the component classes and in the middle are the components from the schematic; on the right-hand side you

Figure 4: Each project starts by Figure 3: You will thank yourself later if you document your work well selecting the required in the beginning. components.

62 MARCH 2018 ISSUE 208 LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM KiCad MAKERSPACE can select the matching footprint ele- when selected, click on the third symbol assignment window. To be on the safe ment (Figure 7). If you want to view the from the left side of the window (View side, click on Tools | Generate Netlist File dimensions and contacts of a component selected footprint). Figure 8 shows a again and then click on Tools | Layout diode used in the example. Printed Circuit Board. Make sure you process all components Now set the grid, the units of mea- before saving your work and closing the surement, and the grid width. To do

Figure 5: You can edit a component retroactively after Figure 6: Gradually add suitable references and values to the placing it. individual components.

Figure 7: Once you have designed the entire circuit, connect the circuit symbols to the matching footprints.

LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM ISSUE 208 MARCH 2018 63 MAKERSPACE KiCad

this, use the Show grid/Hide grid icon of the entry; the corresponding checkbox Right-click in the free workspace to (second down on the left) and the must be filled (Figure 9). open the context menu and select Units in millimeters icon for metric di- Now draw the outline of the board. Global Spread and Place | Automatically mensioning (fifth from the top). The You can find this function under Place | Place All Footprints. The program now grid width can be changed under Di- Line or Polygon or by clicking on the mensions | Grid or with the Grid drop- eighth symbol from the top right of the down along the top of the schematic layer manager. window. To read the schematics data, use the The next step is to determine the size Tools | Netlist | Read Current Netlist or of the board. To do this, start the layer the Net symbol at top. The components manager (left toolbar, second icon from can be found as a bundle on the desk- bottom). Set Edge.Cuts as the current top. Now switch to Footprint mode (top layer by positioning the arrow to the left toolbar, fourth button from the right).

Figure 9: Use the layer manager to define the final size of the Figure 8: Upon request, KiCad can display the footprint data in detail. planned board.

Figure 10: Automatic arrangement of the components does not always give you optimal results. If neces- sary, you can correct them manually.

64 MARCH 2018 ISSUE 208 LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM KiCad MAKERSPACE

Figure 11: Once you have put all the elements in place, connect them using conducting paths whose properties you can edit later, if necessary.

send the Gerber files to a PCB service provider. To check the correct position of critical parts in advance, create a Gerber plot (File | Plot) in Pcbnew.

Conclusions KiCad lets you design the layout for circuit boards from the first diode to the finished product. This complex process requires appropriate knowl- edge, but the program does not pose any major hurdles for an experienced user after a learning phase. Unlike commercial competitors, KiCad often offers a great deal of flexibility because of its Python interface. In terms of functions, it compares well to its free counterparts. nnn

Figure 12: In GerbView, you can see whether all elements of the end Info product are in the right place on the PCB. [1] KiCad: http://​­kicad‑pcb.​­org arranges the components more or less the bottom layer (B.Cu) when dragging [2] Component library: http://​­kicad‑pcb.​­org/​­libraries/​­download/ sensibly within the frame. To make your the conducting paths. You can change [3] Docs: corrections, you might need space for the thickness of the conducting paths or http://​­kicad‑pcb.​­org/​­help/​ heat sinks or wires. insert ground areas later (Figure 11). ­documentation/ To move a component, again choose Footprint mode (Figure 10) and right- Results Author click the component in question. A To print or plot the results, use the File Harald Zisler has worked with Linux and menu opens in which the top entry al- menu. With the GerbView tool, you FreeBSD for many years. He writes ways starts with Footprint. Expand this can create a true-to-scale proof (Figure magazine articles and books on the menu item to move the component or 12). Place the components on top of it topics of technology and computing. drag, rotate, flip, and so on. and check that they match the con- The fourth edition of Computer Always be sure to use the correct ducting paths, drill marks, and other Networks was recently published at layer when using wired devices – use elements. After this quality control, Rheinwerk Publishing.

LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM ISSUE 208 MARCH 2018 65 MAKERSPACE Open Hardware – eelo MakerSpace

Free-licensed and secure phones You Say Goodbye, and I Say eelo

With the eelo project, Gaël Duval has big plans for a free- licensed phone, with an accompanying app store and online services. By Bruce Byfield

uddenly, efforts to produce se- One reason why eelo has a high chance tures have had only modest success, they cure, free-licensed phones are of success is that it is being headed by should give him a familiarity with busi- everywhere. One of the most Gaël Duval [3] (Figure 1). Long-time free ness that is rare among those attempting likely to succeed is eelo [1], a software users may remember Duval as to develop open hardware. project that aims not only for a free the founder of Mandrake (later Mandriva, For Duval, eelo is a highly personal phone,S but the app store and online ser- and the ancestor of Mageia, PCLinuxOS, project. As he explains on his blog [5], in vices to accompany it. The project’s and OpenMandriva), the distribution 2017, with over a decade as a dedicated Kickstarter campaign [2] reached its that, around the turn of the millennium, iPhone and Mac OS user, “I realized that I original goal of EUR25,000 (~$30,000) led in Linux usability. Duval left Man- had become lazy and that my data pri- in less than a week, and, as I write with drake Software in 2006 and has since vacy had vanished. Not only wasn’t I nine days left in the campaign, it has col- been a serial entrepreneur, involved in using Linux anymore as my main operat- lected over twice that amount with such startups as Ulteo [4], as well, he ing system, but I was also using a propri- EUR69,000 and has a strong chance of says, as investing “in a dozen startups etary OS on my smartphone. And I was reaching EUR100,000 (~$119,000). last year.” Although some of Duval’s ven- using Google more and more. Search of course, but also Google Mail, Google Drive, and Google Docs. And Google Maps.” Without meaning to, he had en- tered “voluntary servitude,” and lost his privacy, with information leaking from all sorts of sources (Figure 2). Duval decided that the way “to recon- quer my privacy” was to create a nonprofit that would start to build an alternative. He named the project “eelo” as a reference to moray eels, which he describes as “fish that can hide in the sea” [6]. He also began work with Hathibelagal Ashraff, an Indian developer for mobile devices, and Rhandros Dembicky, a Brazilian interface Figure 1: Gaël Duval, the founder of the Mandrake distribution, is now designer, to produce a proof of concept

creating the ambitious eelo project. study and to develop a roadmap. Lead Image © innovari, fotolia.com

66 MARCH 2018 ISSUE 208 LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM Open Hardware – eelo MAKERSPACE

Eventually, Duval intends to create a Building an Infrastructure phone, which can be difficult to reverse nonprofit foundation that, over the next Eelo’s first step is to build an operating engineer. In the short term, eelo will three years, will develop both a free system based on LineageOS [8], the likely have to continue using proprietary phone as well as an ecosystem of ser- fork of custom CyanogenMod ROM [9], firmware, although Duval does talk vices to support it. This emphasis on ser- one of the most comprehensive efforts about creating some means of auditing vices is in marked contrast to the efforts to provide a free version of Android. this firmware to ensure that it is not of Purism’s Librem 5 phone [7], which is However, while Duval describes the leaking data secretly. Another alternative apparently being developed in the hopes core of LineageOS as “usable and per- may be to partner with a project such as that the combination of a Linux distribu- forming well,” he suggests that “the de- Fairphone [12], which is also attempting tion’s package software repository and sign is not very attractive and there are to produce a free phone and faces a simi- high-end security will be attractive tons of micro-details that can be show- lar limitation. enough that users will not miss the se- stoppers for a regular user. […] Unless Other issues concern the support eco- lection of apps offered by Google Play or you are a geek, LineageOS is not realis- system for eelo’s operating system. For iOS’ App Store. As Duval says, “I’m not tically usable if you don’t want Google example, the project is considering re- sure that we are exactly in the same mar- Inside” [10]. Launchers, icons, and no- placing Google Play with app stores ket as Purism.” tifications on the desktop and a control such as F-Droid [13] or APKPure [14], Instead, Duval has said several times center are all areas that Duval intends two app stores that specialize in free-li- that “I want something with more pri- to improve or add. censed apps – and, in the long run, per- vacy for Mum and Dad.” By implication, Before the campaign began, Duval’s haps, with its own app store. Another that means something “attractively de- team had already managed to get a alternative is to use Yalp Store [15], signed” and easy to use, so that any level proof-of-concept version of the eelo op- which acts as an anonymous proxy for of user can have security. Moreover, ac- erating system running on one phone Google Play users. Similarly, Google ser- cording to the crowdfunding page, at model, the LeEco Le2, and, as I write, vices may be replaced by microG [16], least in the beginning, eelo’s offering was awaiting the arrival of another and Google’s SafetyNet Attestation API, will be – as much as possible – open model for testing. which checks whether a device com- source, meaning that initially eelo may The campaign page also includes a plies with Google’s environment with not meet Purism’s high standards for link to Duval’s Twitter feed, so that Magisk [17], as part of the infrastruc- avoiding proprietary tools. However, would-be users can request that the proj- ture that will help eelo to run apps for Duval adds that “this will improve over ect work to support other phones [11]. unrooted phones. Search engines like time, step by step. Releasing the perfect However, in the interest of time, this DuckDuckGo or Qwant may also be thing from the beginning would be a support means dealing with the proprie- used as replacements for Google, while utopia.” tary drivers found in the average smart- multimedia services like Facebook will be left for users to decide to install. In other cases, such as Gmail, eelo may have to build its own services. The first round of such decisions and developments is scheduled for the project’s first year, with the first results due in the second quarter of 2018. In the second year, eelo plans to add its own web services where necessary and an eelo operating sys- tem for computers, as well as setting up the project’s non- profit foundation. According to the roadmap, the third year will see the Figure 2: Eelo’s illustration of data leaks on a modern smartphone. continued develop-

LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM ISSUE 208 MARCH 2018 67 MAKERSPACE Open Hardware – eelo

ambitious and Info comprehensive. [1] eelo: https://​­www.​­eelo.​­io/​­# While Duval says [2] eelo’s Kickstarter campaign: that he does not https://​­www.​­kickstarter.​­com/​­projects/​ expect that an ­290746744/​­eelo‑​­a‑​­mobile‑​­os‑​­and‑​­web‑​ eelo smartphone ­services‑​­in‑​­the‑​­public‑​­in will be “some- [3] Gaël Duval: thing people will https://​­www.​­indidea.​­org/​­gael/​­blog/ find at Walmart,” [4] Ulteo: https://​­www.​­ulteo.​­com/ (french) the project is [5] Duval’s blog: https://​­www.​­indidea.​­org/​ clearly being ­gael/​­blog/​­leaving‑​­apple‑​­google‑​­eelo‑​ planned with the odyssey‑i­ ​­ntroduction/ possibility of [6] How eelo got its name: being more than http://​­www.​­digitaltechinsider.​­com/​ Figure 3: What the eelo phone may look like. a niche service in mobile‑technology/­ ​­eelo‑​­in‑​ mind. “I think ­conversation‑​­with‑​­gael‑​­duval‑​­creator‑​ ment of these efforts, as well as an eelo that we can partner with some phone of‑­ ​­the‑​­google‑​­less‑​­android‑​­project/ smartphone (Figure 3) and digital as- makers, because some of them will be [7] Librem 5: https://​­puri.​­sm/​­shop/​­librem‑5/ sistant. interested that we do not have Google [8] LineageOS: https://​­lineageos.​­org Duval blogs, “I want eelo to be a non- preinstalled,” says Duval. “And of [9] CyanogenMod ROM: profit project ‘in the public interest’. I course, there is a huge market in cor- http://​­www.​­cyanogenmodroms.​­com/ think operating systems and web ser- porations who want to control their [10] The problem with LineageOS: vices should be a common resource: as I data better.” https://​­www.​­indidea.​­org/​­gael/​­blog/​ explained a few year ago […] this is in- How far eelo will go towards its ­leaving‑​­apple‑​­google‑​­eelo‑​­odyssey‑​ frastructure, like phone networks, rail goals remains to be seen. However, so ­part1‑​­mobile‑​­os/​­#​­more‑1031 tracks, roads. […] Nonprofit doesn’t far, eelo is receiving considerable at- [11] Duval’s Twitter page: mean nothing will be for sale. Probably tention, both from the media and po- https://​­twitter.​­com/​­gael_duval some eelo smartphone will be for sale, tential supporters. “I’m very surprised, [12] Fairphone: and some premium services will be actually,” says Duval, “because most https://​­www.​­fairphone.​­com/​­en/ available for corporates. But profit won’t of the time I hear, ‘People don’t care.’ [13] F-Droid: https://​­f‑droid.​­org/ be the first focus of eelo. Eelo will be for My point of view is that people do care users first, for everyone who cares about when they know.” [14] APKPure: https://​­apkpure.​­com/​­app their data privacy.” At the very least, eelo has helped people [15] Yalp store: http://​­www.​­droidviews.​­com/​ to start talking. And who knows? When ­yalp‑​­store‑​­google‑​­play‑​­store‑​ Creating a New Market secure and free-licensed phones finally ar- ­alternative‑​­to‑​­install‑​­apps‑​­on‑​­android/ Of all the attempts to build a free rive, eelo just might be a major leader in a [16] microG: https://​­microg.​­org/ phone to date, eelo is by far the most field it has helped to create. nnn [17] Magisk: https://​­magiskmanager.​­com/

INTRODUCTION LINUX VOICE

The apt‑get command is a well known and much-loved tool for many users of Debian-based Linux systems. apt‑get is the go-to utility for installing and managing applications at the command line – or at least it used to be. Doghouse – Security 72 A new utility called apt solves some of the problems and Jon “maddog” Hall inconsistencies that apt‑get users have learned to ignore. A serious security problem requires your This month we introduce you to apt and show you some of attention. the differences between apt and apt vs. apt-get 74 Ferdinand Thommes apt‑get. We also show you how The apt command-line utility is a successor to profile a monitor for better to the well-known apt-get, offering simpler color reproduction, and we installation and maintenance for the DEB packages used with Debian, Ubuntu, delve into a little known utility Knoppix, and many other Linux distros. called USB/​IP that lets you DisplayCAL 78 access USB-connected Karsten Günther devices attached to other If you’re tired of inaccurate colors on your computers on your monitor, try calibrating and profiling using a colorimeter and DisplayCAL. network. FOSSPicks 84 Graham Morrison Ocenaudio 3.3.6, Otter Browser, Joplin, WeeChat 2.0, Mailspring, Siril 0.9.7,

Image © Olexandr Moroz, 123RF.com Moroz, Image © Olexandr SuperTuxKart 0.9.3, and more! Tutorial – USB/​IP 92 Paul Brown USB/​IP lets you use USB devices connected to other machines as if they were plugged directly into your computer.

LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM ISSUE 208 MARCH 2018 71 LINUX VOICE DOGHOUSE – SECURITY MADDOG’S DOGHOUSE Jon “maddog” Hall is an author, A serious security problem requires your attention. educator, computer scientist, and free software pioneer who has been a BY JON “MADDOG” HALL passionate advocate for Linux since 1994 when he first met Linus Torvalds and facilitated the port of Linux to a 64-bit system. He serves as president Meltdown and Spectre of Linux International®.

was lying in my bed in the early morning of January 3rd, As with many security exploits, this was “embargoed” by the 2018 when a tweet woke me from my sleep; not a tweet security research groups as people scrambled, first to under- Ifrom a bird (nor from the president of the United States), but stand the problem and then to find a solution. Eventually, as so- a tweet from a security researcher discussing two rather bad lutions were found, the problem was “leaked,” which resulted in hardware issues with a large number of CPU chips. my early morning tweet. Before I wrote anything or contacted These issues, now known as “Meltdown” and “Spectre,” have anyone, I checked sources for the “leak,” and, feeling assured been rocking the computing world for the past couple of days. that the information was both true and correct, I sent out mes- Unlike many other security exploits, these are not really “fixable” sages to other people I knew. by a simple software patch, are not operating-system specific, Understand that these are reasonably hard exploits to utilize, and cannot be avoided by telling your mother not to post her and the application trying to exploit them needs to be on the password on her computer screen. local machine. But in the day of shared cloud servers, the heavy Both have to do with modern hardware architecture and an use of containers, and web-based applications, this is not a rare issue called “out-of-order instruction execution,” used to speed occurrence. up the processor. Sometimes this feature is used to fetch in- There are now tens of thousands of people in the world who structions on both sides of a branch (both the “true” and the have the expertise to exploit this, and perhaps hundreds who “false” side), so as soon as the condition is known, the instruc- would have the expertise and the desire. With todays Internet, tions are ready to execute. Access to this “pre-fetched” data you really only need a few such people. could allow a carefully crafted user-level program to access ker- The Linux kernel has released a patch that stops most of the nel memory, and once that happens, any data on the machine is exploits, and Microsoft and Apple will do the same. By the time vulnerable to be read, including passwords, security certificates, you read this, your favorite distribution should have a replace- and so forth. ment kernel ready for you. At first this was painted as a problem mostly or even solely Lack of detailed information about which processor is in your with Intel processors, but as people investigated it was pro- server, desktop, tablet, or device, and whether that processor is jected that at least some AMD and some ARM processors are affected by this exploit, will make it harder to determine if you affected. AMD has now stated that none of its processors have need the patches. This is a problem on two fronts. this problem. It also depends on when the processor was de- Current patches in the Linux kernel (and I assume in other af- signed (starting in 1965) and what class of processor it is (Intel fected operating systems) cause a slowdown. The slowdown 64-bit processors seem to be prime culprits), as not all proces- occurs because the kernel no longer shares address space with sors perform out-of-order execution. user programs, and this causes overhead for the hardware as The bad news is that the more powerful and expensive the the system shifts back and forth between kernel memory and processor is (think server systems, high-end desktops, gam- user memory during interrupts and system calls. The percent- ing systems, and superior grade notebooks), the more likely it age of slowdown depends on the programs being executed, is to have this feature. Cloud server systems are particularly and typically heavy I/​O programs (such as database engines or vulnerable, since they typically run lots of applications at one network-heavy programs) take the brunt of the slowdown. time. You can partially disable these patches by booting with nopti It is conceivable that even applets and web-based applica- as a kernel boot option if your environment is secure or you are tions could trigger this type of exploit, although the Apache using a processor that is unaffected. Software Foundation (as an example) has taken steps to This exploit has roots back to 1995; there are thousands of make sure that Apache based applications cannot exploit this systems still being used that will not get their kernel updated. by restricting access to the high-precision timers that can be Desktops running XP (yes, they are still out used for the exploit. Google has also applied these types of there), as well as older Apple systems, are just two examples. fixes to their systems. Caveat emptor. nnn

72 MARCH 2018 ISSUE 208 LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM

LINUX VOICE APT VS. APT-GET apt vs. apt-get

The apt command-line utility is a successor to the well known apt-get, offering simpler installation and maintenance for the DEB packages used with Debian, Ubuntu, Knoppix, and many other Linux distros. BY FERDINAND THOMMES

he Debian package management infra- nearly effortless package management for Debian structure is a simple yet powerful system users, as well as users of Debian-based distros T that has been a distinguishing feature of like Ubuntu and Knoppix, who take the time to Debian since the project’s early years. At the core master the commands. of the Debian package management is dpkg [1], a However, some users were not happy about the low-level tool used for installing and removing complex, and often confusing, system of apt‑get Debian .deb packages. The bigger and more com- commands and options. Since the release of prehensive Advanced Package Tool (APT) [2] is a Debian 8 “Jessie” and Ubuntu 16.04 “Xenial Xerus,” higher-level tool that includes dpkg on the back all users of Debian-based systems can enjoy a end. APT performs most of the other functions as- new command-line interface to the APT system: sociated with a package management system, in- apt. The apt utility consolidates features that cluding integrating external repositories. were once spread among apt‑get, apt‑cache, and The APT package system supports a number of other commands, and it simplifies many of the front-end applications, both command-line and command options for an easier and friendlier GUI-based, that act as a user-friendly interface for user experience. managing Debian packages. In the past, most The apt utility has been used in the Debian “Un- users who wanted to work at the command line stable” edition since 2014, and it became official depended on the classic apt‑get tool as an inter- with Debian 8. Because apt‑get still works in re- face to the Debian package system. Through the cent releases of Debian and other Debian-based years, apt‑get and a constellation of other sup- distros, many users have not taken the time to porting utilities, such as apt‑cache, have provided learn about apt. This article introduces the apt

Table 1: Differences Function apt-get apt Install package apt‑get install apt install Remove package apt‑get remove apt remove Remove package including configuration apt‑get purge apt purge Update sources apt‑get update apt update Update packages (without removing or reinstalling) apt‑get upgrade apt upgrade1 Update packages (with removing and reinstalling) apt‑get dist‑upgrade apt full‑upgrade Remove unnecessary dependencies apt‑get autoremove apt autoremove Search package apt‑get search apt search Display package information apt‑cache show apt show Display active package sources in detail apt‑cache policy apt policy Display available and installed package versions apt‑cache policy apt policy New Commands Edit packages sources – apt edit‑sources List packages by criteria dpkg ‑‑get‑selections > list.txt apt list Set/​change package status echo hold | dpkg ‑‑set‑selections apt‑mark 1 Corresponds to apt‑get upgrade ‑‑install new‑pkgs

74 MARCH 2018 ISSUE 208 LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM APT VS. APT-GET LINUX VOICE package management tool and explores some of apt vs apt-get the differences between apt and apt‑get. apt does not guarantee downwards-compatibility Note: The apt tool discussed in this article is not with apt‑get, but many (though not all) command the same as the apt Python wrapper created by options are interchangeable. For a full compari- Linux Mint developers a few years ago. son, type apt ‑‑help and apt‑get ‑‑help and com- pare the results. Table 1 shows some of the important commands side by side. As you can see, many commands are the same if you just ex- change apt‑get for apt. One exception is the apt Figure 1: Use apt‑get update to update the lists using the packages provided by the upgrade command. The repository, but do not expect to see any additional information. old command: apt‑get up‑ grade installed the latest versions of all packages currently installed on the system from the reposi- tory, but it didn’t remove existing packages or ret- roactively add dependen- cies. The new apt upgrade Figure 2: The apt update command not only updates the package lists, but also installs new packages shows you if and how many new versions of the packages exist in the repository. when they are added as

Figure 3: Use apt list ‑‑upgradable to provide some color for a better overview of the packages for which the repository provides a more recent version.

LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM ISSUE 208 MARCH 2018 75 LINUX VOICE APT VS. APT-GET

the number of updatable packages and offers an option to display a structured list of possible up- dates (Figure 2). This list even provides a better overview, adding color to the otherwise drab dis- play (Figure 3). The actual package update command has been given a new visual element: Both apt upgrade and apt full‑upgrade or apt dist‑upgrade now show a progress bar that informs users of the update progress (Figure 4). The update bar also appears when removing packages with apt remove or apt purge. apt re‑ move removes the package itself, and apt purge removes the entire associated configuration – if it is located outside the home directory: apt never tampers with configurations in the user Figure 4: apt full‑upgrade uses a new element in the form of a progress bar to inform directory. users about the upgrade’s progress. Two New Commands dependencies of packages to be updated, al- The apt show command sorts the output alphabet- though it still doesn’t remove previously installed ically and suppresses some less important infor- packages. mation that you might see with apt‑cache show. The new command structure offers subtle im- The dist‑upgrade parameter is assigned the more provements that save time and extra steps. For in- significant name of full‑upgrade, although the stance, apt‑get lets you move a package to /var/ two commands behave in the same way. cache/apt/archives/ and then install the package The apt list and apt edit‑sources commands using apt‑get install package_name, and the soft- are new: apt list in connection with the ‑‑in‑ ware automatically manages the dependencies. stalled or ‑‑upgradeable options outputs lists of apt eliminates the need to push things around; all the installed or upgradeable packages; apt you need is apt install package_name, specifying edit‑sources opens /etc/etc/apt/sources. the full path if necessary. list.d/ with the specified list in the editor for edit- ing (Figure 5). Design Error Corrected apt fixes some errors of the original apt‑get imple- Conclusions mentation. For example, in addition to apt‑get for ed- It was high time to detox and dust off Debian’s iting Debian packages, the legacy system used the command-line package management tool. The apt‑cache command for outputting information new apt utility has been available since 2014, about the packages. The new apt command thor- but habits change slowly, and apt has still not oughly cleans up, combining functions from both old completely replaced apt‑get in the real world. commands and structuring them in a better way. apt The differences between apt‑get and apt still provides features of the most commonly used cause confusion in Internet forums, especially apt‑get and apt‑cache commands, adding useful in- on Ubuntu and Linux Mint. Switching to apt is formation that once required additional options. definitely worthwhile: The new command is For example, apt‑get update only reports execu- faster, more logically structured, and easier to tion at the end (Figure 1), but apt update shows use. nnn

Info [1] dpkg: https://​­en.​ ­wikipedia.​­org/​­wiki/​ ­Debian_Package_ Manager [2] APT: https://​­en.​ ­wikipedia.​­org/​­wiki/​ ­Advanced_Packag‑ Figure 5: The apt tool opens the specified file for manual changes in the standard editor with the command apt ing_Tool edit‑sources debian. list.

76 MARCH 2018 ISSUE 208 LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM

LINUX VOICE DISPLAYCAL Color Coordinated with DisplayCAL

If you work with digital images, you know the colors on your monitor don’t always match what you see in real life. If you’re looking for a more accurate representation of color, try calibrating and profiling your monitor using a colorimeter and DisplayCAL. BY KARSTEN GÜNTHER

nyone who has ever tried to reconcile an A colorimeter is a specialized hardware tool that is electronic image with nature will be famil- used to profile the color properties of a monitor or A iar with the problem: The colors in the other display device. The colorimeter attaches to the image almost always differ from what you see computer, typically through a USB port, and hangs in with your eyes. This problem has several causes. front of the monitor. Colorimetry software running Colors are lost on the way from the camera to the on the computer then proceeds through a series of image. The human eye adapts much better than a checks, using the colorimeter to measure the colors camera to different lighting conditions and auto- produced by the monitor. The software running on matically supplements missing information. An- the computer then produces a color profile in ICC other problem is that color values often shift as format (see the box entitled “ICC Profile”). The profile the image makes its way through the chain of de- tells the system how to adjust the color settings to vices, from the camera, to the monitor, and finally provide truer color representation. After you load the the printer. generated color profile to the graphics card, the col- Each device can only absorb and process colors ors will display more accurately on the monitor. to a limited extent. Image-processing experts use the term gamut [1] to describe the possible colors Calibrate and Profile a device can produce by internal mixing. Colors In order to achieve the truest possible color repro- outside the gamut appear in replacement colors, duction, the monitor must first be calibrated and which leads to distortions. then profiled. Calibration is a preliminary step that Different colors have different effects on the sets certain neutral properties for the monitor. human eye. The eye is particularly sensitive to Until a few years ago, calibration and profiling in tones in the green range and can detect far more Linux were performed in the terminal window nuances of green in nature than a monitor shows. using rather cryptic tools of the ArgyllCMS [2] For mixed colors such as yellow – composed of color management system. Today, you can use green and red on the monitor – the printer may DisplayCAL [3], which acts as a front end for the sometimes be better than the monitor assuming ArgyllCMS system. that this color is available as a process color. DisplayCAL, which is available in the package re- What the brain perceives as “white” is defined by positories for many popular Linux distributions, a whole series of factors, not just the perceived works with several leading colorimeters (see the box wavelengths. Cultural conditions influence what entitled “Supporting Colorimeters.”) Colorimeters are our brain recognizes as “pure white.” For example, available in different price categories; be sure to Asians prefer red shades of white, and Central Eu- use some common sense when choosing a tool: ropeans prefer blue. You don’t need a EUR300 (~$366) measuring de- The differences in the way colors are perceived, vice to profile a EUR100 (~$122) monitor. If you combined with natural limitations of electronic de- vices and the imprecise replacement of colors ICC Profile outside the gamut, mean the colors on your moni- The International Color Consortium (ICC) tor will never exactly match the colors you see maintains a specification for defining the color with your eye. However, it is possible to bring the attributes for a device and mapping the transi- truest possible color reproduction to your elec- tion from a source to a target color space. tronic device using a tool called a colorimeter.

78 MARCH 2018 ISSUE 208 LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM DISPLAYCAL LINUX VOICE prefer open hardware and open source software, supplied with most colorimeters. The process it is definitely worth taking a look at ColorHug (see takes considerably longer, but it ultimately the “All Free” box). achieves better results. Keep in mind that, in older colorimeters, the fil- Install the colorime- ters in the cameras age, which has an effect on ter on the USB port All Free quality. Always store the colorimeter in a dark box (not via a passive hub), The problems with proprietary software in to reduce this effect. and then start the soft- commercial products led to the ColorHug proj- ware. After the logo ect in 2011. ColorHug is a completely free col- DisplayCAL in Action has been displayed, orimeter that works under Linux [4]. The same By default, DisplayCAL profiles quite extensively the user interface manufacturer has produced a professional and more thoroughly than the standard software opens (Figure 1). version of the device known as ColorHug+, but it has a similarly professional price tag.

Supported Colorimeters According to the project documentation, Dis- playCAL supports the following colorimeters: n CalMAN X2 (treated as i1 Display 2) n Datacolor/​ColorVision Spyder 2 n Datacolor Spyder 3 (since ArgyllCMS 1.1.0) n Datacolor Spyder 4 (since ArgyllCMS 1.3.6) n Datacolor Spyder 5 (since ArgyllCMS 1.7.0) n Hughski ColorHug (Linux support since ArgyllCMS 1.3.6, Windows support with newest ColorHug firmware since Argyll- CMS 1.5.0; fully functional Mac OS X sup- port since ArgyllCMS 1.6.2) n Hughski ColorHug2 (since ArgyllCMS 1.7.0) n Image Engineering EX1 (since ArgyllCMS 1.8.0) n Klein K10-A (since ArgyllCMS 1.7.0. The K-1, K-8, and K-10 are also reported to work) n Lacie Blue Eye (treated as i1 Display 2) Figure 1: DisplayCAL starts with a few dialogs that provide you with important information n Sencore ColorPro III, IV, & V (treated as i1 on how to use the software. Display 1) n Sequel Imaging MonacoOPTIX/Chroma​ 4 (treated as i1 Display 1) n X-Rite Chroma 5 (treated as i1 Display 1) n X-Rite ColorMunki Create (treated as i1 Display 2) n X-Rite ColorMunki Smile (since ArgyllCMS 1.5.0) n X-Rite DTP92 n X-Rite DTP94 n X-Rite/​GretagMacbeth/​Pantone Huey n X-Rite/​GretagMacbeth i1 Display 1 n X-Rite/​GretagMacbeth i1 Display 2/LT​ (the HP DreamColor/​Advanced Profiling Solution versions of the instrument are also reported to work) n X-Rite i1 Display Pro, ColorMunki Display (since ArgyllCMS 1.3.4. The HP DreamColor, NEC SpectraSensor Pro, and SpectraCal C6 versions of the instrument are also reported Figure 2: The first settings for calibration are made using the Display and Instrument drop- to work). down menus.

LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM ISSUE 208 MARCH 2018 79 LINUX VOICE DISPLAYCAL

The first step is to configure any hardware-de- software from the website and enter Select file. pendent settings. Select the option labeled Color- The program reports an error on some Spyder imeter corrections from other display profiling soft- colorimeter models, but the device appears to ware, and specify the group of colorimeters to work in spite of the error. Once the firmware is which the connected device belongs. The soft- loaded, the device will appear as activated in the ware usually selects the correct entry. A firmware Instrument area (Figure 2). installation step often follows. You can select the type of screen you want to Either use the software provided by the manufac- calibrate using the Mode drop-down menu. With turer, which is usually no problem even with out- laptop displays, the results are usually significantly dated versions, or you can load the manufacturer’s poorer than with separate LCD monitors. If there are multiple screens available for the system – for example, because you are running an external monitor on the HDMI port of a laptop – select the desired device in the first, unnamed field. Before clicking on the Calibrate & profile button at the bottom of the screen, you should configure some additional settings. Click the Calibration but- ton to view the Calibration settings (Figure 3). Normally the values for the Whitepoint and the White level will be fine if you choose As mea- sured. The Tone curve is usually set correctly at Gamma 2.2. If you only work with sRGB profiles, sRGB might be the better choice. Many modern colorimeters allow you to calibrate at high speed instead of using the preset speed – if so, you can also choose the high-speed option. The Profile quality slider (Figure 4) in Profiling Settings has a special meaning. Setting this slider to High yields far better results. The other settings are best left at the default values. The Calibrate & profile button takes you to a test field where you can place the colorimeter. Then press the Start measurements button to start the

Figure 3: You can create defaults for calibration.

Figure 5: Calibration, including setting the basic monitor properties, is performed via a dialog.

TIP Some manufacturers provide the driver data required from the firmware in the form of sep- arate files with the .ccmx or .ccss file exten- sion. Load these files manually via the Correc- tion field (Figure 2). Figure 4: In Profiling settings, define basic settings for the color profile to be created.

80 MARCH 2018 ISSUE 208 LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM DISPLAYCAL LINUX VOICE

Interactive Display Adjustment dialog (Figure 5). With laptop displays, you usually have no way to make adjustments. In the case of an external monitor, activate neutral playback in the Monitor menu and then start profiling at this point via Start measurement. With a few short tests for the basic colors, the colorimeter determines the current settings. Now adjust the three RGB bars and the brightness on Figure 6: DisplayCAL comments on the actual measure- the monitor to equal (medium) values. DisplayCAL ments with progress dialogs. stays in this dialog until you end the measurement with Stop measurement. Start the profiling, which you can perform using a long row of color fields, via the Continue on to calibration button. In some cases, you will see the differences with the naked eye; in others, you can hardly see the image change. Some dia- logs provide information about the progress of the process (Figure 6). Depending on the color- imeter and the profile quality, the measurements will take some time.

Results Figure 7: You can view the results of the measurement as It is best to take the measurements in the evening graphical output via Show profile information. in a dark room where no external light falls on the monitor. Disable the screensaver. The button with alone monitors, which restricts the use of a mo- the loudspeaker symbol causes the software to bile computer for image processing. give acoustic feedback as long as measurements The Show profile information option (Figure 7) are being taken. offers an easier-to-interpret and more informa- On completion, the dialog shown in Figure 7 ap- tive variant of the result representation (Figure pears. The program shows which part of the stan- 8). Of particular interest are the edge areas of dard RGB color space (sRGB) the monitor covers. the measured profiles, displayed in a standard Gamut Volume lets you evaluate the scope of the color space. The edge areas appear in the monitor’s color space. The Gamut settings reveal graphic with a colored border. For comparison, that laptop screens often prove inferior to stand- see one of the predefined profiles, which then

Figure 8: The diagram for the external monitor (left) shows that it largely covers sRGB and sometimes even shows more colors. On the other hand, the laptop screen (right) has coverage gaps on almost all edges of the color space.

LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM ISSUE 208 MARCH 2018 81 LINUX VOICE DISPLAYCAL

GPL license, but the author requests you send him a postcard if you use it.) See your local package manager for more on obtaining xcalib. With , the xcalib utility is contained in a separate package of the same name. You can also find the source code online [5]. The complete, not very meaningful documentation for the program is in a README Figure 9: Under XFCE, the color profiles could not be file. xcalib requires profiles that contain the installed automatically, but I was able to integrate them VCGT tag, which is always the case for the data manually. generated with DisplayCAL. If you have multiple screens, use the ‑s option appears with a dashed gray line, under Compari- to specify the number of the screen that will re- son profile. ceive the profile. (Screen 0 is the default if you The relevant profile, in this case, is sRGB, which don’t specify the ‑s option.) all screens should completely support. The profile The command from the first line of Listing 1 initially uses Absolute Colorimetric as Color Trans- loads the specified profile for the display 1, an ad- fer (Rendering Intent) – not a good choice. It is ditionally connected monitor. better to switch to Relative colorimetric. With xcalib, you can use the ‑a option to To avoid losing track if you have several ICC pro- change loaded profiles during operation. The ar- files on the computer, the software offers the pos- gument for one of the basic colors (‑red, ‑blue, or sibility of naming the profiles according to an ad- ‑green) is three values: the gamma from 1 to 5, justable scheme. The first component to appear is the brightness in percent, and the contrast in per- the (internal) display name, followed by the date of cent (Listing 1, second line). The adjustments re- calibration. The same information, but with more main active until they are switched off, unless you detail, can be found in the profile information dis- explicitly delete them using the ‑c option. played, which is where you will find the manufac- To automatically launch xcalib, use the bash turer and sometimes the name of the model configuration script .bashrc or call a script using under Device. the desktop’s autostart mechanism. The profiles generated by the application, as well If you have problems with xcalib, you can use as a number of additional files, are stored by the the xicclu utility from the Argyll package [6]. xicclu program under .local/share/dispcalGUI/storage/ is similar to xcalib but provides some different op- in your home directory. Not everything that is there tions. One disadvantage of xcalib is that it does is of direct benefit to you. If you have any problems, not automatically detach itself from the terminal. you should take a look at the logfile. As a final step, the program now offers to load Conclusions the profile you just created. Depending on the For users who are serious about editing images, it desktop environment, this step either works with- is definitely worth the time to create a profile of out any problems or not at all (Figure 9). the monitor at least once. The result is always sur- prisingly positive, and the higher the monitor’s Manually Loading Profiles quality, the more satisfying it is. Photos from the Many Linux systems use the Color Daemon expensive SLR cameras finally look good, and (colord) for managing color profiles. Some desk- shade and light have structure. Whether you want top environments offer GUI tools that act as an to go to the effort of checking the monitor regu- interface to colord, such as the Gnome Color larly and possibly investing in a better colorimeter Manager tool. The other option is to load the pro- depends on your requirements. Normally, an an- file using a command-line tool such as xcalib: nual recalibration run for a previously-profiled monitor is sufficient. nnn xcalib profile_name.icc Info xcalib is a “tiny monitor calibration tool” for X [1] Gamut: https://​­en.​­wikipedia.​­org/​­wiki/​­Gamut Window and MS Windows environments. The au- thor describes the tool as “postcardware.” (It has a [2] Argyll: http://​­argyllcms.​­com [3] DisplayCAL: https://​­displaycal.​­net Listing 1: Loading a Profile [4] ColorHug: http://​­www.​­hughski.​­com [5] xcalib: http://​­xcalib.​­sourceforge.​­net $ xcalib ‑s 1 B156XW02\ 2013‑09‑12\ 2.2\ MQ‑HQ\ 3xCurve+MTX.icc

$ xcalib ‑red 2 50 100 ‑a [6] xicclu: http://​­www.​­argyllcms.​­com/​­doc/xicclu.​­ ​­html

82 MARCH 2018 ISSUE 208 LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM

LINUX VOICE FOSSPICKS

Sparkling gems and new releases from the world of FOSS Picks Free and Open Source Software Graham tears himself away from updating Arch Linux to search for the best new free software. BY GRAHAM MORRISON

Audio editor Ocenaudio 3.3.6

he Audacity audio editor of a waveform and lets you scale parameter windows don’t offer more feedback is excellent and powerful, the view from the small overview (e.g., amplitude reduction or activity of the com- T but its user interface (UI) envelope so that it’s easy to navi- pressor and gate), but neither do Audacity’s. reflects the lack of any major up- gate through large files. Most im- What Ocenaudio does do, though, is allow you to dates for years. Like Gimp, there portantly, Ocenaudio also works see the audio waveform within the plugin win- has been very little to compete well with PulseAudio; Audacity dow and use this to select a part to play back, with its capabilities, making Au- still seems to struggle. during which you can change its parameters and dacity the go-to application for Monitoring is a real strength in apply the effect when you’ve dialed something any audio processing job, big or both application, but even here suitable. This is a good half-way compromise small. Ocenaudio, however, is a Ocenaudio wins. It has a large, between small preview clips and fully fledged strong contender for Audacity’s high-detail volume unit (VU) real-time integration. The effects are good, too, crown, with many small updates meter, the ability to see a spec- especially the noise reduction. The Noise Reduc- over the last 12 months and a trogram alongside the amplitude tion window lets you take a fingerprint profile of modern -based UI. It has had waveform, and a floating FFT an- the background noise and process the audio in dark and light color schemes for alytics window for specific slices combination with a gate to remove the noise. It a while, as well as high-DPI sup- of audio time. It’s a pity the inter- works brilliantly with the kind of noise you get port from version 3.1.0. The UI nal effects don’t run in real time from a low signal or cheap microphone. scrolls seamlessly into and out in the background or that their Ocenaudio also offers a quick, powerful, and pre- cision-based editor that can easily replace Audac- ity for most tasks. Place the cursor somewhere within the audio file and press record, for example, and Ocenaudio automatically records in-place. This is perfect for overdubs or replacing swear words in podcasts without going through the ardu- ous process of recording something else sepa- rately and pasting it in. If you do need to work with several files at once, Ocenaudio has a handy side panel that lets you switch between them instantly or quickly paste to a new buffer that can easily be edited and pasted back into another of your record- ings. Finally, to round off the feature set, its default file format is WAV, as used by almost every other audio application outside of Mac OS, except for Au- dacity, which requires you to export your audio and 1 File management: Open more than one file, tab between them, and paste to defaults when saving to a project file. The real win- new ones. 2 Zoom and regions: Quickly scale the view and create regions for ner in all of this is us, of course, as we now have a looping and overdubs. 3 VU meters: High-precision metering to ensure no clips or choice. Both projects are wonderful in their own glitches. 4 Spectrogram: Alongside the amplitude waveform, the spectrum shows way, and competition may just push the envelope the frequency range of audio over time. 5 FFT analysis: A spectrum view of a sin- with any new versions. gle slice of time. 6 Effects: Real-time previews from inside the plugin window and excellent noise reduction. 7 Routing: Control all inputs and outputs to PulseAudio. Project Website 8 Audio properties: Make notes, add artwork, and see region markers. http://​­www.​­ocenaudio.com/​­

84 MARCH 2018 ISSUE 208 LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM FOSSPICKS LINUX VOICE

Web browser Otter Browser

any alternative web in the transition, such as Opera’s browsers were devel- wonderful tab management and M oped by simplifying or bookmark systems. re-engineering the open source en- Otter is built using Qt and Qt’s gines behind Chrome and Firefox. WebEngine for rendering web Firefox itself was born from a simi- pages. Thanks to this, Otter fits lar motivation to split the browser perfectly into most Linux desk- component from the Mozilla Appli- tops, regardless of whether cation Suite, but there has been they’re based on the Qt toolkit or neither enough reason nor the not. Unlike most browsers, Otter Session management is mechanism to recreate the past will assimilate your font, color, one of the best things ing to remember a keyboard glory of the Opera browser. How- and theme settings. The user in- about Otter Browser; shortcut, and everything is quick, ever, that’s exactly what Otter terface is a little old school but sessions can be saved, stable, and system efficient; plus, Browser does. If you don’t use useful; you’ll also notice the managed, and loaded of course, it has the features that Opera, you won’t be aware that a downloading metrics in the sta- just like sets of open made Opera 12 so popular. There schism occurred in its user base tus bar, such as the total size of a bookmarks. has also been a constant stream between the release of 12.x and page, the speed, and the time it of updates since its original re- the following 15.x, when Opera takes to load, as well as the origi- lease in 2013, making this an switched from its Presto engine to nal speed-dial shortcuts for ideal browser for those of us still WebKit and, subsequently, to the quickly accessing your favorite hankering for Opera’s glory days. Blink engine used by nearly every- sites. An integrated zoom slider thing else. Many users felt some is also a great way of making Project Website of Opera’s best features were lost sites easier to read without need- https://​­otter‑browser.​­org/

Note taking Joplin

ote taking applications iOS, Android, Linux, Mac OS, and attempt to solve a diffi- Windows. There’s even both a ter- N cult problem. They allow minal version and a GUI version for you to take notes and organize the ultimate in accessibility. Hope- things that you don’t think you’ll re- fully, someone is working on the member and then hopefully allow Amiga version. you to retrieve those notes without You write notes using Mark- knowing exactly what you made a down, which means if you already note about. Among the many dif- know its simple syntax, you can For an application with ferent solutions, most modern ver- quickly create and format your such a simple premise, Linux to inform you of when that sions use the ubiquity of the ser- notes, from headings and sub- Joplin features excellent deadline is hit. The equivalent noti- vices to solve the retrieval prob- headings to numbered lists, blocks documentation that can fication system will be used on lem. Evernote and Google Keep, of code, and direct quotes. It’s the really help you get the your phone or other operating sys- for example, store notes online perfect format for this application, most out of your note tem, and notes can be synchro- and can use apps to set reminders because it looks almost as good taking. nized across different versions of that impose themselves into your as raw text as it does rendered. the application using Microsoft’s day-to-day existence. Many of us Jop­lin will render the Markdown OneDrive. Hopefully, Nextcloud are looking for self-hosted solu- output in real time as you type and support is coming in the next up- tions that provide the same ubiq- colorize your source material. You date, creating a completely open uity; this is something Joplin gets can also add attachments, and im- source solution. very close to offering. For a start, ages are shown inline. Finally, you it’s available on almost every plat- associate an alarm with a note, Project Website form you can think of, including and notify‑osd will be used on https://​­github.com/​­ ​­laurent22/​­joplin/

LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM ISSUE 208 MARCH 2018 85 LINUX VOICE FOSSPICKS

Terminal IRC WeeChat 2.0

eeChat, the terminal- The main new feature is the in- based IRC client, is tegration of fset, previously a W one of the best rea- plug­in. This is another portal into sons for using the command line. the wonderful world of WeeChat It’s perhaps more powerful than settings configuration, alongside almost any other client, and yet, the interactive iset plug­in that the user interface is minimal, intu- most of us use to change settings itive, and fast. It’s harder to use during a session. Without install- than GUI-equivalent applications, ing anything further, you can now but unlike the majority of those, issue the /fset command to open Forget Slack, with clients like WeeChat, the supremely flexible and WeeChat has never stopped inno- a new buffer from which you can far more open IRC is the best way to communicate. vating. Need Perl regular expres- browse and change anything from sions to create an alert when the complete set of WeeChat and of variables within the buffer list something is mentioned? Want a running plugin parameters. It’s and new signals. It’s also possible push notification sent to your quick and relatively easy to use to have two completely different phone when your nicklist is used? and is a great step forward for bar items, each with its own con- Want to set up a WeeChat relay to WeeChat general configuration. figuration options, which is great use a single connection with mul- Scripts can now be written in for having different parts of your tiple clients (e.g., your phone)? PHP, alongside the many other lan- layout showing different servers or WeeChat does all of this and guages supported by WeeChat. sets of channels. much more with an incredibly Many small additions help plugin quick release cadence, as this 2.0 makers and configuration tweak- Project Website release proves. ers, including recursive evaluation https://​­weechat.org/​­

Terminal search ddgr

his may seem rather eso- gines and web portals too, such teric, but because I’ve as Wikipedia or even eBay, mak- T covered similar com- ing the web interface to Duck mands that deal with rival search Duck Go a powerful portal to the engines, it seems more than fair open web. to do the same for Duck Duck All of which leads to ddgr, a Go, a search engine that respects command-line interface to Duck your privacy. It won’t share your Duck Go searches. After installa- details, and it doesn’t store any- tion, you just type ddgr followed thing in relation to your searches, by your search phrase, and the re- Search Duck Duck Go, unless you ask it to save your sults will be delivered as num- and every other search results, fire off new searches color and search preferences in a bered output. Select a number engine supported by from the prompt, and specify local cookie. If you’ve not used and the result is opened in your Duck Duck Go, directly MIME file types for searches. If Duck Duck Go, or you haven’t default web browser. There’s from the command line. you need to search while in used it in a while, it’s really im- even bang support for external something like Vim, it’s the per- proved over the last 12 months searches, such as !g for Google, fect solution, and one that could and now delivers results that are and you can limit the number of easily be worked into your own mostly comparable to Google. scripts and sites, for instance, if And when it’s worse than Google, you want to add dynamic linking … it’s really improved over the last 12 simply adding a !g to your search or cache bookmarks. delivers results directly from months and now delivers results that Google through Duck Duck Go. are mostly comparable to Google. Project Website This applies to other search en- https://​­github.com/​­ ​­jarun/​­ddgr

86 MARCH 2018 ISSUE 208 LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM FOSSPICKS LINUX VOICE

Text editor Suplemon

he Sublime Text editor “multicursor” text editing at the has rightly become in- top of its features list, alongside T credibly popular. Its min- TextMate theme support, auto- imal and beautiful user interface complete, and a tabbed view can adapt to any writing and with multiple files open at once. programming style, and its ex- To illustrate how these fea- ceptional plugin system can tures work, load up a new file and transform the editor into a fully create more than one cursor fledged IDE, whether you’re cod- using the mouse. When you now If you want to try some of Sublime Text’s best features without pay- ing for Arduino or the cloud. One start typing, the same text will ing for the editor, check out Suplemon. of its most innovative features is appear at each cursor position. the ability to make multiple se- This is particularly useful when are shown at the bottom of the lections, rather than a single se- you’re starting a new file because text file, making it easy to get lection block used by nearly you can quickly populate it with started, easy to know how to every other editor, which makes similar arguments for methods, save, and easy to open up extra it easy to perform search and re- as well as the structure used by help. It’s also a more powerful place operations in a single pass each of the methods you’re choice than Nano, which makes or quickly change multiple in- going to write, before switching this an ideal editor upgrade if you stances of a variable name or back to single-cursor mode. As find yourself spending more and the tags in a web document. with the Nano text editor, the more time in the terminal. This feature has been trans- command-line interface isn’t in- posed into Suplemon, a console- timidating because most of the Project Website based text editor that puts this important keyboard shortcuts https://​­github.com/​­ ​­richrd/​­suplemon

Desktop email Mailspring

othing can beat a well- years ago. Mailspring, however, designed desktop is a breath of fresh air. It may N email client. They are be because it’s part of a com- more efficient and faster than mercial product that seems to their web-based counterparts, take a lot of its inspiration from they make it easier to host your Mac mail, but it’s mostly be- own mail server or use a server cause it’s a fork of Nylas Mail, a other than Google’s, and they beautiful client that attempted integrate better with your desk- to bridge the cloud-desktop di- You need to register top. Best of all, you don’t get vide before closing in 2017. online to use Mailspring, provide the details for your own distracted by your email when First, there’s a major negative but the app itself may be mail server. With your data sacri- you’re being distracted by You- with this application: You need to well worth the loss of ficed to the cloud, you get to ex- Tube. But they’ve suffered a lit- create a Mailspring account to complete control in cer- perience the UI, and it’s definitely tle at the hands of the web rev- be able to use it. While most of tain circumstances. one of the best on Linux. The olution; especially on Linux, the application is open source, main view to enable is three pan- their design and UIs haven’t the company behind Mailspring els, with your folders on the left, kept up with the times. Geary wants to monetize its software your subject inbox, and the mes- gets close with its conversa- by offering a Pro version. If this is sages on the right. But whether tional view, and KDE’s Kube acceptable, you’ll be able to step it’s worth the account creation is looks promising (if it can ever through the login and add your debatable. make it to release), but other- own mail account details to the wise, we’re usually left with application. You can then enter Project Website Thunderbird or apps from five your cloud provider details or https://​­getmailspring.com/​­

LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM ISSUE 208 MARCH 2018 87 LINUX VOICE FOSSPICKS

Astronomy imaging Siril 0.9.7

stronomy and Linux photographs of space need to often go hand in hand. It have long exposures. But be- A can be found controlling cause the Earth is rotating, un- the largest and the smallest tele- less you move the camera per- scopes and is just as happy num- fectly to compensate, the astro- ber crunching vague signals into nomical objects you’re imaging planets orbiting a distant sun as it will move to smear across your is guiding your personal telescope photograph. The only solution is to the Horsehead Nebula in your to take shorter exposures, reduc- backyard. There’s plenty of open ing the light hitting your lens, source astronomy software to making images darker and the Taken on a phone, this image is the result of Siril processing 10 choose from too, taking you from background noise easier to see. three-second exposures of the sky (ISO 3200). the photorealism of the Stellarium If you take several of these im- planetarium to the fully four-di- ages, known as a stack, and then your phone sitting atop your car. mensional space exploration of align and process them with See the above image for proof. Set Celestia. Although Linux has a some clever algorithms designed a high ISO and RAW image output constellation of brilliant applica- to tell the difference between the if you can and import these as a tions for processing photos, there stardust and the CMOS pollution, sequence into Siril. These are first has never been a decent applica- you can create a single strong converted to FITS or SER files, use- ful for high bit depths or importing videos, before being manipulated If you take several of these into a sequence by Siril. First, a lit- tle pre-processing can be used to images … you can create a single darken and remove as much ther- strong image that is greater mal noise as possible before Siril’s incredibly smart alignment algo- than the sum of its parts. rithm detects and removes the ef- fects of the Earth’s rotation from tion for processing a sequence of image that is greater than the your sequence of images. Depend- space photographs to create a sum of its parts. This is what Siril ing on the size and number of your single image … drum roll … until does. images, as well as the algorithm now. And Siril is awesome. Siril imitates a left-right wizard you select, this can take either a Many problems befall amateur stepping you through the entire few seconds or a full kettle’s worth astronomy photography, but the process, although you can skip of minutes. Finally, the images are two principle problems can’t be steps at any time. First, you need stacked and processed with a se- solved: The night sky is dark, and the images. These can be from a lection of noise-reducing and star the Earth is rotating on its axis. camera connected to a telescope, or planetary detail-enhancing fil- Because the night sky is dark, but they could equally be from ters. These will further extract the background noise and attempt to detect color outside of local atmo- spheric conditions; the process is similar to creating an HDR image in something like Hugin. After tweaking, a final output can be generated with some patient pa- rameter tweaking, some of which has real-time feedback, and many difficult control points and values to change; however, pa- tience is always rewarded with stellar photography.

Siril is complex, but you can get by with adjusting values and checking the output. Project Website Fortunately, you also can access excellent online and PDF manuals. https://​­free‑astro.org/​­ ​­index.php/​­ ​­Siril

88 MARCH 2018 ISSUE 208 LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM FOSSPICKS LINUX VOICE

Space adventure Pioneer

ike the Voyager 2 space up the place; he did it with the star probe, the game Pioneer and planet names in Elite, with the L has been around for a long human contacts in the Frontier time. It hasn’t quite been around games, and from terrain genera- since 1977 when the probe was tion to the AI interaction in his launched, but 2006 is an epoch in modern creation, Elite Dangerous. open source gaming. Also like Pioneer does this too. Voyager, Pioneer is now interstel- Pioneer captures the spirit of lar and based on a technology those original games alongside from a previous generation, start- the cold hard vacuum of space. ing life as an attempt to bring Classical music fills the commu- Unlike Elite Dangerous, but just like Frontier II, you can land within something of the then-neglected nal space stations and the game cities on terraformed planets in Pioneer. Frontier – Elite 2, a 16-bit-era sticks rigidly to the Newtonian game – to Linux and open source. flight model of Frontier 2. Although universe. Fly, taxi, trade, fight, up- David Braben’s Frontier was re- there’s no multiplayer, the universe grade, and explore the beautifully markable, taking the infinitely is a combination of procedurally rendered 3D universe. If you were large open universe of Elite and generated systems and real sys- a fan of the originals, you’ll feel populating it with curves, textures, tems. One of the start locations is right at home. And if you’ve never missions, more craft, and a much Barnard’s Star, for example. How- flown in 1980s space, climb richer universe. Braben’s great ge- ever, Pioneer isn’t a copy. It’s sim- aboard, Commander Jameson! nius has always been combining ply inspired by the same values as procedurally generated space its models and offers a very similar Project Website with enough humanity to warm game style in a completely new https://​­pioneerwiki.com​­

Racing game SuperTuxKart 0.9.3

uperTuxKart has been on around Free Software circles: the nitro (i.e., for power) Gnu, Wilber, Puffy, Beastie, Konqi, S for some time now. Start- Kiki, Pidgin, and Amanda will all ing life as a quaint MarioKart look familiar, and the story mode homage, it’s now the master of its has you face the evil Nolok. own domain, and that domain This new version has taken just keeps getting richer, more over a year to develop and fea- playable, and more populated. It’s tures two new tracks. The first, now even available on Android, Candela City, is a Paris-like city for free, and it’s still open source! at night time. The second new The basic play still features a level is Cornfield Crossing, and The awesome racing story mode, where you drive this looks like a classic Nintendo game SuperTuxKart is mension to an excellent racer. around unlocking various chal- level set around a summer farm, still open source and is As ever, if you donate more than lenges. This is much like Diddy complete with jumps through now even available on $3.99 to help fund development, Kong Racing, for example, where the barn, a roller coaster section Android! you also get access to the gift different lands reveal a set of dif- into the desert, and banana package tracks. This is definitely ferent races against the AI-driven skins. Keeping up with the worth it considering how many competition. There are time trial times, the game also embeds a things this project gets right, modes, grand prix cups, and mul- screen recorder for recording a and it’s still at its heart an in- tiplayer arenas, just as you’d ex- video of your fastest laps. It credibly playable racer. pect, and like similar games, you’ll must be working, because be playing against cute avatars plenty of players have already Project Website loosely based on those you see shared theirs, adding a new di- https://​­supertuxkart.net/​­

LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM ISSUE 208 MARCH 2018 89

LINUX VOICE TUTORIAL – USB/​IP Finders, Keepers

The Linux kernel has many interesting but unknown services. USB/​IP, in particular, is one that you’ll probably wonder why you have never encountered. USB/IP​ lets you use USB devices connected to other machines on your network as if they were plugged directly into your computer.

BY PAUL BROWN his happened to me recently: I have an old- Is there a way to make the process less cumber- ish Brother multifunction printer/​scanner/​ some? Thankfully, there is. It’s called USB/​IP (read: T fax machine. It is an okay thing to have USB over IP); it is a set of modules and tools that and quite useful, but it is as dumb as brick and comes with all modern kernels from 3.17 onwards. has no network capabilities at all. This means you USB/​IP allows you to set up a USB server on one must have a computer plugged into it directly if machine (e.g., on your printer/​scanner server) and you need to use it. If you want to share it over a share it with the rest of your network as if it were network, which of course you do, you have to connected directly to the client machine. make the computer a server and have it manage the network side of things. USB/​IP in Practice Brother supplies some drivers for Linux, but they This may sound like a godsend, but USB/​IP, pre- are closed source. This means that, if something cisely because not very many people use it, is a doesn’t work, you face a familiar conundrum: bit finicky. All distributions provide the modules, Firstly, Brother will not assign an engineer to sort as they are a standard part of modern kernels. out a problem for a system used by a minority of The suitability of the tools you need for setting desktop users and a machine that is at least seven up the server and sharing to the client, however, years old. Secondly, you can’t solve things yourself is a different matter. The combination that because the drivers are closed source. worked for me was to use an up-to-date Debian Unfortunately for me, something doesn’t work. as a server, and machines loaded with Ubuntu Brother’s scanner driver refuses to play ball and KDE neon (which is currently based on with SANE’s network printing protocol. That Ubuntu 16.04) as clients. If you try anything means, if I want to scan without lifting my lap- else, the steps you follow should be very similar, top off the table, walking into the living room, but your mileage may vary. unplugging it from the server, and attaching my Although the USB/​IP modules (usbip‑core, computer directly to the lunk, I have to proceed usb‑host, and vhci‑hcd) are standard, you will have to as follows: install the tools that allow you to set up a server and 1. Open an SSH session from my laptop to the start a client. In Debian, the package you need is server. called simply usbip, but Ubuntu’s usbip package con- 2. Scan from the command line with scanimage. tains out-dated and flawed versions of the software. 3. Copy the file that scanimage creates over to my I have no idea why this exists – very confusing. If laptop using scp, and open it in an image visual- you have installed the usbip package before reading izing program. this, purge it now. What you are looking for is a pack- 4. Make sure that the scan is the correct in size, age called linux-tools-generic. Install that. color, contrast, and alignment. Once you have everything installed on your 5. If not, get up and adjust the piece of paper and server and clients, connect to the machine that the scanimage flags will act as the USB/​IP server and load two mod- 6. Start all over again. ules into the kernel: This is less than ideal, especially when you have graphical utilities, like, say, XSane [1], a compre- su ‑c "modprobe usbip‑core; modprobe usbip‑host" hensive graphical application for all your scanning needs. Then to start the server; still as root, do:

92 MARCH 2018 ISSUE 208 LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM TUTORIAL – USB/​IP LINUX VOICE

su ‑c "usbipd" Ubuntu Paths By starting the server like this, you will be able to Ubuntu saves the USB/IP​ tools in a weird place that is not in your $PATH. see what it is doing. Your computer will display This makes calling usbip cumbersome, since you have to prepend the the machines that try to connect and show whole path (/usr/lib/linux‑tools‑/) each time you whether they are successful. This will help you want to use it. troubleshoot during the first few runs. Once you This gets boring quickly, so you may want to make a soft link to the tool are confident everything works as it should, you somewhere in your path. As it is a command you should issue only with may want to run the server with the ‑D flag: root privileges, you can do:

sudo ln ‑s /usr/lib/flfl su ‑c "usbipd ‑D" linux‑tools‑/usbip /usr/sbin/

This will push usbipd to the background and have For the rest of the article, I’ll assume you have done that. it run as a daemon. You can now check what USB devices you can share. To do this, use the instruction shown in sudo modprobe usbip‑core Listing 1, line 1. The list command is, as its name sudo modprobe vhci‑hcd implies, for listing devices. The ‑l flag tells usbip to list the devices connected “locally.” As you will To query the server and see what devices it has on see later, you use a similar instruction to find out offer, use another variant of the list instruction: which devices are available on the server from the client. sudo usbip list ‑r As Listing 1 shows, there seems to be three de- vices you can share, but really there are only two: where is the name or IP address of the The last one (busid 1‑4) is the machine’s internal USB/​IP server. Listing 2 shows what querying the USB hub doohickey (pretty sure that’s its technical server looks like. name). The two devices you can share are busid The listing gives you the two devices, the 1‑1, a Sanyo webcam, and busid 1‑2, the multi- printer/​scanner and the webcam, that the server function printer/​scanner/​fax machine I mentioned is sharing. earlier. Notice that, in the case of the webcam, the Listing 1: Shareable Devices server has no idea what the device is. But, then $ su ‑ c "usbip list ‑l" again, it doesn’t have to: The task of figuring out what a device is and how to use it falls to ‑ busid 1‑1 (0474:025f) the client. Sanyo Electric Co., Ltd : unknown product (0474:025f) The next step is binding a device to the server, so it can be shared. To bind a device, you have to ‑ busid 1‑2 (04f9:01eb) pass the device’s bus ID to the server: Brother Industries, Ltd : MFC‑7320 (04f9:01eb)

su ‑c "usbip bind ‑b 1‑1"

‑ busid 1‑4 (8087:0a2a) The ‑b stands for “bus ID,” and, as per Listing 1, the Intel Corp. : unknown product (8087:0a2a) instruction above shares the Sanyo video camera. To share the printer/​scanner, you should do this: Listing 2: Querying the Server su ‑c "usbip bind ‑b 1‑2" $ sudo usbip list ‑r 192.168.1.24

Exportable USB devices To stop sharing a device, you should use the un‑ bind command. The command: ======‑ 192.168.1.24

su ‑c "usbip unbind ‑b 1‑2" 1‑2: Brother Industries, Ltd : MFC‑7320 (04f9:01eb)

: /sys/devices/pci0000:00/0000:00:14.0/usb1/1‑2 disconnects the printer/​scanner from the server, : (Defined at Interface level) (00/00/00) for example.

Client Side 1‑1: Sanyo Electric Co., Ltd : unknown product (0474:025f) To get the Ubuntu/neon​ client set up (see the : /sys/devices/pci0000:00/0000:00:14.0/usb1/1‑1

“Ubuntu Paths” box), load the modules you need : Miscellaneous Device / ? / Interface Association (ef/02/01) into the kernel:

LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM ISSUE 208 MARCH 2018 93 LINUX VOICE TUTORIAL – USB/​IP

Note that some versions of usbip use ‑h (for “host”) instead of ‑r. If everything goes well, the device should now show up on your system as if it were plugged di- rectly into one of your USB ports. Listing 3 shows what the list of USB devices looks like on the client. Figure 1 shows what it looks like to see yourself from your laptop’s webcam and from a webcam connected to the USB server several feet away. Attaching the printer/​scanner had the interest- ing effect of providing the client with two printers: one network printer via CUPS and one virtual USB- connected printer (Figure 2), even though both are the same physical machine. Figure 1: A question of perspective: video feed from the laptop camera (bottom right) and Just to show how the client sees the printers from a webcam connected to the USB/IP​ server several feet away (center). differently, take a look at Figure 3. On the left is what you get if you tell the CUPS network printer to print a test page – it is the server that sends the test page to the printer, hence the Debian/CUPS​ logos. By contrast, on the right is the test page from the virtual USB/​IP printer. As the machine “thinks” the printer is connected locally to one of its USB ports, it sends its own, internal test page. With a bit of fiddling (and by “a bit” I mean “hours of hair-wrenching frustration”) you can get even the most stubborn scanner to work as it should (Figure 4).

Detaching Devices that are attached to a client via USB/IP​ are blocked for the rest of the network, so at some point, you will want to detach them and let others use them. To detach a device, first you need to know to Figure 2: Two printers in one. The top printer is the virtual USB/IP​ printer, and the bottom which virtual port each device is attached. Listing one is detected via CUPS, although they are both the same physical machine. 4 shows an example from a client with the printer/​ scanner and webcam attached. If you are not sure To start using a device, you have to first attach it which device is which, look at the vendor/product​ : line and compare the numbers in brackets with sudo usbip attach ‑r ‑b what you get from lsusb. Armed with the port number, you can detach a As before, is your server machine’s name device with: or IP (‑r stands for “remote”) and is the bus ID of the device, as shown using the list sudo usbip detach ‑p command in Listing 2. To attach the Sanyo webcam shown in List- So, to detach the printer/​scanner ( in Listing 4), do: ing 2, for example, you should do this: sudo usbip detach ‑p 01

sudo usbip attach ‑r 192.168.1.24 ‑b 1‑1 Caveats Listing 3: Client USB Devices Although USB/​IP is $ lsusb pretty awesome, there are some disadvan- tages you may want to Bus 003 Device 001: ID 1d6b:0002 2.0 root hub consider before deploy- Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub ing it for everyday use. Bus 001 Device 003: ID 058f:d102 Alcor Micro Corp. For starters, as it is un- Bus 001 Device 002: ID 8087:0a2a Intel Corp. derused, many distribu- Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub tions have scatty sup-

94 MARCH 2018 ISSUE 208 LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM TUTORIAL – USB/​IP LINUX VOICE

port for the USB/IP​ tools usbip and usbipd. Many distros include old versions, and different versions have different parameters. Some versions don’t work at all. Secondly, you have to attach and detach de- vices as root, which makes it inconvenient and a bit dangerous. Also, while a device is attached, it is blocked for other clients, and you have to remem- ber to detach it when you have finished using it. If you have a large number of client machines, by using USB/​IP, you will have to install drivers onto each and every one of them. If you want to share a printer, CUPS may be the way to go, as you only have to install and maintain drivers on the server. If your scanner plays well with SANE’s network system, this would also be the best way of cutting back on installing, configuring, and maintaining drivers. Figure 3: Same printer, but Make It Better Listing 4: Connected Ports different test pages: on the That said, you can make USB/IP​ much friendlier if, $ sudo usbip port left, the test page from the for example, you load modules at boot time both networked CUPS printer; on Imported USB devices on the server and client and turn usbip into a ser- the right, the test page from ======vice on the server. the USB/​IP printer. USB/​IP also allows you to use a Raspberry Pi as Port 00: at High Speed(480Mbps) a server for devices – even if the Pi doesn’t under- unknown vendor : unknown product (0474:025f) stand them. You see, many vendors with proprie- 8‑1 ‑> usbip://192.168.1.24:3240/1‑1 tary drivers only provide drivers for Intel-based ‑> remote bus/dev 001/002 machines and do not supply any for the Pi, since it Port 01: at Full Speed(12Mbps) is an ARM-based computer. This is the case of the unknown vendor : unknown product (04f9:01eb) printer/​scanner that kicked all of this off. With 8‑2 ‑> usbip://192.168.1.24:3240/1‑2 USB/​IP, however, you can still use the Pi as a ‑> remote bus/dev 001/004 printer/​scanner server because it doesn’t actually have to load any drivers: The Pi just has to forward the whole USB connection to the client machine, Info where the driver is installed. Is that cool or what? nnn [1] XSane: http://​­xsane.​­org/

Figure 4: Beat your scanner into submission and make it allow scanning from the network thanks to USB/IP.​

LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM ISSUE 208 MARCH 2018 95 SERVICE Events FEATURED EVENTS Users, developers, and vendors meet at Linux events around the world. We at Linux Magazine are proud to sponsor the Featured Events shown here. For other events near you, check our extensive events calendar online at http://linux-magazine.com/events. If you know of another Linux event you would like us to add to our calendar, please send a message with all the details to [email protected].

Embedded Linux Open Networking Linux Storage Conference Summit Filesystem and MM Date: March 12–14, 2018 Date: March 26–29, 2018 Summit Date: April 23–25, 2018 Location: Portland, Oregon Location: Los Angeles, California Location: Park City, Utah Website: http://events.linuxfoundation. Website: http://events.linuxfoundation. org/events/embedded-linux-conference org/events/open-networking-summit- Website: https://events.linuxfoundation. north-america org/events/lsfmm-2018/ The Embedded Linux Conference is a vendor-neutral technical conference Join business and technical leaders Experts map out and implement im- for companies and developers using across enterprise, cloud, and service provements to the Linux filesystem, stor- Linux in embedded products. ELC has providers to share information, age, and subsys- a large collection of sessions dedi- highlight innovation, and discuss the tems that will find their way into the cated exclusively to embedded Linux future of open networking and mainline kernel and Linux distributions and embedded Linux developers. orchestration. in the next 24 to 48 months.

Events Open Source Leadership Summit March 6–8, 2018 Sonoma Valley, California http://events.linuxfoundation.org/events/ open-source-leadership-summit SCALE 16x March 8-11, 2018 Pasadena, California http://www.socallinuxexpo.org/scale/16x Chemnitz Linux Days 2018 March 10-11, 2018 Chemnitz, Germany https://chemnitzer.linux-tage.de/2018/en/ Maker Faire Ruhr March 10-11, 2018 Ruhr, Germany https://www.makerfaire-ruhr.com/ CloudFest 2018 March10-16, 2018 Rust, Germany https://www.cloudfest.com/ Embedded Linux Conference March 12–14, 2018 Portland, Oregon http://events.linuxfoundation.org/events/ embedded-linux-conference OpenIoT Summit March 12–14, 2018 Portland, Oregon http://events.linuxfoundation.org/events/ openiot-summit Open Networking Summit March 26–29, 2018 Los Angeles, California https://events.linuxfoundation.org/events/ open-networking-summit-europe-2018/ NSDI '18 April 9–11, 2018 Renton, Washington https://www.usenix.org/conference/nsdi18 heise Security Tour 2018 April 10, 12, 18, Numerous European cities https://www.heise-events.de/securitytour 24, and 26, 2018 2018 HPC for Wall Street April 16, 2018 New York, New York http://www.flaggmgmt.com/linux/ Cloud Foundry Summit April 18–20, 2018 Boston, Massachusetts https://www.cloudfoundry.org/event/ North America nasummit2018/ Linux Presentation Day 2018.1 April 21, 2018 Europe-wide in many cities http://www.linux-presentation-day.org/ Linux Storage Filesystem and April 23–25, 2018 Park City, Utah http://events.linuxfoundation.org/events/ Memory Management Summit lsfmm-2018/ KubeCon + CloudNativeCon May 2–4, 2018 Copenhagen, Denmark https://events.linuxfoundation.org/events/ kubecon-cloudnativecon-europe-2018/ Texas Linux Fest June 8–9, 2018 Austin, Texas https://2018.texaslinuxfest.org/ Images © Alex White, 123RF.com

96 MARCH 2018 ISSUE 208 LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM SERVICE Contact Info / Authors CALL FOR PAPERS We are always looking for good articles on Linux and the The ­technical level of the article should be consistent with tools of the Linux ­environment. Although we will consider what you ­normally read in Linux Magazine. Remember that any topic, the following themes are of special ­interest: Linux Magazine is read in many ­countries, and your article • System administration may be translated into one of our ­sister publications. There- fore, it is best to avoid using slang and idioms that might • Useful tips and tools not be understood by all readers­­­­. • Security, both news and techniques Be careful when referring to dates or events in the future. • Product reviews, especially from real-world experience Many weeks could pass between your manuscript submis- • Community news and projects sion and the final copy reaching the reader’s hands. When If you have an idea, send a proposal with an ­outline, an esti- submitting proposals or manuscripts, please use a ­subject mate of the length, a description of your background, and line in your email message that helps us identify your mes- ­contact information to edit@​linux-magazine.com. sage as an article proposal. Screenshots and other support- ing materials are always welcome. Additional information is available at: http://www.linux-magazine.com/contact/write_for_us.

NOW PRINTED ON recycled paper from 100% post-consumer waste; no chlorine bleach is used in the production process.

Contact Info

Editor in Chief While every care has been taken in the content of Joe Casad, [email protected] the ­magazine, the publishers cannot be held respon- Managing Editor sible for the accuracy of the information contained Rita L Sooby, [email protected] within it or any consequences­ arising from the use of Localization & Translation it. The use of the disc provided with the magazine or Ian Travis any material provided on it is at your own risk. News Editor Copyright and Trademarks © 2018 Linux New Swapnil Bhartiya Media USA, LLC. Authors Copy Editor No material may be reproduced in any form what- Amy Pettle soever in whole or in part without the written per- Erik Bärwaldt 32, 50 Layout mission of the publishers.­ It is assumed that all cor- Dena Friesen, Lori White respondence sent, for example,­ letters, email, Swapnil Bhartiya 8, 28 Cover Design faxes, photographs, articles, drawings,­ are sup- Paul Brown 92 Lori White plied for publication or license to third parties­ on a non-exclusive worldwide basis by Linux New Cover Image Zack Brown 12 © ndul, 123RF.com Media USA, LLC, unless otherwise stated in writing. Linux is a trademark of Linus Torvalds. Bruce Byfield 42, 66 Advertising Brian Osborn, [email protected] All brand or product names are trademarks Joe Casad 3 phone +49 89 99 34 11 48 of their respective owners. Contact us if we Publisher haven’t credited your copyright; we will always Mark Crutch 71 Brian Osborn, [email protected] correct any oversight. Christoph Dyllick-Brenzinger 56 Marketing Communications Printed in Nuremberg, Germany by hofmann Gwen Clark, [email protected] infocom GmbH on recycled paper from 100% Karsten Günther 78 Linux New Media USA, LLC post-consumer waste; no chlorine bleach is 616 Kentucky St. used in the production process. Jon “maddog” Hall 72 Lawrence, KS 66044 USA Distributed by Seymour Distribution Ltd, United Charly Kühnast 54 Customer Service / Subscription Kingdom For USA and Canada: LINUX PRO MAGAZINE (ISSN 1752-9050) is pub- Christoph Langner 16 Email: [email protected] lished monthly by Linux New Media USA, LLC, Phone: 1-866-247-2802 Vincent Mealing 71 616 Kentucky St., Lawrence, KS, 66044, USA. Periodi- (Toll Free from the US and Canada) cals Postage paid at Lawrence, KS and additional Fax: 1-785-856-3084 Graham Morrison 84 mailing offices. Ride-Along Enclosed. POSTMASTER: For all other countries: Please send address changes to Linux Pro Magazine, Mike Schilli 46 Email: [email protected] 616 Kentucky St., Lawrence, KS 66044, USA. Ferdinand Thommes 22, 74 Phone: +49 89 99 34 11 67 Published monthly in Europe as Linux Magazine www.linuxpromagazine.com – North America (ISSN 1471-5678) by: Sparkhaus Media GmbH, Harald Zisler 60 www.linux-magazine.com – Worldwide Zieblandstr. 1, 80799 Munich, Germany.

LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM ISSUE 208 MARCH 2018 97 NEXT MONTH Issue 209 Approximate UK / Europe Mar 05 Issue 209 / April 2018 USA / Canada Mar 30 Australia Apr 30 Browser On Sale Date Shootout

After all these years and all this new technology, the web browser is still the most popular application for many desktop users. Which browser is best? It all depends on what you do and what you need. Next month, we compare some Linux browser alternatives, including popular applications like Firefox and Chrome, as well as some command-line browsers and other lesser-known options.

Preview Newsletter The Linux Magazine Preview is a monthly email newsletter that gives you a sneak peek at the next issue, including links to articles posted online. Sign up at: www.linux-magazine.com/newsletter Lead Image © Dejan Bozic, 123RF.com

98 MARCH 2018 ISSUE 208 LINUX-MAGAZINE.COM | LINUXPROMAGAZINE.COM