Linux Format 261 (Sampler)

Page 1

1

3

3D print a chassis Choose a mobile OS

2

Pick a better battery 4 Customise Plasma Mobile

D EE DV .1 FR B S 4 7G U 4. L SO

BUILD A Pi TABLET!

PLUS!

HOW TO…

GET A DIGITAL DIARY PROTECT YOUR FILES MONITOR YOUR SERVERS

The #1 open source mag

VIRTUALISE

EVERYTHING Bring all your servers, devices and services together with the power of virtualisation tools

67

pages of tutorials & features

Switch to BSD, the other open source OS Zededa’s

Erik Nordmark on how Linux will power the edge computing revolution

BETTER SEARCH LIBREOFFICE CALC Create analytic search tools

Use spreadsheets for coding and science

Synthesise and analyse digital signals on your PC Control your system logs the easy way


Contents

NEW GIFT

REVIEWS

AMD Radeon RX 5500 XT 8GB

19

Jarred Walton tries out AMD’s ‘just north of mid-range’ graphics card – a Navi-based offering that’s as good as the older RX 590 but uses much less power.

SUBSCRIBE NOW! Page 26

VIRTUALISE

EVERYTHING Jonni Bidwell isn’t real and everything you think you know about reality is just an illusion on page 34.

PrimeOS 0.4.5

20

John Knight loves this promising desktop Android distro, but before falling in love he finds it marred by a thorny issue.

GhostBSD 20.1

21

There were many people who said BSD didn’t have a ghost of a chance on the desktop. Mayank Sharma was one of them.

Linux Lite 4.8

22

As the lightweight distro now welcomes Windows 7 EOLers, Mayank Sharma wonders if Lite is the right option?

PsychOS 3.4.6

23

Forever 90s’ Jonni Bidwell finds nostalgia and confusion in a weird lightweight/ heavyweight superposition of distro-space.

Dwarf Fortress

ROUNDUP

INTERVIEW

24

Management is wondering what Steve Hogarty has been up to in the LXF Server Dungeon… he’s just digging a hole to hell.

Plotting tools

28

Turn your numeric data from plain figures into stunning charts, plots and diagrams. Alexander Tolstoy finds out which plotting tool is the best.

4     LXF261 April 2020

The razor’s edge

42

More tales from Jonni Bidwell’s pilgrimage to the 2019 Open Source Summit. This time Erik Nordmark explains what the heck edge virtualisation is all about.

www.linuxformat.com


CONTENTS ON YOUR FREE DVD

Pi USER Raspberry Pi news

OpenMandriva 4.1 Solus 4.1 Page 96

50

Vulkan is coming to the Raspberry Pi! More education is coming to the Raspberry Pi! More updates are coming to Raspbian!

Combian 64

51

Les Pounder goes back to the 1980s to remember a time when he used to type in code listings from magazines…

Scratch and SenseHAT

52

TUTORIALS

Les Pounder reveals how we can get data and control the Sense HAT add‑on board using super-easy Scratch 3.

Home-build tablet options

TERMINAL: Smart delete

58

If you’re worried about accidentally wiping out important files, Shashank Sharma knows a few techniques to protect them.

54

Christian Cawley shows you how to customise your Raspberry Pi tablet project and choose the right touchfriendly operating system.

LIFEOGRAPH: Dear diary…

60

Nick Peers reveals how to create private and encrypted ‘Dear Diary’ moments to last you a lifetime (of embarrassment reading them back).

GNU RADIO: Home electronics lab 66

CODING ACADEMY Science with Calc!

Sean Conway will install in your wetware the foundational knowledge to use GNU Radio on an Ubuntu system.

88

Mike Bedford suggests that – in a change from its more common business use – LibreOffice Calc offers much to the scientific and mathematical user.

ZABBIX: System monitor

Elasticsearch

DOCKER: Nextcloud proxy

92

Mihalis Tsoukalos explains how to work with Elasticsearch, Logstash, Beats and Kibana to build and improve your own search systems.

LINUX: Manage your logs

6

People cry the GPL is dead (they are wrong); trolls attack Mycroft; Godot waited and good things happened; Lenovo embraces Linux; and Librepay is going well.

Linux user groups

11

Les Pounder helps out a fellow Linux user and cat-hater (not really).

Answers

12

Comparing directories, bongs for Linux, partitions for Windows, grappling with GRUB, booting the Crontab and file links.

Mailserver

16

GNOME is actually pretty good, tape drives deserve a look, we’re wrong again (it has been a while) and Linux on tiny drives.

www.techradar.com/pro/linux

74

Add a Traefik reverse proxy to your Nextcloud Docker deployment with a little bit of guidance from Chris Notley.

REGULARS AT A GLANCE News

70

Manage an enterprise as Stuart Burns introduces Zabbix, a scalable monitoring tool that is lightweight and easy to use.

78

Mats Tage Axelsson takes you through the basics and then digs a little deeper into log management and analysis.

Subscriptions

26

Back issues

64

Overseas subs

65

Hello BSD!

82

Aaron Peters is a stranger in a strangely familiar land as he dives into using Linux’s open-source cousin FreeBSD…

HotPicks

Alexander Tolstoy hasn’t got time to go around putting pictures of Putin up in lifts and recording people’s reactions to it – he’s far too busy reacting to the finest open source software on the planet like: Tartube, AwesomeBump, UserManager, Minase, Tutanota, JSPaint, ScreenGrab, Tower Time, Rygar, Hardinfo and Fileinfo.

Your free DVD

96

Next month

98

IN-DEPTH 46

April 2020 LXF261     5


Newsdesk

THIS ISSUE: GPL on the wane Mycroft targeted Yay for Godot Embraced by Lenovo Liberapay birthday Linux on iPhone

LICENCES

