VALVE STEAM DECK REVIEW The Linux-first PC gaming handheld is put through its paces
GIMP photo-editing tips, tricks and filters
The #1 open source mag Use theas Pi 400aily your d p! deskto
ESSENTIAL
Pi PROJECTS Become a master maker as we guide you step-by-step through the key code and builds
5
HOW TO
apture and edit C satellite images Get started coding with secure Rust Relive your ARM Archimedes days
How to get the most random of numbers
WEB ARCHIVE IT
Build your own website archiving server today
FILE EXPLORER
It’s the greatest terminalbased file manager ever!
LXF May 2022
TRULY RANDOM
BEST VIDEO SHARING SERVICES
Contents REVIEWS
Bluehost web hosting
21
There’s nothing more that Mike Williams enjoys than a feature-packed hosting package geared towards WordPress.
Valve Steam Deck
22
24
In what seems to have become a trend, just when he gives up hope, a project surprises Mayank Sharma with a new release.
Absolute Linux 15
ESSENTIAL Pi PROJECTS
The Steam Deck can’t yet play every game on Steam, but it’s a great handheld gaming PC system nonetheless, says Wes Fenlon.
OpenMandriva Lx 4.3
SUBSCRIBE NOW! Page 16
25
It’s Pi-time we got down to some steaming hot Raspberry Pi projects, says Jonni Bidwell. The fun starts on page 36!
After willingly burning his fingers with Slackware 15, Mayank Sharma tries a derivative that promises a healing touch.
Slax 11.2
26
The portable distro doesn’t often update, but its many users – including Mayank Sharma – are always after new versions.
MassOS 2022.03
27
Independent Linux distros will always have Mayank Sharma’s admiration, even if he has trouble grasping their raison d’etre.
Dead Cells
ROUNDUP
TOP OF THE FOSS
28
Management say you have to keep working even after death. Chris Thursten isn’t impressed by their rogue-like attitude.
Social video websites Michael Reed takes a look at websites that combine video hosting with social networking tools, while comparing free and paid-for options.
4 LXF288 May 2022
30
Finding equi-Libre-um
54
You might think LibreOffice is popular enough to not need assistance from the open source community. Time to think again, discovers Jonni Bidwell…
www.linuxformat.com
CONTENTS TUTORIALS
Pi USER Raspberry Pi news
TERMINAL: Super file manager
46
58
Introduced by Tom’s Hardware’s Les Pounder. The Raspberry Pi makes it into space, again. The Raspberry Pi goes underwater, again and happens to do some retro computing, again!
The problem of plenty has long plagued GUI managers where many tools offer similar features. Shashank Sharma recreates the situation on the CLI, using nnn.
MX-Linux Pi Beta
Nick Peers reveals how the G’MIC plugin can transform the way you repair and enhance both photographs and videos with hundreds of fresh new filters.
GIMP: G’MIC photo filters
47
Les Pounder dusts off that old 1GB Raspberry Pi 4 to test-drive a lightweight, yet surprisingly configurable alternative to the official OS.
Send sensor data to Twitter
EMULATION: Acorn Archimedes
48
64
Les Pounder heard that mighty oaks grow from little acorns, but all he found was a Raspberry Pi and an Arm – the CPU sort – buried in the garden.
Les Pounder can’t make it to outer space, but he can broadcast the temperature while he’s sat at his earthbound desk!
Daily Pi 400 desktop use
60
50
How capable is the Pi when it comes to carrying out day-to-day computing tasks? Michael Reed powers down his x86 desktop to find out…
CODING ACADEMY Code secure tools in Rust
ASSISTANT: Home automation
90
Make yourself comfortable, as Mihalis Tsoukalos explains the basics of Rust, so you can write memory-secure system utilities for Unix systems.
Discover the V language
GIMP: Satellite image processing
94
There’s nothing Mihalis Tsoukalos enjoys more than a single-letter programming language, so let’s code some command line tools in V and other Hello World tasks.
REGULARS AT A GLANCE 6
Subscriptions
18
Google bigs up the Linux security dev work, a new boot system for Arm systems, ditching Russian CPUs, Dirty Pipe exploit, Ubuntu on Framework and Pipewire a year on.
Get your monthly Linux dose and save cash!
Kernel watch
Overseas subscriptions
Answers
10 12
Backing up Thunderbird files, GRUB and hardware boot issues, capturing error logs, buying a new system, trying to get people to shutdown systems and how to use pipes.
Mailserver
16
We discover another classic computer system and talk about MSX tapes, we’re still mourning the loss of the DVD and discuss how awful the editor is, text editor that is.
www.techradar.com/pro/linux
72
Satellite photos are familiar, their underlying technology less so. Mike Bedford reveals how to process their spectacular images.
LXF SERVER: ArchiveBox
News
68
Matt Holder continues to extend his smart home project with Home Assistant’s Automations and Notifications to make our homes respond to our human activity.
Back issues
20
76
David Rutland maxes out storage on the LXF VPS by archiving as much of the internet as he can get his hands on – keeping it safe for future generations.
IN-DEPTH
Get hold of previous Linux Format editions.
29
Get Linux Format shipped around the globe.
HotPicks
84
Alexander Tolstoy doesn’t have a worry in the world about the Ruble being worthless, he’s too busy stocking up on basic essentials and amazing free software like Falkon, Zapzap, Scribus, Detox, Notepad Next, Whoogle Search, Qxkb5, Freeciv, Gbajs2, Rembg and Lector.
Next month
98
Truly, deeply, randomly
80
Random numbers are essential but they’re not as easy to generate as we might think. Mike Bedford takes us on a journey through the murky world of randomness.
May 2022 LXF288 5
Newsdesk
THIS ISSUE: Linux devs do well Faster ARM booting Russianmade CPUs sidelined Dirty Pipe exploit Ubuntu on Framework
DEVELOPERS
Google praises Linux devs’ response times Google Project Zero says Linux developers are quickest to react to security threats. oogle Project Zero, a team of security researchers at the search giant, has released a new blog post (which can be read at https://bit.ly/lxf288gpz) detailing how fast various businesses have responded to security vulnerabilities between January 2019 and December 2021, and the results are particularly flattering for Linux developers. According to Google Project Zero’s data, 96 per cent of security issues were fixed by Linux developers before 90 days. This is the standard deadline that Google Project Zero gives companies once it’s passed on a bug report. This is the highest percentage out of the companies listed by Google Project Zero, narrowly beating Google itself, which fixed 95 per cent of security issues by day 90, and a lot higher than Apple (87 per cent), Mozilla (90 per cent) and Microsoft (76 per cent). Oracle performed particularly poorly. Despite having the fewest bugs, its developers only managed to fix 43 per cent of them within the 90-day deadline. Linux devs also had the best score when it came to average days to fix (25), with Google on 44, Apple on 69, Microsoft on 83, and Oracle on a rather poor 109. Over the three years that Google Project Zero’s report covers, Microsoft, Apple and Linux have all reliably reduced the average time they take to fix bugs. In 2019, it took Linux developers an average of 32 days, but by 2021 this number had been reduced to 15 days. The number of bugs reported also fell, which hopefully points at the increasing resilience of the operating system.
G
6 LXF288 May 2022
In the report, Microsoft is called out for often relying on the 14-day grace period that companies are given after the 90-day deadline. It was the company that used this grace period the most, which the Google Project Zero team puts down to Microsoft’s monthly Patch Tuesday, where major security updates are released. Increasing the frequency of these releases throughout the month, the Project Zero team suggests, could help Microsoft avoid relying on the grace period. Overall, this report highlights how good Linux developers are at working on and implementing
Google Project Zero is a team of security researchers that pass on bug reports to software developers.
LINUX DEVS LEAD THE WAY “This report highlights how good Linux developers are at working on and implementing security fixes.” security fixes once they’ve been found. As many people in the community have pointed out since this report was published, many Linux devs enjoyed more freedom compared to those involved in commercial software, whose time may be taken up by meetings and other distractions. That freedom for Linux devs means they can spend more time actually developing, while prioritising and fixing issues as they occur, providing yet another benefit for communitydeveloped open source projects.
www.linuxformat.com
ANSWERS
Answers
Got a burning question about open source or the kernel? Whatever your level, email it to lxf.answers@futurenet.com Thunderbird Q Unlocking My computer is running Ubuntu
20.04.03, and Thunderbird is the latest from Ubuntu’s repositories. When I copy my home folder to an external drive I get this error message: cp: cannot create symbolic link ‘/media/ Bryan/Black/.thunderbird/z5xncqsm. default/lock’
This is the relevant part of my backup script. cd /home/bryan cp -u -r * /media/Bryan/Black cp -u -r .thunderbird /media/Bryan/Black
The lock file referred to is generated whenever Thunderbird runs, so deleting the lock file doesn’t solve the problem. Bryan Mitchell
A
Lock files are used by software to indicate that they’re already using a directory. In the case of this file, it tells Thunderbird that an instance is already running, so if you try to run Thunderbird again, it opens the existing instance instead. Lock files tend to be read-only, so copying one with permissions intact won’t work. In this case, Thunderbird creates a symbolic link to a non-existent file, hence the inability to copy it.
You’re not using the best tool for this job in cp. You don’t want to copy, or try to copy, everything. Even with -u it’s far from ideal. A better tool is rsync, which synchronises two directories, copying just what’s needed. It’s also able to copy only the parts of files that have changed, so a small change to a large file doesn’t need a wholesale copy. To back up your entire home directory, you only need: $ rsync -a /home/bryan/ /media/Bryan/ Black/
Note that the trailing slashes on the directory names are important. This will still try to copy your lock file, but rsync has an option to exclude files: $ rsync -a --exclude="lock” /home/bryan/ /media/Bryan/Black/
This will skip all lock files. Unlike your cp command, rsync will try to sync everything, including files and directories starting with a dot, which is why you no longer need a separate line for .thunderbird, but you may wish to add extra --exclude items to omit some of these. Using rsync like this continues with another possible disadvantage of your current script: files that were deleted from home will stay in the backup directory. If you don’t want this, add the --delete
Thunderbird, like many other programs, uses lock files. These are files your backup software should avoid copying.
12 LXF288 May 2022
Neil Bothwick fixes nonfunctional FOSS – fast!
option to your rsync call. Alternatively, you may prefer to use a backup program to handle all the details for you. Something like rsnapshot (www.rsnapshot.org) or Borg (https://borgbackup.readthedocs.io) may be a good place to start.
hardware Q Edgy About a year ago I bought a Dell GS5, which uses Linux Mint 20.3 Cinnamon, kernel version 5.4.0.96, and is equipped with an AMD Ryzen7 4800H with Radeon Graphics (AMD/ATI Renoir). This always refuses to boot with GRUB due to it failing to stop the PSP ring. Over the past year I’ve attempted to apply the fixes posted in the Linux Mint support group and from web searches. They all installed, but they all failed. I use a simple workaround using secure boot as the second item on the GRUB list and the second item on the next GRUB menu, and the Dell works perfectly, although it reports that a driver is needed… which it then says is unnecessary. I’m at a loss after again today updating to the latest kernel. Is it a GRUB problem? Denis Lynch
A
This appears to be a hardware compatibility issue, in that your CPU/GPU combination isn’t supported by the 5.4 series kernels. If that’s the case then switching to a newer kernel should solve the problem. One way to get that is by installing the Edge edition of Linux Mint, which comes with at least a 5.11 kernel version. However, your mention of secure boot is puzzling. Have you tried disabling secure boot in your firmware settings? I would suggest trying with secure boot turned off, because this is the easiest option. If that doesn’t help then try the Edge version of Linux Mint. Your missing driver report may well be a completely separate matter – it’s impossible to say without knowing what driver the message refers to. We can be sure that this isn’t a problem with GRUB, because this message comes from the kernel, and if the kernel is running then
www.linuxformat.com
EXPLORE THE POSSIBILITIES THAT LINUX HAS TO OFFER From open-source software to coding masterclasses and Raspberry Pi projects, get the most from your machine with this exciting array of expert tutorials, guides and advice from the minds behind Linux Format magazine.
ON SALE
NOW
Ordering is easy. Go online at: Or get it from selected supermarkets & newsagents
SUBSCRIBE Save money today!
SUBSCRIBE
Sign up today and get your
AUSTRIAN AUDIO
YOUR GIFT! WORTH £89 ut,
iss o Don’t m e now! ib r c s sub
Hi-X15 Over-Ear Headphones Product features
ow-impedance headphones, ideal for L low-power outputs like mobile devices Soft memory foam earpads to keep you comfortable during the longest sessions Foldable all-metal hinges for easy storage – uncommon at this price range Detachable 1.4m cable Designed and engineered in Austria
SUBSCRIBE NOW! www.magazinesdirect.com/lin/a33x Call 0330 333 1113 and quote A33X 18 LXF288 May 2022
www.linuxformat.com
Save money today! SUBSCRIBE 1
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
! DON’T MISS s ar ye Includes 5 & r se U x nu of Li Developer issues
CHOOSE YOUR PACKAGE! ANNUAL PRINT EDITION
PLUS!
SAVE!
Only
19%
£67.50
13 issues of Linux Format in print by Direct Debit
ANNUAL PRINT + DIGITAL EDITION
PLUS!
NOT FROM THE UK?
Turn to page for more grea29 subscriber t deals!
ANNUAL DIGITAL EDITION ONLY
SAVE!
SAVE!
Only
47%
£92.50
13 issues of Linux Format in print and digital by Direct Debit
Only
39%
£54.99
13 issues of Linux Format in digital by Direct Debit
Terms and conditions: Offer closes 31 May, 2022. Offer open to new UK subscribers only. Pricing is guaranteed for the first 12 months and we will notify you in advance of any price changes. Please allow up to six weeks for delivery of your first subscription issue (up to eight weeks overseas). Your gift will be delivered separately within 60 days after your first payment has cleared. Gifts only available to subscribers on the UK mainland. Gift not available with a digital subscription. The full subscription rate is for 12 months (13 issues) and includes postage and packaging. If the magazine ordered changes frequency per annum, we will honour the number of issues paid for, not the term of the subscription. For full terms and conditions, visit www.magazinesdirect.com/terms. For enquiries please call +44 (0) 330 333 1113. Lines are open Monday to Friday, 9am to 5pm UK time, or email help@magazinesdirect.com. Calls to 0330 numbers will be charged at no more than a national landline call, and may be included in your phone provider’s call bundle.
www.techradar.com/pro/linux
1) Only available to www.magazinesdirect.com subscribers
PLUS: Exclusive access to the Linux Format subs area!
May 2022 LXF288 19
REVIEWS Handheld gaming PC
Valve Steam Deck
The Steam Deck can’t yet play every game on Steam, but it’s a great handheld gaming system nonetheless, says Wes Fenlon. SPECS
CPU: AMD Zen 2, 2.4-3.5GHz Cores: four cores (eight threads) GPU: AMD RDNA 2, 1-1.6GHz GPU units: Eight RAM: 16GB LPDDR5, 32-bit quad-channel Storage: 64GB eMMC, 256GB NVMe, 512GB NVMe Display: 7-inch LCD touchscreen, 1,280x800, 60Hz Audio: Stereo speakers, 3.5mm jack, dual mics Comms: Wi-Fi 2.4/5GHz 2x2 MIMO 802.11ac, Bluetooth 5.0, USB Type-C (DisplayPort 1.4 support), microSD UHS-I Battery: 40Whr Size: 298x117x 49mm Weight: 669g
The joysticks, D-pads and buttons are near-perfect.
22 LXF288 May 2022
he Steam Deck is a gaming system that Swiss Army Knife fans would love. Valve decided that a handheld gaming PC would only work if it had a big screen, two big analog sticks, trackpads, and access to a proper Linux desktop underneath its friendly UI. The Steam Deck isn’t immune to that archetypal jack-of-all-trades problem. After two weeks with it, it’s not a replacement for a desktop PC or as portable as a Nintendo Switch, but it’s something else, a sweet spot right in the middle. It’s the turbo-charged Switch Pro that Nintendo will never make… For most new big budget games, locking the framerate to 30fps is going to be It’s the age-old question: just how big should a hand-held PC be? mandatory for stable performance and practical battery life. With the framerate capped at 60, Deathloop drained the battery from full to Nintendo’s Switch. They all feel great and help justify the 20 per cent in an hour and 10 minutes at about 60 per length of the Deck. cent brightness. The device weighs 68 per cent more than a Nintendo Our other battery life tests had similar results. At an Switch and 38 per cent more than the latest iPad. It average 51fps and 50 per cent brightness, God of War weighs more than two Switch Lites or three PlayStation would chew through the battery in 83 minutes, according Vitas duct-taped together. Playing the Steam Deck for to our calculations during testing. With a 30fps lock, that long stretches requires more deliberate positioning than time jumped to around 200 minutes. with the Switch, which has never given us arm fatigue. GTA 5 could run at 60fps with high settings and Resting the Steam Deck on a pillow quickly became our squeeze out two hours of battery life, but going down preferred way to play. to a 30fps lock nearly doubled the battery estimate to 214 minutes. During play we had to play at maximum Playing it cool brightness in the afternoon and crank up the in-game The cooling on the Deck is capable and the system will brightness setting to clearly see the screen, so the game never get hot in your hands the way a gaming laptop looked a tad washed out and the battery dropped from can roast your crotch. The downside is that its fan will full to 44 per cent in an hour. ramp up to an annoying pitch even under relatively light This isn’t a knock against the Steam Deck’s display, loads. During testing Valve did update the fan profile to though, which is very good. It’s vibrant for an IPS panel be less erratic and run at a lower RPM in lighter games, even when you’re looking at it from off-axis, and about as but the Deck fan is certainly louder and more annoying good as we’d expect from a non-OLED panel. Resident Evil than the Switch. 2 is a dark game and made for an extreme test case. We The fan noise is our least favourite thing about the had no problem playing indoors in daylight and was even Steam Deck, which is something to keep in mind if you’re able to play the 512GB model, with its anti-glare coating, planning to play it next to someone who hates highoutdoors on a sunny day. At night, expect to be able to pitched whirring (Effy?–ED). But if we’re comparing comfortably play the Steam Deck at around 50 per cent against a gaming PC, the fan is probably less obnoxious brightness. Warning: maximum brightness in the dark is than the mechanical keyboard we’re using to write this eyeball-melting. review. And if we’re comparing against a console, well, We hope that there’s a thinner and lighter sequel in we’ve heard PlayStations that sounded like leaf blowers. the Steam Deck’s future, but after gaming on it In contrast, the Deck is more like one of those handheld extensively we think Valve fans you take to a summer day’s game of cricket. made the right call on the device’s physical Steam clean dimension. We It seems wild that the Steam Deck could beat consoles at especially appreciate the thing they’re supposed to be better at than PCs, but the generous full-sized the Steam Deck’s interface is terrific. We’d put this new analog sticks, buttons version of SteamOS up against any of the current and D-pad on the Steam consoles for functionality and ease of use, and if you’re Deck compared to the coming from Steam on the desktop, it’ll mostly be second smaller ones on nature. The Steam button pulls up a range of system
T
www.linuxformat.com
READING IN THE USA?
UK readers turn to p18
SUBSCRIBE!
Don’t wait for the latest issue to reach your local store – subscribe today and let Linux Format fly straight to you. Faster, cheaper and with DRM-free archive access!
3 GREAT WAYS TO SUBSCRIBE
Print, digita l-only, and print+d igital bundles!
USA
From $132 For 13 issues
REST OF THE WORLD From $132 For 13 issues
EUROPE
From €100 For 13 issues
IT’S EASY TO SUBSCRIBE!
Visit www.magazinesdirect.com/linux-format
Call +44 0330 333 1113 Lines open Monday-Friday, 9am-5pm, UK time
www.techradar.com/pro/linux
May 2022 LXF288 29
ROUNDUP Social videoOFwebsites WE COMPARE TONS STUFF SO YOU DON’T HAVE TO!
Roundup Facebook Watch YouTube Odysee DTube
Vimeo
Michael Reed has literally tens of subscribers wishing he’d post to his YouTube channel more often.
Social video websites Michael Reed takes a look at websites that combine video hosting with social networking tools, while comparing free and paid-for options. HOW WE TESTED… The first part of our assessment was the easiest part of the process. We placed ourselves in the position of a consumer of video content and used these platforms to browse and watch videos. While doing this, we tested the possibilities to bounce the content around different viewing devices, which is an essential aspect of video watching these days. Primarily, we considered what you get with a free account on these services, admittedly, with an eye on what the paid-for options offer. Taking on the role of a content creator (exciting buzz words alert! – Ed), we generated a screencast tutorial at 1,080p with maximum quality and we uploaded it to each of the sites. In each case, we kept an eye out for any limitations that might affect Linux users in particular, but they all played nice with open standards and typical browser setups. So, there wasn’t much to report in that area. This led us to assess the commenting, sharing and analytics areas of each site.
30 LXF288 May 2022
e’re taking a look at social video websites – sites that combine video hosting with social networking features. When it comes to the suitability of a given service, the scenario that we’re imagining is a typical Linux user who also wants to become a content creator. That means that we’ve passed over some of the most famous social video networking sites such as TikTok and Instagram because they’re not as suitable for ‘serious’ use. YouTube is one of the most popular sites online, and its content makes up a significant part of the entertainment diet of the average internet user. Well known for viral content and short form videos, it also contains a
W
significant amount of more substantial content such as reviews, self-made documentaries and even professionally made content. When you say ‘social network’ many people will immediately think of Facebook, and Facebook Watch is that platform’s integrated video viewing and aggregating system. Two of the sites that we’re looking at, Odysee and DTube, operate slightly differently with more of an emphasis on decentralised content meaning that the user has greater freedom as they are less affected by the censorship whims of a hosting site. Finally, Vimeo is a mecca for amateur filmmakers. Let’s see how well they all fared…
www.linuxformat.com
Social video websites ROUNDUP
Commenting and rating
Let’s make sure that viewers can interact with the content.
his area puts the social in social video, because it’s important that videos can be interacted with by the viewers. At a minimum, we want a userbase to be able to leave comments and rate videos, and all of the sites could manage this. Of course, the best promotion is when the viewers themselves can post links to your content, and all of the sites that we have tested had a facility to post a link to a video on all the major social networking sites. Since Google took control of YouTube, it has actually removed some of the social interaction facilities such as the ability to post videos in replies to other videos and a option for users to post private messages to each other. Videos can be voted up, but unfortunately it’s no longer possible to see how many people have voted them down. Despite everything that has been removed in the past, YouTube still has a full complement of features, including the ability to rate comments and sort the comments by newness or popularity. Odysee looks similar to YouTube, but it has a few extra features. If you hit the @ key while commenting, a pop-up menu appears of users who are relevant to the discussion, and you can reference them in your comment. You can also see how many people have downvoted a video, unlike YouTube of late. Comments can be sorted by Best, Controversial and New categories. Vimeo covers the basics of commenting and posting links directly to social media, but it’s not possible to rate comments.
T
Facebook Watch inherits all of Facebook’s features when it comes to being able to comment and rate videos (and rate comments).
This means that there’s no way of making sure any popular comments are pushed to the top. Videos can be liked and the number of likes is visible to viewers. Facebook Watch inherits all of the features of Facebook itself. In this case, this means that comments can be left for the videos. Videos can be liked and the following emoticons can be attached to videos and comments: Happy, HaHa, Sad, Angry, Wow, Care and Love. Comments from viewers can be rated and those comments can then be sorted due to popularity or newness in a limited way. DTube has basic features to either like a video or leave comments underneath.
VERDICT FACEBOOK WATCH 8/10 ODYSEE 8/10 YOUTUBE 7/10 DTUBE 6/10 VIMEO 6/10 The recent removal of visible downvotes for videos hurts YouTube, pushing Odysee slightly ahead in the area of viewer interaction.
Analytics & stats Useful for improving your videos, vital if you’re monetising them.
he most basic statistic, number of views, is a good indicator of how well your video is doing, and all of the sites provide this. It’s even better if you can obtain more detail. For example, you might find out that your videos lack broad appeal or that people are tuning out after 20 seconds, and this can give you insight on how to improve your videos. All YouTube accounts come with access to the YouTube Studio dashboard, and from here you can examine detailed stats for all of the videos on your channel. This gives you information on factors such as the age and sex of your viewers, typical viewing times and quite a lot more – to the point of it being a bit daunting at first. Facebook insights are similarly comprehensive, and there’s a page that deals specifically with videos that you’ve posted. Facebook, like YouTube, provides a great number of tools with the basic free account, obviously hoping that you’ll spend money on promotion and other extras. Vimeo has basic statistics that enables you to track views and other forms of engagement. That’s probably sufficient for most users, but for more advanced analytics there are various paid-for packages on offer.
T
www.techradar.com/pro/linux
YouTube’s analytics features are extensive, and could be overwhelming for beginners. Still, we can’t complain that it’s giving away too much for free.
Odysee only provides basic statistical tools. There’s a page that shows you the long-term and previous week’s statistics for views and new followers, along with some other basic figures. Finally, DTube provides only rudimentary statistics.
VERDICT FACEBOOK WATCH 9/10 ODYSEE 6/10 YOUTUBE 9/10 DTUBE 4/10 VIMEO 7/10 Facebook and YouTube both offer useful and in-depth statistical insights.
May 2022 LXF288 31
ESSENTIAL
Pi PROJECTS It’s Pi-time we got down to some steaming hot Raspberry Pi projects says Jonni Bidwell, who’s brought along a whole selection for you to try…
10
HOW TO
I nstall a new OS Fit a new case Connect LEDs Track air traffic Analogue input Machine learning Use Arduino
he diminutive computer that is the Raspberry Pi recently celebrated its 10th birthday. And the maker, tinkerer and hacker revolutions it has fomented show no signs of letting up. Luckily for you, neither does our desire to inspire you with the greatest Pi projects that you can try today. A whole 10 pages of them. Wowza! We’ve got retro-gaming, media centres, high-fidelity audio systems… all sorts of things. Fans of electronics and pretty lights should delight in our enlightening LED deep-dive. And those wondering where to
T
36 LXF288 May 2022
AMAZING PROJECTS TO TRY!
get started might enjoy our summary and OSes and simple guide to getting them up and running. It’s amazing what can be done with a few peripherals and no coding. We’ll show you how a £40 investment can turn your Pi into an aircraft tracking system. One which grabs real-time ADS-B data and squawk codes from the skies above. And if you’re willing to brave a little bit of programming, then the door is opened to all kinds of other projects. We’ll also show you how easy it is to get Python talking to hardware, thanks to a rotary encoder project from our friends at Tom’s Hardware.
The Pi 4 (and Pi 400 which we feature on page 50) are considerably more powerful than any of the other Pis that preceded them. Having up to 8GB RAM and a CPU that can be cranked up to 2GHz enables some really exciting projects to be undertaken. We’ll show you how to get started in computer vision, using TensorFlow and OpenCV to build a simple device for image recognition. All you’ll need is a camera, and the Pi Foundation offers two models, priced at around £5 and £50 for the High Quality model (including lens). So let’s not tarry on this intro page any longer – makery is afoot!
www.linuxformat.com
Essential Pi projects
Getting started Learn to write SD cards. Then use your Raspberry Pi as a Linux desktop, a server or something entirely inconceivable. he first step with your Raspberry Pi is to write out an SD card with an operating system on it. The official Raspberry Pi OS (formerly Raspbian) is the best place to start. It has its own lightweight desktop, dubbed Pixel, and out of the box it can do most tasks you’d expect from a desktop. The Pi Foundation provides its own crossplatform Rpi-Imager tool for downloading and writing a selection of OSes (see www.raspberrypi.com/ software), but you can use anything you like including our favourite tool for the job, Balena Etcher (https://etcher.io). Follow the instructions (below) to get the desktop edition Raspberry Pi OS written to an SD card (technically a microSD card unless you have an original model Pi). You can use this method to write out any of the other OSes we’ll cover later. You could also do this from the command line using dd , but this approach isn’t recommended for beginners since it’s reasonably easy to write the image to the wrong device if one gets ones /dev/sda and /dev/sdb mixed up. They don’t call it ‘destroyer of disks’ for nowt. Insert your freshly baked SD card into the Pi. Connect a monitor, keyboard and mouse (cheap, wireless keyboard/touchpad combos are very useful). If you have an Ethernet connection plug that in too, if you like. Finally, plug in the power and cross your fingers. All going well you should see a satisfying boot sequence whizz by, and be presented with the Pixel desktop. If not, don’t fret: check your cables, turn the monitor off and
T
on. Turn everything off and on. Perhaps you don’t have a beefy enough power supply (see overleaf), or perhaps the SD card didn’t write right. At any rate, persevere. The latest desktop versions of Raspberry Pi OS will automatically log you in, but if not the default username is pi and the password is raspberry . You’ll probably want to get your wireless set up if you haven’t already. Pi 3s, 4s and Zeros with W in the model number have wireless built-in, and you will be invited to configure it from the welcome wizard. You can use USB Wi-Fi modules on older model Pis (compatibility is generally good nowadays), but check first. First, you should complete the questions posed by the welcome wizard. You’ll be asked to choose some locale settings. Finally, you’ll be invited to update the software to catch any fixes since the image was released. Raspberry Pi OS is straightforward to learn and comes with loads of great tools. The beginner Thonny IDE (integrated development environment) is ideal for your first Python projects, and if you want something more advanced it’s easy to install Microsoft’s Visual Studio Code. Speaking of Python, you can use that to interface with the special Pi edition of Minecraft. You’ll also find Wolfram Mathematica for symbolic computation, and the Wolfram Language for querying its online knowledge engine using natural language.
This modest little dialog welcomes you to the wonderful world of Raspberry Pi.
WRITE AN IMAGE TO AN SD CARD
1
Download Rpi Imager
Download Raspberry Pi Imager from www.raspberrypi.com/software. There are Linux, Windows and macOS editions. Double-clicking the .deb file will install it on Debian-like flavours of Linux (including Ubuntu). Then find a suitable SD card (at least 8GB for a desktop OS; the GUI-free version of Raspberry Pi OS can fit on a 2GB card)
www.techradar.com/pro/linux
2
Find an OS image
Insert the SD card, check there’s nothing important on it, and start Rpi-imager (which should have appeared in your Applications menu). If you’re just getting started choose the Raspberry Pi OS (32-bit) option, or you’ll find a 64-bit edition (for Pi 3 and above) and in the menu beneath. Alternatively, select Use Custom to supply your own image file.
3
Write the image
Select Choose Storage and choose the SD card. If you’re writing Pi OS the Advanced options box lets you tweak additional options, such as Wi-Fi networks and SSH credentials (if you plan on running headless). Then hit Write and watch as the progress bar marches on. Make sure and use the Safely Unplug option before removing the SD card.
May 2022 LXF288 37
TUTORIALS Tweet sensor data
TWEETY Credit: //github.com/tweepy/tweepy
Send temperature sensor data to Twitter Les Pounder can’t make it to outer space, but he can broadcast the temperature while he’s sat at his earthbound command desk. he Raspberry Pi Sense HAT is a science lab that connects to the Raspberry Pi for an “out of the world” experience. Right now there are two of these boards on the International Space Station, collecting data and running code created by children. In this tutorial we’ll keep our feet on the ground, but will broadcast our sensor data across the globe thanks to Twitter and a little Python code. The hardware build is simple. With the Pi powered off, connect the Sense HAT so that it fits neatly on top of the Pi. It should not overhang. When done, connect your keyboard, mouse, HDMI and finally power to the Pi. The Sense HAT will display a bright rainbow pattern on boot.
T
OUR EXPERT Les Pounder is associate rditor at Tom’s Hardware and a freelance maker for hire. He blogs about his adventures and projects at bigl.es.
YOU NEED Any Pi Raspberry Pi OS Sense HAT Internet connection Twitter account Code: https:// github.com/ lesp/LXFTwitterSense/ archive/ refs/heads/ main.zip
48 LXF288 May 2022
Connecting to Twitter
On the Pi open a web browser and visit https:// developer.twitter.com, sign in to your account. This next section is the trickiest bit of the project, so take it slow and read everything. Create a new project, name it Twitter_sense_LXF, then select a use case (how we intend to use it). Give the project a short description and then set the app environment to Development. Now create a new app, which will be what we use to tweet the data. Give the app a name, Twitter_sense and on the next screen copy and paste the API Key, API Key Secret and Bearer Token to a text file. Clearly mark which key is which! Next, go to your app’s Settings, and scroll down to User authentication settings. Click Edit. Enable OAuth 1.0a and set the app permissions to Read and Write (write is how we post tweets). Give the app a callback URI and website URL. If you have a site to use, great, but this field will accept any URL. Click Save. Back to our main app screen, click Keys and Tokens and then generate Access Token and Secret. Copy and paste these to your text file. We now have all the keys and authorisations necessary to post to Twitter.
Writing the code
We only need to install one piece of software, and that’s Tweepy, a Python API for Twitter. Open a terminal and install using Python’s packaging tool.
Designed for all models of 40-pin GPIO Pi, Sense HAT has been with us since 2015 and remains an essential purchase.
$ sudo pip3 install tweepy
Open up the Thonny Python editor. You will find it under the Programming menu. We’ll start the code by telling Python where to find the Python interpreter. We’ll later use this to make our app executable. #!/usr/bin/env python3
Next, we import a series of libraries that bring extra features to our code. First is tweepy , used to send our tweets. Then we import the Sense HAT library to use the sensors on the board. Finally, we import the datetime function that’s used to add a timestamp to the tweet. import tweepy from sense_hat import SenseHat from datetime import datetime
Create a connection in our code to the Sense HAT by creating an object, sense that we can issue commands to. sense = SenseHat()
All of those keys and secrets we kept safe, but now we need them. Using an object, client we connect to Twitter using the consumer_key and consumer_secret (API key and API Secret) and our access_token and access_token_secret . Do not share these with anyone, or publish them in your version control software. Note that the keys and secrets must be wrapped in ‘ ‘ . client = tweepy.Client(consumer_key='YOUR API KEY’, consumer_secret='YOUR API SECRET’,
www.linuxformat.com
TUTORIALS Pi daily driver
Pi 400
Using the Raspberry Pi as a daily driver How capable is the Pi when it comes to carrying out day-to-day computing tasks? Michael Reed powers down his x86 desktop to find out… e’ve decided to see how viable a Raspberry Pi 400 is as a Linux-based ‘daily driver’ machine, and attempt to use it for day-to-day tasks in place of a standard desktop PC. The Pi 400 itself has similar specifications to a Raspberry Pi 4, but the whole thing is contained inside the keyboard unit. As part of the test, the bulk of this article was written on the Pi. We’ll start at the beginning, by looking at the device itself. Sat on a desk, the Pi looks like a white compact keyboard, but it’s a tad heavier and fuller once you turn it over in your hands. Around the back, there are various connectors. From right to left these are: Gigabit Ethernet, USB 2.0, two USB 3.0 sockets, USB C power, two micro HDMI sockets, a miniSD socket and finally a 40-pin Raspberry Pi GPIO header. Under the hood the Pi 400 sports a quad-core ARM chip clocked at 1.8GHz and 4GB of RAM. Neither of these can be upgraded, and the RAM is shared between the CPU and GPU. There are no analogue audio ins and outs, so we alternated between a USB audio adaptor (Lexicon Alpha) and some Bluetooth headphones. Both of these solutions worked flawlessly. The Pi 400 can also transmit audio through the HDMI connectors alongside the video data, if you have a suitable display.
W
OUR EXPERT Michael Reed is old enough to (know better? – Ed) remember when his main computer was considerably less powerful than a Raspberry Pi.
The Pi is capable of some simple gaming, but many of the games in the repository required a bit of work to get them going.
50 LXF288 May 2022
Connecting it all up
For our purposes, we connected the official mouse and the power supply. One of the HDMI sockets was connected to a standard 22-inch 1080p monitor. For networking, we used the integrated Wi-Fi instead of the
Thonny, a Python programming environment, comes with all editions of Raspberry Pi OS. Type the code in and press the ‘run’ icon!
hardware Ethernet socket. In operation, the unit emits no sound because it’s passively cooled. Despite this, at no time when we were using it did we feel that it was in danger of overheating, and we did some things that kept the CPU cores pretty loaded up. Moving back to the exterior for a moment, the keyboard that’s part of the Pi 400 consists of flat buttons rather than full-travel keys. This is the style employed by a lot of laptops these days, and you’ll either enjoy using this style or you won’t. You could put the unit on its side, next to the monitor, and use your own choice of USB keyboard, but that would defeat part of the object of using the Pi 400 as opposed to getting a (cheaper) Raspberry Pi 4. With most PI OSes, you transfer the contents of an .img file on to an SD card and run the OS from there, in contrast to the typical desktop Linux procedure of installing the OS from one medium to the other. A Pi can run a number of operating systems, but we started our investigation with the supplied Raspberry Pi OS (formally known as Raspbian). This is a desktop operating system that’s based on the ARM port of Debian. It’s supplied with the machine, but we replaced it with the latest version. There’s a larger version of the OS with all of the recommended applications, but we preferred to start off with the slimmer, standard version. Raspberry Pi OS uses a lightweight window manager that’s derived from the LXDE window manager. The default layout is a combined task switcher, application launcher and status area at the top of the screen. With standard Raspberry Pi OS, the application selection is bare-bones and the choices are lightweight. For
www.linuxformat.com
FINDING EQUI-LIBRE-UM
Your favourite office suite needs help, as Jonni Bidwell finds out…
U
54 LXF288 May 2022
document sovereignty since its establishment in 2010. Through libre productivity software, interoperability, good documentation and translations for as many languages as possible, the independent non-profit meritocracy aims to make the world a better place. Most big projects have the backing of some sort of foundation, and it’s generally inferred that foundations provide support not only in the shape of governance, but also materially, in the form of cold, hard cash. For LibreOffice though, this isn’t quite true. Today, a great deal of LibreOffice development is done by open source champions Collabora, the UK-Canada consultancy that’s contributed extensively to projects as diverse as Chromium, Wayland and SteamOS. And to pay their bills they’ve created Collabora Office, a supported, enterprise edition of LibreOffice. Increasingly, enterprises are switching to online office suites (even Future Towers,
who deny all those without a permit to save their documents locally), and Collabora has developed one of those, too. We chatted with Collabora’s Michael Meeks (general manager for productivity) and Simon Lofthouse (marketing lead) to get the lowdown on Collabora Online, the LibreOffice funding gap, and The Document Foundation’s secret slush fund.
A new office opening
The year 2010 was a wild time in the world of open source. Oracle had just acquired Sun Microsystems, which caused users of their Solaris operating system to fork the project and create OpenSolaris, over fears Oracle that would shelve the project. Sun, you will remember, also created OpenOffice.org and there were fears that project was in jeopardy, too. So in 2010 LibreOffice was forked from the OpenOffice.org codebase, and in order to promote and manage it, The Document
www.linuxformat.com
CREDIT: Getty
pon hearing the words “office suite for Linux” there’s a good chance you’d think immediately of LibreOffice. Yes there are others, but LibreOffice (with a couple of exceptions) has for many years been the de facto standard for wrangling documents on Linux. Not only that, but The Open Document formats have become so widespread that businesses and even the UK government uses them. The applications may been mocked for looking like Word, Excel and PowerPoint from the late 90s, but there’s no denying they’re a powerhouse of productivity. Also, we never liked Microsoft’s ‘modern’ ribbon interface… But have you ever stopped to think how this huge project is maintained and sustained? Perhaps you’ve heard of The Document Foundation, perhaps not. For years this has been lobbying and advocating for digital equality and
Finding equi-Libre-um IN-DEPTH
Foundation (TDF) was announced. Two years later TDF was legally established as a non-profit. But what about the coding? The project is far too big to rely on volunteers (although they still contribute a great deal, such as the 120 odd translations for LibreOffice 7.3). And where exactly does The Document Foundation fit in? We asked Michael, who explains: “LibreOffice development is a highly successful and collaborative endeavour. The Document Foundation (TDF) was set up to be a vendor-neutral entity to help people work together. “However TDF is a relatively small player in LibreOffice development. The majority of work is done by a mix of corporate contributors and volunteers (some mentored by TDF). TDF tenders development projects for feature/function development, but has had lacklustre execution and substantially underspent its budgets for many years in this area. Partly because of this TDF now sits on a multi-million Euro cash-pile. “This creates a problem where TDF owns the LibreOffice trademark and so controls what visitors see, and could be much more effective at using that to improve the software.” Wow, so TDF is sitting on a slush fund and none of it is getting to where it matters. No wonder in 2020 Michael described this economic model as “beyond utterly broken.” Oddly enough, “utterly broken” was the state in which our old webserver managed to persist for over a decade. Surely TDF will not suffer the same inglorious decommissioning? Michael is quietly hopeful. “A new board has been elected recently and can hopefully get to grips with this. Certain parts of the previous board made a concerted effort to push decisions that would de-fund a chunk of the corporate ecosystem (which does the majority of the development work). That disappointingly self-defeating drive caused some significant friction in TDF. It triggered the move of Collabora Online away to Github, although Collabora still remains the largest single contributor to LibreOffice.”
Moving in different directions
Collabora Online (COOL) is the collaborative, online edition of LibreOffice for enterprises (which we’ll get to), so it’s disheartening to see such a project move away from its progenitor. These sorts of schisms do happen from time to time in the FOSS world, but that doesn’t
Nothing keeps management happy like spreadsheets and charts expounding SEO efficacy.
make them it any less disappointing. Sooner or later different factions start pulling in different directions, and it’s often not clear if anyone’s right or wrong. Or even who’s more right and who’s more wrong. “There are some really challenging things to improve around LibreOffice and its economics – there are some tough problems here,” says Michael. “The coding is almost trivial in comparison to the knotty problems around how to best use TDF’s assets to drive its mission. Luckily, the new status quo has removed some of the strains here.” And it’s not all bad. As the erudite Michael points out, “TDF can and still does many things extremely well that cannot be done by other parts of the ecosystem: great long-term, strategic work; hosting infrastructure; mentoring UX design; volunteer developers; QA; documentation – training and educating people to be able to strike an effective blow for Software Freedom. LibreOffice has so many places that newbies can contribute effectively without much effort into the LibreOffice code – the code still has to be one of the most satisfying places to get involved and contribute.” A number of enterprises have chosen to deploy LibreOffice instead of Microsoft’s offering, but using free, unsupported software in the workplace isn’t without its perils. As such, a number of organisations that collaborate on LibreOffice, including Red Hat and Allotropia.de, offer their own supported versions of LibreOffice which are more suited for businesses. This is one way to make free
There’s no way you can read about Collabora Office and not end up grinning from ear to ear. Just look at Michael Meeks!
LINUX AND LIBREOFFICE Today we have a few office suites to choose from on Linux (OnlyOffice, WPSOffice, and yes OpenOffice.org is still alive), but LibreOffice is far and away the market leader. We asked Michael what had contributed to its success. “The Linux community have been the primary evangelists for LibreOffice. Support and investment from SUSE and RedHat, and work from Debian and Ubuntu has been vital to making all FLOSS savvy people aware of LibreOffice. That is combined with a
www.techradar.com/pro/linux
large network of friends working together around the code localisation, documentation and spreading the word, as well as a diverse set of companies from giants to start-ups investing directly (or via paid services). “Add in some support from our donors over the years, and we have a formidable feature edge over the alternatives. Because of this support we have been able to fill out the feature matrix with good mobile, tablet, ChromeOS versions and web-based collaboration.”
So our favourite distros have helped our favourite office suite to thrive. Edifying. It’s always interesting to note the importance of non-code related contributions to projects. Without all those language packs and distro support for localisation, it would be hard for LibreOffice to get noticed outside of the English-speaking world. Documentation too, is crucial. How can we RTFM if the said manual is unreadable, or nonexistent? These are things that lots of people can, and should, contribute to.
May 2022 LXF288 55
TUTORIALS TUTORIAL Prey
NNN Credit: https://github.com/jarun/nnn
Discover the supercharged file manager The problem of plenty has long plagued GUI managers where many tools offer similar features. Shashank Sharma recreates the situation on the CLI. ack in LXF249 (simpler, happier times – Ed), we discussed the FFF file manager, which scoffs at traditional file managers in its appearance and functionality. Our tool of choice this issue, nnn, is cut from the same cloth. The project was originally forked from Noice, which is a small ncurses-based file manager, hence the name Noice is Not Noice (nnn), but the project has since dropped the acronym and now prefers to be known only as nnn, or n³. Many distributions carry nnn in their software repositories and the project’s GitHub page (https:// github.com/jarun/nnn) provides a list of these, and the version of nnn on offer. Unfortunately, many distributions carry older versions of nnn in their repositories, but if you’re running the latest releases of Debian 12, Fedora 34+. Arch, or Void Linux, you’ll find the latest 4.4 release in the software repositories. Additionally, nnn utilises openSUSE’s build service to provide installable binaries for distributions such as Fedora, Debian and Ubuntu. If you’re either unwilling or unsure about installing it from source, the project also provides a portable static binary, which enables you to use nnn without installation. If you’re running Ubuntu, grab the package for your distribution from the OBS service and then install it with
B
OUR EXPERT Shashank Sharma is a trial lawyer in Delhi and an avid Arch user. He’s always on the hunt for affordable geeky memorabilia.
Nothing to see here except active contexts, selected directories and an attempt to create an archive.
the sudo dpkg -i nnn_4.4-1_amd64.deb command. Unlike most other CLI tools, nnn doesn’t have a man page. But you can learn all about working with the feature-rich file manager from the GitHub hosted wiki (https://github.com/jarun/nnn/wiki), which is split into different sections such as Installation and Configuration. Some would argue that a file manager’s purpose is to help you navigate the directory trees on your disk, and
WORKING WITH BOOKMARKS Long-time readers will remember Buku, a useful directory bookmark utility we discussed in LXF256. You can find the same functionality in nnn, and can create bookmarks for frequently accessed directories. Bookmarks are defined using a key_char:location pair. For instance, you can have D as a bookmark for ~/Downloads directory. To do this, run the export NNN_ BMS="D:~//Downloads command. All key_char:location pairs must be separated by the ; key. The command
58 LXF288 May 2022
export NNN_BMS="d:$HOME/ downloads;p:~/Downloads/projects;t:/ media/linuxlala/Stuffsies" creates three
bookmarks. You can view all the bookmarks from within nnn by pressing ?. All user-created bookmarks are listed under the BOOKMARKS heading. You must add the export command to your ~/.bashrc file, and remember to run the source .bashrc command every time you create a new bookmark, if you wish to retain it for future nnn sessions. To access a stored bookmark, press b,
and nnn will display the available key characters used to create bookmarks. In our case, when we press b within a context, nnn shows ‘d D’ at the bottom of the screen. Press the key corresponding to the directory you wish to access. In addition to creating permanent bookmarks, you can also set up a temporary bookmark, called pinning or marking a directory in nnn speak, by pressing , (comma). You can only pin one directory at a time. You can press b and then , to switch to a pinned directory.
www.linuxformat.com
TUTORIALS Edit photos & video
G’MIC Credit: https://gmic.eu
Use filters for image and video editing Nick Peers reveals how the G’MIC plugin can transform the way you repair and enhance both photographs and videos. hen it comes to image and video editing, there’s nothing like applying a filter. Filters enable you to perform all kinds of digital processing – from simple corrections and fixes to transformative special effects – on your movies and photos, and you’ll find most video and image editors come with a selection built-in. G’MIC – or GREYC’s Magic for Image Computing – is an open-source framework providing tools for creating such filters. Thanks to the efforts of dozens of volunteers, the G’MIC language has been used to develop hundreds of filters for both images and video, and its collections are expanding all the time. G’MIC can be used several different ways. You can install it as a standalone tool to run from the shell – in this guise it’s effectively an interpreter for running the
W
OUR EXPERT Nick Peers has hundreds of old family history photos he needs to tidy up. G’MIC might be the plugin to help him achieve his goal.
EXPLORING G’MIC-QT 5
1
3
G’MIC language. But it’s also available as a QT-based plugin, which makes it possible to incorporate over 500 different filters into GIMP and Krita, which will be the main focus of this tutorial. We’ll also reveal how you can use G’MIC filters to transform video clips using the open-source Flowblade tool. Support for G’MIC is built into both GIMP and Krita – no need to download or install anything. That’s the theory, at any rate. The problem is that both GIMP and Krita don’t ship with the latest version of G’MIC, and while that’s not necessarily a problem for Krita (the version of the plugin shipped with the latest 5.x release – 3.0.0 – works fine), you’ll find that if you install GIMP via snap, you’ll be stuck with a plugin – 2.9.6 – that throws up multiple errors with the smart preview on various filters. Because G’MIC ships as a Qt plugin, you need access to Qt, and the snap version of GIMP doesn’t provide any Qt libraries. This means you’ll need to remove GIMP and install both it and the G’MIC plugin via a different route – for example, via flatpak: $ flatpak install flathub org.gimp.GIMP $ flatpack install flathub org.gimp.GIMP.Plugin.GMic
You’ll be prompted to install one of two versions – choose 40, even if you’re running an earlier version of Gnome on your distro (such as with Ubuntu 20.04.3). Once done, the plugin will be ready for use.
6
2 4 Smart preview Use this to see what effect your chosen filter will have on your image. Use the Preview tick box to toggle before and after views.
Bookmark filters Use the add, remove and rename buttons to put together a collection of favourite filters for speedy access.
Settings Click this button to customise the plugin’s interface, as well as configure automatic updates and output messages.
Filter controls Use this section in conjunction with the real-time preview to fine-tune the filter’s effects using the options provided.
Filter list Either browse filters by category or use the Search tool to find one quickly. Select a filter to preview and use it.
Input/Output Use this option to set which part of the image is affected by the filter, and how the effect will be applied.
1
2
3
60 LXF288 May 2022
4
5
6
Browse the filters
Open either GIMP or Krita, and load your target image. GIMP users should choose Filters>Q’MIC-Qt. The G’MIC-Qt plugin window will open, giving you access to (at time of writing) all 574 filters. Krita users need to select Filter>Start G’MIC Qt. One thing you’ll notice here is that only 409 filters are available – simply tick Internet beneath the main list and click the refresh button to download the rest. From this point on, the G’MIC works in the same way in both Krita and GIMP – unsurprising, given they’re running the same Qt plugin. The tool can feel a little cramped, so consider clicking the Fullscreen button to give G’MIC the space it needs to breathe. As the annotation (left) reveals, the window is split into three sections. On the left is a preview of your current image, while in the middle you’ll see a list of all
www.linuxformat.com
TUTORIALS Acorn Archimedes
ARCULATOR Credit: http://b-em.bbcmicro.com/arculator
How to emulate the Acorn Archimedes Les Pounder heard that mighty oaks grow from little acorns, but all he found was a Raspberry Pi and an Arm buried in the garden. he names Chris Curry and The Acorn Archimedes Hermann Hauser are 400/1 looked more forever linked to Acorn like a PC than a typical home computer, and the computers, the BBC Micro and the distinctive three button fun BBC TV movie Micro Men, which mouse set it apart from documents an important era in the its peers. home computer wars. But they, and many others, are also linked to a chip that’s in our pockets, TVs and our Raspberry Pis. There was a time when Arm, the CPU platform that powers our world, was a gamble. Launched in 1987, the Acorn Archimedes range of computers were powered by the Arm CPU. Arm stood for Acorn RISC Machine (later changed to Advanced RISC Machines Ltd), and were a departure from CISC (Complex Instruction Set Computing) CPUs common in many machines of the era. The Acorn 300 series ran on an Arm 2 CPU, which performed better than Intel’s 80286, power didn’t translate into market share. The home and with much lower power consumption. The honour computer scene of the 1980s and 1990s was heavily of the first Arm CPU goes to the second processor addfragmented between the giants (Commodore, Atari, on for the BBC Micro. Costing £800 (over £2,000 in Apple and IBM). Most UK-based readers will have 2022) the Archimedes range came in multiple experienced the Archimedes in school, as many configurations, including the A305 and A310 which educational providers continued to support the legacy even saw BBC branding continuing on from Acorn’s created by the BBC Micro. But from the mid-1990s this successful BBC Micro range. This was something that all changed as IBM PCs became the dominant led to a brief issue between Research Machines and a machines, and Apple rose to pop culture status. Acorn’s Microsoft-led industry group claiming that machines legacies are the BBC Micro (and the generation of should be “business standard”. coders it produced) and the Arm. Without the Arm CPU, No matter what Archimedes you had they were all we wouldn’t have the Raspberry Pi inspiring another compatible with RISC OS. But that wasn’t Acorn’s first generation of coders. OS. Early machines came with the Arthur operating system. But Arthur was plagued by bugs, despite a Archimedes family number of patches. It wasn’t until 1989 that we saw The best emulator that we found for this task was RISC OS, a true multi-tasking OS that drew praise Arculator (http://b-em.bbcmicro.com/arculator/index. from developers. For £29 you could purchase the html). Installation is a little challenging because there’s upgrade kit and run RISC OS on your Archimedes. no installation candidate in the repositories. Installation The Acorn Archimedes machines were powerful – involves downloading, extracting and compiling the more powerful than the Motorola 68000 found in emulator, but it does have a few dependencies that we Commodore’s Amiga and Atari’s ST machines – but this need to address.
OUR EXPERT Les Pounder is associate editor at Tom’s Hardware and a freelance maker. He blogs about hacks and makes at bigl.es.
Remember to use the middle button. It can open extra menus and be used to launch the Pinboard. It’s where we can “pin” icons and directories and turn windows into icons (Shift+ Close Window).
64 LXF288 May 2022
www.linuxformat.com
CREDIT: PaulVernon1974, CC 0
T
TUTORIALS Home automation Part Two
HOME ASSISTANT Credit: www.home-assistant.io
Create automations and notifications
Don’t miss next issue! Subscribe on page 18
Matt Holder investigates Home Assistant’s Automations and Notifications to make our homes as “smart” as they can be. ome Assistant enables data from home automation equipment to be accessed from a central location. It can also access systems in the cloud, but where possible, data is kept on the local LAN. In LXF287 we covered how to install and configure the system as well as set up a dashboard containing basic information about the weather. In part two we’ll be creating regular snapshots for safety purposes, creating automations and adding users. Blueprints is a fairly recent addition to Home Assistant where users can make their scripts or automations available to other users. This makes it simple for complicated automations to be made available to others with a few clicks. Blueprints can be accessed by opening the Configuration options and then selecting Blueprints. From here the blueprint “store” can be opened. For each blueprint in the list there’s a button that will enable the Blueprint to be imported and configured to work with your instance. Scenes are also accessed from the Configuration menu and allow for a collection of items to be controlled with one automation or one press of a button. For example, if you wanted a film-viewing scene setup in your living room, this feature can be used to store the states as required and then they can all be controlled in one go. To create a scene, first set everything to the values you wish to use each time the scene is used. Then create the scene by Navigating to Configuration> Automations & Scenes>Scenes>Add Scene. You can select devices from the window that loads.
H
OUR EXPERT Matt Holder has been a fan of the open source methodology for over two decades and uses Linux and other tools where possible.
For more details on Automations, see www. home-assistant. io/docs/ automation.
Creating a scene
Scripts are similar to scenes, but can be used to store pretty much any sequential series of steps. For example, there could be a script set up to pulse lights. This script can then be accessed from multiple automations or from a button press in a Lovelace dashboard. Scripts can be set up by navigating to Configuration> Automations & Scenes>Scripts>Add Script. Within the dialog that opens, simply give the script a name and icon and then set the sequence of events that need to be carried out. Helpers can be seen as form elements within HTML. They can be added to Home Assistant and the values used in automations as well as the elements being
68 LXF288 May 2022
Scenes can be created using this interface screen.
displayed on Lovelace dashboards. Helpers can take the form of on/off switches, text entry fields, number entry fields, date/time boxes, drop-down lists, counters and timers. For example, there could be a dashboard used to configure a thermostat, so that the set temperature can be edited from one location and the value used elsewhere. Add a Helper by selecting Configuration> Automations & Scenes>Helpers>Add Helper. Users can be provided within Home Assistant to enable multiple members of a household to have access to the same system. Accounts can be created with limited access to administrative features and certain Lovelace dashboards disabled. Users are created from within the Configuration>People and Zones>Users dialog. When creating a new user enter basic details, select whether the user can login from outside of the local network or not, and select if they should be an administrator. To limit access to dashboards, from within the dashboard in question, select the edit option, edit each tab (also known as a view) and either enable or disable for the new user accordingly. While talking about this area of the configuration section, we should also explore People. This section is where we can set up people that we want to track.
www.linuxformat.com
TUTORIALS Satellite imagery
GIMP Credit: www.gimp.org
Use GIMP to process satellite images Satellite photos are familiar, their underlying technology less so. Mike Bedford reveals how to process their spectacular images. hotographs of the Earth taken from space are a part of everyday life, appearing on TV and newspaper weather reports. This state of affairs dates back little more than 60 years, though, to when TIROS-1, the first weather satellite, was launched. How things have changed in the intervening period. By the end of April last year, 971 satellites were in orbit for the purpose of Earth observation. And unlike the early days, these satellites aren’t just operated by governmental organisations: several commercial enterprises now supply photography of the Earth’s surface. But publicly owned satellites are still important. If you want to learn about the technology, the good news is that these satellites have the undeniable advantage of free access to raw data. We saw this in LXF273 when we looked at how to receive data from America’s NOAA weather satellites and display that data as a map. The NOAA satellites are great for amateur experimentation because they orbit at a low altitude. This means they can easily be received using simple equipment, even though we took the approach of receiving the signal through a WebSDR, an online software-defined radio. On the reverse side of the coin, NOAA satellites transmit just two black and white images: usually one in the visible spectrum and the other in near infrared. Therefore the scope for producing coloured images – even false colour – is severely limited. So, here we’re investigating a different class of satellites that enables us to produce spectacular colour images, with plenty of scope for choosing between true colour and the many different false colour alternatives.
P
OUR EXPERT Mike Bedford never tires of studying satellite imagery, whether it’s of the Earth or other objects in the Solar System. Processing Landsat images is right up his street.
The technology of the first imaging satellites seems archaic – they shot on oldfashioned film. The film had to be returned to Earth in an escape capsule, so when all the films were used – and the first satellite had just the one – the satellite was useless.
72 LXF288 May 2022
Introducing Landsat
Landsat is a joint programme between NASA and USGS, that’s the United States Geological Survey. Back in 1972 the Earth Resources Technology Satellite was launched with the purpose of providing multi-spectral images of the globe. It was later renamed Landsat 1, becoming the first of the longest-running earth observation satellite programme, and one that continues to the present day. Currently Landsat 7 and 8 are operational, having been launched in 1999 and 2013, respectively, and Landsat 9, which was launched in September 2021, is about to come online. Here we’ll concentrate on
Landsat 8, but when Landsat 9 data becomes available, the same guidance will apply because it carries almost identical imaging instruments. The principles are the similar for earlier satellites, but you’ll have to read up on their instruments. Landsat instruments can acquire images in several spectral bands, not just the red, green and blue of ordinary colour photography. In the case of Landsat 8 and 9, the satellites carry two imaging instruments that are referred to as OLI (operational land imager) and TIRS (thermal infrared sensor). As the name suggests, the TIRS captures thermal infrared (which is essentially heat) in two different bands at a resolution of 100m. It’s used mainly for monitoring surface temperatures and soil moisture content. The subject of this article, though, is the OLI, which acquires images in nine spectral bands as summarised in the table (below). Band number
Band name
Wavelength (µm)
Resolution (m)
1
Coastal aerosol
0.43–0.45
30
2
Blue
0.45–0.51
30
3
Green
0.53–0.59
30
4
Red
0.64–0.67
30
5
Near infrared
0.85–0.88
30
6
Shortwave infrared 1
1.57–1.65
30
7
Shortwave infrared 2
2.11–2.29
30
8
Panchromatic
0.50–0.68
15
9
Cirrus
1.36–1.38
30
The red, green and blue bands are exactly what they sound like. The information they carry is useful for identifying various characteristics of the Earth’s surface, but we can mainly think of them as providing the information necessary for assembling a normal colour image. The Coastal Aerosol band is deep blue and is used for imaging shallow water resources and tracking aerosols. According to NASA, the three infrared bands, 5, 6 and 7, are used for “emphasising biomass content
www.linuxformat.com
TUTORIALS LXF Server
ARCHIVEBOX Credit: https://github.com/ArchiveBox/ArchiveBox
Create your own VPS internet ArchiveBox
David Rutland uses the LXF virtual private server to archive as much of the internet as possible, keeping it safe for future generations. aper is an honest medium. Once committed to the page by Future’s heavy iron, the images and words in this magazine are unalterable, and could, potentially, last the many centuries until the prophesied year of the Linux Desktop finally arrives. The same is not true of the internet. Data is ephemeral, and updating a website or an individual page takes seconds. Wiping an entire website from existence, along with all of the words and images it contains is as simple as rm -rf /var/www/ . In 2000, one of the largest bodies of knowledge concentrated online was Encarta, an epic site with more than 60,000 articles. Yet by 2009, Encarta was dead – pounded into irrelevance by the free and vastly superior Wikipedia. In 2010, encarta.com redirected to a free dictionary on MSN, and in 2013, the dictionary was dropped and seekers of knowledge were instead redirected to the Bing search results page for the word Encarta. The top result was the Wikipedia entry for Microsoft’s now defunct competitor. Visit encarta.com today and you’ll note that Microsoft no longer even bothers with redirects. You’ll get a connection timedout error. Only those with an original Encarta CD (and an optical drive to put it in) are able to appreciate and enjoy the wonder of what was once the world’s premier electronic encyclopaedia.
P
OUR EXPERT David Rutland spends his time pondering the imponderables. Is it possible for the Internet Archive to archive itself? What would happen? He thinks that there’s only one way to find out…
Archiving can take a long time and pull in some unexpected pages. We weren’t expecting a snapshot of the Linux Format Twitter account.
76 LXF288 May 2022
Using docker-compose to install archivebox on to your VPS is straightforward, foolproof, and takes only a few minutes.
Thousands of sites drop off the internet every day. The domains lapse as owners can’t be bothered to renew, and are sold at auction by ISPs. Your favourite small blog now serves adverts for casinos, and you’ll never be able to read the ridiculous rants of the rambling writers. News stories are changed retrospectively, especially in evolving situations. Furthermore, it’s very rare for outlets to tack an addendum to the bottom of the page explaining what has been changed, and why.
Archiving takes effort
Most of our readers are probably already aware of The Internet Archive. Founded in 1996 with a mission to preserve the web, the vast trove of images, sounds, text and pages were opened to the public in 2001. If you want to find out the top story on the Somerset County Gazette on 8 June 2019, it’s a simple matter of plugging the relevant URL into the search box at www.archive.org and then selecting the date. The Internet Archive visits frequently updated sites to take snapshots, with the aim of preserving them until the end of time, and users can request a snapshot be taken at a time of their own choosing. But the archive isn’t perfect. It’s expensive to run and is slow to load. Snapshots don’t grab the entire site every time they’re taken, and changes may sneak past. Often, there are huge gaps in coverage. Looking at that archived copy of the Somerset County Gazette from June 2019, you can see that half of the front page images are placeholders. Clicking through to some of the stories – for instance ‘Progress underway
www.linuxformat.com
IN-DEPTH Truly, deeply, randomly
TRULY, DEEPLY,
RANDOMLY
Random numbers are essential for so much of everyday life but they’re not as easy to generate as we might think. Mike Bedford takes us on a journey through the murky world of randomness to see how it’s done. ur subject here is random numbers, and how to generate them. And to be honest, we wouldn’t blame you if you think that sounds as enthralling as watching paint dry. What’s more, if we were to quote the definition “a random number is a number chosen as if by chance from some specified distribution such that selection of a large set of these numbers reproduces the underlying distribution” – whatever that means – we fear that might reinforce your view. We have to admit, though, that we presented that particular mathematics definition just to be mischievous, and we promise to do our very best to keep you entertained.
O
80 LXF288 May 2022
The fact is that generating random numbers isn’t as straightforward as we might hope or expect. In this article we’ll delve into a wide range of technologies which, you might be relieved to hear, aren’t all concerned with virtually impenetrable maths. If you want to learn when a random number isn’t a random number, what an entropy pool is and why Linux maintains one, how some Intel processors can generate true random numbers using special hardware, or why we should be interested in random numbers in the first place? In that case, just read on. But if you think this expose will help you break the bank at Monte Carlo, though, we suggest you think again.
Before getting to the heart of generating random numbers, let’s pick up the question of why we need them. After all, unless there are real-world applications, any study of random numbers would be little more than a pure academic exercise. And to many of us, that wouldn’t be especially engrossing, to put it mildly. So, how are random numbers used? If you’re a coder, you’ll be aware that most programming languages offer a random number function, and you’ll probably have made use of that functionality. You might have used it in a video game, for example, to ensure that gameplay differs each time it’s launched. Indeed, games are a key application of random numbers, perhaps for shuffling a deck of cards before they’re
www.linuxformat.com
HOTPICKS THE BEST NEW OPEN SOURCE SOFTWARE ON THE PLANET
HotPicks
Alexander Tolstoy is a long-term believer in the power of open source, and this month he’s got even more useful libre programs for you!
Falkon Zapzap Scribus Detox Notepad Next Whoogle Search Qxkb5 Freeciv Gbajs2 Rembg Lector WEB BROWSER
Falkon Version: 3.2 Web: www.falkon.org
fter three years of silence, the Falkon development team has rolled out the 3.2 release of the web browser. Even though it’s just another point release, we were keen to take it for a thorough test drive, and here’s why… For years Falkon has been one of the most capable and stable members in the group of second-tier browsers. It’s perhaps the most useful if we narrow down our scope to Qt-based browsers only (sorry Otter!). Falkon is essentially a front-end to QtWebEngine, a Qt-backed shared component that provides a repacked Chromium rendering engine for various Qtand KDE-related programs. The release notes on the latest version of Falkon state it’s based on Chromium 87 – not the cutting-edge version, but still a recent one. At least it saves us from most problems caused by websites that may refuse to work with older browsers. Version 3.2 comes with some new additions and improvements, such as screen capture support, an optional PDFium-based PDF viewer, support for selecting multiple cookies in the cookie manager, detachable tabs, a revamped search bar, a fixed layout for vertical tabs, a GUI for removing locally installed plugins, and a variety of other minor fixes. Who is Falkon primarily designed for? We’d suggest KDE Plasma users who want to enjoy a decent ‘default’ browser experience. Falkon works fairly well and its performance is remarkably swift. Those who don’t require advanced features such as account syncing or a particular third-party extension will certainly find Falkon sufficient for daily use. The browser is already equipped with an ad-blocking extension as well as a few other handy extensions. You can’t install additional extensions from either the Chrome web store or similar places, but it’s just a minor trade-off for having a fast and compatible modern web browser at your fingertips. The extendable plug-in architecture is already built into Falkon, so there’s a chance that there’ll be more extensions available down the line.
A
84 LXF288 May 2022
Falkon feels like a slimmed-down version of Chromium optimised for the Plasma desktop.
EXPLORE THE FALKON INTERFACE 1
2
3 5 4
Tabbed browsing Detach, duplicate, pin, mute or unload a tab via the context menu. Restore accidentally closed tabs with Ctrl+Shift+T.
Customise Falkon Some great features may be not enabled by default. Access Preferences to enable spell checking, auto-scrolling or mouse gestures.
Built-in ad blocker Falkon ships with a number of useful plugins, and by default it’s enabled blocking ads with a built-in AdBlock plugin.
Swift performance Falkon relies on the QtWebEngine backend, which is an adapted version of Chromium. It’s very fast!
1
2
4
5
Main menu with extra features Review your browsing history, create private windows, manage sessions and organise your bookmarks.
3
www.linuxformat.com
CODING ACADEMY CODING ACADEMY Rust system tools
RUST
Coding secure Rust system tools
Part One
Don’t miss next issue! Subscribe on page 18
Make yourself comfortable, as Mihalis Tsoukalos explains the basics of Rust, so you can write memory-secure system utilities. ust has become a key language for the Linux kernel and beyond. This series on systems programming with Rust will cover the basics, including memory management, working with command line arguments and environment variables, the cargo tool and writing tests. You’ll learn how to work with files and directories, file I/O, UNIX processes, concurrency and network programming.
R
OUR EXPERT Mihalis Tsoukalos is a systems engineer and a technical writer. Find him on Twitter using @mactsouk.
Get the for this tutorial from the Linux Format archive: www. linuxformat. com/archives ?issue=288
90 LXF288 May 2022
Installing Rust
You can use the package manager that comes with your Linux distribution to install Rust. On an Arch Linux machine, you can install Rust by running pacman -S rust with root privileges – this will also install the cargo tool (explained later on). New, stable Rust versions are released every six weeks) and sometimes without full backward compatibility. You can find out what version of Rust you’re using by executing rustc --version . Note: Rust source code files usually have the .rs file extension.
Data types
Let’s look at the basic data types of Rust and how you can define new variables. Because Rust is a statically typed language, it must know the types of all variables of a program at compile time. Additionally, Rust supports both mutable and immutable variables. All Rust variables are immutable unless defined otherwise. The integer types of Rust have the i<bit> format for the signed versions and u<bit> format for the unsigned versions. The data type of floating point numbers can be either f32 or f64, depending on the bits used. Rust also supports the Boolean type, which can have the true and false values. Rust offers support for the character type. A char is always four bytes in size. You define a char variable using single quotes. Rust supports two data types for working with strings: String and str. The String type is for working with mutable strings and has a length and a capacity property. On the other hand, the str type is for working with immutable strings that you want to pass around. You’ll most likely see a str variable be used as &str – put simply, a str variable is accessed as a reference to some UTF-8 data. A str variable is usually
Here’s the Rust code of dataTypes.rs where you can briefly see how to work with variables, strings and data type conversions in Rust.
called a “string slice” or, even simpler, a “slice”. You can’t add or remove data from an existing str variable. This code excerpt from dataTypes.rs defines three string variables: let lxf: &str= “Linux Format”; let magazine: &'static str = “magazine”; let my_str = format!("Hi {} {}!”, lxf, magazine);
The previous statements show that there’s more than one way to define a string in Rust. The use of format!() is the most versatile one because it enables you to construct a string. Finally, Rust prefers variable names like a_variable instead of aVariable. The screenshot (above) shows the entire code of dataTypes.rs. The code reveals the use of strings and integers, the definition of variables and the conversion among strings and integer values.
Command line arguments
We’re going to skip the usual “Hello World” program and present a program that illustrates how to work with command line arguments. The name of the file is cla.rs and uses std::env to read the command line arguments. Its most interesting part is the following: for argument in env::args() { counter = counter + 1; println!("{}: {}”, counter, argument); }
www.linuxformat.com
CODING ACADEMY Rust system tools
Although macros look a lot like Rust functions, they differ in one key aspect. Macros can have a variable number of parameters whereas the signature of a Rust function must declare its parameters and define the exact type of each one of these function parameters.
release heap allocated memory. The technique used by Rust releases memory when a variable goes out of scope. The technique used by Rust is called Resource Acquisition Is Initialization (RAII). Once a variable goes out of scope, Rust calls the destructor and releases the relevant memory. Part of the Rust memory management are the concepts of ownership and borrowing, which are explained below.
Ownership
Ownership is the Rust way of the developer gaining control over the lifetime of a variable – and to be safe, the language! Put simply, ownership means that the pass of a variable also passes the ownership of the value to the new variable. What do we do in ownership.rs? We define an integer variable (integer) and create a mutable variable that’s based on integer. Rust performs a full copy for primitive data types because they’re cheaper so in this case the integer and my_integer variables are independent from each other. However for other types, such as a Vector, it’s not permitted to change a variable after you’ve assigned it to another variable because no copying takes place. Additionally, you should use a reference to an existing Vector variable. Please refer to the ownership.rs code for more details. Running ownership.rs produces the following output: integer is 321 my_integer is 321 my_integer is 124 a_correct_vector is [1, 2, 3, 4, 5]
Rust catches mistakes related to ownership at compile time – in fact, Rust uses ownership to provide code safety. If you want to learn more about ownership, you can visit https://doc.rust-lang.org/book/ch04-00understanding-ownership.html.
Borrowing and references
There’s another Rust feature related to ownership that’s called Borrowing and this is related to memory management. Borrowing is about taking control over a variable for a while and then returning that ownership of that variable back. Although borrowing enables you to have multiple references to a variable, only one reference can be mutable at any given time! The screenshot (see page 91) shows the code of borrowing.rs. If you remove the curly braces, the code is going to fail to compile because you’ll have two mutable variables (a_var and b_var) that point to the same memory location in the same scope. The curly braces
This shows the main help screen of the Cargo tool, which is the official Rust package manager that comes with all Rust installations.
92 LXF288 May 2022
Here’s the contents of Cargo.toml and ./src/main.rs from the LXF Cargo project. main.rs contains regular Rust code whereas Cargo.toml contains information about the project and its dependencies.
make b_var a local variable that references a_var, changes its value and returns the ownership back to a_ var as soon as the end of the block is reached. Because both a_var and b_var share the same memory address, any changes to b_var will affect a_var as well.
The Cargo tool
Cargo is the Rust package and compilation manager and is a useful command line tool for creating Rust projects. The screenshot (below left) shows the main cargo tool help screen. The command for creating a Rust project named LXF with Cargo is cargo new LXF --bin . The --bin command line option tells Cargo that the outcome of the project will be an executable file, not a library ( --lib ). The output from the cargo tool and the contents of the LXF directory are as follows: $ cargo new LXF --bin Created binary (application) `LXF` package $ cd LXF; tree . |— Cargo.toml |— src |— main.rs 1 directory, 2 files
The single most important file in a cargo project is Cargo.toml, which is where you declare the dependencies of your project as well as other metadata that Cargo needs to compile your project. You can also identify the version of Cargo with cargo --version .
Your first Cargo project
In this section we’re going to convert fibo.rs into a Cargo project. First, we need to create a new Cargo project named LXF – this was illustrated in the previous section. After that we should put the contents of fibo.rs into ./src/main.rs, which is the default Rust source code file. The contents of Cargo.toml and ./src/main.rs are shown in the screenshot (above). If everything is correct, you should be able to run your project using cargo build and execute it with cargo run . The debug version of the executable file can be found in ./target/debug/LXF. You can clean up a Cargo project by executing cargo clean .
Writing Rust tests
In this section we’re going to write tests for the Cargo project that calculates Fibonacci numbers. A test in Rust is a function that’s annotated with the test attribute –
www.linuxformat.com
9000
NEXT MONTH The #1 open source mag
BULLET-PROOF UBUNTU 22.04 Get the most stable, long-term install around with our guide to tweaking your Ubuntu for a trouble-free Linux life.
LXF2on8s9ale
will be Tuesday 3 May 2022
Clean up your room!
Discover the finest file-sweeping, deduplicating and clean-up tools to help keep your terrabyte-sized drives squeaky clean.
What’s in store?
There might not be any walled gardens here, but we see if the new generation of Flatpak and Snap stores are worth the bother.
Wine wine wine!
With Steam Deck out and about, we test the latest Proton builds to help you achieve better gaming compatibility.
Future Publishing Limited, Quay House, The Ambury, Bath, BA1 1UA Email linuxformat@futurenet.com EDITORIAL Editor Neil Mohr Pi eater-in-chief Jonni Bidwell Art editor Catherine Kirkpatrick, Efrain Hernandez-Mendoza Operations editor Cliff Hope Group editor-in-chief Graham Barlow Group art director Jo Gulliver Editorial contributors Mike Bedford, Neil Bothwick, Mark Gardener, Wes Fenlon, Matthew Hanson, Matthew Holder, Jon Masters, Nick Peers, Les Pounder, Michael Reed, David Rutland, Mayank Sharma, Shashank Sharma, Mihalis Tsoukalos, Alexander Tolstoy, Mike Williams Cover illustration magictorch.com Raspberry Pi is a trademark of the Raspberry Pi Foundation. Tux credit: Larry Ewing (lewing@isc.tamu.edu) and The GIMP. The GIMP Wilber logo by Tuomas Kuosmanen tigert@gimp.org
ADVERTISING Commercial sales director Clare Dove clare.dove@futurenet.com Senior advertising manager Lara Jaggon lara.jaggon@futurenet.com Head of commercial – Technology Dave Randall dave.randall@futurenet.com Account director Andrew Tilbury andrew.tilbury@futurenet.com INTERNATIONAL LICENSING Head of Print Licensing Rachel Shaw Linux Format is available for licensing and syndication. To find our more contact us at licensing@futurenet.com or view our content at www.futurecontenthub.com. NEW SUBSCRIPTIONS & BACK ISSUES Web www.magazinesdirect.com UK 0330 333 1113 World +44 (0) 330 333 1113 EXISTING SUBSCRIPTIONS Web www.mymagazine.co.uk UK 0330 333 4333 World +44 (0) 330 333 4333 Subscription delays: Disruption remains within UK and International delivery networks. Please allow up to 7 days before contacting us about a late delivery to help@magazinesdirect.com CIRCULATION Head of newstrade Tim Mathers PRODUCTION AND DISTRIBUTION Head of production UK & US Mark Constance Production project manager Clare Scott Senior ad production manager Jo Crosby Digital editions controller Jason Hudson THE MANAGEMENT MD, tech specialist Keith Walker Head of art and design Rodney Dive Design director Brett Lewis Commercial finance director Dan Jotcham Printed by Wyndeham Peterborough, Storey’s Bar Road, Peterborough, Cambridgeshire, PE1 5YS Distributed by Marketforce, 5 Churchill Place, Canary Wharf, London, E14 5HU www.marketforce.co.uk Tel: 0203 787 9001 Linux® is the registered trademark of Linus Torvalds in the U.S. and other countries. GNU/Linux is abbreviated to Linux throughout for brevity. Where applicable code printed in this magazine is licensed under the GNU GPL v2 or later. See www.gnu. org/copyleft/gpl.html. All copyrights and trademarks are recognised and respected. Disclaimer All contents © 2022 Future Publishing Limited or published under licence. All rights reserved. No part of this magazine may be used, stored, transmitted or reproduced in any way without the prior written permission of the publisher. Future Publishing Limited (company number 2008885) is registered in England and Wales. Registered office: Quay House, The Ambury, Bath BA1 1UA. All information contained in this publication is for information only and is, as far as we are aware, correct at the time of going to press. Future cannot accept any responsibility for errors or inaccuracies in such information. You are advised to contact manufacturers and retailers directly with regard to the price of products/ services referred to in this publication. Apps and websites mentioned in this publication are not under our control. We are not responsible for their contents or any other changes or updates to them. This magazine is fully independent and not affiliated in any way with the companies mentioned herein. If you submit material to us, you warrant that you own the material and/or have the necessary rights/permissions to supply the material and you automatically grant Future and its licensees a licence to publish your submission in whole or in part in any/all issues and/or editions of publications, in any format published worldwide and on associated websites, social media channels and associated products. Any material you submit is sent at your own risk and, although every care is taken, neither Future nor its employees, agents, subcontractors or licensees shall be liable for loss or damage. We assume all unsolicited material is for publication unless otherwise stated, and reserve the right to edit, amend, adapt all submissions. All contents in this magazine are used at your own risk. We accept no liability for any loss of data or damage to your systems, peripherals or software through the use of any guide. Notes: Effy’s away! We are committed to only using magazine paper derived from responsibly managed, certified forestry and chlorine-free manufacture. The paper in this magazine was sourced and produced from sustainable managed forests, conforming to strict environmental and socioeconomic standards. The manufacturing paper mill and printer hold full FSC and PEFC certification and accreditation.
Future is an award-winning international media group and leading digital business. We reach more than 57 million international consumers a month and create world-class content and advertising solutions for passionate consumers online, on tablet & smartphone and in print.
Open Build Services
The easy online way to build and package your open source tools and fire them off to every distro in the land! Contents of future issues subject to change – we might have popped around Putin’s Palace to protest!
98 LXF288 May 2022
Future plc is a public company quoted on the London Stock Exchange (symbol: FUTR) www.futureplc.com
Chief executive Zillah Byng-Thorne Non-executive chairman Richard Huntingford Chief financial officer Penny Ladkin-Brand Tel +44 (0)1225 442244