GPL’s popularity is waning – but don’t count it out GNU’s GPL is seeing increased competition from other open-source licenses like MIT – but not all is what it seems. report by The Register (http://bit.ly/ LXF261TheRegister) suggested that GNU’s GPL (General Public License) is losing favour among developers, who are increasingly looking at permissive open source software licences such as MIT (http://bit.ly/ LXF261MIT) and Apache 2.0 (http://bit.ly/ LXF261Apache). According to The Register, this is because these have fewer caveats, while not requesting licensors to share code revisions. The Register cites WhiteSource (www. whitesourcesoftware.com), a company that provides an “all-­in-one licensing, security, and reporting solution for managing open source components,” which claims that “use of permissive open-source licenses continues to rise, while usage of copyleft licenses, and the GPL family in particular, continues to decrease.” According to the report, in 2019 33 per cent of software handled by WhiteSource used copyleft licenses, while 67 per cent used permissive open source licences – an increase of three percentage points from 2018. In 2012, copyleft licences covered 59 per cent of projects, while permissive licences were used for 41 per cent. This data is only from WhiteSource projects, and we should point out that a trend found in one source does not necessarily mean it will be found elsewhere. However, as The Register points out, it does tally with GitHub’s findings from 2015, where projects appeared to be moving away from copyleft licenses in favour of permissive open-source ones. So, are copyleft licences like the GPL in

A

6     LXF261 April 2020

trouble? Not necessarily. Permissive license numbers are inflated by the fact that they can be used for open source and proprietary projects, while copyleft licences are only for open source. Paul Berg, an open source licensing consultant, explained to The Register that with projects dealing with proprietary aspects, “permissive licenses like Apache, MIT and BSD are more popular, which is expected since those licenses do not impose many restrictions or obligations when interfacing with proprietary software.” This is especially true if

Don’t count the GPL out just yet.

ARE COPYLEFT LICENCES LIKE THE GPL IN TROUBLE? NOT NECESSARILY. software authors don’t want to give rights to others to redistribute their work. Berg claims that copyleft licencing is growing in popularity in cloud computing “because it has stronger guarantees that consumers of that software will remain members of the community rather than simply extend and repackage the software for their own sole benefit.” So no one should take this to mean GPL is dead, but it highlights the importance of developers to seriously consider each licence, as they offer different benefits to different projects.

www.linuxformat.com


ANSWERS

Answers

Neil Bothwick

Got a burning question about open source or the kernel? Whatever your level, email it to lxf.answers@futurenet.com sound of silence Q The I have installed the latest version

of Linux Mint on my HP Spectre laptop. I keep it updated with software updates. My only issue is that when I plug in the wired headphone in the jack, the sound does not work. Can you please help me identify the problem and a possible fix? Sajal Sachdev

A

When you say the sound does not work, do you mean it stops altogether or it continues to play through the speakers? If it continues to play through the speakers, ignoring the connected headphones, check your mixer settings. As Linux Mint uses PulseAudio, try pavucontrol I find this more useful than most desktop mixers for viewing and controlling audio outputs. Your system should detect your headphones being plugged in and automatically switch outputs, but I have seen systems where this does not happen and manual intervention is needed. If, on the other hand, nothing at all is played when you plug in the headphones, you could be looking at a hardware

issue. I assume that you’ve tested that the headphones themselves work by plugging them into another device, so check the laptop too. If it is dual boot, does connecting the headphones have the expected outcome in the other operating system? Alternatively, try booting the computer from a live CD of a different distro and see what happens there. If it doesn’t work with multiple operating systems, then you most likely have a hardware fault.

Skype Q Faceless My desktop OS is Linux Mint 19 and I have installed Skype. When I call a friend using Skype I can hear what they say and see them in a window. They can hear me, but with no video output at their end. I bought a Philips Brilliance 241B7QPJKEB monitor with a retractable webcam and microphone built into the top of the monitor, in order to use Skype. The Philips monitor’s manual states that the webcam will work with various versions of MS Windows, as well as “any other OS whichever support UVC/UAC

even solved world peace but the   dog ate   the answer.

(USB Video Class compliant) under the USB 2.0 standard.” To check whether or not the computer was recognising the webcam, I opened a terminal to list any video4linux devices, and entered: $ ls -ltr /dev/video*

The resulting output ended in dev/ video0. So something was installed. I tested the webcam by opening VLC media player and selecting Media > Open Capture Device> Video Device Name = /dev/video0 > Play. The indicator light next to the webcam came on and I saw myself displayed onscreen in Full HD 1080p resolution. How can I get this output recognised and used by Skype? Alfred Douglas

A

Is your webcam even available for selection in Skype’s settings? There are a number of possible causes for this issue. One is that the uvcvideo module is not loaded by the kernel when it detects the camera. To check this, open a terminal and run: $ lsmod | grep uvcvideo

You should see something like uvcvideo 106496 1. The numbers are not relevant, only that the module shows up. If it isn’t loaded, run: $ sudo modprobe uvcvideo

For better control of PulseAudio devices than most desktop mixers provide, install pavucontrol.

12     LXF261 April 2020

If this does the trick, you need to either load the module each time you want to use Skype or, more conveniently, tell Linux to load it when you boot up. Create a file in /etc/modules-load.d, such as skype.conf, containing just uvcvideo on a line on its own. The name of the file is unimportant but it must end in .conf. From then on, whenever you reboot, the uvcvideo module will be loaded. Another possibility with webcams is that your user does not have the right permissions to use /dev/video0, which usually means that your user needs to be a member of the video group. You can see the groups you are a member of by running either groups or id in a terminal. However, this is unlikely to be the cause in this instance, as you can use the webcam with other software.

www.linuxformat.com


REVIEWS Distribution

PrimeOS 0.4.5 John Knight reviews a beautiful and promising desktop Android distro, but before falling in love he finds it clouded by a particularly thorny issue. IN BRIEF An Android distribution for x86, provides standard PC controls for Android applications and integrates with Google’s Play store. Comes in three editions, 32-bit, 64-bit, and 64-bit ‘Mainline’ for new PCs; requires 16GB hard disk space and SSE4.2 support for 64-bit editions. Provides compatibility for Arm apps, and a gaming utility for remapping touch controls to a mouse and keyboard.

he desktop Android scene has multiple distros competing for this growing market, but a newer competitor has been slowly gathering momentum in the background – PrimeOS. The homepage claims that PrimeOS “gives a complete desktop experience similar to Windows or MacOS (sic) with access to millions of Android apps. It is designed to bring you the best of both worlds – a complete fusion of Android and PC.” The website provides an executable installer for Windows users and a regular ISO image for the When working as intended, PrimeOS gives a fast, smooth and elegant PC desktop based around Google’s app store. rest of us. Overall, the installation process was much quicker and less painful than its rivals, with fewer screens overall, and its which version to download, a forum, a link to an article, GRUB2 prompt actually works. and that’s it. PrimeOS has excellent boot scripting built in, with Second, we couldn’t enable Sleep mode on anything detection for Windows and most major Linux flavours and except a MacBook. The screen just went black (while derivatives, preserving GRUB entries while adding its own. remaining backlit) and mechanical hard disks emitted Without any complicated partitioning, the installation worrying start/stop noises that had us immediately should be done in around a minute. reaching for the power button. For most Android users, a Once rebooted it will run a setup dialogue. It was non-functioning Sleep mode will be a deal breaker. disconcerting when it wanted info like our date of birth Those problems we can forgive an unfinished project, and gender, but otherwise the setup was painless, with but we have one overwhelming issue. It’s closed source. only a couple of prompts, preferring to configure things Why? PrimeOS could easily become the standard of the like Wi-Fi and Google accounts later in the actual desktop. desktop Android world. Instead, this beautiful OS is being Boot times are very fast, and once the desktop is hampered by dumb licensing, keeping the OS in obscurity. loaded you can expect almost Scandinavian levels of PrimeOS is already free. Why not open source it and give tasteful minimalism: a mountainscape wallpaper, icons for it a proper chance to shine? The OSS community could Chrome and the Play store, a taskbar, and that’s about it. easily sort out the Sleep issue and write documentation. Touch the system icons and a pull-down menu will appear So we’re left in a frustrating place. PrimeOS is nicer to from above, where you can configure options like Wi-Fi. use than most rivals – Bliss OS is extremely buggy, It’s all very elegant and runs incredibly smoothly. The Phoenix OS now has ads, and Android-x86 is only a bareonly fly in an otherwise perfect ointment was applications bones system. But if it can’t suspend properly, it won’t that minimised at strange times. suit most Android users. And if it’s closed source, there’s As for unique features, under PrimeOS Settings was nothing you can do to fix it. Enable Native Bridge, which can “support apps with arm native libraries”. We couldn’t find any information on this VERDICT feature, but in our testing PrimeOS ran a lot more software than competing distros. PrimeOS Settings also DEVELOPER: Floydwiz Technologies allows you to enable or disable root access manually, and WEB: https://primeos.in specify different levels of access. LICENCE: Proprietary Freeware PrimeOS also comes with DecaPro Gaming Centre, designed to bring Android gaming to the PC with mouse FEATURES 7/10 EASE OF USE 7/10 control and pre-defined shortcut keys. Some love it, PERFORMANCE 8/10 DOCUMENTATION 2/10 others don’t – either way, it’s definitely worth trying with games like PUBG Mobile. Fast, beautiful, tastefully minimalist, but still unfinished. And why is it closed source when it’s already free?

T

Have we got bad news for you!

There are currently three main drawbacks. First, there’s almost no documentation – there are instructions on

20     LXF261 April 2020

Rating 5/10

www.linuxformat.com


REVIEWS Dwarf management sim

Dwarf Fortress

Management’s wondering what Steve Hogarty has been up to in the LXF Server Dungeon, but it’s nothing to worry about, he’s digging a hole to hell. SPECS

OS: A Linux CPU: Dual core 2.4GHz+ Mem: 4GB GPU: 1GB VRAM HDD: 500MB

n the Dwarven Year 250, the stubby reach of dwarfkind had touched every procedurally generated rock in Ruspsmata, from The Problematic Steppe to The Dune of Hermits, from The Prairie of Pregnancy to the Jungle of Conflagration. Not an inch of stone had not known dwarven steel, yet one dark depth had so far eluded colonisation. “Leave the skies to the birds,” sang the Dwarven king – probably, we’re making this bit up – “the Underworld shall be ours.” Dwarf Fortress is several things at once. It’s The Sims and NetHack and Dungeon Keeper and Minecraft. It’s a vast, simulated fantasy world, generated just for you, with races and religions and history and wars and dwarves whose fingernails grow. It’s also infamously difficult, featuring only ASCII visuals and labyrinthine menus. Yet Dwarf Fortress’s reluctance to expend even a joule of energy in prettying itself results in astonishing complexity. Bidwell the dwarf sets to work dismantling the wagon and turning the wood into beds. Mohr and Effy begin to scoop out a shallow hole. The others busy themselves stockpiling the food, furniture and fuel they arrived with. Over days, seven bedrooms are carved out of the rock, indoor stores are created, as are workshops and kitchens. Peers happily builds doors. Bidwell constructs tables and chairs for a dining room. His puppy is stung by a bumblebee in an attempt to ironically frame just how peril-free life is. The dining room becomes Oakfire’s attractive centrepiece, as the northwest corner has clipped a cluster of green tourmaline, creating a shimmering emerald distraction from the now daily servings of Neil Bothwick’s freshly caught perch. It’s all very pleasant. It’s definitely a

I

shame that Effy is already tunnelling vertically towards oblivion and the realms of unending torture. As a construction and physics simulator, Dwarf Fortress is perhaps at its least intimidating. You can’t assume exact control over your dwarves, instead you designate areas for them to work on. In the early stages, that’s a case of simply tracing out chunks of the ground to be dug. Dwarves are assigned different jobs, such as mining, but some labour is shared by every dwarf, and moving stone becomes a constant low-priority task. Effy’s work takes place a short distance from Oakfire’s entrance hall. A roughly hewn passage leads away from the main fortress before reaching an ever-deepening pit, around which a rudimentary stairwell allows access to the rapidly descending dig site. Two caverns are encountered and traversed in this manner; two great and seemingly endless halls of funguscarpeted rock. Clever dwarves would build walls around their bafflingly unprotected staircases. Oakfire hosts no clever dwarves. Unknown to all, a filthy menace is ascending from below. The noise of all the hellbound tunnelling has awoken a bugbat in the underground caverns. The flitting beast makes its way to the entrance hall. Mayank Sharma is cleaning himself when the creature latches on to the calf of his right leg, bruising him through his silk trousers. He flails madly and humiliatingly about the fortress, crashing through the dining room and startling several hungry dwarves before the bugbat’s tiny mandibles finally slice through his right index finger. Dwarf blood spurts enthusiastically from the wound, spattering the walls. Oh yes: Dwarf Fortress has a very detailed combat system.

You’ve landed, now what? Read the flipping manual! This article first appeared in PC Gamer 228 in the Dwarven year 2011 in the month of Malachite (July). It has been edited for length and the original dwarf names changed for sense.

24     LXF261 April 2020

www.linuxformat.com


SUBSCRIBE Save money today!

SUBSCRIBE

Sign up today and get this fantastic

STM DRIFTER LAPTOP BACKPACK YOUR GIFT! WORTH £89.95 t,

ou Don’t miss ow! subscribe n

Designed to carry most 15-inch laptops and the 16-inch MacBook Pro, this 18L backpack is spacious, comfy, protects your devices and is packed with pockets!

Top features

The protective tech cell lifts your laptop off the bottom of the bag, keeping it away from the impact zone Spacious 18L capacity for books, shoes, clothing and more! Dedicated tablet pocket is integrated into the laptop sleeve 3D foam mesh back-panel with air-flow channel for hot days Internal power pocket provides a place to store your charger Reflective light loop for better visibility and night safety

SUBSCRIBE NOW! www.myfavouritemagazines.co.uk/lin/stm1

Call: 0344 848 2852 26     LXF261 April 2020

www.linuxformat.com


Overseas subs on p65

PLUS: Exclusive access to the Linux Format subs area! 1

! DON’T MISS s ar ye Now with 5 & r se U x of Linu Developer issues

CHOOSE YOUR PACKAGE! 6-MONTH PRINT ONLY

ANNUAL PRINT AND DIGITAL

PLUS!

SAVE!

Only

22%

£32.50 6-month print   by Direct Debit

2-YEAR PRINT AND DIGITAL

Only

£72

SAVE!

58%

Annual print and digital  by Direct Debit

PLUS! Only

SAVE!

£136

61%

2-year print and digital  one-off payment

Terms and conditions: This offer is only available for new UK subscribers. Gift is subject to availability (MSRP £89.95). Please allow up to 60 days for the delivery of your gift. In the event of stocks being exhausted we reserve the right to replace with items of similar value. Prices and savings quoted are compared to buying full-priced print and premium subscriptions. You will receive 13 issues in a year. You can write to us or call us to cancel your subscription within 14 days of purchase. Payment is nonrefundable after the 14 day cancellation period unless exceptional circumstances apply. UK calls will cost the same as other standard fixed line numbers (starting 01 or 02) or are included as part of any inclusive or free minutes allowances (if offered by your phone tariff). For full terms and conditions please visit: www.bit.ly/magterms.   Offer ends 30 April 2020.

www.techradar.com/pro/linux

April 2020 LXF261     27

1) Only available to MyFavouriteMagazines.co.uk subscribers.

1,000s of DRM-free  PDF back issues and articles! Get instant access back to issue 66 (May 2005) with tutorials, interviews, features and reviews.  At linuxformat.com


ROUNDUP Plotting apps WE COMPARE TONS OF STUFF SO YOU DON’T HAVE TO!

Roundup LibreOffice

Veusz

Jade

Dia

LabPlot

Alexander Tolstoy is planning to do what he does every night, plotting to take over the world!

Plotting applications Turn your numeric data from plain figures into stunning charts, plots and diagrams. Alexander Tolstoy finds out which plotting tool is the best.

HOW WE TESTED… These days plotting in Linux usually starts with an internet search for ‘best plotting OSS apps’, this predictably returns a bunch of decent reviews. They are good, but we have decided to shift the focus towards beginner-friendly applications that provide an easy-to-use graphical interface. With this in mind, we’re not including such respected packages as Gnuplot and Ggplot2 in this Roundup. Instead, we’re putting powerful and mature WYSIWYG suites (LibreOffice and Veusz) against Jade, the promising project that rivals MS Visio, as well as the classic diagramming app that’s been around for ages (Dia), and also LabPlot – the very decent tool for data analysis and plotting. The term ‘plotting’ is wide enough to be handled in many different ways, but in this Roundup we’ll mainly look at ways of turning numeric data into aesthetically pleasing plots, charts and diagrams without going too scientific – although advanced dataprocessing features are always a bonus.

28     LXF261 April 2020

here are several approaches to data visualisation that differ in the level of scientific complexity. However, you don’t have to be a scientist to visualise some simpler things in life, like kids’ school (downward spiral?–Ed) performance or money spending. As such, we’ll leave powerful systems as MATLAB aside and give more favour to WYSWIG tools and editors. Finding a perfect balance between a rich set of features and a novice-friendly GUI sometimes sounds alike an impossible mission, but we feel that some of our contenders come very close to perfection.

T

We’re going to evaluate how our contenders perform with CSV handling, drawing custom plots, block schemes and diagrams, and also what it takes to get used to them and take a right step towards being proficient in plotting. There is some additional intrigue in this Roundup due to the fact that participating apps come from different categories: LibreOffice is a classic desktop productivity suite, Veusz and LabPlot are very scientific, while Dia and Jade have many vector-editing features. We will also be looking at the interoperability of each app and ways of exporting and sharing our plotting results.

www.linuxformat.com


Plotting apps ROUNDUP

Ease of installation What does it take to get the applications up and running? lthough this test is not directly data-related, it is a crucial factor, because the availability of an application is key to its adoption by the general public. LibreOffice is an undisputed benchmark of perfect app availability. Many Linux distributions make it available right after installation. Check the Office section of your application menu to see if it is already there. If not, install it via a package manager or a software store. Veusz is more niche, and it’s sometimes necessary to search for third-party Veusz packages. Nevertheless, the official Veusz website offers a rich selection of builds for various platforms, including an assortment of Linux and BSD systems, so it’s not a problem to install. The situation is even better for LabPlot. Being a member of the KDE family, this application is available almost ubiquitously. Just in case, the official website lists helpful links in the Download section for nearly all mainstream Linux flavours. Dia boasts excellent availability as well. It’s been around since the late 90s, and many if not all Linux vendors include Dia out of the box or keep it available in standard repositories. The only minor issue is that the official Dia website offers a very limited set of download options and recommends outdated packages, so it’s better to search for Dia in the stock repositories of your distro. The only contender that requires more efforts to install is Jade. This is a small, one-person project that consists of two parts: the

A

Jade is a nice drawing app, but it takes some time (and requires editing the jade.pro file) to successfully compile the application.

Jade app, and the Libjade shared library it depends on. Firstly, you need to compile Libjade using Qmake and a standard set of Qt5 build dependencies. Then you grab the Jade source code and build it the same way. Jade looks for Libjade in /libjade/lib, which means that you need to download and put both projects side by side. So while there’s nothing too challenging in installing Jade for tech-savvy users, many inexperienced with compiling from source will likely find it a serious obstacle.

VERDICT LIBREOFFICE 10/10 DIA 9/10 VEUSZ 9/10 LABPLOT 8/10 JADE 4/10 If you manage to get Jade up and running, you’ll probably have no trouble with the rest of apps.

Ease of use Will novice users feel welcomed? or years LibreOffice has been promoted as an alternative to Microsoft Office, which in turn is a widely adopted desktop software suite. Using advanced features of Excel and Calc does take some time and effort, but we must admit that drawing plots and diagrams in Calc was really a piece of cake, and those plots looked quite nice! Veusz is also very interesting. This is a specialised plotting and data analysis application that feels quite complex. However, it has an unmatched built-in tutorial that runs (upon your agreement) right after the first launch. The tutorial involves animations and widget highlighting implemented directly in the Veusz interface, allowing you to learn complex things from scratch in minutes. We really wish other scientific software could implement the same tutoring approach. For instance, LabPlot uses the same ‘project’ metaphor as Veusz and features a similar tree of hierarchical objects, but it takes substantially more effort to get used to it. Dia is a very simple software, with most of its features displayed at your reach, but it uses the legacy floating-window mode, which is annoying. Run it like $ dia --integrated to get the single-window mode and the much better experience. Ease of use is Jade’s stock in trade. We suspect that the reason behind creating Jade was primarily to get things done quickly and

F

www.techradar.com/pro/linux

Before dealing with complex and time-consuming 3D plots, start with simpler things and let the built-in Veusz tutorial guide you.

conveniently. As such, if you just want to experiment with simple diagrams and plots by drawing them directly onto the canvas, then go with Jade.

VERDICT LIBREOFFICE 9/10 DIA 8/10 VEUSZ 8/10 LABPLOT 5/10 JADE 10/10 Go with Jade for simple drawings, and don’t miss the built-in tutorial in Veusz!

April 2020 LXF261    29


VIRTUALISE

ALL THE THINGS Fed up with breaking Linux installs, and Linux installs breaking him, Jonni Bidwell looks to virtualisation to ease his very real woes.

ithout virtualisation, life at Linux Format towers would be a lot more complicated. Testing the DVD would be a nightmare, reviewing new distros would require us to wipe the machine on which we installed last issue’s distros, and if we wanted to test new software on different distros, we’d probably need yet more hardware and yet more time. Yet if you rewind back to the late Mesolithic LXF age – the early 2000s – these were exactly the kind of hardware logistics

W

34     LXF261 April 2020

that the team had to wrangle, all the while living the wild lifestyle encouraged by the heady golden era of dead-tree publishing. Back then tech journalists were made of stronger stuff. Nowadays things are much more straightforward. If you want to try a  new OS, or even if you just want to do something a bit crazy with your current one, all you need do is fire up a virtual machine, and within minutes you have a device that for all intents and purposes behaves like a regular computer. Only

you don’t need to worry about breaking it – anything you do can be undone, and no one will come at you with pointed questions/sticks if it breaks. For beginners, a virtual machine is  a great way to try Linux. You can run VirtualBox for free on Windows or macOS. If you’re already running Linux you may prefer to use Red Hat’s Virtual Machine Manager, which uses QEMU (an emulator) and KVM (Linux’s powerhouse of a hypervisor) behind the scenes. Whatever your tastes, we’ve got something for you.

www.linuxformat.com


Virtual machines

Virtualisation 101 Nobody can tell you what virtualisation is – you have to experience it for yourself. Or you could just read this… irtualisation has been around since the 1960s. Of course, computing then was all done on mainframes and OSes were a lot different, so it’s harder for youngsters to get their trendy heads around how this worked. The idea then is essentially the same as it is now: compute resources were to be shared (fairly) amongst users in such a way that concurrently running jobs would not interfere with one another. Operating system kernels used to be called ‘supervisors’, and each separate job was more or less its own entity (today we expect our OSes to multitask programs as a matter of course, but this wasn’t the case back then). So the underlying OS which governed these jobs was referred to as a hypervisor, a term still used today. Modern hypervisors such as Xen and Microsoft’s Hyper-V are thin OSes that run on bare metal with the sole purpose of hosting guest VMs strictly and securely, much like the time-sharing schema of the mainframe days. These are called Type-1 hypervisors, which correctly implies the existence of Type-2 hypervisors. The latter, exemplified by VirtualBox, Parallels and QEMU run on a regular operating system and are probably more familiar to everyday users. Things are not binary, though; the Linux’s KVM (Kernel-based Virtual Machine) doesn’t fit nicely into either category, since it turns the kernel into something like a Type-1 hypervisor, but the host OS still runs as intended. In 2006, Intel and AMD started shipping processors with, respectively, VT-x and AMD-V extensions. These enabled operating systems to run virtualised without modification, in contrast to previous approaches such as paravirtualisation (which modified the OS to run in a guest environment) or complex software workarounds. Since then, virtually (ahem) all desktop CPUs have

We use only virtual penguins to test our disc now – ever since that ugly uprising six years ago.

V

shipped with these hardware virtualisation extensions. And they have evolved to enable not only faster virtualisation, but deeper too, with hardware interrupts, memory management units (MMUs) and onboard graphics – via Intel’s iGVT-g on Iris Pro graphics – now being virtualisable. It’s even possible to blur the boundaries between physical and virtual; actual hardware can be handed off to a virtual machine and used seamlessly. A popular example of this is running a Windows 10 VM with a second (usually high spec) graphics card. This trick, known as PCIe passthrough, enables Linux users to play AAA games at very close to native speeds. PCIe and the general area of Virtual Function I/O (VFIO) require different CPU extensions, called VT-d on Intel and AMD-Vi on AMD. Some of Intel’s overclockerfocused chips (the ones ending in K) lack these. One new project worth keeping an eye on is Looking Glass (https://looking-glass.hostfission.com) which aims to streamline passthrough setup for Windows VMs. In particular, the need for a separate monitor and keyboard is obviated.

VIRTUALISATION, EMULATION AND CONTAINERISATION It’s easy to confuse virtualisation and emulation. Both are a piece of software masquerading as a machine, and both have been around for a long time. In one sense virtualisation is just a special form of emulation. On Linux, we can emulate lots of hardware; for example, a Raspberry Pi with QEMU, an Amiga with UAE, or a Sega Megadrive with BlastEm. We can also emulate software, using DOSBox or Wine (we know, Wine isn’t an emulator – arrest us) for example. Emulation recreates everything in software, translating  or rearranging foreign code into something the host can understand. Virtualisation differs in that the guest code  runs directly on the host, which means it’s faster (although sometimes other hardware still has to be emulated which makes it slower again), but also means it’s only possible to

www.techradar.com/pro/linux

virtualise architectures that are similar. Around a decade after the virtualisation revolution, a new technology emerged: containers. These were popularised by Docker in 2013 and bring many of the benefits of virtualisation (isolation, efficiency), but use the host’s kernel, obviating the need to run a whole guest operating system. Containers can be seen as OS-level virtualisation, as opposed to machine-level. Since a container need contain only the libraries required to run a particular application, they are eminently portable. They also provide a neat solution if that application only works with a particular version of a library. In the same way that Qubes OS runs applications in different VMs, OSes like Container OS (formerly CoreOS Linux) and RancherOS run everything in containers.

April 2020 LXF261     35


THE RAZOR’S

EDGE More tales from Jonni Bidwell’s pilgrimage to the 2019 Open Source Summit – this time from virtualisation guru Erik Nordmark.

42     LXF261 April 2020

www.linuxformat.com


Erik Nordmark INTERVIEW rik Nordmark is one of the co-founders and the chief architect at Zededa, pioneers in edge virtualisation and creators of Project EVE – the Edge Virtualization Engine. For anyone that doesn’t buy into new computing paradigms, Erik claims “the edge is already here, it’s just not connected yet.” And he would know. He also sits on the technical advisory committee of the Linux Foundation’s LF Edge umbrella organisation (https://lfedge.org), which brings together seven (and counting) projects, including Project EVE (and EdgeX Foundries, which we heard about in LXF257). LF Edge has the lofty goal of establishing an open, interoperable framework for edge computing. Erik was brave enough to join Jonni Bidwell among the clouds on the roof of the Lyon convention centre – skirting dangerously close to all kinds of appalling edge/cloud punnery, but escaping with only a tasteful nod to W. Somerset Maugham’s lukewarm classic.

E

Linux Format: What sort of things are you working on at Zededa? Erik Nordmark: What I care about is driving edge technology, but there’s scary stuff that goes along with that. We’ve seen many home products that ship with default usernames and passwords. How can we advance the state of the art [tech] so that people can deploy these things and still be able to sleep at night? We want the people who have the domain expertise – retail, energy, healthcare, whatever – they worry about their applications, they don’t worry about how to make Linux secure. When we set up Zededa [in 2016] we found you could buy a $7 Orange Pi board with 256MB of RAM and boot the Xen hypervisor on that. So now we can build something that’s quite secure, in terms of having a type-1 hypervisor with a smaller

www.techradar.com/pro/linux

attack surface. This means the hardware is no longer the obstacle, even though today most of what’s deployed is for Intel processors, typically lower powered, passively cooled things. I talked to people who were deploying or thinking about deploying things, about what they saw as their pain points and what was missing. One of those was data, IoT data, which we don’t deal with. What we deal with is how to operate and scale things. So let’s say I deploy an application on 10 devices – it doesn’t matter if those are MQTT relays or AI devices with TPUs, the application is deployed and everything works. Now what happens when we want to scale to 1,000, or 10,000 devices? LXF: For the benefit of our readers, and indeed me, could you explain a little bit about where this edge computing trend came from and why it is important? EN: Edge computing is something that’s touted as being quite new, but I would argue it’s actually been here for a long time. It’s just it wasn’t connected until now. If you walk into a factory today every machine there has an industrial PC inside it, with an operator console. So people look at that, see the data that’s there and deploy new applications. That’s an example of taking something that exists in one place and deploying it elsewhere, but the edge is a lot broader because people talk about it in terms of anything that’s not in the cloud or the data centre. And that’s a very broad definition. One of the things we’re looking at in LF Edge is, “What is actually distinguishing in terms of the edge?” It’s not just that it’s a different size data centre that has similar characteristics. It’s deployed in a distributed way, where maybe you don’t have the same physical security, or you

might not have the same network security with firewalls and such. Or it could be that these things are so distributed that you don’t ever want to go there for software maintenance because it’s too far away. You’d have to get on a plane and drive for a couple of hours just to service one box. So there’s other things that are unique about the edge in terms of the IoT aspect of data. Some of the things that Jason (Shepherd, see our interview in LXF257) has been working on concern data provenance, right, and how to transform that data because there’s all these different protocols and different schema in terms of how that data is set up. The way you describe a light fixture could be very different because some organisations have defined a schema that talks about colour temperature, and others describe it in terms of red, green and blue components. So there are many problems that are coming from IoT and the apps that go with that. LF Edge as an organisation is bringing in projects that are covering different aspects of this. So that’s a key thing, it’s not just taking what we’ve already done in a central way and distributing it. We’re trying to address all these things that are unique to the edge. LXF: Which projects are involved in LF Edge at the moment? Right now there are seven projects, and more are coming in. The original five projects were: Akraino – they’re looking to do integration work from a telco background, EdgeX Foundry, which Jason told you about; Project EVE (Edge Virtualization Engine) – that’s what I’ve been working on, we’re looking at providing a baseline for edge virtualisation; there’s the Open Glossary project, which is trying to harmonise terminology across

April 2020 LXF261     43


IN-DEPTH FreeBSD

USING BSD FOR

LINUX USERS Aaron Peters is a stranger in a strangely familiar land as he dives into installing and using Linux’s open-source cousin FreeBSD… f you’re reading this magazine, then you have at least a passing interest in free software. Maybe it’s limited to Linux, but the FOSS community is bigger than that. There’s plenty of software projects that run on other operating systems, and also a variety of open source Un*x clones. The BSD family of operating system is an important example, representing some of the first systems truly free from legacy Unix code, and can be seen as at least an uncle to Linux as we know it today. What started as one system, the Berkeley Software Distribution (BSD) went through a variety of versions (a book in itself), with different projects and vendors. Today’s family of BSD systems include NetBSD, OpenBSD, and TrueOS. Of these, FreeBSD is considered the most ‘general purpose’ and is arguably the most popular. Notably, Apple used FreeBSD

I

code as the basis for the Darwin project, an OS that became Mac OS X (and now macOS). If you’re looking for a desktop system to install and immediately be productive with, there’s better options for you (see the sidebar for some other members of the BSD clan). But this article intends to be a learning exercise to see how this little Unix-y devil stacks up. And FreeBSD offers that learning opportunity by being more hands-on than other desktop-oriented systems, whether Linux or BSD. However, the author did have a goal – to be able to take this from a fresh install to a “productivity system”, complete with a GUI interface and accompanying tools. But along the way, we’re aiming to see what’s the same, as well as what’s different. And as we in the open source community know, variety is the spice of digital life. So we owe it to ourselves to explore this BSD system and see what’s what.

CREDIT: The FreeBSD® logo is a registered trademark of The FreeBSD Foundation. 46     LXF261 April 2020

www.linuxformat.com


FreeBSD IN-DEPTH hy use FreeBSD? A better question might be “Why not use FreeBSD?” As we’ll see, FreeBSD comes from the same Unix-y roots as Linux, and we can expect our skills to transfer over nicely. Oh, there will be slight differences for sure, but a shell is a shell is a shell, and your ls command in FreeBSD will indeed list the contents of your current directory. But there’s always something to be learned from different ways of doing things, and some of the areas where FreeBSD excels include: As a server. FreeBSD powers some of the most basic services on the internet, and is also used in some of the network hardware that makes up its infrastructure. Security. Its beginnings as a server OS have led to FreeBSD including a number of unique security features, such as access control lists (ACL), a choice of powerful firewalls, and jails for running virtualised OSes. Following documentation. With many modern Linux distros, getting installed is a simple point-and-click affair. In contrast, FreeBSD comes from an era where you actually had to read the documentation, understand it, and follow along closely. A focus on compiling source. The Ports system gives a fantastic introduction to compiling software for those who aren’t software engineers by training. Use FreeBSD for fun. Use it to learn, and evangelise it to others in the community – we’re family after all. The way you install FreeBSD is just like Linux, in that you need to get some sort of installation medium, then boot your machine from said medium. The main differences during installation are threefold. First, the installer is text-based. Second, the installer doesn’t give the option to move back to previous screens. Finally, the way you include software during the install is rather unique. In this context, “include” software doesn’t mean actually installing it. But the installer does give you the option to add the FreeBSD Ports Collection. Ports is the equivalent of Linux package repositories, except that they’re used to build packages rather than install. For now, if you’ve installed a Linux distro, you’ll breeze through the text-based installer’s screens: 1 First up, a couple of environment screens: Keymap selection, and choosing a hostname for your machine. 2 Select the “distributions”. As mentioned, make sure you include Ports. Think of these as software sets, rather than the colloquialism for a Linux-based OS. 3 Disk partitioning. The first option will be between the traditional UFS and the newer ZFS (see LXF227) filesystems. For testing, UFS is fine. You’ll be offered the usual manually partition,or take over the whole disk. You’ll also have a choice of several different partition schemes. 4 The installer will start decompressing the distro onto your drive. Don’t go anywhere, it won’t take long.

W

You may start to panic when you see FreeBSD’s text-based installer. But its steps (like Partitioning as shown here) will be familiar.

www.techradar.com/pro/linux

5 Finally, some quick system configuration, including setting up the root user, network, time zone, date/time, services (SSH is selected by default), security options, and user account(s). There are sub-steps, and it may seem like we glossed over the installation. But honestly, if you’ve done a Linux install you’ll have no troubles. For those of us of a certain age, step 2 might even bring back fond memories of writing sets of Slackware floppy disks.

Booting into FreeBSD That nostalgia will continue once you reboot your system. You’ll get to see the plain-text system messages blur past in all their glory, and when all is said and done you’ll land at a login prompt – no fancy desktop, no newfangled session manager. You’ll see login: and that’s it. It doesn’t even clear the screen for you. But start poking around and things will begin to get familiar pretty quickly. Your home directory is in /home /<username>/, and the standard sh shell is similar enough to Bash that you won’t notice the difference. The first thing that will probably jump out at you is that sudo isn’t installed by default, so you’ll need to use the actual root account to make changes. But otherwise all the basics are there: cp, mv for shuffling files, mkdir for new directories, and cd to get yourself around. That said, your system is definitely barebones. Take a tour around your executable directories (/bin, /sbin, /usr/bin, and /usr/sbin) if you don’t believe me. You’ve got basically enough to do some text editing (with either edit or <sigh> vi). In order to make this a useful system, we’ll need to get started installing some programs. Note: one area where the author ran into some delays is in setting up the bootloader. In part, this has to do with his stubborn insistence on trying to make it work with the native Windows boot manager on this dual-boot device. Things went much more smoothly once FreeBSD was allowed to take over the entire disk, and even just installing the FreeBSD bootloader would

MEET THE BSD DEVILISH FAMILY FreeBSD is similar to Linux in that there’s an extended family of other systems. There’s now quite a few different choices in the BSD world. Here are a few of the most popular: FreeBSD (www.freebsd.org) was originally a server OS first (as most Unix-likes were), but now is positioned as the “jack-of-alltrades” system, if you’re willing to put in the work in, as we’ll cover. NetBSD (www.netbsd.org) is another all-purpose OS, with a focus on running on as many different devices as possible, meaning you can just as easily find it on a desktop, a server, or replacing Windows CE on an NEC MobilePro 790 circa 2004. OpenBSD (www.openbsd.org) its claim to fame is security, with all packages going through rigorous audits at the source level. TrueOS (www.trueos.org), originally called PC-BSD, this is a desktop-friendly remix of FreeBSD, but pre-configured with niceties such as a graphical installer and bundles of apps pre-installed. DragonflyBSD (www.dragonflybsd.org) forked from FreeBSD and provides a carefully tuned system for high-performance applications. GhostBSD (www.ghostbsd.org) is technically a grandchild of FreeBSD, as it’s built off of TrueOS. Just as Linux distros stand on the shoulders of giants, this aims to provide a simpler experience than its parent, with a focus on lighter desktops like MATE and Xfce.

April 2020 LXF261     47


Pi USER

TUTORIAL xxx

Les Pounder works with groups such as the Raspberry Pi Foundation to help boost people’s maker skills.

BACK TO BASIC(S) For the past few weeks I have been immersing myself in the 1980s – specifically, BASIC programming on a Z80 board called the RC2014 Micro. It got me thinking about those golden days. I learned to code using BASIC, and I could even do some rudimentary GPIO and electronics work thanks to a series of books from Usborne Publishing, which are now free to download as PDFs. BASIC is a great language, and it struck me that because I can already code in a few other languages, I picked up BASIC quickly and made a few projects using the language. Learning to code is not just about learning a language – it is about how logic works. How a loop can iterate, how to declare a variable, set the variable and get the data from it, and so on. By learning one language I quickly learned this logic, and now I can apply it to others. But why am I so impressed with such an old language? Simplicity. If I can understand what is going on, even vaguely, I can debug and fix my issues. If you have never tried BASIC, please do so! There are many versions on offer: Microsoft BASIC, Commodore BASIC and what is often considered to be the best, BBC BASIC. All of these versions can be run on the Raspberry Pi, via emulation or a modern-day application. If you have access to the old hardware, and have electronics skills, then perhaps you can build those Usborne projects and show them off at your next Raspberry Jam.

Vulkan to land on Raspberry Pi 4 VideoCore VI hardware offers enough bells and whistles to support a native build of Vulkan. ulkan is an industry-wide initiative to deliver a modern, high-performance, cross-platform API to support 3D rendering and compute abilities. It was largely created through the need to replace the more complex OpenGL library with a lower-level and less CPU-demanding API, especially for mobile devices running Android – but extending to anything requiring GPGPU compute abilities and OpenCL.

V

Before the Raspberry Pi 4, Pi models were unable to directly support Vulkan as it requires hardware that supports OpenGL ES 3.1. Obviously, this didn’t stop the Pi community trying to bring Vulkan support to the Pi regardless… But with the release of the Raspberry Pi 4 and its VideoCore VI hardware that does support OpenGL ES v3.1, the possibility of Vulkan support became a reality. So it shouldn’t surprise anyone that at the end of January 2020 Ebon Upton announced Vulkan would be coming to the Pi 4. The post was accompanied by a proof-of-concept, Vulkan-rendered RGB triangle. In his comments, Upton suggested a first public beta release would be in six months’ time, so watch this (3D) space. See http://bit.ly/ lxf261vulcan for more. Rendering has to start somewhere, and where better than an RGB triangle?

Raspbian updated

Educators united! Super symposium.

New screen reader. aspbian has received an update, post the Pi 4 release of last year. The new revision has tweaked the file manager for the better, introduced the Orca screen reader, enhanced the audio mixer and now Ctrl+Alt+Del brings up the power dialogue rather than the task manager. Get updated now with a terminal-based: sudo apt update && apt full-upgrade .

R

The tweaks sound great!

re you a Pi enthusiast? Are you a UK educator? Then you should get involved in the Pi Foundation’s Education Research Symposium on 1 April 2020. Held at the Department of Computer Science and Technology, University of Cambridge, it’ll cover school-level computing education with free workshops run the day before. Get more details and book your spot now at http://bit.ly/lxf261symp.

A

We love a good symposium, so sign up today…

IMAGE CREDITS: Raspberry Pi Foundation 50     LXF261 April 2020

www.linuxformat.com


TUTORIALS Sense HAT

SCRATCH 3

Light up your life with the Sense HAT

Les Pounder reveals how we can get data and control the Sense HAT add‑on board using super-easy Scratch 3. ere we’ll use the scientific powerhouse Sense HAT board with Scratch 3 to create three projects; using LEDs to scroll our name, joysticks to trigger input and sensors to read temperature and orientation. With the power off, connect the Sense HAT to all 40 pins of the GPIO, ensuring that the board fits neatly over the Pi. Use the brass standoff provided with the Sense HAT to fix the board firmly in place. Connect your peripherals, then power up the Pi to the desktop. From the desktop, go to the main menu and click on Programming > Scratch 3, if Scratch 3 is missing we have a solution in our Quick Tip for this project! Scratch 3 has three main sections. From left to right they are: The blocks to code a project, grouped by function. These colour-coded blocks can be filtered by function. There are also tabs for costumes, to change how a sprite looks, and a tab for sounds associated to a game. The central area is the coding area, where blocks are dragged to make a project. The right section is the stage, a place where our sprite reacts to input and produces output in a project. Underneath the stage is a section to manage sprites and backgrounds. To use the Sense HAT we need to install an extension, a library of code that Scratch uses to provide extra blocks. Click on the icon on the bottom left of the screen, and a series of extensions will be offered. Look for Raspberry Pi Sense HAT, and click on it to install. In a few moments a new section of blocks will appear, and we are ready to make our first project.

H

OUR EXPERT Les Pounder is a freelance maker who works with organisations such as the Raspberry Pi Foundation to promote maker skills. He blogs at https://bigl.es.

YOU NEED Raspberry Pi 3B+ or 4 Sense HAT Latest Raspbian release Code: https:// github.com/ lesp/LXF261Scratch3SenseHAT/ archive/ master.zip

52     LXF261 April 2020

Scrolling Hello World To get used to using the Sense HAT extension we are going to create a simple scrolling name project. Firstly we need to go to the Events section of blocks and drag When Green Flag Is Clicked into the coding area. The next block is found in Sensing, and it asks a question, What is your name? Drag this block and connect it

The Scratch interface is easy to use. We have all of the projects in this tutorial together in one window.

under the previous block. The next block for this project is found in the Sense HAT section of blocks. This block is called Display Text. Drag this block and connect it under the previous one. We want to say “hello” to the user, but we also want to call them by their name. So from the Operators blocks look for Join Apple Banana and drag this over to replace the word hello in display text. Change apple to Hello (the space after Hello is important!). Then go back to Sensing and drag the Answer block and drop it on top of the Banana section of the join block. By doing this the answer to the question, “Who are you?” is saved as a variable called answer , which is then used to greet the user by their name. Click on the Green Flag icon just above the stage, and the sprite will ask your name. Type in your name and watch as your Sense HAT greets you by name.

Johnny 5 neeeed input The Sense HAT has a simple joystick that we can use for input. To test that it works we are going to write one simple project, and then one that’s more complex. The test project uses the When Joystick Pressed Up block found in the Sense HAT section. Drag this into the same coding area as our earlier code, then change the direction to push the joystick from up to centre. The next block to connect is also from Sense HAT and is Set Colour To… Change the colour to something fun! The final part of this test is to drag Display… and connect it to the previous block.

www.linuxformat.com


TUTORIALS TERMINAL

The smarter way to delete files

If you’re worried about accidentally wiping out important files, Shashank Sharma knows of a few techniques to protect yourself. eleting files is a fairly straightforward process, whether you work with a graphical interface or the command line. The former, more often than not, relegates deleted files into the trash directory, giving you the option to access deleted files and even restore them if needed. But this isn’t the case with the popular rm command. Once invoked, rm immediately flushes the specified files, skipping the trash directory altogether. To recover a file deleted from the command line, you must use dedicated software such as PhotoRec, but the process is involved and cumbersome, and not the subject of this tutorial. If you wish to permanently delete files using the graphical environment, you must press the Shift+Del key combo. You’ll be prompted with an alert seeking confirmation before the selected files or directories are deleted. This is in stark contrast to the command line, where running the rm command will delete the specified files without any confirmation prompts.

D

OUR EXPERT Shashank Sharma is a trial lawyer in Delhi. He’s pained at having to abandon the noble quest of growing a yeard (a hipster beard) after 10 months.

MAKE FILES IMMUNE TO DELETIONS If you have accidentally lost precious data because of hasty Shift+Del, we have a quick solution to prevent further mishaps. You can use chattr to change the associated attributes for a file. The default syntax is chattr [operator] [switch] [filename] . Refer to the man page of chattr for a list of all available attributes and their purpose. For now, we’re only interested in the immutable attribute, which can be used to make sure a file cannot be deleted by any command, even by a root user. Run the sudo chattr +i filename command to set the immutable attribute. You’ll find that you can no longer delete the file, and you can’t edit it either. Run lsattr filename to view the attributes of the specified file. sudo chattr -R +i <directoryname> can also be used to recursively change the attribute of all files in the specified directory. If you wish to be able to edit the file, but only wish to protect it from being deleted, you can use the append attribute instead of immutable: sudo chattr +a filename . Replace the + with an – operator to remove the attribute from a file. For instance, running the sudo chattr -i filename command will once again grant you the ability to edit or delete the file.

58     LXF261 April 2020

In this tutorial, we’ll discuss two command-line utilities, trash-cli and rm-protection, which you can use to add these functionalities to the terminal.

Trash for bash Even if your graphical environment of choice doesn’t place an icon for it on the desktop, your Linux distro already has a trash directory. The advantage of relegating files to a trash directory is that it gives you the option to view all the deleted files and even restore files, empty the trash, etc. You can access this trash directory by navigating to ~/.local/share/trash. It comprises three directories: files, expunged and info. The info directory keeps a record of the permissions, path and deletion date of each of the files. This is relevant and useful if you decide to restore deleted files or directories. You’ll find all the deleted files and folders in the files directory. The trash-cli utility adds the ability to move files to the trash from the command line. You’ll find the utility in the software repositories of many popular desktop distributions. If it’s not available for your distribution, you can follow these steps to install it from Git: $ git clone https://github.com/andreafrancia/trash-cli. git $ cd trash-cli $ sudo python setup.py install

The first command creates a directory named trash-cli in the working directory and copies the contents of the trash-cli repository. You can now run the setup.py script

While the project hasn’t seen a new release in quite some time, it works exactly as advertised, even with large files and directories.

www.linuxformat.com


TUTORIALS Digital diary Credit: http://lifeograph.sourceforge.net

LIFEOGRAPH

Create and update your digital diary

Nick Peers reveals how to create private and encrypted ‘Dear Diary’ moments to last you a lifetime (of embarrassment reading them back). ne of the biggest weaknesses of blogging – the online equivalent of keeping a diary – is that it’s so public. Sure, you can lock down your blog, but unless you’re hosting it on your own local server, it can leak online despite your best efforts. Lifeograph (http://lifeograph.sourceforge.net) is designed to provide you with a journal that’s offline and – through password-protected encryption – private. It’s clean and simple to use, but dig a little deeper into it and you can get even more from it than simple textbased scribbles.

O

OUR EXPERT Nick Peers Is still getting over the embarrassment of keeping a diary as a teenager.

First steps Lifeograph is available in the official Ubuntu repos, but the version here is likely to be outdated – 18.04 carries version 1.4.2-1, for example. For this tutorial we added

BUILD YOUR OWN THEME Lifeograph enables you to change the look and feel of diary entries using themes to define the colour scheme used. These are applied at the tag level: when you select a tag to view its properties you’ll see a section devoted to themes. Here you should be able to change the colour of selected items, whether it’s text in the case of headings and normal text, or the colour used for highlighted text, or the background of the entry itself. You can also change the font size and style too – again by clicking the appropriate option and making your choice from the menu. Once you’ve assigned a custom theme to a tag, you can quickly paste it to another one – simply select that tag, click the drop-down menu next to Theme and choose Copy From followed by your desired tag. You’ll also see a Reset To Default option on the Theme drop-down menu should you need it. Any entries that aren’t assigned to tags are themed according to the Untagged entry, which you can also customise. Themed tags are identifiable by their dotted red outline. If you assign two themed tags to an entry, the post will keep the theme from the original tag – to switch to the other tag’s theme, click its entry in the bottom pane and click Use Themes apply specific colour schemes, backgrounds and fonts to entries. Theme from the pop-up menu.

60     LXF261 April 2020

the Flatpak repository (https://flatpak.org/setup/ Ubuntu), which gave us the latest version – 1.6.1 at the time of writing – through the Software Centre. After installation, launch the program to find yourself at the main program screen, which going forward will provide you with a list of all recently opened diaries (yes, it’s possible to set up and run multiple diaries to keep various aspects of your life separate). The first time it appears, you’ll see a handy ‘If this is your first time with the program, click here to start right away’ button to create your first diary file. Choose a suitable location on your hard drive and provide your choice of filename (with .diary extension) before clicking Save. First, encrypt your diary for greater security if necessary: click the diary’s filename in the right-hand navigation pane to bring up its properties screen. Next, click the Edit button followed by the diary icon to its right to bring up a pop-up menu. Select Encrypt, then add a password – the diary will be encrypted using AES‑256, and you’ll need to enter the password to open the diary in future. As an extra security measure, Lifeograph logs you out of your diary (while saving it) after 90 seconds of inactivity – look out for the countdown timer popping up and giving you a ten-second warning (click anywhere within Lifeograph to cancel it). You can temporarily disable this by clicking the ‘v’ next to the Log Out button and clicking ‘Disable Auto Logout for This Session’. Permanently disable the feature – or change the expiry time by clicking the burger ( ) menu to the left of the Log Out button and choosing Preferences.

Lifeograph is a good repository for all those old blog posts that you want to back-up somewhere safe, away from prying eyes.

www.linuxformat.com


BACK ISSUES

BACK ISSUES

MISSED ONE?

ISSUE 260 March 2020

ISSUE 259 February 2020

ISSUE 258 January 2020

Product code:

Product code:

Product code:

In the magazine Sensing the coming of spring, we rouse ourselves from semi-hibernation with a feature full of glorious maker projects. We also look at firewalls, set beginner distros against each other, and show you how to move from Evernote to Joplin.

In the magazine As Windows 7 reaches its end of life, we opportunistically swoop in to lead you to Linux’s desktop paradise. Plus, learn the best ways to back up everything, set up an audiobook streaming server, how to build a processor, and how to use Grafana.

In the magazine We venture into the murky realm of hacking, taking a look at some of the ways hackers operate, how to prevent it, and how to set up a hacking playground. Plus, we chart the rise of Blender, look at music notation software and building micro:bit walkie-talkies.

DVD highlights Mint 19.3 (64-bit), Elementary OS v5.1 (64-bit), and BlackArch 2020 (64-bit)

DVD highlights Pop!_OS 19.10 (64-bit), Rescatux 0.37 (32/64-bit) and Bodhi 5.0 Lite (32-bit).

DVD highlights Kali Light (64-bit), Fedora 31 (64-bit), and MX Linux 19 (32-bit).

ISSUE 257 December 2019

ISSUE 256 November 2019

ISSUE 255 October 2019

Product code:

Product code:

Product code:

In the magazine Tired of a laptop that’s slow off the mark? Discover how to make Linux lighter and faster. Also, bring deleted files back to life, quickly edit videos, create great HDR photos with open source tools, and create smaller apps with React.

In the magazine That dastardly Google, eh? Escape its data-guzzling clutches with our complete guide to open-source alternatives. Plus: get full Linux on your Android device, enhance your audio tracks with Audacity, optimise your media libraries and code in ZX BASIC!

In the magazine The new Mint is here, and we’ve got your complete guide to using it. Plus: how to transfer data from Pi to PC (and back), more Linux-on-Android fun, managing your apps, calling Linux services from your code, and a peek at Google’s Fuchsia OS.

DVD highlights Ubuntu 19.10 (64-bit) and NixOS 19.09 (32-bit).

DVD highlights Puppy Linux 8.0 (64-bit) and LXLE 18.04.3 (32-bit).

DVD highlights Mint 19.2 Cinnamon (64-bit), Mint 19.2 MATE & Slax 9.9.1 (32-bit).

LXFDB0260

LXFDB0259

LXFDB0257

LXFDB0256

LXFDB0258

LXFDB0255

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

Quote the issue code shown above and have your credit or debit card details ready 64     LXF261 April 2020

www.linuxformat.com


£10

SUBSCRIPTION OFFER FREE DIGITAL MAGS!

SUBSCRIBE TO

LINUX FORMAT

10

for €/$/£

and get a selection of digital tech mags for FREE!

www.myfavouritemagazines.co.uk/lin/intt10 Offer available to EU, US and ROW subscribers *Terms and Conditions: This offer applies to all new subscribers. This offer entitles new subscribers to their first quarter of issues for £10, €10 or $10 dependent on location. After these issues, standard subscription pricing will apply – please see online for details. Offer applies to print subscription only for iCreate, Linux Format, MacFormat, T3, What Hi-Fi?, Windows Help & Advice. You will receive an email after your purchase with a downloadable link to your free digital magazines. Prices and savings quoted are compared to buying full-priced print issues. You can call us to cancel your subscription within 14 days of purchase. Payment is non-refundable after the 14 day cancellation period unless exceptional circumstances apply. For full terms and conditions please visit: www.bit.ly/magterms. Offer ends April 30th 2020.


TUTORIALS Digital signal processing Credit: www.gnuradio.org

GNU RADIO

Part One!

An electronics lab on your desktop

Don’t miss next issue – subscribe on page 26!

Sean Conway will install in your wetware the foundational knowledge to use GNU Radio on an Ubuntu system – like an electronic hacking pro! e’re going to take an in-depth look into the instructions for installing and using the GNU Radio software on a standard Linux desktop. GNU Radio is an open-source software development toolkit (SDK) that replaces physical test equipment and electronic circuitry – usually found in an electronics labs – meant to generate and/or process analogue signals. It can simulate the audio source in software and then play the audio tone from the digital source using the PC’s sound output: no need for the audio generator and breadboard circuits! We’re going to install GNU Radio on a computer running Ubuntu 18.04 and provide the basic knowledge

W

OUR EXPERT Sean D. Conway This retired Senior IT Security Specialist loves to dabble in tech.

Let’s explore GNU Radio… 1 3 2

5

4 Toolbar Flow graph controls. Some key functions are managing flow graph files and starting and stopping flow graphs.

Terminal Shows messages from flow graph executions.

Workspace The area in which you place blocks to create a flow graph.

Block Property Displays a table of defined blocks IDs and their variables.

1

2

Library A listing of all the blocks that are installed on the system, with categories.

3

66     LXF261 April 2019

4 5

required to construct an analogue audio circuit with the software. From a command line, enter the following commands to refreshes the OS to ensure all repositories and software loads are current. After a reboot, it installs the GNU Radio application: $ sudo apt-get update -y;sudo apt-get upgrade -y $ sudo reboot $ sudo apt-get install gnuradio gr-osmosdr

The core of GNU Radio is written in C++ using floating-point processor extensions for critical signal processing paths. This provides a real-time, high throughput radio system. Additional functionality is provided using Python. The user interface for GNU Radio is the GNU Radio Companion (GRC). The terms are GRC and GNU Radio are often used interchangeably, but to avoid confusion, GRC is the graphical tool used for creating and generating the flow graph source code used by GNU Radio. GRC is bundled with the base install.

Radio GUI GUI GRC can best be described as a GUI console for GNU Radio. If GNU Radio’s software version changes, the console may or may not change also. The console packaged with GNU Radio version 3.7.11 is divided into five areas: Toolbar, Workspace, Library, Terminal and Block properties (see Let’s explore to the left). Before using the software, let’s get familiar with the terminology and then explore some basic concepts to better understand the user interface. GNU Radio uses flow graphs for all signal processing, which are constructed using blocks. For this tutorial we will use blocks native to the software. Writing new blocks is encouraged in the community, and this can be done using C++ or Python, with plenty of resources available for those up to the task. A flow graph after construction can be edited, saved and recalled for future use. These files are saved with a .grc extension. Sharing flow graphs is similar to sharing files containing blocks of code. They can be expanded on, or combined with other flow graphs to build more complex circuits. Blocks are the basic building units in GNU Radio. A block typically performs a single digital processing function. Creating multi-processing blocks is not

www.linuxformat.com


TUTORIALS Zabbix monitoring Credit: www.zabbix.com

ZABBIX

Enterprise-grade monitoring made easy Manage an enterprise as Stuart Burns introduces Zabbix, a free, scalable monitoring tool that is lightweight and extremely easy to use. abbix is an extremely lightweight, easy-to-use and free monitoring tool that can scale from a small home lab to a huge multinational company. Zabbix can help monitor and highlight issues in the reader’s environment through a single application, making life easier. Even companies such as T-Mobile and Dell use it to manage parts of their estate. Here we look at the functional pieces that make up the product and how to deploy it across your environment in a test scenario, whether that be a small home lab or a company. It can even monitor your cloud servers, should you want it to. It should be noted that this walkthrough does not address the security of the system – for example, encryption during data transmission or database security. While it may not be obvious how a small home lab could benefit from such monitoring, try this real-life example: your internet goes offline… what time did it occur, how long did it last? What was the impact on other systems? If Zabbix was set to monitor uptime by pinging the device, this information would be recorded. That is but one trivial example. For smaller companies, a free but extremely capable monitoring system can make the difference between a well-managed IT environment and a disruption causing outage. For the purpose of this guide it is assumed that the reader is able to set up basic servers and DNS.

Z

OUR EXPERT Stuart Burns is a Fortune 500 administrator and small business owner specialising in high-quality IT content. He wears many hats and loves to delve into technology and simplify it.

The Zabbix installation wizard, making the setup easier.

Although most of the Zabbix site seems to prefer Cent OS, this demonstration is going to use Ubuntu 18.04 LTS. Make sure to give the server a static IP address so that the server is always on the same IP address, or it will cause problems, i.e. it changes and causes agent connectivity issues. Create an Ubuntu server VM with 4GB RAM, two CPU cores and 60GB of disk space, install Ubuntu and reboot. At this point the reader should be able to SSH into the server using your credentials. For this proof of concept using a single disk is OK, but in a production environment it is strongly be recommended to have the SQL DB and other Zabbix data items on the second disk to prevent any potential out-of-space issues. It’s recommend you create another virtual machine with Apache installed and running it, so that it can be used for experimentation.

The software stuff Time to locate the appropriate repository links from Zabbix. It is quite straightforward. If you visit the Zabbix download page (www.zabbix.com/download) you will be able to tailor the download with OS versions, Zabbix versions etc. if you don’t want to use the same configuration. To save the work, the code below shows all the requirements to install items required for our Ubuntu server. Install the repository by using the following command: wget https://repo.zabbix.com/zabbix/4.4/ubuntu/pool/ main/z/zabbix-release/zabbix-release_4.4-1+bionic_all. deb sudo dpkg -i zabbix-release_4.4-1+bionic_all.deb sudo -- sh -c ‘apt-get update && apt-get install zabbixserver-mysql zabbix-frontend-php zabbix-apache-conf zabbix-agent -y’

At this point the Zabbix application and dependencies are installed, but there is not yet a database configuration. The next step is therefore to create the MySQL database, a user for that database and then assign the rights and then import the database configuration that was downloaded. Once done, start the MySQL client by using the command sudo mysql -p: create database zabbix character set utf8 collate utf8_ bin;

70     LXF261 April 2020

www.linuxformat.com


TUTORIALS Containers

DOCKER

Adding a reverse proxy to Nextcloud

Part Two!

Catch up and grab a back issue on page 64

Add a Traefik reverse proxy to your Nextcloud Docker deployment with a little bit of guidance from Chris Notley. f you followed part one of this tutorial (it’s on the archive, https://linuxformat.com/ archives, available to all) you should have a working install of Nextcloud running in a Docker container, along with a supporting container running MariaDB. Assuming you configured port forwarding entries on your router, you should also be able to access this Nextcloud server from outside your home network. This is great, but one of the main advantages of using Docker is that it’s really easy to add extra containers; however, only one of these can listen on a given TCP port (such as TCP/443, for secure web connections). One solution is to configure port forwarding entries for each container (such as TCP/443 for Nextcloud, TCP/444 for a wiki, etc.). This approach has a number of problems, not least that some locations might block your access to non-standard web ports; many corporate or educational networks limit access to TCP/80 and TCP/443, for example. Another way to solve the problem is to use a reverse proxy, which is a service that listens for web requests (e.g. TCP/80 or TCP/443), and then retrieve the requested content from Nextcloud, wiki or similar. Reverse proxies have been around for a long time, and the two most popular web servers (Apache and Nginx) can both work this way. For this tutorial we’ll use a tool called Traefik (https://containo.us/traefik), which is an open source edge router; it offers both traditional reverse-proxy services, along with many other features. Among its many impressive features, Traefik is Dockeraware (as well as many other container platforms), meaning that it can discover containers automatically, and you can configure it using the same dockercompose tool we used in part 1 of the tutorial. Before we dive into the configuration, the focus of this tutorial is exposing Nextcloud to the internet securely using a free SSL certificate from Let’s Encrypt (see the Let’s Encrypt boxout on page 75 for more information). To work through this tutorial you are going to need the following: Either a DNS domain that you can control (for example, registered to you, one you can edit DNS records for) or a free DNS service such as Duck DNS that will let you create and update records (for example, some-hostname.duckdns.org).

I

OUR EXPERT Chris Notley runs a technology consultancy in Surrey with an interest in opensource software.

During part two of the tutorial our dockercompose.yml file has grown in size and complexity. If you want to save typing in each line, scoot over to the project Github respository at https://github. com/prel-im/ lxf261, where you will find a final version of the file. Remember to change the hostnames for your environment!

74     LXF261 April 2020

Updating containers is easy with docker-compose pull – one command checks for any updates to the images we are using and pulls them down automatically.

Port-forwarding and/or firewall rules configured on your router to route web and secure-web traffic (TCP/80 & TCP/443) to your Docker host from the internet. Detailed instructions on the above requirements are beyond the scope of this tutorial; however, an internet search will quickly provide you with answers. Throughout this tutorial a test domain (prelim.xyz) was used, with a wildcard DNS entry pointing at the router’s external IP address (i.e. *.prelim.xyz points at the external IP address of the router). This approach is easiest if you have a spare or test DNS domain, but as long as you can configure a fully qualified domain name to point at your router’s IP address, it will work. The schematic in this article shows how traffic flows through the solution and might help if you are unfamiliar with a reverse proxy.

That’s Traefik Before we do anything else, let’s check to see if there are any updates to our container images using the command docker-compose pull . We now need to update our Nextcloud container so that we stop forwarding TCP/443 on Docker host to the container. Edit your existing docker-compose.yml file and locate the Nextcloud container configuration, changing the ports section as follows: ports: - 9443:443

You should then apply the configuration using the command docker-compose up -d, which will spot the

www.linuxformat.com


TUTORIALS System logs

LINUX LOGS

Manage and read your system logs Mats Tage Axelsson takes you through the basics and then digs a little deeper into log management and analysis. inux gives us a very stable and secure system – that’s why we use it. It’s this sort of attitude that makes you get arrogant and start ignoring weaknesses and threats. When you are working on documents, programs, graphics, or anything really, your system is writing to logs. In these logs, there is information that tells you how the system is running and, most interestingly, what is going wrong. Big parts of these logs do not wreck the system, nor do they create serious problems. However, if you see and can correct small things, it can have a substantial impact on your system performance. You can also prevent a sudden crash by being ahead of bad behaviours on your system. With this in mind we’re going to learn about the logs you should monitor to keep your system in top shape. For most users, even advanced ones like you (who me? <blush> – Ed) the install comes from a distribution medium, and some tools are installed by default. The most basic way to check your log is using cat, less or grep, in any combination that takes your fancy. A method like that combined with dmesg will get you there. However, there are many other tools you can use. With systemd, you can use journalctl to check logs, which is the primary tool for this. For a graphical solution, search your repositories for Log File Viewer. You get a listing of all your logs with a view pane on the side. The most common log files are in /var/log. List the files in that directory to see what you have installed. If you’re handy with regular expressions, investigate all these files from the command line. These files are the ones your system uses traditionally. The big difference comes when you have systemd, as that has a database that you can query with journalctl. The original files are still there and used by systemd, but you have enhanced tools to look through your logs. You will see more tools to help you keep your system on a tight leash.

L

OUR EXPERT Mats Tage Axelsson is still showing you how to make your life and work a more pleasant experience.

Before you start using all the tools, learn a few grep tricks, they will help you use more advanced tools. The simplest is to look for the word in all files; grep -r memory / var/log . You

will then have a result full of memory events.

78     LXF261 April 2020

Log! .log! log! You need these tools to find out why you have strange system hangs, as these can be really hard to track down. At a hang, you don’t have a specific fault situation or crash. This means you have no crash dump or an obvious fault. Instead, you need to see what happened

You have a utility called syslog from the GNOME project where you can set filters for your viewer to narrow down the results.

during a specific time period. You will need to filter and sort your results so that you know you are looking at the current issue and nothing unrelated. Applications acting strange is another issue. They may not crash or cause a fault that you can pinpoint, but you still wonder why you have to go through many steps to save a file. Those situations require a lot of digging in to log files and most likely contact with developers. For developers to have any chance of helping you, you absolutely must provide logs and ways to reproduce problems. Many issues can look similar, so describing and logging is essential to getting to a conclusion of how to deal with a problem. When the network is working but some sites break occasionally, you need to identify what feature you are using that isn’t working. This can be rather complex, because there are many protocols that are in use over the internet.

Spotting hardware failure When your hardware is getting old, it keeps going for as long as possible. A hard disk can crash unexpectedly, but you have a chance to be prepared if you can find logs that point to read errors. The system works around many errors, so you may not notice until it is impossible to save that data, rather sub optimal. When you’ve gone through this article, you will know enough to identify issues before they cause real problems. In the aftermath of a serious crash, many people think that they should have had a backup – don’t

www.linuxformat.com


HOTPICKS THE BEST NEW OPEN SOURCE SOFTWARE ON THE PLANET

HotPicks

Alexander Tolstoy thinks that global warming isn’t that bad because it helps make his open source picks even hotter!

Tartube AwesomeBump UserManager Minase Tutanota JSPaint ScreenGrab Tower Time Rygar Hardinfo Fileinfo GUI FOR YOUTUBE-DL

Tartube

Version: 1.3.048 Web: https:// github.com/axcore/tartube

outube-dl is one of the most important CLI tools for everyone fond of downloading videos from YouTube. The Youtube-dl repository on Github is flourishing with hundreds of contributors and thousands of commits. No wonder that many video players often integrate this utility to provide an extra feature of playing media ‘directly’ from YouTube (though the content is silently downloaded first). There is no visible lack of graphical frontends to Youtube-dl, but we think we have found the most advanced and complete one – Tartube. This application is based on Python and GTK3, and it provides a clean and developed interface for managing videos. In particular, Tartube can sort your downloads in several folders, download whole channels and playlists, and lets you define many, if not all, youtube-dl options. Most people use this CLI tool just to fetch the local MP4 file from a given URL, but youtube-dl can do much more, and Tartube even helps you to find new videos. In fact, Tartube lets you completely avoid using a web browser once you have the URL for a channel or a playlist. You can discover the list of videos before downloading anything, customise download options globally or individually for any video, preview videos on Hooktube (an alternative web client for YouTube), run your own Favourites list and more. Tartube can even run a fully-fledged media library with integrated search, and that applies to more than just YouTube, as youtube-dl supports dozens of other web services too (bit.ly/2NVU0s4). This grants users a superpower they can use without entering a single command! Find a video-hosting site and then use Tartube to grab all the videos that match your filter and upload date with ease and added convenience. Install and run the application this way: $ sudo python3 setup.py install $ cd tartube && python3 tartube Before downloading, go to the Progress tab to set max downloads, limit speed and specify video quality.

Y

82     LXF261 April 2020

Discover new videos in your favourite channels without accessing the YouTube website at all!

Discovering the Tartube interface 3 4

1

2 5

Organise videos in folders There are five pre-defined folders, plus you can add your own using the Folder button on the toolbar.

1

Explore the current list of videos Decide which items from your channels or playlist will be downloaded, or play videos that are already on your computer.

2

Main features within reach Tartube has another toolbar that acts like a ‘ribbon’ and shows all important actions.

3

Set system preferences Tartube has two configuration panels. The one highlighted here defines global things such as back-ups, language, download scheduling, etc.

4

Adjust download options You can set up the video format and quality, manage subtitles, change file naming rules and other general download options for Tartube from here.

5

www.linuxformat.com


CODING ACADEMY CODING ACADEMY LibreOffice Calc

LIBREOFFICE

Using Calc for serious mathematics work

Mike Bedford suggests that – in a change from its more common business use – LibreOffice Calc offers much to the scientific and mathematical user. longside the word processor and presentation software, the spreadsheet forms the mainstay of business computing – and for good reason. Spreadsheets enable business users to do many tasks quickly that would otherwise require either several dedicated applications or coding. However, we’d like to propose that it does the spreadsheet a massive injustice to suggest this is the limit of its potential. In fact, we’d go as far as to say that it is also a very powerful tool for mathematical and scientific computing. As a high-level scientific calculator it has so many uses. Here we’re just scratching the surface, but it could be used for quite complex calculations in science or engineering, and for trying out ideas in a range of scientific disciplines. A particular strength is graphics, so we can imagine it being used to show experimental results graphically – by students for use in projects and coursework, by teachers for use in handouts, by researchers for preparing illustrations for use in academic papers, and by scientific authors for use in books and articles. Here we’ll be focusing on applications that have a graphic element, if for no other reason than it provides us with more attractive-looking screenshots. We’ve categorised this article as inspirational. By this, we mean that our aim here is to give you a better view of LibreOffice Calc’s potential for scientific use, even though, in some cases, our example workbooks aren’t particularly difficult to create. The chances are that your

A

OUR EXPERT Mike Bedford despite his experience with programming languages and scientific calculators, commonly uses the humble spreadsheet for problem-solving in maths, science and engineering.

LibreOffice Calc provides lots of options for formatting charts. Included here are line styles, thicknesses and colours, marker types, sizes and colours, axis formatting and so much more.

88     LXF261 April 2020

An unusual example of an XY plot is the generation of the Sierpinski Triangle using random numbers.

needs will be different from the requirements addressed by our examples, but we trust that once you’ve stared to see the humble spreadsheet in a new light, your creative juices will begin to flow. This tutorial will be particularly useful for readers who don’t code, but even for coders, this will prove to be a quicker way of doing a job in many cases. And on the subject of programming, although spreadsheet applications usually have built-in programming languages that can be used to write macros, no part of our main example exercises use this facility. This is in recognition of our view that if you’re going to write some code, you might as well use a more conventional programming language. That is something of a simplification, however, so don’t lose sight of the fact you could still make use of a spreadsheet, even if you have to write a short macro. Indeed, we suggest one such exercise as a closing example, although we leave it mostly to you to figure out how to do it. Oh, and finally before making a start, we’re assuming that you are familiar with using spreadsheets, even if not for this sort of application. If that is not the case with you, you would be well advised to get up to speed on the basics first.

Mathematical functions LibreOffice Calc’s trigonometry functions and its charting capabilities make it easy to illustrate the concept of the Fourier Series.

In the realm of business use, rarely is the requirement for maths any more complicated than the common arithmetic operators of add, subtract, multiply and

www.linuxformat.com


On the disc

DOWNLOAD YOUR DVD Get

code and DVD images at: www.linuxformat.com /archives

Discover the highlights from this month’s packed DVD!

START HERE USING THE LXFDVD

Using Linux for the first time can be very confusing. It’ll be unlike anything that you’ve likely operated before, especially if you’re used to Microsoft Windows or Apple macOS. Generally our DVDs are designed to be run directly, which is to say that when you first power on your PC (or Mac) it should ‘boot’ from the DVD – so before Windows or macOS even starts to load – with Linux running directly from the DVD. This trick is known as a Live Disc. It enables you to try out the various versions of Linux without having to install or change anything on your PC. Just remove the DVD, restart your PC and it’ll be exactly as you left it. While many systems will boot from a DVD when it finds one, many will not. See below for the standard process for enabling booting from a DVD on various desktops and laptop PCs. The alternative option is to locate the ISO file on the DVD and write this to your own USB thumb drive and attemp to run that. We recommend using Etcher from https://balena.io/etcher that’s available for Windows, macOS and Linux. Good luck!

FOR GRUMPY TEENS REC. SPECS: 2GB MEMORY, 10GB DISK

Solus 4.1 olus is an independent distro that first appeared in 2012. Since then it has brought many innovations: its own Budgie desktop (with its gothically titled Raven sidebar), the Steam Linux Integration tool (sadly now defunct), its bespoke package manager (eopkg) – and it has also nurtured an enthusiastic community. It’s been nigh on a year since Solus 4.0 (Fortitude) was released (see our review in LXF250), so we were excited to see what’s new in this update. Solus is popular with gamers, and this new release comes with the widely discussed ESync fixes streamlined, and support for third-gen Ryzen processors plus new GPUs from AMD and Nvidia. Besides the new kernel (5.4.12) there’s also updated Mesa (19.3.2), and gtreamer (1.16.2) packages, as well as various multimedia improvements. All of which should contribute to a slick audio-visual experience. In line with other distros Solus now uses zstd compression for the Live disc. So, on an even modestly fast machine, you’ll notice the Live environment is more responsive and find the installation process much quicker. It will probably take you longer to answer the

S

BOOT THE DISC

Many PCs should boot automatically if they’re turned on with a disc in the drive. If not, many offer an early Boot Menu accessed by tapping a key while powering up from cold: F9 (HP), F12 (Dell, Lenovo), F8 (Amibios) or F11 (Award BIOS). Alternatively, use the BIOS/UEFI to adjust the boot order to start with the optical drive. Again, this is accessed by tapping a key during power up, usually Del but sometimes F1 or F2. Some new UEFI PCs require access via Windows: holding Shift select its Restart option. If you’re still having problems using the DVD visit: www.linuxformat.com/ dvdsupport Mac owners: Hold the C key while powering on your system to boot from the disc.

96     LXF261 April 2020

64-bit

There are many beautiful backgrounds with Solus, and this tiny picture will never do them justice.

Nevermore be bothered by lack of easy to access volume and playback controls. Nevermore!

Calamares installer’s simple setup questions than it will to copy onto the target drive. You’ll find everything you need to get started is installed, with a bare minimum of cruft. Solus follows a rolling release model, so if you already use the Budgie edition your system will automatically receive this update. If not you’ll find Budgie 10.5.1 a pleasure to work with. It has a stylish dark theme with which the bundled applications all integrate beautifully, a traditional menu and a distinctly non-traditional but eminently useful sidebar. Raven combines an applet area, for calendars and configuration widgets, with a notifications area. It’s a slicker solution than an overcrowded system tray whose residents occasionally interrupt you. We were told the next version of Budgie would be based on Qt, but this may no longer be the case, with Experience Lead Joshua Stobl last year suggesting the project would likely use GTK4. Either way we’re already excited for Solus 5.0. There’s also a new Plasma-based Solus 4.1 edition too (as well as new Gnome and MATE editions), which almost went on the disc, but our disc replicators told us too much Plasma on the disc could cause atomic instability.

IMPORTANT NOTICE!

DEFECTIVE DISCS: For basic help on running the disc or in the unlikely event of your Linux Format coverdisc being in any way defective, please visit our support site at www.linuxformat.com/dvdsupport. Unfortunately, we’re unable to offer advice on using the applications, your hardware or the operating system itself.

www.linuxformat.com


AND MORE! OOH LALA!

THE LXF LIBRARY

MIN SPECS: 2GB MEMORY, 10GB DISK

OpenMandriva Lx 4.1 easoned readers will fondly remember Mandrake Linux from back in the day: a French distro that had the audacity to make Linux easy (well, easier, anyway). Mandrake became a cosmopolitan fusion when it merged with the Brazilian distro Conectiva Linux to form Mandriva Linux in 1998, a distro that lasted until 2011 – whereupon most of its developers joined the Mageia project via the Russian ROSA Linux fork. However, Mandriva lives on in the form of OpenMandriva Lx, and like its globe-spanning lineage before, it offers a stylish take on the KDE desktop and lots of features to make users happy. This latest release, which pleasingly has the same version number as Solus, is codenamed Mercury. OpenMandriva’s friendly welcome application helps introduce new users to the OS and puts various configuration options and common postinstall tasks within easy reach. This is quite handy on KDE because there are a number of places for such things to hide. One of OpenMandriva’s most standout features is its selection of desktop themes. It can be made to look like Windows, Ubuntu or macOS, and has

S

64-bit

a more stock take on the KDE Plasma desktop than its own theme. The latter is, like Solus’ Budgie theme, a dark affair. OpenMandriva is unusual in that the vast majority of its packages are compiled with LLVM-Clang which may offer increased performance, but mostly makes life easier for developers compiling for multiple architectures (Arm releases are available, and a RISC-V port is on the way). Under the bonnet it offers a bleeding-edge 5.5 series kernel, as well as the option to install a Clang-compiled kernel, which you can easily use to test the improved performance claim. If you have a new AMD processor, you’ll want to download the special znver1-optimised build of the ISO, which better exploits the capabilities of such hardware. The distro switched to Fedora’s DNF package manager with the 4.0 release, and includes its half-sister Mageia’s dnfdragora frontend for managing this. Packages are zstd-compressed so installation of new ones is very quick, and you can test this by installing popular applications from the Welcome screen. You’ll find everything you need is ready to go though.

dvanced Bash A Scripting Guide Go further with shell scripting. ash Guide for Beginners B Get to grips with the basics of Bash scripting. ourne Shell Scripting B First steps in shell scripting. he Cathedral and T the Bazaar Eric S. Raymond’s classic text explains the advantages of open development. he Debian Book T Essential guide for sysadmins. ive Into Python D Everything you need to know. I ntroduction to Linux A handy guide full of pointers for new Linux users. inux Dictionary L The A-Z of everything to do with Linux. inux Kernel in a Nutshell L An introduction to the kernel written by master hacker Greg Kroah-Hartman. he Linux System T Administrator’s Guide Take control of your system. ools Summary T Overview of GNU tools. NU Emacs Manual G Six hundred pages of essential information! roducing Open P Source Software Everything you need to know. rogramming from P the Ground Up Take your first steps.

Not everyone’s into making Linux videos, but if you are, OpenMandriva includes SimpleScreenRecorder.

NEW TO LINUX? START HERE…

9000

Never used a Linux before? Here are some handy resources: Read our quick-install guide http://bit.ly/LXFinstall Looking for an answer? https://askubuntu.com Want to delve more deeply? https://linuxjourney.com

www.techradar.com/pro/linux

April 2020 LXF261     97


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.