0% found this document useful (0 votes)
162 views100 pages

10 Hot Pi Projects

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
162 views100 pages

10 Hot Pi Projects

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 100

VIDEO EDITING WRITE A NOVEL GET CHATTING!

Get better videos in Grab the best open We test the most
Ubuntu with Kdenlive source writing tools powerful Matrix clients

PLUS!
How to contribute to
open source projects

The #1 open source mag

NEW FOR 2023

10 HOT Pi
PROJECTS
Break out your Raspberry Pi
and Picos to discover fun and
thrilling builds for all!

HOW TO…
Master GIMP layers
67
Pages of
Get started with SerenityOS tutorials &
Take better notes with Obsidian features

MONITOR PACKETS EASY SIGN-UPS CODE WEB APPS


LXF February 2023

Keep an eye on your Create QR codes for Play with our Python-
TCP/IP network traffic fast and simple logins based catalogue tool
WELCOME

Build the future


We’re kicking off 2023 with a selection
of hot Pi projects – what maker builds Why didn’t you pick up that flashy
MacFormat or shiny T3 magazine?
or new open source ventures would you Perhaps you don’t own a Mac, or
recommend for readers to try this year? don’t care about iPhones or
Samsung Folds – I hear they’re
very slick. Do you hate technology?
Oddly, you can’t actually buy a
Matthew Holder Future-published Windows
The key to learning a new skill is to tackle magazine any more – people lost
it in bite-sized chunks. For example, if you interest years ago…
wish to learn about programming and using Perhaps that’s it – you’re
GPIO, decide what your end goal is and interested in how things work,
start small. On day one, make an LED blink, you’re interested in what goes
on day two, read the state of a switch, and build from there. on underneath and what makes a system tick. While Apple,
Microsoft and much of the tech world are desperate to hide all
the complexity away, there are still people who enjoy getting their
Nick Peers hands dirty and learning what makes something run.
This year’s hot new find for me is the So when Eben Upton first revealed the Raspberry Pi’s naked
fabulous Audiobookshelf, a self-hosted PCB back in 2012, much of the tech world moved on for lack of
streaming server for audiobooks and a shiny alloy case to attract its attention. But makers, the open
podcasts. Since its debut in September source community and the curious brought down the pre-order
2021, it’s come on in leaps and bounds to web servers faster than any mob could move. With sales now
become the best in its field by some way. Who needs Audible? topping 50 million units, as much to the commercial sector as
enthusiasts, the Raspberry Pi Foundation, with its primary focus
on education, is perfectly positioned to help build futures – for
Les Pounder children, for open source projects, for makers and for industries.
The ESP32 range of boards have most So, if you have a Raspberry Pi or Pi Pico and are wondering
excited me in 2022, so for 2023 I implore what you can do with it, why not build yourself a future? Jump to
you to give one a go. The Banana Pi Pico W page 32 and start having fun with our selection of hot projects for
shares the same pinout as the Raspberry Pi 2023 – you’re bound to enjoy them all!
Pico – Adafruit’s range of ESP32 boards
cannot be beaten for quality and support.

Neil Mohr Editor


Michael Reed [email protected]
For a new year’s resolution, I ought to get
a Nextcloud server on my Pi. It would be
nice to have all my file and media sharing
in one place, because at the moment, I
seem to be relying on about three different
proprietary solutions whenever I need to get at my stuff.

Mayank Sharma Subscribe


I’ve been thinking of building OpenCat, a
Pi-powered robotic cat, since forever. It can
& save!
pose, crawl, balance, recover from falls,
actually does as you say, and doesn’t poop On digital and print:
on your sofa. Funnily, this build always see page 16
seems to get on my new year wish list but doesn’t come off it.

www.techradar.com/pro/linux February 2023 LXF298   3


Contents SUBSCRIBE NOW!
Page 16

HOT Pi
REVIEWS

Wix  19
A giant in the website builder industry,

PROJECTS
Shashank Sharma takes the feature-rich
Wix for a test drive and discovers there’s
plenty to like under the bonnet.

AMD Ryzen 5 7600X  20


AMD’s latest Ryzen offering is a beastly
‘budget’ gaming CPU but one that
Christian Guyton has discovered has a Dig in to our New Year smorgasbord
big if temporary drawback.
of hot Pi projects, from Pico
devices running Micro
Python to full-Pi setups,
with expert guidance
from Les Pounder
and Matt Holder.
WattOS R12  21 See page 32!
Nate Drake explores how WattOS can
magically bring your ancient hardware
back to life with this zippy, if spartan
Linux distribution.

Kali Linux 2022.04  22


If you exist in the grey twilight between
good and evil, and want to look cool while
doing it, David Rutland has just the deity-
based distro for you.

Nitrux 2.5.1  23
An impressive beginner distro that’s well
worth your time, even if you spend most
of that tweaking its many, many settings,
says Mayank Sharma.
ROUNDUP IN DEPTH

Victoria 3  24
“The peasants are revolting,” cries The
Management, but really it’s just Jonathan
Bolding serving up their afternoon tea
and biscuits.

Matrix message clients  26 Contributing for non-coders  44


Mats Tage Axelsson examines the Aaron Peters, who is a coding tinkerer
potential of distributed messaging and at best, describes some ways that non-
federated authentication servers that use technical folks can contribute to open
the Matrix protocol. source projects.

4    LXF298 February 2023 www.linuxformat.com


CONTENTS

Pi USER TUTORIALS

Pi news  49 TERMINAL: Tackling tabular tables  56


Introduced by Neil Mohr, who can’t get With the right tools at his disposal,
enough Pi. Christmas deliveries of Shashank Sharma has no trouble making
100,000 Raspberry Pis, plus two fruity sense of his vast heaps of endless Formula
Pi alternatives. One tabular data.

Petoi Bittle Robot Dog  50 BIBISCO: Plan and write a novel  60


The rise of quadruped robots is upon us — Nick Peers reveals how to develop better
their mission to boost STEM and AI stories with the help of our favourite
learning with Anj Bryant. freemium app for budding novelists and
part-time magazine authors.
Elegoo Neptune 3 Pro 51
Denise Bertacchi wishes everything
in life could be relied upon to add
more features while remaining
excellent value.

Pi robots: motors
and control 52
In part two of his series,
Les Pounder shows us how
to safely connect and control
motors with a Raspberry Pi. KDENLIVE: Polish your video footage  64
Michael Reed looks at how you can use
the best open source video editor,
CODING ACADEMY Kdenlive, to produce high-quality clips
suitable for uploading all over the internet.
Monitor TCP/IP networks with eBPF 90
Naturally suspicious, Mihalis Tsoukalos GIMP: Fun with layers and masks  70
keeps an eye on all his network traffic Karsten Günther explains how GIMP
using eBPF – and he’ll show you how, too. manages layers, what the different types
are and how they differ from channels,
Finish your cataloguing app  94 plus how to get the most out of them.
With a tear in his eye, Matt Holder finishes
up our cataloguing database app by GIMP: Create better QR codes  74
adding search and export functionality. Mike Bedford reveals how to get creative
with your QR codes so you can draw more
attention to them and turbo-boost your
newsletter sign-ups, so we’re told.

REGULARS AT A GLANCE OBSIDIAN: Nifty note-taking  76


Nate Drake walks you through adopting
the almighty Markdown-based note-taking
News  6 Subscriptions  16 app to see whether it lives up to its legend
Tumbleweed moves to x86-64-v2 – will Get your monthly Linux dose and save cash! and can help with his lighthouse project.
you be left behind? Rust grows in the
kernel, Asahi Linux ports Linux to M1/M2 Back issues  68 SERENITYOS: Direct from the source  78
Macs, and AMD opens up ray tracing. Get hold of previous Linux Format editions. What do you get if you take a modern
kernel, a classic GUI and a handful of
Kernel watch  10 Overseas subscriptions  69 custom apps? Michael Reed has a bit of
Get Linux Format shipped around the globe. a chat with the developers behind it.
Answers  11
We help you with remote desktop work, HotPicks  83
forgotten passwords, merging partitions, Mayank Sharma might have figured out
exploring SSH tunnelling, YouTube what to do until F1 2023 – master all this
downloading and much more. open source software he’s found for us:
Cryptomator, PowerShell ,OSM, Logseq,
Mailserver  14 Easy Effects, Ear Tag, Gabut Download
Linux Format lends a hand, a look back at Manager, 3D-Puzzles, Total Chaos,
one reader’s long career in computing, and Metadata Cleaner and Hidamari.
we learn about an amazing scheme
repurposing ageing laptops. Next month  98

www.techradar.com/pro/linux February 2023 LXF298   5


Newsdesk
THIS ISSUE: CPU support Rust Linux on Apple AMD
ray tracing Thunderbird for Android RGB lighting

DISTRO

OpenSUSE to drop
early 64-bit CPUs
Tumbleweed moves to x86-64-v2 – do
you even know which version you have?
umbleweed is SUSE’s rolling release v4 has AVX512, which is limited to server chips SUSE’s Tumbleweed prides itself on

T distro and is constantly updated


with the latest stable software;
and Intel’s Core-X. Unless your system is over 10
years old, you’re probably fine. The loss of earlier
being at the leading-edge of Linux
distros. To stay there means dropping
development is handled by OpenSUSE Factory. versions of the Atom chips might sting – some support for older 64-bit processors.
Tumbleweed’s Dominique Leuenberger has sent were released as recently as 2013 and were still
an email to the Factory mailing list saying the v1 – but otherwise Athlon 64, Pentium-D and
Factory is “repurposed to move forward with first-gen Intel Core 2 are the main victims.
x86-64-v2”. This leaves the first generation of Need we worry, though? Probably not.
64-bit chips dead when implemented. A new Tumbleweed isn’t an average distro, nor is Leap;
repository will be created for legacy systems both target business rather than home. Red Hat
but will require volunteers to keep it running as, Enterprise Linux 9 has announced a similar
after setting it up, Leuenberger says he won’t move. Support for x86-64-v1 will start to fade
touch it. SUSE Linux Enterprise is already due to on bigger commercially orientated distros, but
move to x86-64-v2 (it had considered moving one thing the whole community is good at is
to v3, but this was dropped as a step too far). building distros: whatever your hardware, if it is
Given that Leap is derived from Tumbleweed, it at all possible to run Linux on it, somebody will Still running an Intel Core
can only be a matter of time before that joins build a distro that can. Things have to move on architecture chip? Some are
the list. It makes sense – Tumbleweed is aimed at some point, and who still laments the start of still decent enough!
at high-performance and enterprise applications the end of x86-32 support about 10 years ago?
and the bar has to move at some point. Even now there are plenty of distros that run on
Not all 64-bit chips are the same but you will a 32-bit box, most notably Debian. If you are in
be forgiven for not knowing which generation charge of server racks, you might like to start
of architecture you have. In 2020, AMD, Intel, checking your processors, though.
Red Hat and SUSE got together to define the See the SUSE page at https://en.opensuse.
difference between various implementations org/openSUSE:X86-64-Architecture-Levels.
of the instruction set because, over the years,
numerous extensions had been added, and if
you wanted to access these directly, you needed ROLLING ON AND OVER…
CREDIT: SUSE, Intel PR

to know if a chip included support. To make this


“easy”, x86-64 architectures were divided into Tumbleweed is aimed at high-
four versions, each representing a minimum
level of support: x86-64-v1 is the baseline; v2 performance applications and
starts around 2009 and includes SSE4; v3
appeared around 2015 and includes AVX2; while the bar has to move at some point
6    LXF298 February 2023 www.linuxformat.com
NEWSDESK

PROGRAMMING LANGUAGE OPINION

Rust testing the kernel TURN TO


LLVM is ready to check your distro. RUST
he release of Linux Kernel 6.1
T introduced a significant
change: support for a second
language, Rust. This offers developers
intriguing options. There are 30 million
lines of code in the kernel, so it’ll be
many years before Rust becomes a Adrian Ratiu
significant part of it. For now, all we is a senior software
have is some sample modules and engineer at Collabora.
subsystem-specific bindings. There
aren’t any real device drivers yet, but After waiting in the
the basic infrastructure has been laid Linux-next integration
down. At the last Linux Maintainers tree for about 18 months,
Summit, Linus Torvalds asked for this Linux is no longer the home of pure C. If you go with Rust, the basic Rust infrastructure
new infrastructure to be tested, and it has now kernel testing is in place, albeit in a limited form for now. finally landed in the mainline
been added to the KernelCI (the community- Linux kernel with the release
based testing project that makes sure Linux It is still very early days for Rust and Linux, of v6.1. While this did not
passes muster). There’s a simple command to but the plan is that the capability to do any include any real device
check a distro has the required dependencies, required testing will keep pace, which is why drivers and only a few toy
which returns the curt but friendly message basic testing has been put in place before the sample modules, further
“rust is available!” if they are. Currently, only kernel supporting it was even released (by six subsystem-specific bindings
version 1.62 of the LLVM-based Rustc compiler days, anyway). The next step is kunit tests, more with real drivers should be
is supported, so there’s some work to do yet. toolchain and Kconfig combinations. However added in the future.
(LLVM is a set of low-level complier tools that enthusiastic the uptake for developing the During the 2022 Linux
CREDIT: LLVM.org

help develop front and back-ends for any kernel using Rust proves to be, it’ll be a while Maintainers Summit in
instruction set architecture; it’s language before wide-scale testing of drivers and other Dublin, Linus Torvalds asked
independent.) The GCC Rust front-end is components written in Rust is required. When CI systems to start testing
currently being worked on, but for now, if you Mr Torvalds asks for help with the kernel, it the new Rust infrastructure.
want Rust in your kernel, you need to use LLVM. seems things get done pretty quickly. So, with that in mind, Rust
testing has now been added
to KernelCI!
Of course, the future of
Rust in the Linux kernel in
APPLE general and what community

Linux and the M1


adoption Rust will have
within the project remains
uncertain. The codebase is
still in its early stages of
The making of Asahi Linux for Apple. experimentation and some
topics are controversial.
he Asahi Linux project has a grand story of how the feat was achieved has However, we do plan to help
T ambition: a porting effort to get
Linux running on Macs powered by
appeared in a blog by Lina entitled Tales Of The
M1 GPU (https://asahilinux.org/2022/11/tales-
test Rust code via KernelCI
and this is why we’ve added
Apple’s own silicon, the M1/M2 chips. Work of-the-m1-gpu), which makes for inspiring build testing early.
started early in 2021, not long after Apple reading. It begins with Alyssa Rosenzweig Going forward, we plan
announced it was going its own way with reverse engineering the M1’s GPU and driver, to add kunit tests, more
processors. No easy task, but it seems we’ll while Dougall Johnson documented the shader toolchain and Kconfig
have a functional native GPU driver sooner architecture. In no time they were drawing combinations, GCC-Rust
than we expected as we’ve been treated to a triangles. Enter Lina to add the kernel driver. It when it eventually becomes
demonstration of a Direct Rendering Manager then gets a bit complicated and involves Python, ready, extendt testing to
driver written in Rust running Gnome, along Mesa, Rust and some coding magic. On 7th cover more subsystems and
with a selection of apps including YouTube December, we got an alpha release of the first architectures (as they are
and Firefox, all on an Apple M1 chip. Apple GPU driver – it’s buggy and hasn’t passed added), and just maybe, if the
The magic was attributed to one Asahi OpenGL conformance tests, but it mostly works. stars align, even do boot and
Lina, who joined the project a few months ago. At the end of this road is a fully functional Linux runtime testing, bisections
Presumably this is a pseudonym, or an almost system running on Apple hardware, a tantalising and the like for drivers
unbelievable coincidence. Now a detailed prospect. It’s a significant milestone, top work. implemented in Rust.

www.techradar.com/pro/linux February 2023 LXF298   7


NEWSDESK

OPINION GRAPHICS

EXPERT AMD opens


ADVICE up ray tracing
The Radeon Raytracing Analyzer You now have 69,420 odd lines of AMD code
finally goes full open source. to help develop ray-tracing apps on Radeon
GPUs as AMD embraces open source.

ast summer, AMD added its Radeon that will produce a performance bottleneck.
Keith Edmonds
is MD of Tiger Computing,
L Raytracer Analyzer (RRA) to its
development suite to help ray
The package even includes build instructions,
currently tailored to Ubuntu. Good stuff for
which provides support for tracing with DirectX and Vulcan APIs. The developers as you can delve deeper into the ray
businesses using Linux. initial release was binary-only, although some tracing guts of Radeon GPUs, including the new
documentation mentions the MIT Licence. RDNA 3. AMD’s approach is laudable, unlike
Linux isn’t like Now it is properly open source as part of Nvidia’s. It has a similar software suite, Nvidia
Windows or Mac OS. AMD’s GPUOpen project, its middleware GameWorks, which is only partially open source.
You know that, of course, suite aimed at developers. RRA aims to ease Linux gaming is growing and to fully support
but it could be news to some the transition from rasterisation to ray tracing that, you’ve got to go open source; it comes

CREDIT: AMD
of your users. with tools to help organise model geometries with the territory. Nvidia’s recalcitrance looks
What they see is a and to understand and finesse ray tracing counterproductive.
computer. Desktop, laptop, performance. Using RRA, you can visualise You can find GPUOpen at https://github.
tablet; Dell, Apple, Lenovo; bounding box hierarchies and easily see areas com/GPUOpen-Drivers/libamdrdf.
Android, Windows, Mac OS.
It’s a computer, and you fix
computers, right?
Yes, you can probably
make an attempt at fixing
EMAIL LIGHTING

The K-9 and OpenRGB gets


systems that you don’t
normally work on. There
are enough similarities

Thunderbird a big update


that you can probably help
at least with the more
straightforward things.
But are you an IT
generalist or specialist?
The generalist can be likened
merger Extensive new device support.
penRGB aims to cut through the
to your GP – they have a
wide range of medical
New milestone in project to
completely rebrand K-9.
O bloated proprietary systems and offer
a single open source way to control
knowledge, but for most RGB lighting with one app. As you might expect,
areas, they don’t possess the he Thunderbird for Android project this means delving into a lot of inadequately
required in-depth knowledge.
The person to be in the IT
T is the reworking of K-9 Mail until its
look and feel match Thunderbird, at
documented material from myriad, often
uncooperative, sources. OpenRGB has released
world is the specialist, not which point it’ll get rebranded. The team is a new stable version, 0.8, which has been over a
the generalist. You want to busy adding features – the latest is a redesign year in the making. It’s a major affair with 22
be known for providing of the message view. The UI changes include a pages of merged and closed MRs. Along with
excellent Linux support to reply action with overflow menu, colour-coded new features, bug fixes and so forth, there’s an
your customers – and you account names, and organisational labels. Tap extensive list of new device support, although
don’t need to worry about the top section of the message and it opens a there are still the inevitable omissions.
other systems. bottom sheet with message details, including
The specialist has the each recipient’s contact details. This brings Fancy RGB
knowledge and experience. K-9 into line with Thunderbird, but adds screen lighting looks
They know when to seek clutter that doesn’t endear itself to those who good, but
more in-depth information prefer K-9’s simpler approach. The project is each has its
own control
and how to use it. You don’t still a work in progress and the exact feature
CREDIT: OpenRGB.org

software. Enter
have to be a generalist. set isn’t nailed down, so your feedback now
OpenRGB: one
When you’re asked to look could count. The final transformation of K-9 lightweight
at a system you don’t know, Mail is due summer 2023, when it will be fully app to rule
it’s OK to tell the owner subsumed into the Thunderbird family. Read them all.
that you’re a Linux the blog at https://thunderbird.topicbox.com/
expert only. groups/android-planning.

8    LXF298 February 2023 www.linuxformat.com


NEWSDESK

Distro watch
OPINION

HAPPY
Fresh from the farm. NEW YEAR
NOMADBSD 131R
This is a distro designed to be run from a USB flash
drive and is based around FreeBSD, this time version
13.1. New features include two images, one using ZFS
and one using UFS for the filesystem, with the latter
having soft updates journaling. The automated Donnie Berkholz
graphics driver has been updated, including support is senior vice president,
for VIA, and there’s a new display manager: SLiM. To product, at Percona.
keep the image size down, LibreOffice and some This distro likes to travel on a memory
multimedia applications have been removed. stick. With automated hardware detection The start of a year
and setup, it’s ideal for data recovery. always brings a raft of
predictions about what will
be different in the next 12
LINUX MINT 21.1 BETA months. I prefer new year’s
Linux Mint has been designed to give the classic resolutions, as these are
desktop experience with custom tools to make for a actions you can take yourself.
convenient out-of-the-box web-based installation, My first resolution is to
ideal for beginners. There are custom menus and look at platform engineering.
desktop, and many unique configuration tools. It’s This takes the self-service,
based on Ubuntu and is also compatible with automated approach that is
Ubuntu repositories. This new development common in the cloud and
snapshot includes Flatpak support integrated into applies it to self-managed
the Software Manager, which makes it easy to Aimed at those looking for a simple software, like open source
distinguish between Flatpaks and system packages, desktop-focused intro to Linux, it has a projects. It brings what
and switch between them. fuss-free install and a suite of major apps. people like about the cloud –
ease of getting started, ability
to work more efficiently –
NIXOS 22.11 and keeps the level of
Originally a research project, this independently freedom and control in your
developed GNU/Linux distro aims be the state of hands that open source
the art in system configuration management. The provides. Adopting some of
entire OS, kernel, apps and system packages are built these approaches should
by the Nix package manager and stored separately help you get more done.
from each other. It has reliable rollbacks and a Secondly, look at data
reproducible system configuration. Gnome, KDE ownership. Are you able to
Plasma, Cinnamon and other elements have been manage where your data is
updated. This release will also check to make sure processed and stored? In the
your passwords are strong enough. To make a neat arrangement of packages, US, the California Privacy
there are no /bin, /sbin, /lib or /usr Rights Act will come into
directories; everything lives in /nix/store. force in July 2023, while the
EU continues to build new
legislation around data. All
OPENINDIANA 2022.10 these rule changes will affect
A continuation of the OpenSolaris OS, OpenIndiana how you design and build
CREDIT: Nomad, Linux Mint, nIXos, Deepin

offers a full open source alternative to Solaris 11. This apps and data. Open source
is the first update for a year and contains updates of projects have made it easier
many components, including Firefox, Thunderbird, to manage this kind of
LibreOffice, Perl, Mate desktop, Python and more. requirement, but check if you
Other upgrades include the ability to mount and need to make any changes.
install media using NFS, the latest Intel and AMD Lastly, find a way to
microcode updates, enhancements to BHyVe and support your local
the internal SMB server, and updated Nvidia drivers. community. If you can give
Born out of the uncertainty after Oracle back around documentation,
acquired Sun, this has grown into a full code or financial support,
community-based open source alternative. please do so. It makes
a big difference.

www.techradar.com/pro/linux February 2023 LXF298   9


NEWSDESK

Kernel Watch
OPINION

BYE, 2022!
Jon Masters keeps an eye out for all the latest
happenings in the Linux kernel, so you don’t have to.
inus Torvalds announced the complex) data structure with a long history, and
Jon Masters is a kernel hacker
who’s been involved with Linux
L release of Linux 6.1 just in time for
the holidays. On the one hand, users
commonly used in Linux for VMA management.
VMAs are how regions of virtual memory are
for over 22 years, and works on could see it as a nice Christmas present, but maintained in the kernel. One problem with
energy-efficient Arm servers. it made the whole end of year period quite “rbtrees” is that “walking the nodes in numerical
frantic for kernel developers. The reason for order is not very efficient”. Maple trees aim to
I’m writing this as we this is that following a new kernel release improve upon this and scale up to much larger
near the end-of-year typically comes a two-week merge window, systems with less overhead.
holiday period, a time when during which disruptive changes planned for Multi-generational LRU aims to improve the
we tend to look back at the the next release are merged into the code process by which Linux decides what data in
past 12 months. And what base (these are subsequently stabilised in memory should be paged (swapped) out to disk.
a year 2022 was. My wife the RC or Release Candidate kernels). Applications commonly allocate more virtual
and I bought our first house As we’ve mentioned before, Linux 6.1 is memory than they either use or is available,
– and five Linux kernels likely to be the next Long Term Stable kernel with the kernel swapping unused data out to a
were released! We started maintained by Greg K-H (Kroah-Hartman) for swap partition on disk. CPU hardware known
the year with Linux 5.16, several years through stable backports. as an MMU (memory management unit) helps
which added memory folios We’ve also mentioned that it is the first swap it back in again when needed, but this can
(improving the scaling of kernel to include support for the Rust have tremendous overhead if in a critical path.
certain memory operations) programming language. While these are Finally, Linux 6.1 gains enhancements for
and support for Intel AMX. interesting headline features, perhaps even memory-tiering. This is where machines don’t
Next came Linux 5.17, which more interesting is the number of internal just have the traditional NUMA (non-uniform
added a P-state (power) changes in 6.1. These include a new data memory access) nodes associated with RAM
driver for AMD systems, and structure – the maple tree – to replace red- chips that are closer to CPU sockets but also
Linux 5.18, with scheduler black trees for tracking virtual memory areas have different categories of memory. For
improvements and a switch (VMAs), multi-generational LRU patches that example, with CXL (Compute Express Link), a
to the C11 standard. impact swapping, and various changes to machine might have DDR memory attached to
The summer brought improve memory-tiering support. the CPU, and also in a separate box connected
Linux 5.19, which added Maple trees replace red-black trees, a data using a CXL link. That separate memory might
support for AMD’s SEV-SNP structure optimised for frequent insertion be large, but slower to access than local RAM.
and Intel’s TDX Confidential and deletion, as well as good search Tiering helps to manage these differences by
Computing extensions. characteristics. They are a good (yet deciding where to place data between chips.
These allow for the creation
of specially encrypted
virtual machine guests that ONGOING DEVELOPMENT
can’t be spied upon by the
hypervisor. Autumn brought
Right on cue, following the Linux 6.1 data structures (known as page table
Linux 6.0, which includes
announcement, Regzbot (the regression entries) are actually shared as well. This
Runtime Verification (RV),
robot maintained by Thorsten Leemhuis) reduces memory overhead, particularly on
which aims to provide some
sent a notice of the 44 known regressions large systems with lots of sharing.
reassurance for use in more
in Linux 6.1, including a few new crash bugs. SeongJae Park (Amazon) leads the Linux
safety-critical environments
These are likely to be addressed in the DAMON project, an attempt to improve the
(such as in cars).
stable kernel updates from Greg K-H. Khalid memory management mechanisms for
And we round the year off
Aziz posted patches adding “support for modern workloads, particularly given that
with Linux 6.1 (see right). A
sharing page tables across processes “DRAM has not been increased enough to
tremendous amount was
(previously mshare)”. Sharing of memory accommodate such huge working sets”.
achieved during the third
regions between two processes is far from While the project is really interesting, it is
year of a global pandemic in
a novel concept – it’s used for dynamic also charming to see SeongJae organising
which many of us were also
shared libraries – but traditionally, this a regular “DAMON beer/coffee/tea chat
trying to catch up on lost
still involved some duplication of the data series” for interested folks to meet virtually.
time seeing friends and
structures used to track the actual memory It is something that, surprisingly, doesn’t
family, or in some cases
that was shared. With these patches, the happen often for particular kernel teams.
confronting the horrors of
war. I hope you have a
more relaxing 2023.

10    LXF298 February 2023 www.linuxformat.com


ANSWERS

Answers
Got a burning question about open source or the kernel?
Whatever your level, email it to [email protected]
Neil
Bothwick
eats Linux
desktop
problems for
breakfast!

Q Two PCs, one desktop


I am using a CentOS 8 Stream
single X session. You must have a desktop
session already open – it doesn’t work
using it for work, but you can protect your
data with an SSH tunnel:
desktop at work to run some software if your computer is displaying the login $ ssh -t -L 5900:localhost:5900 remote-
that uses a GUI. I want to be able to screen. The program outputs a stack of host ‘x11vnc -localhost -display :0’
connect to it remotely from a Windows information; near the end you should find $ vncviewer localhost:0
machine to continue working on a project something like The first line sets up the SSH tunnel to
from home or simply from another The VNC desktop is: remote-host:0 remote-host and starts up X11vnc, then
Windows PC in the office. So far, every PORT=5900 you run Vncviewer for localhost to go
remote desktop solution I tried either The port number can vary – VNC through the tunnel. If the first command
didn’t work at all or only opens a new starts from 5900. The number after the shows a port other than 5900, you can
blank session in Gnome. All I want is for hostname is the port number less 5900. press Ctrl+C to exit then run the command
it to work as the Remote Desktop works This is what you pass to your VNC client again with the port that was indicated.
in Windows, where I can always connect on the local computer:
to my Windows work PC from home and I
will see the screen exactly the way I left it
$ vncviewer remote-host:0
We used Vncviewer in this example,
Q More users than passwords
I inadvertently clicked on an icon
before leaving for home. but any VNC client works. You don’t even that changed access to a second user
Victoria Martin need to remember to run X11vnc before login. I was unaware there was a second
you leave for home if you have SSH access user with my name – it may have been
A The usual remote desktop systems,
such as VNC and X2Go, work by
– you can run it over an SSH connection.
That is why we pass the display name
there from when I loaded Mint 21 less
than six months ago. I don’t recall the
creating a new session when you connect. to X11vnc explicitly rather than using password so I’m searching under all rocks
There is a way to do what you need with $DISPLAY, as that variable is not set and trying old passwords to no avail. Now
the X11vnc program. This should be in for an SSH session. Unlike a traditional I can’t get into my system. Is there a way
your distro’s repositories, so install it in the VNC server, X11vnc only runs for one to change the login back to the previous
usual way. Then run it from a terminal on connection; when you exit the client, setting or otherwise gain access?
the computer you want to control: the server quits, too. Kieran Thompson
$ x11vnc -display :0 One thing to be aware of is that you are
Run this as a normal user, and the value
for -display is the number of your display,
only using SSH to start the server – your
VNC session is not encrypted. This may be
A The login screen shows the default
or last selected user; you can still
which is usually :0 if you are running a an issue, particularly as you said you are click on the username field to switch to
the other user and log in as before. If this
is not possible for any reason, you can
boot from a live distro to change your
user’s password. Any live distro will do – I
always keep a copy of SystemRescue
(www.system-rescue.org) handy, but you
can use the USB stick from which you
installed Mint. Once you have booted the
live distro, open a terminal and run:
$ sudo -i
This gives you root access for the rest
of the session and saves having to use
sudo with every command. Now you
need to find out where your Mint system
is installed. Running $ fdisk -l lists all
your disks and partitions. Hopefully, you
only have one partition marked as Linux
filesystem, otherwise more detective
work is needed. Once you know where the
system is installed, mount it in the terminal:
$ mkdir -p /mnt/mint
The X11vnc program enables you to make an existing desktop session available over VNC. $ mount /dev/sda1 /mnt/mint

www.techradar.com/pro/linux February 2023 LXF298   11


ANSWERS

Replace sda1 with the partition where


your system is actually installed. The
passwd command is used to manipulate
user passwords. It normally operates on
the running system but can be instructed
to work with the files of another system:
$ passwd --root /mnt/mint youruser
Here, youruser is the username you
wish to change. You are prompted for
the password twice. Unmount the Mint
partition with $ umount /mnt/mint and
reboot. Your new password should now
be effective.
If you are unsure about the correct
username, look at /mnt/mint/etc/passwd.
The /etc/passwd file contains details
of all the users existing on a system
(although not their passwords, despite
the name). There are a lot, most used by
system daemons; any actual users appear While Gdisk and Cgdisk are good for manipulating partitions in a terminal, you still have to resize filesystems
near the end and have a user ID (the first separately. Gparted does it all in one go.
number after the name) of at least 1000.
filesystem on it, but it is also simple to do old partitions, the filesystem is still
Merging partitions with command-line tools like Gdisk. There there. However, it is still the same size
Q How do I merge two partitions? is also Cgdisk, an ncurses version of Gdisk. as before – you have only resized the
One is the system and the other contains This lets you see more clearly what you partition, not told the filesystem to use
disposable content, and is directly after are doing. Whichever you use, the process all of the space. How you do this depends
the system one. I’d prefer to use Gdisk is the same. First, delete both partitions. on the filesystem in use, but if it is an ext4
unless you have a better suggestion. That sounds scary but it is fine, unless filesystem, the Linux default, you would
Patrick Giles you do anything daft like writing the new use the resize2fs command:
partition table and rebooting before doing $ sudo resize2fs /dev/sdxN

A As a terminal junkie, I would still say


the easiest way to do this is to use
anything else. Next, create a new partition
using all the space previously occupied
Replace sdxN with the address of your
new partition. If you do not give a size
Gparted (https://gparted.org). Simply by the two partitions. Set its type to Linux, option, it expands the filesystem to fill the
delete the second partition, resize the first then save the partition table. partition, and growing filesystems like this
to fill the space and hit Apply. This takes Because the new partition starts can be done while it is mounted and in use.
care of resizing both the partition and the at the same point as the first of the Having said that, it is a good idea to carry
out the whole process from a live distro
if possible. Executing these commands
A QUICK REFERENCE TO… SSH TUNNELLING from a running system should be safe, but
if anything goes wrong you need to boot
An SSH tunnel is an SSH connection from a port on the local computer to from a live distro to fix it, so you might as
between two computers that is one on the remote system. You can well have one available at the start.
used to transfer data securely also set up a reverse tunnel to facilitate
between the two. For example, ssh -L
8080:localhost:80 example.com results
a connection in the opposite direction,
with the -R option:
Q Capturing Cron
I have a Cron job running a script
in all connections to port 8080 on the $ ssh -R 8080:localhost:80 example. every hour. I want it to email me the
local computer being forwarded to port com output and write it to a log file – stdout
80 on example.com. There are various In this case, we are connecting port and stderr. This is what I have in crontab.
reasons you may want to do this. There 8080 on the remote system to the MAILTO=”[email protected]
may be a restriction that prevents you local port 80. DATEVAR=”date -d ‘+1 hour’
directly connecting to port 80 on the Although we have set up a tunnel +’\%d_\%m_\%Y_\%H’”
remote computer with a browser. Or through localhost, the tunnel allows 0 * * * * root /root/reminders/tasks/hourly
you may wish to send sensitive data connections from any computer. >> /root/reminders/logs/$DATEVAR
with a program that does not provide Another computer on your LAN I receive the email, but it only contains
its own encryption. All traffic going can connect to port 8080 on your any errors that the script outputs. A log
through the tunnel is encrypted by SSH. computer in the first example to access file is created, containing the output of
A good example is the VNC problem the remote system. You can prevent the script, minus the errors that I received
answered on the previous page – VNC that by adding a bind address – to in the email (stdout), but the name of the
is not encrypted but you may not want only allow the tunnel to be used by the log file is not the date/time – it’s the literal
anyone to be able to snoop on what system that is running it, you could do value of the variable (date -d ‘+1 hour’
you are doing on your desktop. the following: +’\%d_\%m_\%Y_\%H’)
The above example uses the -L $ ssh -L 127.0.0.1:8080:localhost:80 I am using Debian 11.5 and believed
option to set up local port forwarding, example.com that Vixie Cron could handle variables.
Hayden Hartley

12    LXF298 February 2023 www.linuxformat.com


ANSWERS

then these are opened in Firefox. I copy all


the URLs (via an add-on) and paste into a
text file, then download with YouTube-dl.
Is there an alternative?
Ben Mann

A There is a fork of YouTube-dl


called Yt-dlp. The latest version of
YouTube-dl may not be available for your
distro. It can also have speed issues due
to changes made at YouTube. The fork
avoids such problems and adds features.
Because of the extra features, the
command-line options have changed,
but there is a compatibility mode to have
Yt-dlp respond to YouTube-dl syntax,
and even a handy wrapper script called
youtube-dl. This means you can install Yt-
dlp and use it as you did with YouTube-dl.
Vivaldi’s password manager enables you to export and import passwords, but be There is an easier way to generate the
careful where you put the exported data. list of links. Using a command-line RSS
reader such as Rsstail (www.vanheusden.
A You have set DATEVAR to a literal
string. I suspect you intended to use
my Vivaldi browser. I can’t find them in
Vivaldi’s settings and I can’t find them
com/rsstail) makes life a lot easier. For
each feed, simply run:
backticks or, preferably, a $() enclosure: in the Gnome keyring with Gnome $ rsstail -l -1 -u https://feed.url | awk
DATEVAR=$(date -d ‘+1 hour’ Passwords and Keys (or Seahorse). ‘/^Link:/ {print $2}’
+’\%d_\%m_\%Y_\%H’) Neither are they to be found with GPG, so Normally you leave Rsstail running and
However, there are still issues with this where are they? I am using Ubuntu 22.04. it outputs new entries every 15 minutes;
as Cron runs in a very limited environment, Joshua Wade the -1 option has it run once and exit. The
so date may not even be in its path. Also, -l switch tells it to output the link for each
you can’t depend on Cron evaluating the
command substitution here; it is only
A You can export and import
passwords in Vivaldi. On the old
news item. The title is also output, so we
pipe the output through Awk to pick out
meant for setting variables to specific computer, open the settings page and go only the lines starting with Link: and print
values, as you have done with MAILTO. to Privacy And Security. Scroll down to the following URL. You can direct this to a
The reason you are only seeing stderr Passwords, or type pass in the search file for later passing to Yt-dlp, or you can
in the mail is that all that’s output as stdout box, and you’ll see an Export Passwords pipe the list directly to Yt-dlp.
is directed to the log file. If you remove the button. This saves your passwords as a Bear in mind that programs like
redirection, you should see the output in CSV file. Importing passwords is disabled this should not be used to circumvent
the mail, but you lose the log file. I would by default. On the new computer, type copyright or fair use restrictions.
move the log file reporting into the script. vivaldi://flags in the address bar and put
If you still want the output to go into the password-import in the search box. Select GET HELP NOW!
mail, you can either use the tee command Enabled and restart Vivaldi to apply the
or cat the log file after writing to it. change. Now type chrome://settings/ We’d love to try to answer any questions
somecommand 2>&1 | tee -a /root/ passwords in the address bar and click you send to [email protected], Subscriptions: for magazine issues email [email protected]
reminders/logs/$(“date -d ‘+1 hour’ the menu button to the right of Saved no matter what the level. We’ve all been
+’\%d_\%m_\%Y_\%H’) Passwords. You will see an import option stuck before, so don’t be shy. However, we’re
The 2>&1 redirects stderr to stdout, to pull in your saved passwords. only human (although many suspect Neil is
then tee sends all its input to the given The CSV file contains all your a robot), so it’s important that you include as
file and repeats it on stdout. The -a option passwords in plain text, so be careful much information as you can. If something
appends to the file if it already exists, like where you store it. I would save it to a USB works on one distro but not another, tell us.
the >> redirection you’re using. Otherwise stick, plug that into the new computer for And if you get an error message, please tell
the file is overwritten, as with > . import, then securely wipe the USB stick, us the exact message and precisely what
If the script contains multiple either by using shred to remove the file you did to invoke it.
commands that produce the output you or just wipe the whole stick by using dd to If you have, or suspect, a hardware
need, or you’d prefer to not modify the write from /dev/urandom to it. problem, let us know about the hardware.
script as you may be using it elsewhere, Vivaldi’s data is stored in ~/.config/ Consider installing Hardinfo or lshw. These
use a wrapper script to call it from Cron: vivaldi but Vivaldi does not state where or programs list the hardware on your
#!/bin/bash how the password data is kept, and being machine, so send us their output. If you’re
/root/reminders/tasks/hourly 2>&1 | tee -a closed source, finding that out is not easy. unwilling, or unable, to install these, run the
>>/root/reminders/logs/$(“date -d ‘+1 following commands in a root terminal and
hour’ +’\%d_\%m_\%Y_\%H’)
Q YouTube downloading
I’m on Debian 9 Stable. I’ve been
send us the system.txt file, too.
uname -a > system.txt
Password transfer using YouTube-dl for a while, but it no
Q Moving to a new computer, I can’t longer works for me. My old routine was
lspci >> system.txt
lspci -vv >> system.txt
move over the passwords available to to open lots of YouTube links in QuiteRSS,

www.techradar.com/pro/linux February 2023 LXF298   13


Mailserver
MAILSERVER

WRITE TO US You helped! assembler) programs in COBOL as part of a project for


I watched a lot of YouTube videos about different HM Treasury to replace the ageing 1900 series with
Do you have a distros, agonised over what OS to install... I couldn’t the 2900 series. This was back in 1980.
burning Linux-
figure out how to do it. Then I spotted your mag with I moved on from the ICL 1900 to the ICL 2946,
related issue
Pop!_OS on its DVD. Best tenner I remember spending. then the NCR V series mainframe, ending up working
that you want to
discuss? Write Mick on the IBM AS/400 around 1988.
to us at Linux Fast-forward a few decades and I’m still working on
Format, Future Neil says… the IBM AS/400 successor – I’ve lost track of all the
Publishing, Thanks for the kinds words. Look everyone, we’re marketing changes. I think it’s now a Power System I.
Quay House, helping, too! The best thing about the latest incarnation: it can run
The Ambury, Python, though most of the programming is still RPG.
Bath, BA1 1UA or Mainframe man Alongside the AS/400s, we introduced Linux to the
email letters@ I’ve been receiving the magazine since some time business I worked for around 2002, running Apache
linuxformat.com.
in the early noughties I think, my first exposure to and Tomcat with MySQL as the database. We had a bit
Linux being while I was doing a part-time MSc at of opposition at the time (from the US) on why we ran
De Montfort University in Leicester, 1999-2001. Linux rather than Solaris or AIX, but a few years on
We had coursework that needed to be done on Unix from that and almost all the proprietary Unix flavours
workstations and, as a part-time student, couldn’t get had been replaced by Linux.
access to the workstations that easily, so found Linux My laptop is still Windows (work-owned) but there
and started running it on a home PC. is the Subsystem for Linux, and I have treated myself
I loved the article on retro emulation (LXF295). I was to a Pi 400!
expecting something along the lines of similar articles Andrew Bennison
on the likes of Apple II, Tandy TRS and so on, but it
was ICL 1900 series mainframes. Neil says…
My first computer was not a personal computer You’ve certainly kept busy over the years. Good to
at all, but a mainframe: an ICL 1904S, so I absolutely hear the mainframe article brought back some
loved the article on how to emulate dear old George 3. memories and it’s interesting to hear about your
Coding sheets, card decks and the Westinghouse transition from Unix to Linux – I bet the sales people
CREDIT: UKRI Science and Technology Facilities Council.

teletype – though we did also have a couple of weren’t happy about you shifting to Linux! Enjoy the
MOP terminals as well. I was rewriting PLAN (ICL Pi 400 – it’s probably a lot faster than those old
systems and much easier to carry!

Pi gaming
Just wondering if you have any advice on open source
programmable Game Boy-like devices? I remember
these used to come up on occasion. My son and I
want to have a go at making our own games to play.
Luke and Max, Australia

Neil says…
It really depends on how authentic and hands-on you
want to get. See the project on page 34 for an outline
of how to install RetroPie, which is largely the basis of
all these kits, software-wise.
For premade handheld console kits, you’re spoiled
The Linux Format for choice; we looked at the Pimoroni Picade in LXF295.
office, circa 2021. WaveShare has a range of options – we like the Game
Helpdex

14    LXF298 February 2023 www.linuxformat.com


MAILSERVER
The Lyra+ looks like a mini Steam Deck.

LETTER OF THE MONTH


Laptop drive
Over the last few months, the Isle of Wight Linux User Group
(www.iwlug.org.uk) has supplied over 80 laptops to guest Ukrainian
HAT https://bit.ly/lxf298pigame. The PiBoy is also a refugees. It is a joy to equip laptops with 128GB SSDs and bring
popular range, though we’ve not tried it – see https:// them back to a new lease of life. We use Linux Mint Cinnamon by
experimentalpi.com for more details. Similarly, the default, enabling Ukrainian and Russian languages, and stick on
Lyra+ is a DIY Compute 4 kit from www.creoqode.com Cyrillic key tops.
that seems very slick. Let us know how you get on! Most Ukrainian guests are mothers arriving with mobile phones,
backpack luggage and children, staying with generous hosts across
Watching the watchers the Isle of Wight. A mobile phone is never sufficient for children’s
I was quite intrigued by the content of your CCTV online education at home or necessary complex form-filling.
article (LXF293) and thought it might be interesting to We only ever just get by with donated laptops, so more are
at least play with a basic setup. So, my first thought always welcome. We’d also love to hear of any similar activity on
was: what would a suitable camera cost? I was pretty the mainland. Especially in the Linux community, because Linux is
overwhelmed by the range of options, just for cameras a total gift for an activity such as this. Please get in touch via our
for external use, with PoE but no tilt and zoom. Many website contact form (https://laptops-for-ukrainians.weebly.com).
seem to include object recognition and other features Roger Skidmore, Isle of Wight
referred to in Frigate. Would these clash or does that
indicate the cameras are over-specified for the role? If Neil says…
Matt could give some kind of guide to selecting What a fantastic project to undertake and well done for helping so
suitable cameras, that would be very useful. many people. If anyone is interested in donating equipment or
John Mangan creating something similar in their area, Roger is more than happy to
help with advice, so do get in contact with him.
Matt says…
I don’t stick to any particular brand, but look through
the listings for either RTSP or ONVIF2 support. RTSP
support means it’s pretty likely to be supported in
something like Frigate, while ONVIF means it is
compatible with a lot of the fully blown NVR tools. I
use a Unifi camera at home and that’s RTSP.

Linux can help refresh ageing hardware, so it can go on to have a useful second life.
You can use any camera for home CCTV, but we have some pointers…
[email protected]

www.techradar.com/pro/linux February 2023 LXF298   15


SUBSCRIBE Save money today!

SUBSCRIBE TO
LINUX FORMAT MAGAZINE
Subscribe today and enjoy great savings!
http://www.magazinesdirect.com/LIN/B23R
Call 0330 333 1113 and Quote B23R

NOT FRO?M
THE UagKe 69
Turn to p great
for more er
subscrib
deals!

16    LX298 February 2023 www.linuxformat.com


Save money today! SUBSCRIBE

PLUS: Exclusive access to 1

1) Only available to www.magazinesdirect.com subscribers


the Linux Format subs area!
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
ars
Includes 5 ye
&
of Linux User
Dev eloper
issues

CHOOSE YOUR PACKAGE!


Our simple three-month best offer breaks up the annual subscription into
four easily manageable payments over the course of the year.

ANNUAL PRINT EDITION ANNUAL PRINT + DIGITAL EDITION DIGITAL EDITION ONLY

SAVE! SAVE! SAVE!

Only
50% Only 61% Only
50%
£10.54 every 3 months
£16.79 every 3 months
£11.35 every 3 months
13 issues of Linux Format in print 13 issues of Linux Format over 12 months 13 issues of digital Linux Format
over 12 months and save 50%! in print and digital, and save 61%! over 12 months, and save 50%!

*Terms and conditions: Offer closes 28/2/2023. 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). The full subscription rate
is for 12 months 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 Telephone: +44(0)330 333 1113 (open
Monday-Friday, 8:30am-7pm, and Saturday, 10am-3pm UK time, or email: [email protected]. 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 February 2023 LXF298   17


REVIEWS
Wix
Shashank Sharma takes the feature-rich site builder for a test drive.
ix is a giant in the website
IN BRIEF
With hundreds
W builder industry. Browse
its site and clues to its
of templates, success appear right away. While
support for some services give you only a few
over two dozen templates, Wix has more than 500.
languages, and Its built-in image editor has 40
hundreds of Instagram-style filters. The blog
widgets for supports 26 languages. The App
integrating Market has more than 200 widgets
third-party sites to enhance your site and integrate
and services on third-party sites and services.
to your website, Beginners can sample much of
Wix is one of this for free, but experts can go
the most much further, with features like Wix
thorough Code, enabling them to manage
website builders database collections, generate A two-tier editor enables you to just get on with your site or do advanced pixel-level editing.
you’re likely dynamic pages and custom forms,
to find. use their own JavaScript, access APIs and more. for instance, and also includes services. Products can
It’s not perfect, though. The templates aren’t be illustrated with videos, as well as images. You can
responsive in the usual sense, although the effect is give them custom options (size, colour), a weight or
very similar (Wix generates a separate mobile version a SKU. Wix supports plenty of payment providers, too.
of the site). Some features, like form building, come in
the form of apps that require payment to get their full Plans and pricing
functionality. But nonetheless, it is a powerful and The free plan includes Wix branding, gives you access
comprehensive service with a lot to offer all users. to the drag-and-drop editor, and in theory supports an
unlimited number of pages. In practice, a 500MB
Build a site storage limit and maximum 500MB data transfer per
Account creation is as simple as entering your email month mean it’s only suitable for very small sites.
address and a password. You’re asked to choose the The Connect Domain plan, at £4 a month, lifts your
type of site you’d like to create – business, music, bandwidth limit to 1GB but still includes Wix branding.
photography, blog and so on – and then whether you’d Further plans increase the bandwidth and storage, and
like to have Wix generate the site for you or if you’d ditch the branding, right up to the VIP plan at £21 a
rather do it yourself from scratch. month, with 20GB of storage and priority response
Opting for the regular editor gives you complete support. There are three Business and eCommerce
control of layout. Objects can be positioned with pixel- plans, too, which allow you to sell products online.
level placement, rather than being automatically Wix’s attractive templates and excellent editor
aligned in blocks or columns. You can drag and drop make it easy for even total newbies to build a great-
complex blocks (contact forms with headings, buttons, looking, powerful website. We’re less convinced that it
text) as a whole, change alignments, even ungroup has the support services big sites require, but the core
items within a block to rearrange them how you like. features are so strong that you need to try it.
The core editing functions are equally well designed
and more like a native app than the average website
builder. Right-click menus show relevant commands
VERDICT
for different controls, for instance. Alignment guides DEVELOPER: Wix
and on-screen displays of control heights and widths WEB: http://wix.com
help you position and size items accurately, and PRICE: Multiple plans, starting with a free tier
floating toolbars give speedy access to key options.
FEATURES 9/10 EASE OF USE 8/10
Ecommerce PERFORMANCE 9/10 DOCUMENTATION 8/10
Building a web store with Wix is simple. Browse an
array of templates, add any extra components you Despite its range of offerings, it’s still just as easy to use and
need, and the visual previews and sample images make welcoming for novices as it’s a delight for professionals.
it easy to define the look and feel of your store. Don’t
be fooled, though – there’s plenty of power under the Rating 8/10
hood. Wix supports digital as well as physical products,

www.techradar.com/pro/linux February 2023 LXF298   19


REVIEWS Processor

AMD Ryzen 5 7600X


A beastly “budget” gaming CPU that Christian Guyton
has found has one big temporary drawback.
MD isn’t messing around
SPECS
Socket: AM5
A this time; Intel’s nifty Alder
Lake core architecture put
Process: 5nm Team Blue in front in the current
TSMC generation, and with 13th-gen
Cores: 6 Raptor Lake chips on the way, AMD
Threads: 12 clearly knew it had to swing for the
Clock: 4.7GHz fences. AMD is giving us a similar
(5.3GHz boost) generational upgrade, but without
Cache: 384KB resorting to ‘efficiency’ cores to
L1, 6MB L2, save power; the result is a chip that
32MB L3 dominates in single-core workloads,
Unlocked: Yes and still performs reasonably well
GPU: AMD when firing on all cores.
Radeon two- The new 5nm manufacturing
core RDNA 2, process used by TSMC to produce
400MHz the Ryzen 7000 chips is clearly Finally AMD has the goods to take the processing crown back from Intel, at least for a while…
Mem max: excellent – and that’s even bearing
128GB DDR5- in mind that Ryzen 5000 was an extremely solid considering the applications in GPU-less systems like
5200, ECC generation of CPUs. It’s worth noting, though, that lightweight laptops and office PCs. There’s AV1 and
support, two- Zen 4 comes with a new socket, meaning AMD is HEVC decode, and support for DisplayPort 2.0, HDMI
channel finally leaving the trusty AM4 socket behind and 2.1 and USB Type-C video output, which all keep this
PCIe: v5 mandating upgrades to new AM5 motherboards. chip competitive with Intel’s forthcoming offerings.
24 lanes Another inclusion clearly designed to keep pace with
TDP: 105W Socket to ’em Intel is support for Intel’s AVX-512 instruction set.
At £265, the Ryzen 5 7600X doesn’t represent a One thing the 7600X doesn’t have is a dedicated
generational price increase when compared to the cooling solution, possibly marking the death of AMD’s
ever-dependable Ryzen 5 5600X. The problem with excellent Wraith line of stock air coolers. The upside is
the 7600X’s excellent price-to-performance ratio is that AM4-compatible coolers work on AM5 boards, so
that it doesn’t take into account the cost of upgrading you might not need a new cooling solution.
the rest of your system to be compatible. These new General processor single-core performance pegs
processors require a Zen 4-supporting motherboard, the Ryzen 5 7600X a few percentage points ahead
with the new AM5 socket, add on top of this, AM5 of the formidable Intel Core i5 12600K and a good
boards only support DDR5 memory, so you’ll be out of 22% faster than the Ryzen 5 5600X. This plays out to
pocket for some new if faster RAM, too. on average the Ryzen 5 7600X outpacing its older
This isn’t entirely AMD’s fault; Team Red had to model by 35%, matching the Ryzen 9 5950X and
move on from the AM4 platform eventually, but with outpacing the Core i5 12600K. With a peak max of
even the cheapest X670 AM5 motherboard costing 111W, it consumes more peak power than the 5600X’s
£270 and DDR5 memory costing a little more on top, 78W, but on average used 10W less across tests.
it’s all extra costs you have to factor in.
With six cores, 12 threads, and a boost frequency of
5.3GHz, the Ryzen 5 7600X is no slouch, with a step up
VERDICT
of 0.6GHz at boost from the Ryzen 5 5600X, and the DEVELOPER: AMD
upgrade also comes with much faster PCIe 5.0. WEB: www.amd.com/ryzen
Naturally, those new compatibilities mean better PRICE: £265
performance – and while Intel users have had access
to them in 12th-gen Alder Lake chips since late 2021, FEATURES 9/10 EASE OF USE 9/10
the market hasn’t really reflected that; PCIe 5.0 SSDs PERFORMANCE 9/10 VALUE 8/10
might actually be available to buy at some point in early
2023, and Intel’s decision to keep Alder Lake AMD is coming out swinging with its new generation of Zen 4
backwards-compatible with DDR4 has evidently led Ryzen processors, with the 7600X providing an exceptional
many buyers to stick with their existing memory. level of performance for a more affordable CPU.
The 7600X comes with integrated graphics, running
a dual-core RDNA 2 GPU – this isn’t going to scare any Rating 9/10
dedicated graphics card, but it’s a worthy inclusion

20    LXF298 February 2023 www.linuxformat.com


Linux distribution REVIEWS

WattOS R12
Nate Drake explores how WattOS can bring your ancient
hardware to life with this zippy, if spartan Linux distro.
e love lightweight distros.
IN BRIEF
After six years
W This is why we reviewed
some of the best of them
in development in LXF295, but WattOS didn’t make
limbo WattOS the cut, because a new version
R12 is finally hadn’t been released since 2016.
here. Now This is most likely because
based on WattOS is the creation of just one
Debian 11, it still man: Ronald Ropp, aka Biff Baxter,
focuses on ease who started development of the
of setup and distro in July 2008. Unlike previous
speed, running versions, WattOS R12 is based on
comfortably on Debian, not Ubuntu, which in theory
older machines. makes for a much more stable
operating system. This is reflected
in the bundled apps, such as Firefox
SPECS 102.4 ESR (Extended Support A custom version of the minimalist LXDE desktop environment makes for a snappy interface.
CPU: 1GHz Release). Using Debian alone
64-bit usually means you have to do extra tinkering to install to be energy efficient. Given the very small number of
Mem: 512MB the latest versions of programs, but WattOS has taken running processes, it didn’t surprise us that our version
HDD: 10GB care of this for you, supporting installation via both of R12 only drew down just under 1.4W in a virtual
Builds: 86_64 Flatpak and Debian backports. machine. Still, before wiping your existing install,
Set up is very simple via the Calamares installer and consider testing WattOS in live mode to see whether
takes only a few minutes. This is one of the fastest OS it really will extend your laptop battery for hours.
installations we’ve ever done. The lightweight LXDE 11 There’s no dedicated wiki or manual, but if you run
desktop environment is extremely quick to respond into difficulties using WattOS, help is available via a
and the install footprint is just 5GB, putting even well-attended Discord server. The forum community
minimalist distros such as Lubuntu to shame. is also extremely willing to address users’ issues. This
According to contributors on WattOS’s Discord might be enough to persuade less-experienced Linux
server, the OS can run on some incredibly ageing users to take the plunge with this distribution, given
machines, as well as budget Chromebooks. When that they may have to attend to some post-install
testing in a virtual machine, we found it ran perfectly tweaks themselves.
well on Debian’s minimal stated specs of 512MB RAM Overall, if you like your distros super-fast and
and a 1GHz CPU. There’s no specific ISO for running barebones, and are happy to manually install only
WattOS on old 32-bit machines, however. those programs you need, then WattOS R12 is the
This minimalist ethos carries over to the pre- right distribution for you. Because WattOS is based
installed apps, which are very spartan. For instance, on Debian 11, which is supported for five years, there’s
the only bundled office software is the Evince also little danger of it becoming obsolete, even if the
document viewer. Internet apps comprise only the good people at Planet Watt drag their heels about
aforementioned Firefox ESR and version 3.0 of the releasing a new version in the future.
Transmission BitTorrent client. You can also play media
files via VLC 3.0.17.4 (Vetinari). Beyond this, it’s largely
down to you to install any other programs you need.
VERDICT
Installing LibreOffice via Flatpak wasn’t too DEVELOPER: Ronald Ropp
troublesome but we had to open LXTerminal to set WEB: www.planetwatt.com
up the relevant software plugin so that installation via LICENCE: GNU GPL and others
the Flathub website could be done graphically. This
was a minor niggle, as it only had to be done once, but FEATURES 6/10 EASE OF USE 9/10
suggests that WattOS may not be for users who want PERFORMANCE 10/10 DOCUMENTATION 7/10
to avoid the command line altogether. In fairness, we
could just as easily have installed LibreOffice and other WattOS’s no-frills interface is clean and responsive, but it
software using the GUIs of the pre-installed Software may need some work before you have all the apps you need.
Center, GDebi or Synaptic package manager.
Although the R12 release notes don’t explicitly Rating 8/10
make this assertion, WattOS has traditionally claimed

www.techradar.com/pro/linux February 2023 LXF298   21


REVIEWS Linux distribution

Kali Linux 2022.4


If you exist in the grey twilight between good and evil, and want to
look cool while doing it, David Rutland has just the distro for you.
ali Linux is an evil distro for
IN BRIEF
Kali Linux is a
K hackers, ne’er-do-wells and
other undesirables who
mature and want to overthrow the state and
stylish distro, sow chaos. You can tell because
which has all of the menacing wallpapers that
the tools you feature evil-looking dragons, who
need to pursue are doubtless up to no good.
a career in There’s also the vast array of
cybersecurity, tools designed for network analysis,
ethical hacking penetration, password cracking and
or penetration other such things, which we’ll get to
testing. New shortly. They’re kind of a giveaway.
and updated Rapidly approaching its tenth
tools add birthday, Kali is the go-to distro for
to already individuals in the network security
impressive field, those wanting to get into There are nine evil dragons of hacking in this screenshot. We bet you can’t spot them all.
capabilities, the field, and people who want to Download the ISO and find them yourself.
and it runs on look cool and mysterious while
practically hammering on a keyboard in the local Costa Coffee. Bluetooth, SDR and MouseJack support – just what
everything – The 22.04 release just squeezed in before the end you need when penetration testing.
including the of 2022, and in recognition of the essential nature of There are some additions, too. These include
Raspberry Pi the ubiquitous Raspberry Pi, Kali has now been added bloodhound.py, a Python-based ingestor for
and specific to the Raspberry Pi Imager tool, so it’s simple to install Bloodhound (a tool for finding hidden relationships
smart phone this hacker’s toolkit on proper DIY hacker hardware. within an active directory or Azure environment);
builds. Unfortunately, Pis are in short supply, so we had peass-ng, a collection of privilege escalation tools for
to make do with installing Kali the old-fashioned and Windows, Linux and Mac OS; and ldapdomaindump,
SPECS proper way: on a virtual machine. You can also install which does exactly what you probably think it does.
Kali on WSL, as a live USB, in a docker container, as a
CPU: 2GHz vagrant image, as a ready-to-go app on various cloud More shiny for your eyeballs
Mem: 512MB providers, or even on certain mobile phones. Hardware Everyone knows that 1337 haXors are all about the
HDD: 2GB resource access, and other more esoteric factors, may cool eye-candy, and Kali doesn’t disappoint. Desktop-
Builds: i386, vary, but Kali makes it easy to install on anything – with wise, Gnome lovers will be pleased to find Gnome 43
x86_64, armhf, dedicated images for each, so you can maximise the as an option. You can also deploy your exploits from
armel, arm64 resources of what’s available. KDE Plasma 5.26. As always, the wallpapers are top-
Kali is based on Debian, so installation on our notch artwork, usually featuring dragons. There’s also
decidedly non-exotic VM was simple and familiar, a graphical network monitor in the task bar – neat.
once the epic download of up to 11GB was out of the All you need is a trenchcoat and some RGB, and you
way. There were no nasty surprises or unnecessary can be the hero of your own cyber action movie.
complications, and after selecting Xfce over either
Gnome or KDE, we were on the desktop in a couple
of minutes, staring into the side-eye of a malevolent
VERDICT
dragon who wanted us to hack something – anything! DEVELOPER: Offensive Security
Because, don’t get us wrong, unauthorised entry is WEB: www.kali.org
Kali’s raison d’être. Sure, you can use it as a daily driver, LICENCE: GPL3
and it’s great. You get everything you’d expect with a
minimum Debian install – plus a whole lot more. You FEATURES 10/10 EASE OF USE 9/10
can install LibreOffice, GIMP and Steam without too PERFORMANCE 8/10 DOCUMENTATION 9/10
much trouble. But that’s not what Kali is about.
Even without its killer suite of ethical hacking tools, Kali is the
New tools for mischief ice-cold epitome of style and substance, which is as easy to
The central tool suite of Kali has been more or less use as you’d expect from a Debian derivative.
the same since its inception, but there are refinements
in this latest release. Particularly notable are updates Rating 9/10
to the wireless firmware, and better wardriving

22    LXF298 February 2023 www.linuxformat.com


Linux distribution REVIEWS

Nitrux 2.5.1
An impressive beginner distro that’s well worth your time, even if
you spend most of it tweaking the settings, says Mayank Sharma.
f you are just taking your
IN BRIEF
Targeting
I first steps in Linux, you
should begin your journey
beginner Linux with Nitrux. It leverages some of
users, Nitrux the most stable and well-respected
does a splendid open source projects and builds on
job of them to create a distro that suits
simplifying the sensibilities of new Linux users.
software For instance, instead of building
discovery and a custom desktop environment
offering a slick from scratch, Nitrux relies on KDE
KDE-based Plasma’s malleability along with
interface, but some redesigned components to
perhaps leans simplify workflow for new users. It
too much into offers a couple of layouts for the
the minimal desktop to enable users to make
design aspect. best use of the screen real estate. Sitting somewhere between Ubuntu’s minimal Gnome desktop and Mint’s traditionalist design.
Nitrux has even customised
some admin apps to make tasks such as firewall and your pointers. The interface uses disappearing scroll
backup approachable for inexperienced users. It ships bars, so you won’t know they’re there and you can’t
SPECS with a good dose of apps for all kinds of desktop tasks. just jump back to the root of the Store. That aside, the
CPU: 2.5GHz The distro also supports and encourages the use of Store works a treat and the use of AppImages means
dual-core 64-bit AppImages, makes it straightforward to install extra managing software is entirely straightforward.
Mem: 2GB apps. In fact, Nitrux plans to eventually switch all its The distro has an active community that you
HDD: 5GB graphical apps to AppImages. These are launched in a can interact with on all the popular social networks.
GPU: 32MB Firejail sandbox, which makes Nitrux more secure out However, the lack of a dedicated documentation
VRAM, of the box than your typical desktop Linux. section is a downer, there is a tutorial section that
OpenGL 2.1 offers guides to many general topics, such as Samba
Builds: x86_64 Easy does it shares, using Wine, Wayland and more.
Trying Nitrux is a snap. The 2.8GB downloadable ISO We’re encouraged by the regularity of updates
served from a speedy dedicated server offers Live and speed of response by developers to queries.
booting, so you can try it out easily and, once happy, This latest 2.5.1 update, released in early December,
install it from here, too. The Calamares-based installer brings support for the latest Mesa 23.0 release and
is clear and inviting, and makes setting up keyboard introduces Kernel 6.0. Nitrux is available for 64-bit
and passwords, plus partitioning with encryption, computers only, but can also boot on older hardware
obvious and clear, though it seems to default to manual with the Legacy BIOS, as well as newer EFI machines.
partitioning, which isn’t ideal for beginners. Certainly worth your attention just for the speed
Once into the custom KDE desktop, the main of updates and number of customisation options,
sticking point is the unified window controls that which are the source of our main confusion, and could
permanently live top-left of the desktop, rather than as be reduced with an installer-based option.
part of the active window. So, if you want to minimise,
expand or close the current window, you need to
override your muscle memory and shift the mouse to
VERDICT
the top-left. It’s somewhat baffling and you can’t even DEVELOPER: Nitrux
double-click the title bar to expand or contract. WEB: https://nxos.org
KDE is renown for its customisability and you can LICENCE: GPL, Various
alter many of these default behaviours and styles
through the Windows Management and Appearance FEATURES 7/10 EASE OF USE 8/10
settings, which also offer comprehensive window tiling PERFORMANCE 8/10 DOCUMENTATION 6/10
features. It’s just a matter of discovering these and
tailoring them to your needs, but it feels like an option It’s slick, fast, regularly updated and offers just enough
that could be put into the initial Calamares installer. documentation but the KDE desktop roots can confuse.
The design oddities continue through to the
software Store – you have to decipher the title-less Rating 8/10
category icons or hover the mouse over them to get

www.techradar.com/pro/linux February 2023 LXF298   23


REVIEWS Industrial-scale strategy

Victoria 3
“The peasants are revolting,” cries The Management, but really it’s just
Jonathan Bolding serving up their afternoon tea and biscuits.
t’s 1836 and the
SPECS
Minimum
I Industrial Revolution’s
machines are in high
OS: Ubuntu gear. The coming century will
20.04 LTS change the face of the human
CPU: Intel Core world with a population explosion,
i3 3250, AMD a second industrial revolution
FX 8370 – AVX and more. In Victoria 3, you take
required control of a society attempting
Mem: 8GB to ride this wave of explosive
GPU: GeForce change to its end in 1936. What
GTX 660, you do along the way, and how The fairer sex
AMD R7 370, much fun you have, is up to you. voting? I can’t
2GB VRAM Victoria 3 tasks you with see any good
coming of this…
HDD: 10GB building a nation by shaping
APU: Intel HD its laws, economy, people and
Graphics 630, institutions. Developer Paradox
AMD Radeon calls it a “society-builder”. It wants you to care about the deeper in. Governments are based on laws: sets of
Vega 8 minutiae of political movements, distribution of power, options that cover diverse topics such as how your
population trends, economic organisation, factory output economy is structured and who gets to vote. Changing
Recommended or global trade, and then start manipulating them. laws requires the support of interest groups, Victoria 3’s
CPU: Intel Core That might be hard. Victoria 3 boasts some of the finest mechanic. These groups, such as landholders,
i5 6600K, AMD most intricate game mechanics we’ve seen in a strategy petite bourgeoisie, armed forces, trade unions,
Ryzen 5 2600X game. They can be overwhelming. You can micromanage industrialists, religious authorities and rural folk, gather
Mem: 16GB trade routes, chart paths for societal reform, tweak your up clout from their members and try to push their
GPU: GeForce nation’s build queue, or examine production methods. agendas, forming dynamic political parties.
GTX 1660, Even a small nation is constantly given options to fiddle These groups intersect masterfully with every other
AMD RX 590, with, and progress in large nations can slow to a crawl as game system, creating opportunities and obstacles.
6GB VRAM you scramble between trade crises and multi-front wars. Maybe you want to change tax laws to fix your budget,
Managing this is made easier by one of Paradox’s but the powerful industrialists will cause a big stink, or
better interfaces. It’s not quite as friendly as Crusader maybe even team up with another group and threaten
Kings 3, but it does have significantly more complex revolution. So, you change voting laws to give the poor
systems to work through. The bottom bar in particular power, reducing the industrialists’ political clout. Of
is useful, with shortcuts to all kinds of national actions, course, this means you now have another group able
from building and diplomacy to mustering troops. The to push forward their agenda.
map, meanwhile, is striking and impressively detailed. The core of all those interest groups are people, also
known as pops. Every person on the planet is simulated
I am the law in the background. They have jobs and families, and they
Who doesn’t like a It’s in Victoria 3’s simulation of how a society is governed want various necessities and luxuries (like heating? – Ed).
good map? that the game is at its best, drawing you deeper and They migrate and move in a system that is fascinating to
watch. When ideologies such as socialism and fascism
are invented, pop groups gain supporters or goals,
triggering unrest and revolution at home and abroad.
Your big concern with pops is their standard of living,
cultural discrimination and employment, but trying to
improve these involves solving big social and political
puzzles. Freedom of religion and giving immigrants
citizenship annoys other people even while it improves
lives, so it’s a thorny but compelling balancing act.

Big business
Alongside managing a nation’s people, your hand is
also on the tiller of trade and industry. Victoria 3 has you
serve as a kind of omniscient chief executive, deciding
what new factories, mines, infrastructure and farms get
built. You need cash for that, of course, but whether it’s

24    LXF298 February 2023 www.linuxformat.com


Industrial-scale strategy REVIEWS

from wealthy investors or the state itself, these are your


decisions – the buck always stops with you. ARTIFICIAL UNINTELLIGENCE
Victoria 3’s economic system is a slick simulation that
incentivises real-world behaviours. You don’t always Smaller nations without a sizable army can get locked into civil wars
want to hoard wealth. You can run a deficit for a few for an interminably long time, rendering chunks of the map unusable
years, then build up a reserve, or nearly bankrupt yourself unless you want to declare war and end it yourself. Bigger ones have
fighting world wars before entering years of austere the same rich inner life as yours, but lack the guiding hand of a
recovery. And if you’re missing some important goods, person aiming them at bigger goals.
you can look abroad and exploit less developed nations. That’s exacerbated by the AI’s short memory. In a game playing
Planning your economy, finding out what goods as the Socialist United Syndicates of America, we helped every
are needed to industrialise, what raw inputs to source communist revolution across the globe to power. More often than
and from where is the stuff that economic strategy not, within a month of winning victory, those newly forged sibling
dreams are made of. The added complexity of deciding nations would decide we were an existential threat and adopt a
production methods and ownership stakes is just icing massive penalty to relations with us.
on the customisable cake of your nation’s market. That’s the exception, though. If anything, the nations of Victoria 3
As opposed to fiddly tracking of every single bushel are too reluctant to forge diplomatic pacts or start wars. You’ll never
of wheat, Victoria 3 provides comprehensibility by saying see anything resembling major conflicts such as the Franco-Prussian
that while supply of materials is unrealistically infinite, it’ll or Crimean Wars, let alone an international conflict like World War I.
eventually hit a very, very expensive price ceiling or
become so cheap its market crashes into the floor.
Helpfully, a rich trade system lets you quickly address
deficits or excess from the same screen, and feedback
notifies you when trade routes post a negative balance.
The intermingling of business and state quickly
becomes a colonialist machine that eats people and
spits out bones. You’ll fight wars of conquest over rubber
just so your people can have bicycle tyres – or find your
budding socialist utopia playing world police to stop
others from doing the same.

Aggressive negotiations
Eventually, of course, you have to deal with conflicts both
domestic and international. These aren’t always armed,
however, and many take place across the negotiating
table. This is perhaps the weakest part of Victoria 3, and
only a few key systems keep it from being a total dud.
Militaries are managed abstractly, with your armies troops to rattle your sabre. If nobody folds before the It all feels familiar
run by generals assigned to fronts. You can tell them to timer runs out, that means war. and yet somehow
different.
hold the line or try to advance and capture territory. It’s a It’s is a tidy system, but the diplomatic actions around
pretty fitting simulation of 19th century warfare – at least it are anaemic and difficult to pull off, because when it
from a politician’s chair – because it’s about hoping the comes to international relations, the AI is static or even
army you’ve built, the equipment you’ve produced, and unpredictable. Sometimes it stays friends for decades, or
the person you’ve picked to lead it can bring you victory. it turns into hateful a rival overnight. It’s not clear if this is
Your suite of diplomatic options are simple. In order to down to bugs or invisible changes in other countries.
do most things, you make a diplomatic play: claim a state Victoria 3 is weak on the international stage, but if
controlled by another country as yours, demand another your fantasy is to take control of a nation and set goals,
nation submits as a puppet regime, force others to adopt build a society and play around with complex systems, it
specific laws. You make demands, the other side makes fulfils that brilliantly. The internal life of your nation is rich,
counter-demands, and outside nations either stay and for much of the game that’s where are – up to your
neutral or get bribed to pick a side. You raise and deploy neck in domestic politics and squabbling pops.

VERDICT
DEVELOPER: Paradox Development Studio
WEB: www.paradoxinteractive.com
PRICE: £41.99

GAMEPLAY 8/10 LONGEVITY 8/10


GRAPHICS 7/10 VALUE 6/10

Attractive historical sandbox filled with potential, but it’s on


That’s a nice wall – it would you to unlock it if you can work around iffy war mechanics.
be a shame if someone, you
know, just went around it. Rating 7/10

www.techradar.com/pro/linux February 2023 LXF298   25


ROUNDUP Matrix
WE COMPARE TONSchatOF
clients
STUFF SO YOU DON’T HAVE TO!

Roundup
Element 1.11.14 Cinny 2.2.2 Mirage 0.7.2
Mats Tage
Axelsson
keeps learning
more about Linux,
NeoChat 223.09 Fractal 4.4.0 even after all
these years. How
many? Guess!

Matrix chat clients


Mats Tage Axelsson examines the potential of distributed messaging
and federated authentication servers that use the Matrix protocol.

HOW WE TESTED…

We paid a visit to https://


matrix.to and got ourselves
an account. If you want to
try it for yourself, you can
get an account there or
somewhere such as https://
riot.im. Ideally you should
use a password-supported
account as many clients do
that support SSO or OAuth2.
Next, we went to https://
matrix.org to find clients.
Installing them on Linux
was mostly a breeze thanks
to the projects supporting
plenty of distros and
packaging standards.
Figuring out how to log in
and when you can use
something other than
password authentication
was the first hurdle. After aving seen how Big Tech tracks even server. For this to have a chance to
you’ve done it a few times it
becomes obvious, but it
H everything you do in the name of
profit, you may be tempted to use
work, standards are a necessity. One
such standard is Matrix, developed and
differs in some details an alternative means of communication. maintained by the Matrix Foundation, a
between apps and sites. Platforms such as Facebook and Twitter group you can support yourself if you wish.
Lastly, we realised that in don’t seem to be improving from a moral Following the protocol, you can use any of
order to keep the account point of view and are becoming more and the mainly free and open source chat apps
secure, there are several more crowded with ads. To counter this, available, or write your own. To get started,
layers of functionality that alternative platforms have appeared. you need to register an account on a server,
you can deploy if you want Most of these solutions fall short if they the most popular being http://matrix.org.
to be diligent – which you are run by another big business that does You can also set up your own server, but
should be, as one point of everything in the name of money. Instead, we’re only talking about clients here. You can
this network is privacy. you can choose to put in a little more effort use OAuth2 authentication to get an account
and have your own username and maybe but not all apps support this yet.

26    LXF298 February 2023 www.linuxformat.com


Matrix chat clients ROUNDUP

Ease of
Searching in
the Ubuntu
software store

installation
for Matrix
clients results
in a long list
of packages.

Most applications offer multiple


Which one will
you choose?

package formats for installation.


eing chat applications, Matrix clients often come as web

B services. An example of this is Cinny’s web page, which


has a link to the online version of the application. You
have to actively seek out the Flatpak edition. This is the same project. You must take care with Element because development
for Element, although installing it on your smartphone is actively happens in different Git repositories for different platforms. The
encouraged. It doesn’t mean it’s impossible to install these on desktop version can be found at https://github.com/vector-im/
Linux, it’s merely a quirk of their web pages. element-desktop. The project’s main focus is on the web app,
When you start looking around, you will find that downloading and all other versions stem from that.
the desktop application is second choice for several of these If you go for a tar install, make sure you have the libolm
clients. But that makes it more interesting to have them on your library. This is one of the basic libraries required for the Matrix
desktop – you are a rebel, right? The ones that don’t do this are protocol. It covers the encryption part, which is essential for
Fractal and NeoChat; the teams behind these are part of the privacy. Oddly enough, some of the applications do not support
KDE and Gnome teams, making them lean in their obvious encryption, even though they support private rooms. Possibly
preferred desktop directions. Finding packages for Fractal is better known is the Signal application – the team behind this
easy because it exists on Flathub. NeoChat comes as a Snap and pioneered the algorithm and is still maintaining the development
a Flatpak. The nightly version also comes as a Flatpak. of the libraries.
When you come to choosing packages, you’ll find Flatpak is
a common option. The best clients come as both AppImage and VERDICT
Flatpak, like Cinny. Another that offers both is Mirage. It goes a
few steps further and also offers packages for Arch, Gentoo, Nix ELEMENT 8/10 NEOCHAT 7/10
and others. On the GitHub page, there are also clear instructions CINNY 5/10 FRACTAL 7/10
on how to install it manually from source on more distributions. MIRAGE 9/10
Source install instructions are excellent for Mirage. In fact, the Packaging is becoming easier on Linux, despite the choices.
instructions clearly show how to get started developing a new In this respect, Mirage has the most options.

Look and feel


You’ll see the interface a lot…
o withstand the pressure of the next flame war, your

T interface had better look good. But good looks are


subjective. Some people want a lot of colour and a
picture-based background, but a more basic issue is whether your
text is dark or light. Most of these clients use the dark or light
theme, and most have a total of four variants. NeoChat has four
colour themes and some other titbits including Bubbles and
Compact for the message feed. In Fractal, you can change the
theme to match the system’s, other settings seem to be missing.
To make your view the best possible, you can change a lot
more things in Mirage. Coming from a Qt toolkit, the application’s
appearance has been prioritised for the design of this package. The Mirage application has the flashiest interface of them all. Hopefully,
Cinny is quite lacking when it comes to tweaking its looks, development will take off again to add more features.
although you do have four colour options.
In Element, you have a choice of a light or dark theme, three
message layouts and font size settings. Additionally, you can VERDICT
choose whether image messages are small or large.
All clients can notify your desktop in Gnome and most other ELEMENT 8/10 NEOCHAT 6/10
standard desktops. They all allow On, Off or Noisy settings. To CINNY 7/10 FRACTAL 5/10
really make your experience visually stunning, you should use MIRAGE 10/10
Mirage, it includes all those features and you can have a picture Offering more than just dark or light themes, Mirage has the best interface
background. If you set it using theme files, you can really go wild. aesthetics of the bunch.

www.techradar.com/pro/linux February 2023 LXF298   27


ROUNDUP Matrix chat clients

Logging in and getting started


Having conversations
on Matrix is open Element 9/10 Cinny 8/10
until you set up When logging in using Element, you are The login view of Cinny looks remarkably

your own groups. greeted with a clear welcome screen and


the option to log on with your username
similar to that of Element, with one
important difference: it has several
and password, or with SSO. On the homeservers in the list. You also have
n many ways, you can use password section, you have the choice a theme even at the login screen. The

I Matrix as a social media


alternative. You have
of one standard identity server. Since
there are already hundreds of servers,
phrase “heating up” is a nice quirky touch.
Groups and rooms look almost the
options to join groups and chat that is a little weak, although you can also same as in Element – again, there are
about your favourite topics, and enter your choice of server. SSO offers just small tweaks. The People tab is on
talk directly with friends. One big the usual suspects: Google, Facebook, by default, which makes it easier to send
difference is that on the Big Tech Apple and the two Git options. direct messages. In the Settings window,
services, you are set to public by Element has a simple and clear you get a tab-organised screen, making it
default and you can choose interface where you can easily add your simple to find your various settings.
subjects as you go. With Matrix, own groups and rooms. You can change Encryption and other features work the
you choose your subject by joining settings for the size of images in chat same way as in the other clients here.
a group. feeds. Themes are limited to dark or light, What Cinny has going for itself is that
Another big difference is and you can set the font size easily. it is easier to make it look good and it’s
that if you want to have private Otherwise, theming has only a few more comfortable to use than the others.
conversations, you must take standard options and no backgrounds. Usage is so similar to Element that it
action yourself. You need to Encryption for verification of other comes down to personal taste as to which
create a group where you alone sessions and room encryption keys is is best. Being second in this section only
can invite people. For it to be truly simple if not convenient. means that it’s not our favourite.
secure, you must also create
encryption keys.
The strength of this is that
you are responsible for your own
security. You need to know how
to verify any people who join your
group. This requires tools that can
help you handle security – and
each client has one such tool.

Community and status


Use the power of community for yourself.
ou want to communicate with someone about a stopped. Hopefully, someone will take over the project, because

Y particular subject using Matrix. Whatever topic you are


looking for is probably available elsewhere, but with
it looks really nice and only needs the few features that are
missing for full usage.
Matrix you can have direct conversations. For these packages, NeoChat, on the other hand, has daily code updates, so is
you can do what you always do: scour question sites where the still actively maintained, which means you can rely on it to
answers have been waiting for a long time. This works, but some keep working. Fractal is a quirky one – it seems way behind
things are difficult to find; if you enter a chat interface, you can the competition but it has a very clear new goal with a lot of
get hints where to go next. developers. Cinny has major updates coming and a large
Before choosing a specific client, you should go and see what following, while Element is in very deep development mode,
is happening with the project. It is useful to know whether there promising a brand new version.
has been any work done on the project over the past year before
getting used to it. There are many ways to check this – one is to VERDICT
look through the last question on one of the Stack Exchange
sites. The other is to check the developer’s code site, which is ELEMENT 9/10 NEOCHAT 8/10
usually GitHub. CINNY 7/10 FRACTAL 7/10
Looking at that, you may notice that Mirage has had no new MIRAGE 5/10
updates for many months but the room is very active. It means Most of the projects we’re looking at here are still in active development and
that the client is popular to use but development has slowed or maintenance, but Element is possibly the best supported.

28    LXF298 February 2023 www.linuxformat.com


Matrix chat clients ROUNDUP

Mirage 7/10 NeoChat 6/10 Fractal 5/10


When logging in using Mirage, you have a NeoChat’s login has a single box where Fractal does not offer any hints about
screen that should show you the stability you put your username and homeserver homeservers – you have to supply your
of servers and other pertinent data. before you can move on to the password. own. The login screen is plain but it works.
However, this isn’t working. You can only It’s an odd way of doing this, without help There is no offer of using single sign-on,
use a username and password combo – for other homeservers, but it does stop so you must get a password account. You
single sign-on from GitHub and the like you from sending your password until need to go through two steps to get there,
is not yet supported. In the current the server is ready to take it. You can use so it feels a bit awkward.
version (0.7.2), the Register tab is there multiple accounts; they show up as tabs The opening screen is organised the
but it is not yet implemented. As for under the Rooms And Groups column. same way as the other clients here but
homeservers, there seems to be a plan Rooms are shown in a simple list, all with a sparse interface. For colour, you can
for them but by default all you have is according to the KDE standard. NeoChat use the Gnome theme – Fractal is a native
Matrix.org for now. has a list of participants in the far-right Gnome application.
When it comes to organisation, you column, which also contains pinned As for organisation of the screen, that
have the same groups and rooms like messages from the room. You can change is also simple, without any fancy tricks or
all the others, but they’re implemented the look between Bubbles and Compact, tweaks to make. It simply does what it is
better. Rooms are tightly listed and you and four themes of light or dark. supposed to do.
have a filter option. Inside the rooms, All the verification and encryption This application also lacks encryption
you can set the messages to have boxes. functions work, and settings are easy to and verification of the session. Overall,
Next to the room, you can list all the find with the column view for features. the impression is poor and it needs to be
participants or check the values of the Overall, NeoChat has the necessary improved, which the Gnome maintainers
room. Verification is lacking, though, features but lacks the fancy graphics are working on in Fractal 5 – the next
which limits Mirage’s scope. that would make it more pleasant to use. generation is coming soon.

How are they made?


Language and framework make a long-term difference.
ith the correct language and framework under the smartphone should be easy. You can even add it using Chrome

W hood, new features can be added when the other


projects add support. Having a code base that clearly
or with specialised apps such as Hermit.
Because Fractal uses the Gnome environment, it suits Gnome
has high activity ensures an interesting future for a project. It users well, but if you want to spread your wings, there may be a
also shows you on which devices you can use it. You may prefer problem – unless you have a Linux phone.
an application that looks the same on all devices, but with the NeoChat is likewise built using KDE in particular, which is
wrong code base, this is unlikely to happen. difficult to support outside a regular desktop environment. With
In this regard, Element sticks out because there are several that said, it works perfectly fine on a Gnome desktop.
clients for many platforms. Written mostly in TypeScript and The choice of application also applies if you want to help the
JavaScript, Element easily converts to different platforms. The project, so pick carefully if that applies to you.
web page offers clients for Android, iOS and web. Obviously,
there is also a Linux desktop client available. VERDICT
The Mirage client, however, comes only as an AppImage and a
Flatpak, which are excellent for Linux purposes, of course. Being ELEMENT 9/10 NEOCHAT 8/10
built with Qml and Python, it may take a little more work to port CINNY 7/10 FRACTAL 7/10
it to Android. MIRAGE 6/10
Despite being written primarily in JavaScript, Cinny only has a Element comes out on top in terms of the number of platforms for which it
web app and a desktop client. This still means that using it on a has clients, enabling you to use it almost anywhere.

www.techradar.com/pro/linux February 2023 LXF298   29


ROUNDUP Matrix chat clients

Encryption
You might be
looking for
easy ways to

options
send direct
messages
and encrypt
them for

Look out for ways to your privacy.

protect privacy.
efore you see the full potential of Matrix, the clients

B probably look like any old chat box. But when you
discover the more intricate details, you’ll see the power
of encryption and private rooms. The specification (https://spec. standard tools. Element defaults to being a web app and can
matrix.org) is open, clear of patent licensing and mostly uses be a client for most platforms. Cinny also has such a web app,
HTTP. Importantly, it has vast support for encryption and is built making it easy to use from a browser.
for environments that anyone can join – so-called federations. NeoChat and Fractal have no web app capability, because
Any user should be able to create their own rooms and they are made for their respective desktop environments.
servers, making it vital that you know how to handle your Other useful features would be to use different formatting
encryption keys. Fortunately, all clients that support it have for your messages and the overall look, which is where Mirage
simple ways of doing this. shines. Having a web app of Mirage would make it outshine the
In this case, Mirage is disappointing because it does not lot, but its real weakness is sadly encryption.
support encrypted rooms or client verification. That said, Fractal
and NeoChat also lack these essential features so cannot use VERDICT
Matrix to its full potential. You can still create private rooms but
since encryption is not supported, you end up with a low-security ELEMENT 9/10 NEOCHAT 5/10
environment. Cinny does support these vital features. CINNY 5/10 FRACTAL 5/10
One useful feature is to have a web app available that can run MIRAGE 7/10
in a browser. This makes it possible to have an application using A lack of encryption options can let a chat client down.

Frequency of
updates
To use it, you need updates.
ere we’re considering whether the client you pick will

H keep going for a reasonable time. If not, you should


think twice before using it because you may end up with
an unsupported product. To make a decision in this regard, you
need to see how much development is going on and whether
there are groups of people making it popular in different ways. You can search for rooms for your issues but it takes
You can see on sites like GitHub whether any updates have more effort to know how well a client is doing.
happened lately and how much activity of other kinds is going
on. If you look for support requests, you can also see how many groups. This may mean that there is a higher probability that
people are using it. The more users, the bigger the incentive to someone will pick them up again and create newer, greater
continue developing the application. It is not always obvious by versions. You can also see that there is a new version of Fractal
looking at just one of these indicators but combine them and you being developed as this Roundup is being written.
have a clear picture. That leaves Cinny. This project has a promising 36
The winning client here is Element, which is supported by an contributors on GitHub and keeps sending updates to the code.
entire company selling services for Matrix. This is a group that is With several sponsors and such an active project, this client sees
completely dedicated to Matrix and its own client, making it a a bright future ahead. Add a few cosmetic features and it could
reliable choice when it comes to maintenance. be a real contender.
In stark contrast, Mirage has many fans but even the
development team has not made much noise in the last 18 VERDICT
months. Without activity from these groups, all you can hope for
is that your contribution can somehow get things running again. ELEMENT 9/10 NEOCHAT 8/10
Sad, considering how pretty the application is. CINNY 7/10 FRACTAL 8/10
The two clients that occupy the middle ground are Fractal MIRAGE 4/10
and NeoChat, which are both supported by the bigger desktop Element tops the table again in terms of updates and maintenance.

30    LXF298 February 2023 www.linuxformat.com


Matrix chat clients ROUNDUP

The Verdict
Matrix chat clients
f you’re choosing Matrix for your social needs, you

I are either a geek or you are tired of the flood of


messages that have nothing to do with your query.
You could be both, of course. In either case, switching takes
something of an attitude adjustment. That attitude needs to
be that every conversation is on point and does not wander
from the subject matter.
With Matrix clients, you always create a room for your
subject. A new room for each subject – keep it clean and
stay civilised. In contrast, anything goes on Twitter and you
have to filter out all the nutters.
The other difference with Matrix is creating a private
room, which is fully end-to-end encrypted, and is the default
option. Having your own room and encryption keys requires 1st Element  9/10
a different way of thinking from simply throwing your ideas
out into the current cyberspace black hole of traditional Web: https://element.io Licence: Apache 2.0
social networks. Version: 1.11.14 OLM version: 3.2.12
All the packages in this Roundup have their advantages Element has a clear interface and is supported by serious people.
and disadvantages, but they are all usable. NeoChat and
Fractal follow the standards of their respective projects 2nd Mirage7/10
but lack some vital features: end-to-end encryption and
the verification of devices. Mirage suffers from a similar Web: https://github.com/mirukana/mirage
problem but has the looks down to a tee. It does have one Licence: LGPL 3.0 Version: 0.7.2
more issue: there is no menu for settings; you have to tweak Mirage looks polished and has potential but has stalled in development.
it with configuration files.
Element has all the settings you’d expect from a highly 3rd Cinny7/10
polished application and it also has all the features you
could wish for. With one exception: you can’t change its Web: https://cinny.in Licence: MIT
appearance very much. Version: 2.2.2
You can expect future developments to offer audio and Cinny has the features but is harder to configure. Development is active.
video communications. In some clients, they already exist
but are in the early stages of development. Look out for fully 4th NeoChat7/10
fledged tools for doing that. Potentially, you can also look
forward to different kinds of meeting rooms, which may Web: https://apps.kde.org/neochat
require a central point for performance reasons. Sending Licence: GPL 3.0 Version: 223.09
lots of video feeds to everybody is a nightmare, and NeoChat is ready – if you love KDE, you will love its looks.
solutions could combine techniques around WebRTC to
accomplish these things. 5th Fractal  6/10
There are many solutions nowadays for fully private chat
functions, but if you switch to Matrix, you have a standard Web: https://wiki.gnome.org/Apps/Fractal
that enables you to choose a software client without Licence: GPL-3.0 Version: 4.4.0
switching your identity. Fractal is for Gnome users. It has a clear interface but nothing fancy.

ALSO CONSIDER
Syphon is an up and coming client that is very much in early interesting alternative that’s building for all platforms from
development. This makes it inaccessible for ordinary users day one. It comes with desktop, Android and iOS clients.
but it could burst on to the scene at any point. When you At this stage, it’s mostly aspiring developers who will be
download it, you end up with a directory containing the interested. Anyone who is curious may want to know that
executable, which when run provides a barebones application Flutter is used to put it on screen. This gives you a wide array
that works but keeps throwing odd errors. of systems you can install it on without running around a
This is interesting, especially if you want to explore myriad of software development kits. The project is also very
how things work and learn coding. In the long run, it is an active on GitHub.

www.techradar.com/pro/linux February 2023 LXF298   31


Pi projects

Hot Pi
projects
Dig in to our New Year
smorgasbord of hot Pi projects,
from Pico devices running
MicroPython to full-Pi setups,
with expert guidance from
Les Pounder and Matt Holder.

he problem with owning a mostly. We’ve selected self-contained ask Les Pounder about trying to get his

T Raspberry Pi is knowing what


to do with the flipping thing.
That’s if you’ve been able to
capsule projects and have supplied the
relevant code, while any kit you need
shouldn’t be too outlandish, from basic
robot to go in a straight line…
The Pi’s launch was revolutionary – it
put a generous amount of computing
get hold of one over the last year. But NeoPixels to simple radio receivers. power into the hands of enthusiasts for
that is where the Pi Pico comes into its That’s half the fun of Raspberry Pi a ridiculously low price, all powered by
own, costing a fraction of the latest Pi 4 projects: one moment you’re flashing open source. And it’s still revolutionary,
models and actually being available. LEDs in different colours, the next you’re thanks to its investment in education,
No matter what Pi you have to hand or reliving retro gaming moments, and then software, hardware improvements and,
what your ability is, we’ve got projects to you could be up to your elbows in Python most recently, manufacturing its own
keep you busy and out of trouble. Well, code. That last one is definitely fun – just silicon with the Pi Pico. So get making!

32    LXF298 February 2023 www.linuxformat.com


Pi projects

I like to make it, make it


Welcome to the maker revolution – but first, get your Pi up to speed.
A Raspberry Pi 4
o become a maker, you need the right kit, and

T
with Pimoroni’s
without a microSD card, the main Raspberry Fan Shim providing
Pi models won’t even boot. So, to kick things active cooling.
off as quickly as possible, we’ve had our friends at
Tom’s Hardware do a bit of testing and come up with
the fastest microSD cards to power your Pi.
Now is an amazing time to buy a fresh microSD card
as prices have tumbled and speeds have increased
dramatically. Previously, we would have recommended
32GB cards, but it’s getting hard to find a 64GB card
that costs much more than £7, while 128GB cards are
regularly under £15. Much of this is powered by even
larger capacity cards entering the market.
Theoretical speeds can top 140MB/s, with many
advertising a healthy 100MB/s, as the old Speed Class
measure tops out at Class 10 (10MB/s) there are now SanDisk Extreme Pro showed a clear lead on the rest
three new speed markings you now should look for: at 38MB/s, the SanDisk Extreme came second with
UHS: Denoted with a U symbol and a number 1, 2 or 3 32MB/s ,and the Kingston Canvas React at 27MB/s.
denoting 10MB/s, 20MB/s and 30MB/s respectively. The Samsung Pro Endurance posted 21MB/s and the
Video Class: Marked with a V and a number that Silicon Power 3D Nand was just shy of 19MB/s.
denotes the MB/s, starting at V30, V60 and then V90. Now you can boot your Pi as quickly as possible,
App Class: The newest measure, which switches to turn the page to find a range of hot projects. We also
IOPS (input/output operations per second), is denoted recommend installing your Pi in a case – we’ve listed
by A1, A2 and A3, although people have found Pi the best to consider at the end of the feature.
performance is less affected by IOPS.
Best for booting: All the big-name brands boot a Pi
Raspberry Pi Config.txt
within 2.5 seconds of each other. The Kingston Canvas
React came out first at 24 seconds, while the Samsung arm_freq=1100
Evo Plus and SanDisk Extreme snuck in under 25 Pi Zero (W) core_freq=450
seconds, with the Samsung Pro Endurance and over_voltage=6
SanDisk Extreme Pro at just over 25 seconds. arm_freq=1500
3A+/B+/CM3+
Best for apps: All the main cards on test launched over_voltage=4
GIMP within 0.8 seconds of each other. The lesser-
arm_freq=1300
known Silicon Power 3D NAND being the fastest at Pi 3/CM3 &
core_freq=500
6.5 seconds, the Samsung Evo Plus, SanDisk Extreme Pi 2 v1.2
over_voltage=4
Pro and Samsung Pro Endurance are just under 7
seconds, and the SanDisk Extreme at 7 seconds. arm_freq=1000
Pi 2 v1.1 core_freq=500
Fastest writes: Depending on your use case fast writes
over_voltage=2
could be more useful than general performance. The

OVERCLOCK YOUR Pi
It’s easy to overclock your Pi to gain gpu_freq=750 correct, reduce the clock by 100MHz,
a modest speed increase. If you’re over_voltage=6 check your cooling and try again.
serious, first attach a suitable Pi cooling force_turbo=1 With the Pi booted to the desktop,
fan, such as the Pimoroni Fan Shim. If you choose to use the same SD open a new terminal. To see its current
It’s worth a sudo apt update && sudo card in a different model of Raspberry CPU speed updated every second, use:
apt upgrade -y then open config.txt for Pi later, you should change or remove $ watch -n 1 vcgencmd measure_clock
editing (in the /boot directory): these lines. Save the file by pressing arm
$ sudo nano /boot/config.txt Ctrl+X, Y then Enter. When idle, the CPU runs at around
At the bottom of the file for a Pi 4, Reboot the Raspberry Pi. If it fails 600MHz. If we were to open a web
400 or CM4, add these new lines – see to boot, power off the Raspberry Pi, browser or another heavy application,
the table (above-right) for other models: remove the microSD card, edit config. the CPU speed would increase to
arm_freq=2200 txt and check your settings. If they’re match the demand.

www.techradar.com/pro/linux February 2023 LXF298   33


Pi projects

Play retro games


Defend the universe, save the princess, win the
race and all without spending a 10-pence piece!

n the ’80s, the only


YOU NEED
Raspberry
I way to experience
arcade-quality gaming
Pi 3, 4 or was by going to an arcade.
Zero 2W Over the passing decades,
8GB or arcades have become mere
larger memories and gaming is now
microSD a home pastime. For the more
card ‘mature’ gamer, the appeal of
Controller retro gaming is nostalgia, and
(USB or the Raspberry Pi has been a
Bluetooth) capable retro gaming platform
for most of its life. In this
tutorial, we’re converting a
Raspberry Pi into a retro
gaming console using RetroPie.
Before we get too far, a word The RetroPie user interface is made for controllers. Games are broken down into their respective
on legality. Retro games are still console or computer for easy reference.
under their respective owners’
copyright. In some countries this isn’t an issue, in FAT32-formatted USB drive. Create a folder, RetroPie,
others it is. Please consult your local regulations. on the USB drive and insert it into the Raspberry Pi
RetroPie is a great way to play classic retro games running RetroPie. Leave the drive for five minutes for
via a Pi. We should know, as we have a Picade cabinet RetroPie to create a folder structure for the ROMs.
on our bookshelf that runs a customised version of Remove the USB drive, place it into another computer
RetroPie. Installation is simple – download and install and copy your ROMs into the correct folder under
Raspberry Pi Imager from www.raspberrypi.com/ /retropie/roms/. Note that the number of ROMs should
software/ and open the app. In the Operating System not exceed the capacity of the RetroPie microSD card.
RetroPie can menu, select Emulation and Game OS, then select Remove the USB drive and place it back into the Pi.
be heavily
RetroPie for your model of Pi. Insert an 8GB or larger The ROMs auto-copy to their respective folders on the
customised,
microSD card and select it from the Storage menu. Pi. If you’re copying gigabytes of ROMs, this takes a
under the
RetroPie menu Click Write to download and write the image to the long time; if it’s only a few hundred MBs, it should be
– look for ES card. Remove the card and boot your Pi from it. done within a few minutes. When done, remove the
Themes and On the first boot, we need to set up a controller. This USB stick and reboot RetroPie (Start > Quit > Restart).
Splash Screens. needs to be a controller physically connected to the Pi Some systems, such as Arcade, MAME and
The former can via USB. Bluetooth doesn’t work at this time. Follow the PlayStation, require BIOS images.
change the UI, instructions and map all the relevant controls. Once
the latter can done, we see the RetroPie interface, EmulationStation. Controllers
change the boot Games are collected by systems, and without any To use a Bluetooth controller, go to the RetroPie menu.
splash for a
games, no systems show in the menu. Your legally Scroll down and select Bluetooth. Select Pair And
bespoke cabinet.
owned ROMs can be transferred to RetroPie using a Connect Bluetooth Device. The name and MAC
address of the controller should appear (it is normally
Sega’s MegaDrive printed on the controller) – make sure they match. To
(Genesis in the
US) is a classic validate the connection, try the first security mode; if
16-bit console, that fails, try the next. Once done, your controller can
and something be used from the comfort of your sofa.
that all models On the Raspberry Pi 4, the best level of emulation
of Raspberry Pi
we can achieve is Nintendo 64. Even then, some
can emulate.
games, such as the seminal Goldeneye 007, may run a
little choppy. PlayStation 1 and some 2D PS2 games
should run rather well.
We’ve only just got you started with RetroPie. For
more information, head over to https://retropie.org.uk
and learn how to get even more retro gaming fun from
your Raspberry Pi.
CREDIT: Sega

34    LXF298 February 2023 www.linuxformat.com


Pi projects

Make a media centre


Settle down with your own open source media centre and watch
the latest blockbusters with a side of Pi and popcorn.

hen the Raspberry Pi first arrived in 2012,


YOU NEED
Raspberry
W one of the first projects we saw was a media
centre. Even the humble Raspberry Pi 1, with
Pi 3, 4 or just a single 700MHz CPU and 512MB RAM, was
Zero 2W capable of decent 1080p video playback. Fast-forward
8GB or to today and the Raspberry Pi 4 is many times more
larger powerful and able to perform much better with our
microSD growing library of media. In this tutorial, we explain how
card to install a media centre OS to your Raspberry Pi, and
then show you how to play media from USB and live
streams, all from the comfort of your sofa.
OSMC is a great introduction to turning your
Raspberry Pi into a media player. This lightweight Linux This simple interface is made for the big screen and from it we can
OS is designed just for serving media, be it local or devour our media libraries and watch streaming media.
streaming video, or music. Installation is simple: just
download and install Raspberry Pi Imager from https:// behaves in the exact same manner, except that it can
www.raspberrypi.com/software/ and open the app. In play audio files in many different formats.
the Operating System menu, select Media Player OS Streaming media such as YouTube can be easily
and then select OSMC for your model of Pi. Insert an accessed via OSMC. Go to Settings > Add-On Browser
8GB or larger microSD card, then select the card from and select Install From Repository. As we have already
the Storage menu. Click Write to download and write connected the Pi to the internet, a list of add-on
the image to the microSD card. Remove the card and categories appears. Select Video Add-Ons and press
boot your Raspberry Pi from it. Enter. A new list of compatible add-ons is presented.
On the first boot, we need to set the language We chose NASA’s live streams. Scroll down to NASA
and our location. Once done, we are presented with a and install. This triggers the add-on to request the
simple UI that is made for media consumption. Media is installation of YouTube, as this is how NASA serves
categorised into sections (Videos, Music, Pictures) and its videos. With installation complete, go back to the
clicking on these headings opens additional menus. main OSMC menu. Select Videos, then Video Add-Ons.
Before that, we need to go into Settings > My OSMC NASA is now a selectable menu with the latest
and from there select the top icon: Network. In the streams. Using the same process, we can also install
Network menu, use the arrow keys (or mouse) to select music and game add-ons, such as a MAME arcade
Wireless and then enable the adapter. Select your machine emulator – but instead of doing that, you can
Wi-Fi SSID and connect. When done, press Esc or check out the retro gaming tutorial (opposite page).
Backspace until you reach the main OSMC menu. For more information about OSMC, head over to
To play local media, such as video files on a USB https://osmc.tv and discover how to get the very best
stick, insert the USB drive in the Raspberry Pi and go to from this great media operating system.
Videos, press Enter and you
will see that the drive is auto-
mounted. Select the drive
and navigate to the video file.
Note that video files need to
be in a format compatible
with the Raspberry Pi –
usually MP4 or MKV. If not
Infrared remote
in this format, use the free
controls can be Handbrake tool to transcode
used with the them on a more powerful
Raspberry Pi – PC. Press Enter to play your
just search for video. The on-screen UI can
FLIRC. Wireless be toggled on and off by
keyboards pressing the right mouse
with trackpads button. To exit, press Esc,
make excellent which returns you to the
controllers.
main menu. The Audio menu Adding extra features, such as streaming services, is made possible via the add-on repository.

www.techradar.com/pro/linux February 2023 LXF298   35


Pi projects

Build a Wi-Fi router


Create a Raspberry Pi-based Wi-Fi router as a
secure option for use around the home.

ith the release of the Raspberry Pi 4, the


YOU NEED
Raspberry
W networking stack was greatly improved
thanks to changes to the hardware, which
Pi 4 Model B meant that USB bus was no longer used to make it
(2GB is available to the operating system. In this project, we
ample) are creating our own Wi-Fi router using Raspberry Pi
16GB OS and RaspAP. Once the initial setup has been
or 32GB completed, the wireless router can be configured via a
microSD web interface – much like the products available from
card popular router manufacturers.
Suitable What’s the benefit of making this yourself? Well,
PSU the first reason is that cheaper routers aren’t kept
updated for very long, possibly leaving security holes.
Basing the router on Debian means that the base
operating system is incredibly well tested and security
updates are released on a regular basis. The web GUI
also enables traffic usage graphs to be viewed,
connections made to OpenVPN and WireGuard
tunnels, the use of ad-blocking DNS services and much
more. But enough introduction – let’s begin! Use Raspberry Pi Imager to write the image to a microSD card.
The project is completed in three stages. Stage one
is to prepare the microSD card with the Raspberry Pi $ sudo apt update
OS image and enable SSH access from first boot. $ sudo apt full-upgrade
Stage two is to install the RaspAP software, while $ sudo raspi-config
the final stage is to configure the router and connect $ curl -sL https://install.raspap.com | bash
devices to it. $ sudo reboot
To prepare the image, first of all follow the Once you have rebooted the Raspberry Pi, the
instructions at the following web address to install initial details need to be used to connect a device
the Raspberry Pi Imager tool: www.raspberrypi.com/ to the router. These details can then be changed from
software/. Once installed, open it from the launcher the web GUI.
and select Raspberry Pi OS (Other) > Raspberry Pi OS IP address: 10.3.141.1
Lite (64bit) from the Operating System menu. Next, Username: admin
from the Storage menu, select the relevant microSD Password: secret
card (if multiple options appear in the list, make sure DHCP range: 10.3.141.50 — 10.3.141.255
you don’t pick the wrong one because you’ll lose SSID: raspi-webgui
whatever is stored on it). Click on the settings cog Password: ChangeMe
and select the options to enable SSH with password Once connected, open a web browser and navigate
authentication, set the username and password, and to 10.3.141.1. Log in with the details above, then
set the locale to the correct time zone and keyboard navigate to Authentication to change the login
layout. Click on OK to confirm the options and then password and go to Hotspot > Security to change
click on the Write button. Wait while the image is being the details of the SSID being connected to. When we
downloaded and written to the microSD card. first connected to the new AP, a DHCP address was
When the image has been written to the microSD granted, but it was not possible to browse the web.
card, remove it from your device and plug into the To cure the issue, first of all edit the /etc/sysctl.conf
Raspberry Pi, and connect the Pi to the power supply file as administrator and uncomment the line that
and wired network. The lights then flicker as the device reads net.ipv4.ip_forward=1 . Save the file and then
boots up. Once booted, you can SSH to the Raspberry run the following commands before rebooting the
Pi from the terminal using ssh <USERNAME@IP_ Raspberry Pi:
ADDRESS> . Refer to the DHCP leases on your router $ sudo iptables -t nat -A POSTROUTING -j
if the IP address is proving tricky to find. Enter the MASQUERADE
following commands to make sure the system is fully $ sudo iptables-save | sudo tee /etc/iptables/rules.v4
updated and that the correct region is set for the Wi-Fi In this article, we have only had space to cover the
configuration – navigate through the raspi-config tool very basics of how to get this tool up and running, so
to find the correct settings: take your time and discover more about the software.

36    LXF298 February 2023 www.linuxformat.com


Pi projects

Track and scan planes


Use your Raspberry Pi to track aircraft or detect local devices to
keep an eye on all kinds of data.

ver the last few years,


YOU NEED
Raspberry
O there has been much talk
of software-defined radio
Pi 4 Model B (SDR – see LXF273). This is a way
(2GB) for a generic piece of receiver
16GB hardware to be repurposed to scan
or 32GB different frequencies or be used
microSD for a whole variety of purposes.
card One example of this is the Realtek
5V PSU RTL2832U+R820T2-based
ADS-B USB stick (around £35), which was
receiver originally intended to be used as a
Realtek TV receiver. For this project, we will
RTL2832U + briefly introduce how this receiver
R820T2 can be used to receive ADS-B
USB signals from passing aircraft and
extension how this information can be fed Live aircraft tracking data from our Raspberry Pi. Elon, is that you?
cable into a web service that aggregates
signals from many users, from across the globe. The should be changed using the Change Password option
second thing we will discuss is how to use the same from the web GUI. Once this has been changed, access
receiver to scan for any local devices that send data via SSH and for the web GUI uses your new password.
at 433MHz or 868MHz. The local interface can display graphs of detected
aircraft and a map display. Viewing from the following
Plane tracking address displays aggregated data: https://globe.
ADS-B Exchange is a service that aggregates data adsbexchange.com.
from a huge number of receivers, which are situated
across the globe. The project styles itself as the world’s Scanning at home
largest source of unfiltered flight data. Some other When preparing this tutorial, we were able to detect
services only display certain types of flights – for and interpret the data from an Oregon weather station.
example, they exclude military aircraft. To install the This data could then be used to feed online services or
project’s image, utilise the Raspberry Pi Imager to sent, via MQTT, to a local home automation system.
install a custom image, which can be downloaded from To set up the relevant software, first of all prepare
the following link: www.adsbexchange.com/how-to- a new installation of Raspberry Pi OS using the
feed/adsbx-custom-pi-image. instructions on the build your own Wi-Fi router project
Once written, the card can be put into your (see opposite page). Once this has been completed,
Raspberry Pi, the receiver can be connected via USB connect the receiver to a free USB port and install the
and it can then be connected to the power. After necessary software:
booting, connect to the ADSBx-config Wi-Fi SSID and, $ sudo apt install rtl-433
from a browser, visit http://adsbexchange.local. Click Once installed, the following two commands can be
on Wi-Fi Setup and add the details for your home used to scan at either 433MHz or 868MHz:
network. Get reconnected to your home network, visit $ sudo rtl_433 -C si
the same address again and select Configure Receiver/ $ sudo rtl_433 -f 868M -s 1024k
Location. From here, add your longitude and latitude, Running these commands for a few minutes each
and select the Save And Reboot option. determines what devices are transmitting on these
A reboot later, connect to the same address again frequencies and what useful information can be
and explore the interface, which shows any detected utilised from them. While running the commands,
planes or helicopters. If you wish, you can enable the look for any old remote-controlled sockets, remotes
Use Custom LED Indications setting, which repurposes and devices of that nature that could be utilised. Data
the Pi’s LEDs to give you an idea of what is currently returned can be reformatted into JSON and piped to
being detected. To determine whether your own an MQTT server, for further usage:
instance is reporting data back to ADSB-Exchange, you $ rtl_433 -F json -M utc | mosquitto_pub -t
can visit http://adsbexchange.com/myip – this queries home/rtl_433 -l
the database, using your internet-facing IP address. Further information about this useful tool can be
The initial password for the Pi user is adsb123 and this found at https://github.com/merbanan/rtl_433.

www.techradar.com/pro/linux February 2023 LXF298   37


Pi projects

Master the Pi Pico GPIO


Get to grips with the Raspberry Pi Pico’s GPIO to
open the gateway to a range of simple projects.

he Pi Pico comes pre-installed


YOU NEED
Raspberry
T with MicroPython, a version of
Python 3 for microcontrollers.
Pi Pico or It is regularly updated and new versions
Pico W can be found at https://bit.ly/lxf298
A push upython. It is prudent to update
button MicroPython before trying this tutorial.
An LED Our circuit for this project is a simple
330 Ohm LED toggle switch – a detailed circuit
resistor diagram is included in the download
(orange- link. A push button is used to turn the
orange- LED on and off. The Pico reads the
brown-gold GPIO pins and reacts to the change.
A Download and install Thonny for your
breadboard OS and connect your Pico to the
Code: computer. Open Thonny, go to Tools >
https:// Options and click on the Interpreter tab. Your first electronics project on the Raspberry Pi Pico is intentionally easy. It builds our
github.com/ Set the interpreter to be MicroPython knowledge and confidence to tackle the next project.
lesp/LXF-Pi- (Raspberry Pi Pico), then set the serial/
Special/ COM port to auto-detect the Pico. Thonny should now led = Pin(15, Pin.OUT)
archive/refs/ detect the Pico and the Python shell confirms this. button = Pin(16, Pin.IN, Pin.PULL_UP)
heads/main. We start the project code in a blank document. The Turn the LED pin off. This is basic housekeeping –
zip first step is to import two modules of prewritten code the pin should already be off.
SD card that will enable us to interact with the GPIO pins, and led.low()
control pauses or delays in the code: Create a while True loop that will indefinitely run the
from machine import Pin project code:
import time while True:
Next we create two objects. The first, led, sets up The code is now indented inside the loop; this
our LED on GPIO15 as an output – we want current to means that it works within the loop. The first task is
flow to it in order for it to illuminate. The second object, to create a conditional test that checks whether the
button, is a push button on GPIO16. This is an input button has been pressed. If it has been pressed,
and we pull the pin high so it has current flowing. When the GPIO pin changes state from high to low (0).
the button is pressed, it connects GPIO16 to GND, if button.value() == 0:
causing the pin to pull low and toggle the LED on/off: When the button is pressed, the LED is toggled on
or off, depending on its current state. A short message
is printed to the Python shell for debug purposes. A
THE RASPBERRY Pi PICO delay of 0.2 seconds is added in order to reduce
accidental double pushes, called debounce:
The Raspberry Pi Pico arrived in early 2021 and saw the first Pi led.toggle()
silicon device hit the market, the RP2040. The RP2040 system on print(“Toggle”)
chip (SoC) is an Arm Cortex M0+ dual-core at 133MHz (which can time.sleep(0.2)
be easily overclocked), with 264KB of SRAM and 2MB of onboard The final two lines are part of the conditional test
flash storage. This may not sound like a lot, but in the world of and relate to when the button is not pressed. In this
microcontrollers, it is plenty. The Pico has a 40-pin GPIO, just like the circumstance, pass is used to allow the loop to repeat:
larger Raspberry Pi, but these pins are located around the perimeter else:
of the board and make for easy insertion into a breadboard. The pass
pins do not come presoldered and feature castellated edges. This Click on File > Save and save the code as button_
means we can either solder male header pins to the board, or use blink.py to the Raspberry Pi Pico. Click on the run
the castellations to surface-mount solder the Pico to a circuit of our button (green play button) to start the code. Now
own design. The GPIO is easy to use via MicroPython, CircuitPython, press the button to toggle the LED on and off.
JavaScript, C, Arduino and many other languages. The Pico also has This introduction is just a fraction of what the
the power to easily emulate ’80s-era home computers, such as the Raspberry Pi Pico can do. For more projects, head
ZX Spectrum and Commodore 64. Not bad for a £4 device. to Tom’s Hardware, where there is a full section of
projects to try out: https://bit.ly/lxf298toms.

38    LXF298 February 2023 www.linuxformat.com


Pi projects

Convert currency
Work with remote data using an API and the
Pi Pico W to make a live currency converter.

n this project, we’re creating a simple app


YOU NEED
Raspberry
I to get the latest exchange rates for the euro
and US dollar against the UK pound. The
Pi Pico W Raspberry Pi Pico W comes with MicroPython, a
Code: version of Python 3 for microcontrollers. It is regularly
https:// updated and new versions can be found at https://bit.
github.com/ ly/lxf298upython. It’s a good idea to update
lesp/LXF-Pi- MicroPython and ensure you get the version for the
Special/ Pico W, as it has extra modules for Wi-Fi connectivity.
archive/refs/ Download and install Thonny for your OS and
heads/main. connect your Pico to the computer. Open Thonny, go
zip to Tools > Options and click on the Interpreter tab. Set
the interpreter to be MicroPython (Raspberry Pi Pico) The only outward difference between the Pico and Pico W is the large
and then set the serial/COM port to auto-detect the silver square in which the Wi-Fi chip resides.
Pico W. Thonny should now detect the Pico W and the
Python shell should confirm this. variables (dollar and euro) are appended to the end of
JSON Start the project code in a blank document. The first the sentences. The comma is used to add a space:
(JavaScript task is to import libraries of prewritten code – modules, print(“The current value of the UK Pound to one US
Object Notation) in Python parlance. These modules enable our Pico W Dollar is £”,dollar)
is convenient to connect to a network and make requests to remote print(“The current value of the UK Pound to one Euro
and easy to use,
machines over the network: is £”,euro)
but large objects
import network Click File > Save and save the code as Pico_API.py
can become
jumbles of noise. import urequests to the Pi Pico W. Click on the run button (green play
Use an online Next create an object, wlan. This object represents button) to start the code. In the Python shell we see
viewer (http:// a connection between the code and the Pico W’s Wi-Fi either True or False appear. True means we are
jsonviewer. chip. You need to set the connection to active to connected to Wi-Fi. The next two lines we see are
stack.hu) to enable the Wi-Fi chip: the current exchange rates for the dollar and euro. We
explore the data wlan = network.WLAN(network.STA_IF) could mix the code from the Raspberry Pi Pico GPIO
and find the wlan.active(True) tutorial (opposite) into this project to create a tool that
correct keys. Connect the Pico W to your Wi-Fi access point. fetches the latest data at a button press. That is the
Change YOUR SSID and YOUR PASSWORD to match beauty and power of MicroPython and the Pi Pico W.
those of your router and keep the quotation marks.
Print the connection status to the Python shell. True
means we are connected, False we are not: PICO PRODUCTS
wlan.connect(“YOUR SSID”, “YOUR PASSWORD”)
print(wlan.isconnected()) The Raspberry Pi Pico W has spawned a wave of
The exchange rate data is stored in an online products that embed the board as the centre
resource that uses JSON, an open standard file format. of a project. Pimoroni, for instance, has created
By creating an object, gbp, we can make a network Pico W Aboard. This new range sees the Pico W
request for the data in JSON format by getting the data surface-mount soldered, via its castellated pins,
from the URL: to a range of products, such as weather stations
gbp = urequests.get(“https://api.exchangerate-api.com/ (Enviro Weather), RGB LEDs (Plasma Stick 2040
v4/latest/GBP”).json() W) and the ludicrously named Galactic Unicorn,
Data is stored inside the JSON object as a series which has no bearing on intergalactic equines.
of keys and values. By giving the name of a key, JSON There are also sensor kits – Enviro Urban,
gives us the value. So, using USD as a key, we return Indoor and Grow – that can monitor air quality,
the value of the pound to the US dollar and store it in temperature, air pressure and our plants. These
a variable, dollar. The same applies to the value of the kits come with an onboarding process, hosted via
pound to the euro. a micro web server on the Raspberry Pi Pico W –
dollar = gbp[“rates”][“USD”] yes, you can run a tiny web server from the £6
euro = gbp[“rates”][“EUR”] Pico W! We made one in LXF294. Details about
Print the exchange rate data and mix it into a Pimoroni’s Pico W Aboard products can be found
sentence so it has context. Here we explain the current at https://shop.pimoroni.com.
value of the pound to the US dollar and the euro. The

www.techradar.com/pro/linux February 2023 LXF298   39


Pi projects

Build a smart home


Use ESPHome to feed a wide range of useful data to a
smart home hub via a Raspberry Pi Pico W.

SPHome was originally


YOU NEED
Pi Pico W
E written to allow the
ESP8266 and ESP32
DS18B20 devices to easily interact with Home
temp sensor Assistant. Using YAML syntax, the
4.7kOhm required options and configuration
resistor can be written, then parsed and
Dupont used to create source code, which The dashboard created by adding the integration can be seen here. Temperature information
jumper is cross-compiled and uploaded to can now be used in automations and Home Assistant dashboards.
cables the devices. With the release of the
MicroUSB 2022.11 version, developmental support has been the new device. At the bottom of the file, add the
power added for Raspberry Pi Pico W boards. following lines:
adaptor In this project we’re creating a program that enables dallas:
An us to read the temperature from a DS18B20 sensor, - pin: GPIO1
instance report it to Home Assistant and flash the internal LED sensor:
of Home on the board via a switch in Home Assistant’s web GUI. # - platform: dallas
Assistant To begin, we need to set up Home Assistant and # address: ADD_HEXADDRESS
(see LXF287) enable the ESPHome add-on. The easiest way to run # unit_of_measurement: “°C”
the software is to install it on a microSD card, which # name: “Temperature”
is then inserted into a Raspberry Pi. If using this option, output:
download the image from www.home-assistant.io/ - platform: gpio
installation, follow the instructions in the build your pin: 32
own Wi-Fi router article (page 36), and select the id: ‘output_component1’
custom image that has been downloaded. Alternatively, light:
use the generic x86-64 image and install it as a VM on - platform: binary
your laptop or PC. Once installed and running, follow name: “State LED”
the onboarding instructions to finish the installation: output: output_component1
https://bit.ly/lxf298onboard. Once done, use the My Now save the file and click on the Install button.
Add-On link (https://bit.ly/lxf298addon), which makes When asked, select manual download. Once the
installation of the add-on a lot easier. Once you are compilation has completed, download the file and
logged into Home Assistant, select the option to install connect the Raspberry Pi Pico W to your PC or
the add-on, start it at boot and enable the watchdog. laptop with the Bootsel button pressed down. Copy
Start the add-on and select the Open Web UI link. the downloaded UF2 file to the new drive that has
Before creating your device, select the Secrets link appeared on your device. When the file has copied
and add these options, then save and close the file: and the device has rebooted, it connects to the
wifi_ssid: ADD_SSID Wi-Fi and then ESPHome. The device then shows
wifi_password: ADD_PASSWORD as online and is available to be added to the Home
We will now create a new device and add some Assistant dashboard. A notification is displayed on
code to it. Click on New Device, then Continue and the sidebar and by selecting this and using the API
Use this circuit enter a name, which will be shown in the ESPHome password from the file we edited earlier, it is added.
diagram to
connect the dashboard. When asked to select the board type, click Note the commented lines in the file – these need to
temperature on Raspberry Pi Pico W and then select Next. Once be uncommented and the address replaced once the
sensor. created, select Skip and then click the Edit button on Logs option has been selected from ESPHome and
the address found from this page. When the sensor’s
address has been changed, the lines uncommented
and the file saved again, click on Install and this time
the Wirelessly option can be used.
Finally, from Home Assistant, navigate to the
Settings > Devices & Services page and under the
ESPHome option, select the name of your newly
created device and then 1 Device. From this page,
you can see the measured temperature, and by
toggling the switch, the on-board LED switches on
and off.

40    LXF298 February 2023 www.linuxformat.com


Pi projects

Control NeoPixel LEDs


Create animated lighting effects with the brightest LEDs
connected to your Raspberry Pi Pico.

e’re using MicroPython


YOU NEED
Any Pi Pico
W here to control a small
set of LEDs. Known as
Micro USB NeoPixels, they are a string of
cable LEDs that are generally multi-
Thonny coloured and can be addressed
Editor individually. NeoPixel is the name
MicroPython given to this style of LED by
firmware Adafruit, but the same driver is
WS2812B used for a large number of them
LEDs (with (WS2811/WS2812), no matter
suitable who the manufacturer or supplier. Here you can see the LEDs running the program we have written.
power) These models are available with
separate RGB channels, so that any colour can be brightness before fading back down again to nothing,
made by mixing the values (think of HTML colours). before this cycle repeats.
First, download and install MicroPython from import machine
https://bit.ly/lxfupdate. Then hold down the Bootsel import neopixel
button on the Pico board and connect to your PC or import time
laptop. Copy the downloaded file to the newly mounted #Pulse all LEDs
disk, then the Pico W reboots and loads MicroPython. numPixels = 8
Download and install the Thonny IDE from https:// np = neopixel.NeoPixel(machine.Pin(1), numPixels)
thonny.org. Open the IDE and, from the bottom-right, pulseTime = 2
select MicroPython (Raspberry Pi Pico). This connects numLoops = 100
the terminal in the bottom of the window to the Pi while True:
Pico’s REPL (Read-Eval-Print Loop) – this allows code for a in range(1,numLoops):
to be entered line by line. This is useful for basic tests, for i in range(0,numPixels):
but not very useful when trying to write a program. np[i] = (int(a*254/numLoops),0,0)
Programs can be entered into the main section of the np.write()
window, then saved to the board. When saving, you can time.sleep(pulseTime/(2*numLoops))
choose between the local computer and the Pi Pico. for a in range(numLoops,1,-1):
When saving to the Pico, use the filename Boot.py for i in range(0,numPixels):
and the code executes as soon as the board boots. np[i] = (int(a*254/numLoops),0,0)
Step three is to connect the Raspberry Pi Pico or np.write()
Pico W to the LEDs and the PC for programming (see time.sleep(pulseTime/(2*numLoops))
the circuit diagram below). In this code, we first import the necessary libraries,
The following code smoothly pulses the LEDs. They then store the number of pixels in a variable, create an
start with a dim red colour and gradually build to full object to reference and set values on the LEDs, then
Follow the circuit two more variables. The larger the value of numLoops,
diagram to
connect NeoPixels the smoother the effect. Next we define a while loop
to the Raspberry that will run forever, before setting a for loop that runs
Pi Pico or Pico W. for the number of times defined in the numLoops
variable. For each iteration of this loop, we set each
LED of the string (using the inner loop) to a brightness,
as defined by the value in the outer loop. After we have
set the value of each LED, we write the values that
cause the LEDs to change state, wait for a short period
before iterating again and getting brighter each time.
Once this outer loop has completed, the second stage,
decreases the brightness until the LEDs are practically
switched off. The colour can be altered by changing
the numbers in the brackets when setting np[i] . The
values in the tuple represent red, green and blue.
You can find two other examples of effects at
https://github.com/mattmole/LXF298.

www.techradar.com/pro/linux February 2023 LXF298   41


Pi projects

We’re on the case!


A case isn’t just for Christmas – it’s a life-long home for your
chosen Raspberry Pi project, so make sure you pick a good one!

lthough you can run a Raspberry Pi effectively a ribbon cable to connect to the pins, because some

A without one (Raspberry Pi co-founder Pete


Lomas designed it that way), many people
cases allow only that. The CSI camera and DSI display
ports may also be blocked by some cases.
want a case that can protect the single-board
computer while offering an attractive design, built-in Cooling solution
cooling or even special features. Originally, the Some cases come with built-in fans, while others use
Raspberry Pi was not supposed to be contained in passive cooling by turning the top of the case into a
anything, but over the years the number of cases heatsink. Others leave room for a fan but don’t come
available has become almost as numerous as decimal with one. Are you planning to use the case in the living
places in the number pi, so choosing the right one for room? Could fan noise become an issue? If so, a
your model and project can be a challenge. passively cooled Pi makes more sense. Cooling with
There’s no single best Raspberry Pi case for all uses, the Pi 4 is more critical than for other models.
because what you would want for a media centre is
different from what you need for maker projects or Special requirements
extreme overclocking. Some cases can turn the Some cases enable you to put the Pi on the back of a
humble SBC into a desktop computer, while others are screen or come with a screen attached. Other models
designed like classic retro consoles to hit the nostalgia are meant to look or function like retro game consoles.
node of our brains, and some cases completely engulf The more advanced cases offer extra features, such as
the Pi in a shield of aluminium or acrylic. Let’s start by the Argon One M.2, which has connectivity for an M.2
considering what you need from a case: SATA SSD.

GPIO, camera, display The Pi 400


Many cases limit or completely block your access With the release of the Raspberry Pi 400, we see
to the GPIO pins, which you need for attaching the a modified Raspberry Pi 4 4GB inside a keyboard
best Raspberry Pi HATs and other lights, motors and chassis. We have access to the GPIO and great cooling
sensors. Before you buy, consider whether you plan to but no connections for the official Raspberry Pi
use the GPIO pins and whether you need to put a HAT Camera or touchscreen. If you are just starting out, the
directly on top of your Pi or you are comfortable using Raspberry Pi 400 may be the best all-round purchase.

GET POWERED FROM AFAR


In the early days of the Raspberry first brought funny colours and limited. However, a cable solution
Pi, keen makers just grabbed any stutters to fully loaded Pis, then is available in the form of the
old basic 5V plug-in USB power eventually blank screens. The Raspberry Pi PoE+ HAT, standing
supply and off they trotted. latest Pi 4, with its USB-C power for Power Over Ethernet, a
But as Pi models started to get connector and official PSU standard for delivering device
more and more power-hungry, supplying 15W, ensures such power from a compatible network
such antics power shenanigans are a thing of router or switch over suitable
the past but it certainly limits the Ethernet cabling. The official
PSU cable length. PoE+ HAT is designed for the
What if you want to power Raspberry Pi 3B+ and Pi 4 with a
your Pi from afar? Battery maximum 20W, so there’s spare
solutions do exist for powering USB devices, too,
but obviously while PoE Cat5 enables lengths
are time– up to 100m.
The official board isn’t the
CREDIT: Raspberry Pi

only PoE HAT game in town; the


You can dangle WaveShare PoE USB Hub is a Pi
your powered Pi
from the end of
Zero board that offers the same
100m of Cat5, if power possibilities alongside
you fancy. additional USB ports.

42    LXF298 February 2023 www.linuxformat.com


Pi projects

Best all-round case


Argon Neo £15
The Argon Neo has attractive gunmetal-grey
aluminium on its top and sides, with a shiny black
plastic bottom. An aluminium plate covers the surface
of the Raspberry Pi 4 itself and uses an included
thermal pad to bond the CPU and RAM to the metal
for passive cooling. There are cut-outs for the GPIO
pins and the CSI/DSI ports. You can easily fit a
standard-size HAT on the Argon Neo, without the
need for an extender or a ribbon cable. There’s even
a little nook where you can prop up a Raspberry Pi
Camera module.

Best project case


Pimoroni Pibow Coupe 4 £10
If your priority is ease of access to the GPIO pins so
you can add a HAT, this could be your best choice.
The Coupe is not completely sealed on top, so it
leaves the GPIO pins unobstructed and provides
enough room to run cables to both the camera and
display CSI ports. If you like a dash of colour, the
rainbow version will brighten up your desk, while
different options for various Pi models are available.

Best smart case


SmartiPi Touch 2 £24
The SmartiPi Touch 2 enables you to combine the
official 7-inch touchscreen (sold separately) with the
Camera module and just about any Raspberry Pi
board (except the Zero) to create an awesome kiosk-
style device. You mount the official touchscreen in the
SmartiPi Touch, which provides a space on the back
to screw on your Pi and a camera hole as well.

Best advanced case


Argon One M.2 £40
A stylish but large piece of kit, which measures
140x93x40mm, the Argon One M.2 looks like a prop
from Star Trek and is made with an aluminium top
piece and a plastic lower section, where an M.2 SATA
hard drive can be installed. The Pi 4 is placed sideways
and custom boards break out the ports, control the
cooling fan and provide a power button. A magnetic
hatch on the top of the case provides access to the
GPIO; next to this is a slot that is useful for routing the
Pi Camera and official display cables through.

Best active cooling


Unistorm dual-fan case £15
CREDIT: Argon Forty Inc, Pimoroni

This case both passively and actively cools the Pi 4


via a two-part aluminium construction and a pair of
20mm fans, which are powered directly from the 5V
and GND pins of the GPIO. This does mean that HAT
connectivity is blocked, but individual GPIO pins are
available for use. The case offers access to ports,
including making connections to the CSI and DSI
before closing the case. Fan noise is low, and no
louder than a typical laptop fan running at idle.

www.techradar.com/pro/linux February 2023 LXF298   43


IN-DEPTH Contributing

Contributing
for non-coders
Aaron Peters, who is a coding tinkerer at best, describes some ways
that non-technical folks can contribute to open source projects.
t takes a village to run an open source writing a single line of code. And what’s more, the work

I project, or so the saying goes. Or would, if


software were a thing back when that
saying came to be. It nevertheless still
you do can actually benefit you as well. It’s a win-win!
Creating open source software requires a number
of skill sets. We’ll look at some of these in terms of the
applies to open source, which moves forward thanks value they bring to the project, as well as what skills
to the efforts of contributors around the world. and tools you need to get started.
Specifically, thousands of developers write millions
of lines of code to create all the components that make
1 Quality assurance
Image credit: Getty images

up our favourite operating system. From the kernel to Commercial entities have a fiduciary duty to their
base utilities to desktops and applications, many of customers to produce software that’s free of defects.
these contributors volunteer their time to improve and Open source has a similar responsibility, but projects
grow the FOSS ecosystem. likely don’t have funds to staff a quality assurance (QA)
But even more people use the software, but aren’t department with people dedicated to testing. Open
developers. If you, like the author, are among this source projects are always looking for contributors to
group, how do you go about lending a hand? In this help make sure the software is as bug-free as it can be.
article, we’ll explore a variety of ways you can pitch in An easy way to help is to report bugs you find in the
to help an open source project, none of which requires software you use. Projects often manage their work in

44    LXF298 February 2023 www.linuxformat.com


Contributing IN-DEPTH

HOW TO START CONTRIBUTING


To make the most of your contributions, select a project you’re
passionate about. If you have a nine-to-five job, volunteering your
free time can make life hectic. So, being truly excited about the
project you’re joining helps ensure your effort is time well spent.
To get started, poke around the project’s website. Most have a
page or section called Get Involved or How To Contribute featured
prominently. Where exactly it exists differs, but as an example, the
projects in this article welcome new contributors as follows:
FEDORA: The project has a site (https://whatcanidoforfedora.org)
that uses simple questions to help determine the best way for you
to pitch in.
LIBREOFFICE: The LibreOffice project uses the same format,
available at https://whatcanidoforlibreoffice.org.
KDE: The Get Involved page on KDE’s community wiki offers a more
straightforward list of its teams (https://community.kde.org/Get_
Involved), each of which has a page with its details.
MOZILLA: The Mozilla Foundation’s Contribute page (www.mozilla.
org/en-US/contribute) contains paths for you to find your ideal role
in the community.

screenshot (page 46), note that ‘Fedora’ is the product,


and ‘emacs’ is the component (a fun example, as we all
know Emacs is perfect).
3. Fill out the Description as completely as you can.
Simply saying “this is broken” is a good way to get your
report tossed out.
4. Including screenshots where applicable makes it
easy for developers to quickly understand the problem.
Once you submit the bug, you can expect a member
of the project to triage it. This could involve asking you
further questions, adjusting some of its settings (such
as Severity if it’s overall more or less important than
your initial assessment), assigning it to a developer, or
KDE’s Visual rejecting it. Note that a rejection isn’t necessarily a
Design Group
provides styles judgement on whether it’s valid or not. But it’s common
and imagery you that the issue you’re reporting is something that was
can use to mock introduced by the upstream project, who should rightly
up your own idea. be the ones to perform the fix. You can then follow the
progress of your reported issue from being assigned to
fixed, and hopefully at some point released.
issue-tracking systems. For example, the Fedora Reporting bugs is a simple but invaluable way you
Project welcomes bug reports on the Red Hat Bugzilla can help improve the quality of a project’s software.
site (https://bugzilla.redhat.com). If you find something
wrong with the software you’re using, you can submit a
description of it to the dev team in a few simple steps.
Before logging your bug, make sure it isn’t a known
2 Design
Another way to assist free software projects is to
contribute to their design. In this context, design has
issue. It’s a good idea to check any ‘troubleshooting’ or two separate but related connotations. The first is in
‘known issues’ list that might come with the software the sense of software design – how an application
you’re using. You can search the Fedora list with the should behave. Software projects in general do better
keywords that best describe your problem. Be as when they listen to the requests of users, and open
descriptive as you can, because the less precise the source projects are no exception. This is another great
search, the more results you need to wade through. For way to dip your toes into the volunteer waters, in that
example, if your system won’t boot after an upgrade the only requirement is to give some real thought to
and you search simply for ‘boot’, Fedora’s Bugzilla your suggestion as you submit it. Even better, the
presents a list of over 1,500 items to slog through. process to do so is likely very similar to submitting
If, after some due diligence, you’re satisfied you’ve a bug. The only difference may be making sure it’s
discovered something new, you can take the following marked as an idea or feature request rather than a bug.
steps to submit your report: A more direct way to contribute to projects is UX/
1. Create an account in the Bugzilla system. visual design – the way the software looks and how you
2. Fill out the form, making sure to select the correct interact with it. For example, in the KDE project, you’re
component, version and other options. In the invited to join the Visual Design Group’s (VDG) Matrix

www.techradar.com/pro/linux February 2023 LXF298   45


IN-DEPTH Contributing

chat room to learn about the team. Once you’ve talked has usable documentation can help prospective users
with some of the other members and decided on the evaluate it better, and gives the impression of a mature,
idea you’d like to submit, you flesh it out using two complete product. And nearly every software project is
tools. Firstly, the VDG uses GitLab Issues to track happy to accept contributions to its documentation.
in-process tasks. You can use this to describe the If you’re interested in writing docs, each project’s
overall concept and hold a discussion about it using the toolset involves a different level of complexity. For
built-in comments. In addition, you use a tool of your example, in addition to its formal application docs, KDE
choosing to provide a mockup of your idea to help the allows users to contribute to the UserBase wiki. This is
team (including developers) visualise it. as easy as registering for an account, deciding what to
The team offers samples and design assets in its write about and what format to use (a how-to page or a
Figma project to get you started. Finally, the VDG also full manual, for example), and contacting someone on
welcomes help with creating icons and maintaining its the team to get started. While you’re still expected to
Human Interface Guidelines, available on the KDE follow the project’s workflow and style guide, you can
Developer wiki (https://develop.kde.org/hig). pretty much start with just an up-to-date version of the
component you’re documenting and a web browser.

3 Documentation
When software is developed well, who needs
documentation, right? Wrong. Making sure software
In contrast, other projects have a more technical
infrastructure for their documentation. For example,
the Ubuntu Documentation team follows a docs-as-
code philosophy. In order to contribute, you need to
take the following steps:
1. Install the tools, which include the DocBook markup
language, XML transformation utilities (XSLT and FOP,
for example), the Bazaar version control system, and
Make to build everything:
$ sudo apt install bzr xsltproc libxml2-utils yelp-
tools yelp-xsl make docbook docbook-xsl
2. Next, you need to register with and provide an SSH
key to Launchpad, the management system used to
coordinate Ubuntu and other open source projects.
3. Connect Bazaar to Launchpad with:
$ bzr whoami “Aaron Peters <[email protected]>”
$ bzr launchpad-login [username]
4. To contribute, you use Bazaar to check out a copy of
the current doc set for the product you want to work
Submitting a Fedora bug report is as simple as creating an account on Red Hat’s on, one of either ubuntu-docs (for desktop Ubuntu),
Bugzilla and filling out the form. xubuntu-docs (for Xubuntu), or serverguide (for
Ubuntu Server):
$ bzr branch lp:ubuntu-docs
INTERACTING WITH THE COMMUNITY 5. Make your desired changes to the source files.
6. When you’ve finished, update to pull down any
Contributing to open source projects brings benefits over and changes from other team members, then commit
above being able to see your work represented in your favourite your changes locally:
bit of FOSS. One of the most rewarding aspects of volunteering is $ bzr update
interacting with the community, including fellow contributors as well $ bzr commit
as users. In fact, starting out by just talking with other community 7. Finally push the commit back to Launchpad with a
members is a great way to get a feel for how the project operates, new branch name describing the changes you made:
and whether it’s the right fit for you. As you might expect, each $ bzr push lp:~[username]/[product branch]/[new
project has its own preferred way of collaborating. But the following branch name]
represent some places where you can start to interact with other Please note that the above steps aren’t intended
volunteers, and maybe get some direction on how to get started. to be a complete description of the process. You
MAILING LISTS: This decidedly old-school way is still very common should follow the instructions on the Ubuntu Wiki’s
among open source projects. Subscribe to the mailing list to receive System Documentation page (https://wiki.ubuntu.
threaded updates in your inbox. com/DocumentationTeam/SystemDocumentation) if
IRC: Internet Relay Chat (IRC) is also still going strong as a you decide to start writing for Ubuntu. Instead, they’re
communication method for many FOSS projects. intended to give you an idea of some of the technical
TELEGRAM: Some projects are moving to the Telegram protocol steps you need to take. And it’s important to look at
for their chat. these as a challenge, rather than a deterrent. One of
SLACK: Finally, some communities use Slack. While the limitations the most rewarding things about contributing to open
on its freemium service require some workarounds, its availability source is all the things you can learn along the way.
and familiarity make it an increasingly popular choice. Working on documentation is particularly beneficial,
Once you’ve found the right channel(s), it’s a great idea to simply as you’re teaching others while you learn yourself.
lurk for a while. Many projects actually recommend you do just that.
You’ll get an idea of how the group operates, what opportunities are
available and, importantly, where they may need some help. 4 Translation
If you speak more than one language, translation
is an extremely valuable way to give back to an open

46    LXF298 February 2023 www.linuxformat.com


Contributing IN-DEPTH

source project. This is because with a comparatively


small amount of work, you can open up a whole new
market to the software. This isn’t to say that translation
is easy, but by converting a moderate amount of text in
one language (typically English, for better or worse)
into another, you can add the population of a whole
country to the project’s user base.
The Mozilla Foundation makes it extremely simple
to start pitching in. A page on the Community Portal
(https://wiki.ubuntu.com/DocumentationTeam/
SystemDocumentation) provides links to start
localising either software or help content. The
process for both is similar:
1. Make an account in the appropriate system.
2. Gain an understanding of the project’s guidelines.
3. Find things that need to be localised into your Mozilla’s Pontoon localisation platform makes it easy to get translating quickly and
particular language. provides plenty of tools to boot.
4. Start submitting your translations.
If you choose to work on Mozilla software, for grew from roughly six to now several dozen active
example, you’ll use the project’s Pontoon localisation members, it quickly became difficult for the proverbial
platform. Most software designed for translating text left hand to know what the right hand was doing. So
works on the basis of strings, or individual fragments or we began to implement Agile product management
sentences. Pontoon displays all the strings that require principles alongside the writing of doc templates. As a
translation. Once you select one, there is a variety of result, we’re now headed towards our second formal
tools at your disposal to help you create the translation. release (shown in the screenshot, below), and already
As shown in the screenshot (above-right), you start have a backlog of items we can look forward to
by selecting a string from the list on the left. This working on in the coming year.
opens it at the top of the centre column. The grey Other functions, including advocacy, community
area below is where you place your translation of that relations and marketing, are also part of, or at least
string. Any previously-submitted translations for it adjacent to, a more central coordination function.
appear at the bottom of the centre column. The right- It’s a great way to sharpen up your negotiation skills
hand side contains tools and other hints for you to use as well, because you don’t have direct authority or
while translating, including any terms with specific monetary incentive as you might as part of corporate
translations, available translations of identical or management. Instead, it’s a chance to work with great
similar strings, and the results of machine translation. people and use your organisational skills to make
When you’ve finished, you can submit the translation, everyone else’s volunteering a lot easier.
and then move on to another. Other volunteers Hopefully, this article has not only laid out some
subsequently review your translation for approval of the options to contribute to an open source
to be included in a project release. project if you’re not a developer, but also provided an
idea of what they take and what benefits they provide.

5 Management and coordination


Even moderately sized open source projects
can become complex, for a few reasons. Firstly, the
Having volunteered in two of the above capacities
(coordination and writing documentation), we can
attest that it’s an immensely rewarding experience that
project’s membership is likely to be widely dispersed, also gives you the chance to work side by side with
right across the globe. This makes coordination great people. If you have the bandwidth, you should
challenging due to differences in time zone and, in definitely consider giving it a try. It’s an important part
some cases, language. Furthermore, unless volunteers of what makes free software so great.
are independently wealthy, they’re juggling their
contributions with some other occupation.
But over and above these logistical issues, the fact
of the matter is that contributors are volunteering,
and the process should be enjoyable. This makes the
task of managing an open source project just as
pivotal as it is for commercial projects, though for
different reasons. If you’re organised and can liaise
between different groups, you can position a project
so that others can focus on their core competencies
(coding, for example) without having to worry about
administrative matters. This enables these volunteers
to be more efficient, and to focus on the contributions
that make them happy.
We’re fulfilling such a role in The Good Docs Project
(https://thegooddocsproject.dev), an open source
initiative to provide best-practice documentation By rolling out management processes, The Good Docs Project now has a consolidated view of
guidance and assets such as templates. As the project how releases are progressing.

www.techradar.com/pro/linux February 2023 LXF298   47


Pi USER
Santa Claus delivers Neil Mohr
badgers his small

extra Pis for Christmas


children into doing
electronic things
so he can write
about them. Is
that so wrong?

Saint Nick, aka Eben Upton, drops 100,000 extra Pi-TERNATIVE


Raspberry Pis on Tiny Tim just in time for Christmas. LIFESTYLE?
ue to the delays of print publishing Raspberry Pi Zero W, 3A+ and Raspberry The Raspberry Pi wasn’t the

D and extended Christmas deadlines,


this news will seem a little late, but
Pi 4 2GB and 4GB, for single-unit sale. He
confirmed that units are “flowing into the
first SBC on the scene. Long
before, there was the very similar
we’re doing our best! Raspberry Pi CEO Eben Approved Reseller channel now, and this is BeagleBoard, released in 2008.
Upton announced via the official blog that already translating into better availability When the Pi was first released,
100,000 units had been secured for single- figures on rpilocator”. You can read the full many advocates pointed out that
unit sales (one unit per customer) and that by announcement at www.raspberrypi.com/ the BeagleBoard was better
the second half of 2023, it is expected that news/supply-chain-update-its-good-news. specified (it was) and had better
there will be a return to pre- support (it did at the time),
pandemic stock levels. This though with its BeagleBone and
is good news for those who Black edition, it was a good deal
have felt the bite of the supply more expensive ($89) than the
shortage that has dogged the $25 Pi. BeagleBoard is still going
Pi for well over a year. The bad strong and is currently gearing
news? Raspberry Pi Zero and up to release a RISC-V-based
Zero W see a $5 price increase, BeagleV. It might not be an SBC
but the Pi Zero will be available as such but the Arduino Uno
for bulk purchase in 2023. microcontroller just about
Upton acknowledged the predates the Pi and at the time
patience of the community and had (and still does have) a huge
offered 100,000 units, made of Hold off on weak imitations – the Pi should be returning as you read this. open source community behind
it, while being affordable and
easy to access, though lacking
the full-computer aspects of the

Cool Pi 4 Aaeon Extreme! Pi. Why am I telling you this? Pi


models are currently hard to
come by but that doesn’t stop
Not cool dude! Too much to handle? inventive companies offering
similar products both in function
While the Pi shortage continues, plenty are Asus has a decent history of supplying SBC and often very much in their
stepping in to offer more expensive, less boards for development. Its latest is a beast, looks. We’re happy to cover that
well-supported offerings. The latest is the sporting a 12th-gen Intel Core i7/5/3 Celeron news, but should you be rushing
dubiously named Cool Pi 4 – looking very with up to 12 cores and 16 threads, PCIe V4, out to grab one? It’s something
similar to the classic Pi but with the eight- 2.5Gb Ethernet, up to 32GB DDR5, USB 4.0 that I would avoid. I enjoy the
core RK3588 SoC and costing around $140. and more. Find out more at www.aaeon.com. immense amount of support
Find out more from the Chinese site: https:// the Raspberry Pi offers from its
cool-pi.com/category/6/pi-4-model-b. fabulous community – it makes it
simple to troubleshoot and I’m
It has distros to not worrying about updates to
download in Chinese, crucial distros down the line.
but for how long?
That’s not to say at least some of
these alternative boards don’t
have merit. BananaPi has stuck
around and has gone from
strength to strength, but is it
helping to fund education
High-end research in the UK? I know which
development kit boards I’ll keep buying, if for no
for those who can
afford and need it!
other reason than that.

CREDIT: Cool Pi CREDIT: ASUS

www.techradar.com/pro/linux February 2023 LXF298   49


REVIEWS Robot Kit

Petoi Bittle Robot Dog


The rise of quadruped robots is upon us — their mission
to boost STEM and AI learning with Anj Bryant.
uadruped robots aren’t new, but they’re as head acts as a clip that can hold on to tiny objects and is
IN BRIEF
A modular
Q cool and fascinating today as they were a few
decades ago when they first surfaced. Bittle is a
also where the add-on sensors are placed.
Bittle’s short battery life quickly became an issue. An
beginner’s robot programmable robot dog targeted at robotic beginners hour isn’t enough time for play and exploration at all.
kit that offers ages 14 years and up, or anyone who wants to have fun Extra batteries can be purchased for £32.
the ability for learning and playing with robots. Priced at £310
Scratch-level (assembled), it comes programmed with a few starter Construction kit
coding and tricks, such as walk and trot, that learners can try out to Bittle also comes in a do-it-yourself construction kit,
enhancing the familiarise themselves with what the robot can do, then which ships unassembled so you can experience putting
base kit with later expand to more complex types of behaviour. the entire robot together yourself — a worthy and most
additional This may seem like an expensive STEM kit, but it’s enjoyable activity for anyone interested in robotics. You’ll
sensors, servos fairly affordable compared to similar products. In fact, also learn circuitry and cable management.
and more some servo-based quadruped robots, such as the Xgo The main body frame and legs are made of hard,
advanced Mini or the PuppyPi, retail for well over £500. durable plastic. It’s cleverly designed with an interlocking
coding Bittle’s open-source platform also enables you to add mechanism, so parts easily snap in place. Assembly
languages. a Raspberry Pi and attach Grove sensors to extend its videos and tutorials are available online if you need help.
capabilities, explore AI machine-learning projects and try There are also diagrams that you can refer to in the
out various STEM experiments. online manual. When you assemble Bittle yourself, you
It ships in two models, a pre-assembled kit and a DIY need to upload code to the NyBoard and make sure your
construction kit, and three colour options: black and connectors are connected to the right circuit.
yellow, blue and yellow, or red and yellow. There are three To use Codecraft to program Bittle, make sure you
ways to control your Bittle: using the IR remote that have OpenCat 1.0, as version 2.0 is not yet compatible.
comes with the kit, downloading the mobile app on your You need to connect to your Bittle to check what version
phone, or installing the desktop app on your computer. of OpenCat is installed. Use the USB adapter and dongle,
The pre-assembled robot also comes precalibrated Wi-Fi or Bluetooth to connect, and run the Petoi Desktop
and preloaded with a set of basic tricks such as walk, sit, App. In the main window, click on Firmware Uploader.
stand and trot, which you can speed up or slow down You can download the Codecraft app on your
using the controller of your choice. computer or go to https://ide.tinkergen.com and select
It trots around naturally, is very agile and maintains Bittle to start experimenting and programming different
good balance even as it changes direction. However, it routines for Bittle. When done, click the Upload button
isn’t as graceful on carpet as it is on smooth surfaces. on the left side menu. It takes a few seconds before
Standing 11cm tall and weighing under 300g, Bittle is Bittle executes your script. There are 16 online courses
Sit! Stay! Now the perfect size to pick up and place available for beginners and advanced learners. Bittle also
write an entire
issue of Linux
in different settings. We found the supports Python and C programming languages.
Format! Who’s a head came off too easily, but this is The hands-on coding experience from the apps, free
good boy? a feature rather than a defect. The online coding courses and further expansion projects
and experiments definitely make Bittle a worthwhile
investment. Not to mention the support of the open-
source online community.

VERDICT
DEVELOPER: Petoi
WEB: www.petoi.com
PRICE: £310 (£299 kit)

FEATURES 8/10 EASE OF USE 8/10


PERFORMANCE 7/10 VALUE 8/10

A fun introduction to robotics and coding, but its short


battery life, incompatible firmware and calibration issues
CREDIT: Petoi

could turn eager young learners away.

Rating 8/10

50    LXF298 February 2023 www.linuxformat.com


3D printer REVIEWS

Elegoo Neptune 3 Pro


Denise Bertacchi wishes everything in life could be relied upon
to add more features while remaining excellent value.
one are the days of ‘beginner’ printers that
SPECS
Build vol: 225x
G welcome new makers with a trial by fire. The
Neptune 3 Pro arrives 90% pre-assembled
225x280mm and goes from box to first print in 30 minutes.
Material: PLA/ Everything we liked from the Neptune 3 has been
PETG/TPU/ABS carried over and improved in the Pro edition. The PEI-
(up to 260°C) coated build plate holds on to prints with the right
Extruder: amount of stick, then releases when cold. Bed levelling is
Direct drive a snap, and the Z height was on target without needing
Nozzle type: adjustment. The removable touchscreen is easy to use,
0.4mm MK8 and thumbnails have returned when you use Elegoo’s
Platform: slicing software. It also adds a few new goodies: a direct This type of print
PEI textured drive that really grips slippery filaments, such as TPU, can be tricky, but
the Neptune 3 Pro
spring steel dual Z screws for steady printing, and a built-in task light.
handled it easily.
sheet, heated You get tools to build and maintain the printer, side
Levelling: cutters, a plastic scraper, two spare nozzles, and a
Automatic, microSD card with a USB adapter. There’s also a small making its calculations. It uses a hard-mounted build
inductive probe sample of white PLA to print your first model. surface and an inductive probe that works amazingly well.
Runout sensor: The Neptune 3 Pro is a direct-drive printer with its
Yes Hot off the press extruder and hotend all in one spot. To load filament, tap
Comms: The most interesting update is riding on the gantry: a Prepare on the main menu, then Temperature and select
MicroSD card, dual-gear direct drive that does an excellent job of the one of four presets that match your filament.
USB Type A grabbing squirrelly material like TPU. It has three cooling It comes with a copy of Elegoo Cura, which has
Control: fans and an improved aluminium heatsink. Elegoo brags profiles for all its machines. It also has the added ability
4.3-inch colour about the new “TC4 titanium alloy” throat pipe, but to create a thumbnail of your model to display on the
touchscreen, there’s still a chunk of PTFE tube in there, so it’s not an printer. This function doesn’t work if you use OctoPrint,
removable all-metal hotend. The improvements should help prevent as the Raspberry Pi overrides the main screen. Standard
Size: 475x445 clogs, but you’re still limited to 260°C on the hotend – versions of Cura or Prusa Slicer don’t have profiles for
x515mm, 8.1kg which is fine for most 3D printing enthusiasts anyway. any of Elegoo’s printers, but you can use the profile for an
The power supply has been moved beneath the build Ender 3 Pro and adjust the build volume accordingly.
plate to make room for a second Z axis screw. Shifting The Neptune 3 Pro printed wonderfully right out of
the weight lower and adding Z rods on both sides should the box. The first print was the pre-sliced Buddha Elegoo
help with print accuracy, especially on taller prints. provided on the microSD card. Using the supplied
The Pro has a large removable touchpad with a sample PLA it turned out very smooth.
magnetic base. The graphic menu is easy to understand, The Neptune 3 Pro is a great 3D printer for people
although the ‘buttons’ could be more sensitive. who want a polished machine that’s easy to use straight
Elegoo has also put some work into the auto bed away. Its simple auto bed levelling, PEI-coated flex
levelling system, which now taps 36 points before tttplate, and excellent direct drive all help beginners by
eliminating the major headaches we often experience
with stripped-down basic printers.

VERDICT
DEVELOPER: Elegoo
WEB: www.elegoo.com
PRICE: £244

FEATURES 9/10 EASE OF USE 9/10


PERFORMANCE 9/10 VALUE 9/10

The easy-to-use Neptune 3 Pro offers upgraded features,


The Elegoo like a direct drive and dual Z axis, without an upgraded price.
Neptune 3 Pro
comes mostly
built and Rating 9/10
ready to go.

www.techradar.com/pro/linux February 2023 LXF298   51


TUTORIALS Build a robot

Pi ROBOT

Pi robots: motors Part Two!


Don’t miss
next issue,

and control
subscribe on
page 16!

In part two of his series, Les Pounder shows us how to safely


connect and control motors with a Raspberry Pi.

t the end of part one, we had built our robot

A from a kit and soldered wires from the motor


terminals. In this part, we move on to writing
code that will control the motors and move our robot.
As our robot has four motors, we need to use two
motor controllers. One for the rear motors, the other
OUR for the front. But which are the best choice for this
EXPERT project, and how do we interface the Raspberry Pi to
Les Pounder them? We will create our own Python module (a library
is associate of prewritten code) to control the motors and create a
editor at Tom’s test script to ensure it all works.
Hardware and a This part can get quite complex – we are working
freelance maker. with four motors. Take your time, tackle just one motor
He blogs about at once, and double-check your connections before
hacks and makes moving on. Sure, we want to get to the bit where our It may look a mess, but this robot is ours. We’re still in the debug phase,
at http://bigl.es. robot runs around under our command, but we need to so making it look pretty is not a concern yet.
put some work in before we reach those giddy delights.
maximum current, per motor channel, of 1.5A. Two
YOU NEED Motor controllers motors running from one unit could pull 1.8A in a worst
We can’t just connect the GPIO of the Raspberry Pi case scenario. So for now, the DRV8833 is a maybe.
Robot kit to the motors. The amount of current consumed by a The final motor controller is the L298N, which is a
Pi 3B+ or 4 motor is many times what the Pi GPIO can produce. beast of a motor controller. The L298N is the name of
4GB Instead we need something that sits between the Pi the chip itself, but it is commonly sold as the L298D,
2x L298D and the motors: a motor controller. The controller which features a breakout board for screw terminals
motor receives the signal from the Raspberry Pi’s GPIO and and header pins. You’ll also notice that the L298D has a
controllers triggers its output pins to send power to the motor. In massive heatsink. Well, it needs it as this chip can sink
12x reality, the motor controller is an H bridge, where 2A per motor channel, over double the stall current of a
female- changing the state of two pins can send the power to single motor. This makes the L298D a great choice for
to-female alternate motor pins. This forces the motor to spin in this robot project. We are going to need two: one for
jumper wires either direction, giving us directional control. The most the front motors, the other for the rear.
USB common motor controllers for makers are the L9110S,
battery L298N and DRV8833. But which one do we need? Connect the motors
for testing To determine this we need to look at the datasheet Wiring up the motors to the controllers is an involved
Code: for our yellow DC motors. It seems they have a max process, so let’s do it one by one. We start with the rear
https:// current of 800mA. This is the stall current, which is
github.com/ the current consumed by the motor when it is forced
lesp/Linux- to stop – a wire may catch in the axle, or the robot
Format- becomes trapped. Looking at the datasheet for the
Robot/ L9110S, we see that it can handle 800mA, but only for
archive/refs/ one motor; two motors could see 1.6A go through and
heads/main. destroy the controller. We tested the stall current for
zip one motor and noted that it reached 900mA, which is
a definite strike against the L9110S.
That leaves us with the DRV8833 and L298N. Cable ties are your new best friend. They can keep your components
The DRV8833, a chip from Texas Instruments, has a tight to the chassis, and clean up the mess of wires.

52    LXF298 February 2023 www.linuxformat.com


Build a robot TUTORIALS

Take your time with this circuit. Check your


connections before applying power. Do not
connect the red 6V power connection from
the motor to the Raspberry Pi!

motors. To wire up one motor we need the two wires Testing time
from the motor connected to OUT1 and OUT2 on the Before we can set our robot off on an adventure, we
L298D. It doesn’t matter much which goes in OUT1/ need to ensure that we have full control of the motors. Wire up
OUT2; we’ll test that later. From the Raspberry Pi, To do that we create a test script that checks that each each motor
connect GPIO14 to the IN1 pin, and GPIO15 to IN2. motor can spin, and that we have control of the individually.
These pins control the motor rotation. Now we have direction and speed. This test script is based upon Check the
connections
one motor connected to the L298D, and our Pi is also GPIO Zero, an excellent Python module from Ben
match those in
connected. Nuttall and Dave Jones. GPIO Zero simplifies working the table (see
Connect the second motor to OUT3 and OUT4, and with the GPIO by abstracting the complexities into page 54). If your
GPIO18 and GPIO23 for the IN3 and IN4 pins. Connect human-readable instructions. motor spins the
the power from the batteries (or USB battery) to the Begin by powering up to the Raspberry Pi desktop. wrong way, swap
12V and GND of the L298D via a breadboard that we’ll From the main menu, go to Programming and select the connecting
use to break out one connection into many. We also Thonny. In a new, blank window, save the code as wires between
need to connect any GND from the Pi to the GND of robot-test.py. We start by importing two modules. The the motor
the motors; use another series of breadboard first is GPIO Zero, specifically the PWNOutputDevice and the L298D.
connections for this. The batteries only power the class from it. This is used for fine control of the motor
motors, not the Pi. Four AA batteries is 6V, much more
than a Pi can safely use. Right now we have two L298D
motor controllers, powered from batteries/USB, with MOTOR CONTROL BOARDS
their GND pins connected to the GND of the Pi and the
power source. This gives us a common ground We’ve focused on bespoke H bridge motor controllers as the
reference necessary for the circuit to operate correctly. method to work with motors on the Raspberry Pi. They are not the
These two motors will be the rear-left and rear-right of only option, though. There are many other motor boards to choose
the robot. from and here we highlight two that we have personally used. First is
Now for the front motors, and for this we need Pimoroni’s Explorer HAT Pro, a board that was used in the Raspberry
another L298D. This time, connect the front-left motor Pi Foundation’s Picademy teacher training course. This versatile
to OUT1 and OUT2, then connect GPIO24 and 25 to board has two motor outputs, capacitive touch inputs and 5V
IN1 and IN2 respectively. Connect the front-right motor tolerant inputs. It is a great board for newcomers and while it isn’t for
to OUT3 and OUT4, and then connect GPIO8 and 7 to use with big motors, for 6V micro gear metal motors, it is perfect.
IN3 and IN4, respectively. Again connect the 12V The other controller is Cytron’s Maker Drive, which is a breakout
terminal to the batteries via the breadboard, and for an MX1508 motor controller. This tiny board is made for makers
connect GND to the breadboard row of GND pins. An who want to get things to move. It has solid screw terminals, header
alternative to a breadboard are Wago 221. These are t pins for GPIO connections and, in a truly innovative move, push
that turn one connection, for example GND, into many buttons. The four push buttons are used to test that a motor is
GND connections. We can use a Wago 221 with five connected and working. Press the button and it sends current along
connections to common the GND of our Raspberry Pi a set path, press another button and the H bridge flips and spins the
and the battery. Another Wago 221 can be used to motor in the opposite direction. We’ve used this board in a few
break out the 5V connection from the battery to both projects, even with a Commodore 64 and a GPIO breakout to write
L298D motor controllers. See the picture (page 55) for Basic code to make a motor spin.
an example of how we did this.

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

www.techradar.com/pro/linux February 2023 LXF298   53


TUTORIALS Build a robot

speed by sending pulses of current instead of simple


on/off. The second module is time, and we use the
If you can’t sleep function to create pauses in the code:
get any from gpiozero import PWMOutputDevice
L298D motor from time import sleep
controllers, a Our focus now turns to creating objects that act as
DRV8833 will
an interface between the code and the GPIO pins that
do the job. The
control the motor. The objects are given the cryptic
DRV8833 can
cope with 1.5A names of rra and rrb. These refer to rear-right motor,
of current per and then one of two terminals represented by a and b.
motor channel, Object rra is the rear-right motor terminal a, connected
but it is a little to OUT1 on the L298D. This is controlled from GPIO14
harder to on the Pi. The value of GPIO14 is set to 0 so that the
work with. motor doesn’t automatically start. We repeat the We used a Pimoroni Pico HAT Hacker to help us remember the GPIO
process for rrb, connected to OUT2, IN2 and GPIO15. reference for each pin.
rra = PWMOutputDevice(14,initial_value=0)
rrb = PWMOutputDevice(15,initial_value=0) lrb.value = 0
Here is the code for the left-rear motor, connected fla.value = speed
to OUT3 and OUT4 via IN3 and IN4 and GPIO18 and 23. flb.value = 0
lra = PWMOutputDevice(18,initial_value=0) #left rear fra.value = speed
motor terminal a frb.value = 0
lrb = PWMOutputDevice(23,initial_value=0) #left rear Next we create a function called stop() to stop all
motor terminal b the motors dead. No gentle deceleration – this is an
Here is the code for the two front motors. emergency stop. It takes no argument.
fra = PWMOutputDevice(24,initial_value=0) #front def stop():
right motor terminal a rra.value = 0
frb = PWMOutputDevice(25,initial_value=0) #front rrb.value = 0
right motor terminal b lra.value = 0
fla = PWMOutputDevice(8,initial_value=0) #front left lrb.value = 0
motor terminal a fla.value = 0
flb = PWMOutputDevice(7,initial_value=0) front left flb.value = 0
motor terminal b fra.value = 0
Save the code before moving on. frb.value = 0
For quick reference, below is a table of connections print(“ALL STOP”)
between the motors, L298Ds and Raspberry Pi GPIO. Next we make a new line and write a few lines that
To control the motors, we create functions for call the functions to test that everything is working. We
forward, backward and spinning motion. Each function set forward to full speed, 1.0, but this can be any value
is named after the direction in which we want to go. above 0.5 for the test. Any values lower may cause the
The function takes an extra parameter, an argument, motor to stall, but later we can drop our speed down to
which is the speed at which we wish the motors to lower than 0.5 while the motor is moving.
move, using a value between 0 and 1. forward(1.0)
We start by moving forward using the forward() sleep(10)
function. To move forward we need to spin the motors stop()
in the same direction. We set motor terminal a of each Save the code and ensure the motor power supply
motor to run at the speed value we pass to the is powered on and that the red LEDs on the L298D are
function. Motor terminal b is set to 0 so the H bridge in lit. Lift the robot chassis up and ensure the wheels are
the L298D knows which direction the current flows. clear of any objects and fingers. In Thonny, click Run
def forward(speed): and the motors spin. Check that each motor is spinning
rra.value = speed in the correct direction. If not, make a note and when
rrb.value = 0 the code stops, swap the motor terminal connection
lra.value = speed to the L298D for that motor and then try again.

Object name Motor pin Motor input Pi GPIO Add more directions
With the successful test done, we add functions for
rra OUT1 IN1 14
backward, spin left and spin right. Place these below
rrb OUT2 IN2 15 the forward() function, but above the test lines.
Backward
lra OUT3 IN3 18
def backward(speed):
lrb OUT4 IN4 23 rra.value = 0
fra OUT1 (2nd L298D) IN1 (2nd L298D) 24 rrb.value = speed
lra.value = 0
frb OUT2 (2nd L298D) IN2 (2nd L298D) 25 lrb.value = speed
fla OUT3 (2nd L298D) IN3 (2nd L298D) 8 fla.value = 0
flb.value = speed
flb OUT4 (2nd L298D) IN4 (2nd L298D) 7 fra.value = 0

54    LXF298 February 2023 www.linuxformat.com


Build a robot TUTORIALS

frb.value = speed download for this project is a quick reference table


Spin left (Motor-Direction) of the values for each motor terminal.
def spin_left(speed): Writing a
rra.value = speed Create a Python module test script is
rrb.value = 0 With a successful test under our belt we now move on essential. We
lra.value = 0 to create a Python module that controls the robot. This need to make
sure that we
lrb.value = speed is the easy bit. Copy all the lines from the imports and
have full control
fla.value = 0 functions (we don’t need the test lines), and paste
of the motors
flb.value = speed them in a new Thonny window. Save it as robot.py. before we
fra.value = speed Open a new Thonny window and use import the unleash the
frb.value = 0 robot module and the sleep function from time: robot. Getting
Spin right import robot the basics
def spin_right(speed): from time import sleep correct will yield
rra.value = 0 Add a few test lines that call the functions from the better results
rrb.value = speed module and use them to control the robot. We preface for future parts
lra.value = speed commands with robot to tell Python which module to of this series.
lrb.value = 0 use. Save as test.py in the same directory as robot.py.
fla.value = speed robot.forward(1.0)
flb.value = 0 sleep(5)
fra.value = 0 robot.backward(1.0)
frb.value = speed sleep(5)
Now we can modify the test lines to use each robot.spin_left(1.0)
function for five seconds: sleep(5)
forward(1.0) robot.spin_right(1.0)
sleep(5) sleep(5)
backward(1.0) robot.stop()
sleep(5) Lift up the robot and click on Run. The robot should
spin_left(1.0) move in the same pattern as our previous test script.
sleep(5) To run the code remotely we need to start an SSH
spin_right(1.0) server. From the main Raspberry Pi OS menu, go to
sleep(5) Preferences > Raspberry Pi Configuration. In the new
stop() window go to Interfaces and enable SSH. Hovering the
Save the code, pick up the robot and click Run to mouse over the network icon in the top-right shows
test. Does every motor move correctly? If so you have your IP address. On another computer, open a terminal
completed the test and have a basic user-controllable window and use SSH to remotely connect to the Pi.
robot. If not, swap the motor terminal connections You can use your IP address or hostname to connect.
between the motor and the L298D, and retest. In the Typically the hostname is raspberrypi.local and the
username is pi. So we would use SSH as follows.
ssh [email protected]
or
ssh pi@YOUR-IP-ADDRESS
Run test.py using Python (pick up the robot):
python3 test.py

And relax…
We now have a robot that we can code using a custom
Python module. Next time we’ll interface sensors into
A Wago 221 connector can turn one connection into many. We used it the robot to give it a level of intelligence that will see it
to make a common ground reference and break out the 5V power. navigate a room without outside help.

RASPBERRY Pi ALTERNATIVES
The Raspberry Pi is not the only brains Lite model to give the robot intelligence intentions. Another option is Khadas’s
for a robot. It just depends on what level to identify objects and obstacles, and range of boards. The VIM4 is a beast of
of intelligence you need in your bot. At react accordingly. The Pi is the sweet a board, with 8GB RAM and an octa-core
the most basic level, we can use a £2 spot for computational power and price, Arm CPU. It runs Ubuntu 22.04 and is
microcontroller, such as an ATtiny85, to but if money is no object, Nvidia’s Jetson priced just over the currently high prices
build a £10 Arduino robot: https://bigl. range of boards has superior AI and of the Pi 4. The Khadas Edge 2 Pro
es/friday-fun-attiny85-10-robot- computer vision capabilities. The Nvidia comes with up to 16GB RAM and a SoC
challenge. If we want to use Jetson has additional cores devoted to that features additional computing
MicroPython or CircuitPython, we can machine learning, and with a webcam, power for machine learning. Sure, we
build a robot based around the Pi Pico or we can train our robot to detect faces pay more, but we get much more power
Pico W. We can even use a TensorFlow and objects, hopefully with altruistic for robotics in a tiny form factor.

www.techradar.com/pro/linux February 2023 LXF298   55


TUTORIALS
TUTORIALS Sxxxxx

VISIDATA
Credit: https://visidata.org

Tackling terminal
tabular table tools!
With the right tool at his disposal, Shashank Sharma has
no trouble making sense of vast heaps of tabular data.

ast amounts of information, separated into of changing it in any fashion. In fact, it’s also possible

V logical rows and columns that add up to a


table, is the layman’s definition of a data set.
to save a VisiData session so that your particular
manipulations are recorded, and you can then restore
We see such data sets everywhere, from the ever- the session without having to start again from scratch.
changing prices of consumer electronic goods to All this and more will become obvious as you go
polling statistics, results of football matches, and more. through this tutorial and, more importantly, spend
OUR With the right tool at your disposal, you can explore, some quality time working with VisiData.
EXPERT clean, edit, summarise, analyse and plot the data into
Shashank graphs for quick assimilation. While working with Sit at the table
Sharma spreadsheets or CSV data is not traditionally Some distributions, such as Arch Linux, carry VisiData
is a trial lawyer envisioned as a task suited for the command line, in their software repositories. However, the quickest
in New Delhi VisiData will quickly dispel you of such notions. way to install the latest version is to use Pip, Python’s
and an avid Arch Written in Python and released under the GPLv3, package manager.
user. He’s always VisiData is incredibly fast and lightweight. You can If you already have Pip installed on your distro, run
on the hunt for easily use it to work with data sets featuring a few the pip3 install visidata command. You can check the
affordable geeky million rows of data. The project’s goal for future version of VisiData with the vd --version command.
memorabilia. releases is to be able to handle hundreds of millions The project is constantly under development and this
of rows of data. tutorial is based on version 2.10.2.
Data from 2020 For our money, one of VisiData’s best features is Ubuntu and Fedora users can install Pip using the
league results. You
can use the mouse
that it’s non-destructive. This means that it doesn’t software repositories by installing the python3-pip
scroll wheel to alter your raw data by default, leaving you free to package with the sudo apt install python3-pip or
navigate the file. manipulate the data to best analyse it without fear sudo dnf install python3-pip respectively.
In addition to CSV files, VisiData supports a number
of other file formats as well. Out of the box, it supports
SQLite-databases, JSON files, Unix directories, ZIP files
and more. Head to www.visidata.org/docs/formats/ for
a list of all the supported formats.
You have to install additional packages if you wish
to work with Excel spreadsheets, Postgres, MySQL
databases, XML or YAML files, and various others. For
instance, the xlrd and openpyxl packages are required
for working with Excel spreadsheets (XLSX files). You
can install these with the pip3 install xlrd openpyxl
command. You’ll similarly have to run the pip3 install
mysqlclient command before you can connect
VisiData with a MySQL database.
Like traditional spreadsheet applications, VisiData’s
workflow also focuses on sheets. Every file you open in
VisiData is treated as a sheet. If you open a single file
with the vd filename command, you are essentially
working with a single sheet. However, if you were to run

56    LXF298 February 2023 www.linuxformat.com


Terminal TUTORIALS

Shift+O opens the Options sheet, where you can tweak parameters Using the frequency table, we can see that the UK has produced the
such as the sidebar colour, the colour of the current column, and so on. maximum number of Formula 1 drivers, at 19.32%.

the vd filename.csv filename1.csv filename2.csv frequency table. We’ll discuss both of these further
command, VisiData opens each file as a separate down in the tutorial.
sheet. It only displays the first specified file by default. VisiData’s vast
You can confirm this by looking at the bottom-right of Working with VisiData capabilities are
all controlled
the interface, which shows the name of the file that is With VisiData installed, you can open any supported
using myriad
currently open. file with the vd filename.csv command. keyboard
You can access all the other sheets by pressing Although VisiData is designed to be operated shortcuts, which
Shift+s from anywhere in the VisiData interface. This entirely with the keyboard, you can use the mouse for admittedly take
opens a Sheets sheet, which provides a list of all open a few operations. When you open a file with VisiData, some getting
sheets. Use the arrow keys to select any other sheet you’ll see a menu bar at the top with typical entries used to. But not
and press Enter to open it. such as File, Edit, View, Column, Row, Data, Help and so because they
If you have a table open in VisiData, hit the Shift+C on. You can click on these to navigate submenus. You are illogical
key combo. This opens a Columns sheet. All the can also use keyboard shortcuts to access submenus. or difficult to
master. As a
columns in your table are listed as rows in the Columns Alt+h for instance opens the Help menu, while you
beginner, we
sheet. You can configure different elements, such as can access the Plot menu with Alt+p , and so on.
recommend
the width and height of the columns, here. This is When you first open a file, the top-left entry is keeping a cheat
useful when your table has multiple columns where selected. You can navigate the rows and columns sheet handy:
the data doesn’t fit all on the screen, or if you wish to using the arrow keys. Alternatively, you can use h https://jsvine.
reposition columns in your table. Press q when you’re and j to move left and down respectively, while k github.io/
ready to return to the source sheet. and l can similarly be used to move up and right. visidata-cheat-
You can similarly press z followed by Ctrl+H sheet.
to open the Commands sheet. This displays all the
Keybinding Function
commands available for you to use in the current sheet.
The Sheets sheet, Commands sheet and Columns h Move left
sheet are examples of metasheets in VisiData. You can j Move down
think of these as sheets that are designed to help you
navigate and customise VisiData. k Move up
All the data files you open in VisiData are source l Move right
sheets. Any manipulation that you perform on a
PageDown/Ctrl+F Move one page down
source sheet in VisiData doesn’t alter the original files.
Derived sheets are sheets that draw their data from PageUp/Ctrl+B Move one page up
source sheets, such as when you filter certain rows
gh Move to leftmost column
from a file based on a defined parameter, or create a

MAKING SENSE OF THE DATA


The quickest means to make sense of your data is columns in a single sheet. To create a frequency
by using VisiData’s frequency table. Navigate to any table of all set key columns, press gF . Note that
column and press Shift+F . VisiData immediately you have to press g followed by Shift+F to get this
offers details such as count and percentage, as command to work.
well as a histogram to quickly assimilate the data. A frequency table essentially counts the number
For some operations, such as when you want a of times an entry occurs in the given sheet.
frequency table as a combination of two different However, you can use additional aggregators such
columns, you must make use of key columns. To set as sum, min, max, mean, median and others.
a key column, navigate to the column in question Navigate to a column and press + to add
and press ! . You’ll now notice that the column is an aggregator. VisiData asks you to define the
pinned to the extreme left of the sheet, irrespective aggregator or press Ctrl+X to see a list. Note that
of its original position. You can define multiple key you have to press Ctrl+Shift+X to access this list.

www.techradar.com/pro/linux February 2023 LXF298   57


TUTORIALS Terminal

such as deleting all selected rows, or create a new


sheet with only matching rows in it.
The following table lists some of the commonly
used commands for selecting rows:

Keybinding Function
s Select the current row
u Unselect the current row
t Toggle selection
gd Delete selected rows
|<regex> Select rows matching <regex>
\<regex> Unselect rows matching <regex>

You can use g in combination with other keys for


global effect. For instance, while pressing s selects
You can access the
plugins installer by gj Move to last row the current row, you can select all rows by pressing gs .
pressing Space and Similarly, gu unselects all rows, while gt toggles all
gk Move to first row
running the “open- rows between selected/unselected.
plugins” command. gl Move to rightmost column It’s also possible to move rows up and down a table,
Navigate to the
/+<regex> Search forward in current column by pressing the Shift+j or Shift+k keys respectively.
plugin you wish
to activate and You may also need to occasionally edit the cells in
press “a”. Pressing g/+<regex> Search forward in all columns your file, such as when changing the VisiData settings.
“d” deactivates
?+<regex> Search backward in current column To edit a cell, navigate to it using the arrow keys or h ,
a plugin. j , k and l keys if you prefer, and then press e . To
g?+<regex> Search backward in all columns cancel editing, press Ctrl+c .
As with the movement keys, g can be combined When you exit VisiData, by pressing q – or gq if
with many different VisiData keybindings. It denotes you have multiple sheets open at the same time – all
that the action is to be applied to the file as a whole. the changes you made to the file, such as repositioning
You can also search for data in your file using rows and columns, or editing cells in the table are lost.
regular expressions (regex), which can be applied to a This is because VisiData is non-destructive by default
single column or all the columns in the file. VisiData and doesn’t alter your source files. You can choose
drops you to the first row where it finds a match to to save an edited sheet as a new file or overwrite an
your entered string. Press n to move the next existing file. Press Ctrl+s to save your current sheet.
The split- matching entry, or N to move backwards. You’re prompted to provide a filename. The choice of
screen feature, Sort is one of the quickest operations you can extension, such as CSV or JSON, defines the format.
accessed by perform. Select the column to sort and press [ to Hit Enter when you’re done and the file is saved.
pressing Shift+z sort the data in ascending order or ] for descending.
is ideal for We’ve already discussed how you can search for Making changes
accessing a data in VisiData, but it’s also possible to select rows Depending on your source files, you may on occasion
sheet and its
of data. In addition to manually selecting multiple rows, encounter cells in your table that have content that
column sheet at
you can also select rows using regular expressions. doesn’t fit in the defined row and column size. When
the same time.
Once selected, you can perform different operations this happens, you can either scroll the contents in the
specific cell, or alter the width of the columns and
height of the rows.
You can alter the width of columns from the Column
sheet. When you have a file open in VisiData, press
Shift+c to open the Columns sheet. This displays all
the columns in the table and their attributes, such as
width, height, type, and so on. Navigate to the relevant
entry under the Width column. Press Enter and then
edit the value from the default 20 to another number
that you think would suffice for the content in your file.
If you find the process of opening the Column sheet
and changing the width of certain columns too tedious,
there’s a quicker solution. Navigate to the column with
the scrollable content and press z_ – this expands the
current column’s width to accommodate the content. If
you have several columns with scrollable content, you
can press g_ instead. As we’ve seen from various
commands in this tutorial, using z with a keyboard
When working with multiple sheets at the same time, you can split the interface shortcut means that it’s applied narrowly, usually to
by pressing Shift+z to make life easier. the current cell, row or column, while using g with a

58    LXF298 February 2023 www.linuxformat.com


Terminal TUTORIALS

ESSENTIAL READING
You can
VisiData is an incredibly robust and featureful utility data, and more. The section on Intermediate Usage configure
and we can’t cover a thorough usage in this tutorial covers some of the advanced features, such as VisiData’s
due to space constraints. While many of its features, joining sheets and reshaping data by creating pivot appearance
such as creating pivot tables, will be of use only to tables, and more, while the Advanced Usage section using the
~/.visidatarc
seasoned operators, this project features a lot of is still under development. Even so, you’ll appreciate
file. This isn’t
documentation that will be of use to novice and the section on configuring VisiData. It’s also possible
created by
experienced users alike. to extend VisiData with plugins. default when
Your VisiData journey must begin with the ‘An Although there’s a dedicated subreddit for you install
Introduction to VisiData’ tutorial. This is split into VisiData, you’ll be better served raising queries on VisiData. Head
different sections, such as The Big Picture, Basic the GitHub page. Make sure you go through all the over to the
Usage, Intermediate Usage and so on. Once you solved and open issues, as there’s a good chance project’s GitHub
have VisiData installed on your machine, make that your specific query has already been addressed. page, and
sure you go through the Basic Usage section of For more detailed information, head over to fetch a sample
the tutorial. This providers a good introduction www.visidata.org/docs to master the different .visidatarc file
from the Issues
to opening and closing files, saving sheets, components of VisiData and how to get the most
discussion page.
manipulating rows and columns, sorting and filtering out of them.

Define the column


$ $10.99, £25, €40
type as currency
Define the column
% 0.1, 29.99, -15.9
type as float

Depending on your choice, the corresponding


symbol is displayed next to the column name. If the
content of a cell can’t be converted to the defined
column type, VisiData shows a ! in the relevant cell.
We’ve only scratched the surface of all that’s
possible with VisiData and how it can help you quickly
We’ve used the “g_” key combo to expand the width of columns and assimilate and manipulate data files. You have to spend
defined the date column with the @ keyboard shortcut. quite a bit of time with it, and with the documentation,
before you begin to fully appreciate its capabilities.
keyboard shortcut affects the file globally. Of course if That said, the non-destructive default behaviour
all you want to do is read the contents of a cell, without means you can press q at any time to exit the tool You can use the
changing the width of the column, you can navigate to when you feel lost, without fear of affecting the source edit mode (e) to
the cell in question, press e to enter the edit mode data. More than anything else, the freedom to explore change the name
and use the arrow keys to move left and right to read without constantly worrying about destroying your of a sheet from
the Sheets sheet
through the contents. Press Enter when you’re done, or files is essential for mastering any project with a steep or the name of
Ctrl+c to cancel edit mode and return to the sheet. learning curve. Refer to the Essential Reading box columns from
Certain operations, such as drawing a graph or (above) to see where you can get started. the Columns sheet.
performing operations such as sum, median and so
on, require numerical data in your columns. By default,
VisiData treats all data in all columns as plain text.
However, a typical file contains a variety of different
data types, such as text, integer, date, currency and so
on. You can define the data type for a column using the
following keyboard shortcuts:

Keybinding Function Example data


Define the column 1,12, 2005,
#
type as an integer 500000
09/10/2022,
Define the column
@ 2022-10-09,
type as date
October 9, 2022
Define the column
~ This is text
type as text

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

www.techradar.com/pro/linux February 2023 LXF298   59


TUTORIALS Write a book

BIBISCO
Credit: https://bibisco.com

Plan and write your


next smash-hit novel
Nick Peers reveals how to develop better stories with the
help of our favourite freemium app for budding novelists.

nyone who’s written – or attempted to write –

A a novel will appreciate just how difficult it is


without doing your research. And where do
you put all that research so it’s easy to access when
bringing it all together? Linux is blessed with all
manner of apps promising to bring order to your story-
OUR writing chaos – we rounded up five in LXF294, and
EXPERT settled on Bibisco as the best of a very promising
Nick Peers bunch. So, let’s find out how it can help you with your
has one next writing project, whether fiction or non-fiction.
particular story
idea knocking Package me not
around his head Sadly, Bibisco doesn’t exist in any repository – you Bibisco’s Project Explorer tool enables you to view any or all of your
– Bibisco could need to head to https://bibisco.com and scroll down to notes, research and other info while editing.
be the tool to the Download section, where you’ll find a choice of two
finally bring it downloads: the free Community Edition or the paid-for is recommended as it will give you easy access to
to fruition. Supporters Edition, which costs a minimum of £24 updated versions in the future.
(including VAT). All the core functionality can be found Once done, you’ll see a list of downloads (Bibisco
in the Community Edition, which includes a 30-day free is also available for Mac OS and Windows), and here
trial of the Supporters Edition, so we’ll clearly signpost you have a choice of three: DEB, RPM and ZIP. Ubuntu
any paid-for features we think are worth exploring. users will, of course, find the DEB package the easiest
Assuming you’re starting with the free Community to work with – once downloaded, open the file in
Edition, after clicking the Get It! button you’re Software Install and follow the prompts.
prompted to supply your email address. Once entered,
click Get and you’ll see a Show Content button, behind First-time setup
which you can find the downloads you need. Before Once installed, open Bibisco via the applications
doing this, you’re prompted to create an account – this launcher. Read through and accept the licence terms,

BIBISCO’S TEXT EDITOR


When planning and writing your novel, free mode, but note this is an typing your premise, you can change its
you have ample opportunity to get SE-restricted feature. When in full- status using the three buttons in the
acquainted with Bibisco’s rich text editor. screen mode, there are no formatting top-right – !!! (to-do), … (not complete)
It’s not as powerful as a word processor, controls on view, so make use of the and OK (completed) – to track progress.
but contains all the key elements you usual keyboard shortcuts, such as Ctrl+B You’ll also see a Project Explorer
need. Styling is limited to bold, italics, for bold text, and press Esc to revert button beneath the text editor window.
underline and strike-through, plus a back to the normal windowed view. Clicking this enables you to display the
highlighter, but you can define a default As you start typing, you’ll see Bibisco contents of any other section – from
display font, size, lining spacing and so is set to automatically save your architecture to characters and chapter
on via the settings button. There are also changes as you go, but there’s also a summaries – alongside the editor
handy undo/redo buttons. manual save button, too. You’ll see a window, providing an easy way to refer
You’ll also see a full-screen button, handy word count in the bottom-right back to your notes as you type. It’s
which switches Bibisco to distraction- of the screen, and once you’ve finished accessible from any text editor window.

60    LXF298 February 2023 www.linuxformat.com


Write a book TUTORIALS

then select your language – English (UK) – to begin. GET FAMILIAR WITH BIBISCO
You’re now prompted to select a folder for your
projects (typically a subfolder inside Documents) and a
place to store backups.
After clicking Finish, Bibisco quickly sets up the user
2
dictionary, then prompts you to create your first project 1 3
– you’ll also see options for importing an existing
project and accessing the main settings (it’s worth
taking a quick tour to set your theme and zoom level).
Other settings include changing language and user
directories, and tweaking Bibisco’s backup options. 4
Let’s work our way through the new project wizard:
click Create The First Project, where you’re asked to 5
give your project a name and enter its author – you can
also change the project’s language from here. Click
Save, acknowledge the warning that once the language
is set, it’s set for the life of that project, and click OK. 6
Project goals
You find yourself at Bibisco’s main screen – as the Navigation pane Project Explorer
annotation reveals, it’s primarily a two-paned affair, 1 Use this to quickly access all of Bibisco’s 4 Click Project Explorer to toggle this box
with a navigation pane on the left. The Project screen tools – look out for collapsible > headings. on and off, letting you access notes easily.
in time lists a complete summary of your project, but
Breadcrumbs Rich text editor
for now, it simply lists your novel’s name, plus ‘This is 2 The breadcrumb navigation system 5 Bibisco’s text editor contains all the core
your novel’ in large letters and two buttons beneath. makes it easy to jump back up the currently functionality you need – click the Settings
The Here Are Some Tips button is a shortcut to the selected section. button to change display font and formatting.
Tips section, where you’ll find lots of writing advice,
Status buttons Word count
from developing believable characters to tapping into 3 Use these to help track the progress of 6 Bibisco provides running word (and
Bibisco’s planning tools to help develop your novel’s individual parts of your project, from planning character) counts of each separate part of
background to improve your story’s quality and realism. to entire chapters. your project.
The other button – Goals – is your first experience
of accessing a feature restricted to the Supporters
Edition (SE). As you’re in trial mode, a warning pops and chronological sequence’, which translates as the
up revealing how many days are left in your trial, with place to record a more detailed breakdown of your
buttons to purchase the SE or continue (after a five- story – you might be eyeing up the Timeline section Because Bibisco
second countdown) to the restricted feature. at this point, but aside from the fact it’s an SE-only is distributed as
Clicking Continue reveals the Goals screen, where feature, it’s more an analytical tool, as you’ll see later. a DEB or RPM
you can set a deadline for finishing your project (click Beneath the four basic architecture sections are package, you
the calendar to select year, month and day in turn), narrative strands. Click Create Narrative Strand to need to update
it manually:
plus an overall word count. You can then set your own start your first one. This pops up a prompt to give
either click
arbitrary words-per-day goal or click Calculate to have your strand a title, which creates a standalone element
the link in the
Bibisco do it for you. Click Save if you decide to make that works in a similar way to the main architectural original email
use of this, or Back to return to the previous page. element: click it to open the text window for you received
composing or editing. Narrative strands are linked to or log into
What’s your premise? resolving so-called conflicts, which basically represent the Gumroad
Bibisco stores key information about your novel in its the characters’ motivations (both internal and external). account you
Architecture section, where you’ll find four elements As with all parts of Bibisco, you can set these up optionally
called Premise, Fabula, Setting and Notes, plus a now or come back to them later. Navigating between set up during
Narrative Strands section beneath. If you click > next the different elements is nice and simple, thanks to the registration
to access the
to Architecture, you’ll see these options all appear in a expandable navigation pane on the left, but clicking
latest version.
submenu beneath Architecture, making them easier to
access. Of these, only Notes is restricted to the SE.
Each section is accompanied by a short description
and an icon indicating its current status (the red !!! icon
indicates it’s still in the to-do phase. Click anywhere
inside the Premise box and you jump to its own
dedicated section, where you’re tasked with describing
your novel in a single sentence. Click Get Started again
to reveal a rich text editor, which works as you’d expect
(see the box, left, for details).
The other key elements of the Architecture section
– Fabula and Setting – work in a similar way. Setting
provides you with somewhere to record a more
detailed summary of your novel, while Fabula describes Build up a rich portfolio of information and history about each
itself as a ‘narration of the events stored by their logical character to create fully rounded personalities.

www.techradar.com/pro/linux February 2023 LXF298   61


TUTORIALS Write a book

Back steps you back to the last thing you were doing, section on personal history dubbed Life Before The
while a breadcrumbs system at the top makes it easy Story’s Beginning.
It bills itself as to move up the current section’s navigation tree. Unlike the architecture section, many of these
a novel-writing provide you with a series of questions to answer – click
app, but Bibisco Have character Edit and you’ll find yourself in the familiar text editor,
can be adapted Every story has a protagonist, and Bibisco enables you albeit with one key difference: a drop-down menu at
to other to record as little or as much detail as you need about the top enables you to move between each question.
purposes. It’s the people in your novel via its Characters section. Obviously, all sections are optional, and you’ll see an
great for family Here you’ll see characters are broadly split into two option at the bottom enabling you to switch between
historians types: main and secondary. interview and free text if you’d rather write a biography.
looking to write
Start with the star of your novel: click Create The Again, use the status buttons above the text editor to
a memoir of an
ancestor, or you
First Main Character. Give them a name and click help track your progress.
could use it to Save. As with strands, this creates a blank character Things are simpler with secondary characters –
write a general template, ready for you to fill. You can add other you’re given a free-form text editor to record all the key
history, with character templates now or click your main protagonist details you need about that person on a single page.
real people to start turning them into a flesh-and-blood person. As with other sections, the Supporters Edition
filling the role A wide range of traits can be recorded: personal offers bonus features – you can attach images to
of characters data covers the basics, while you’ll find sections on characters via the images button (or + button next
in your ‘story’. physical features, behaviours and attitudes, to their thumbnail for a profile picture), plus record
psychology, ideas and passions, sociology and even a date and time-stamped events, which show up in the

WORKING WITH SCENES

Set up a scene Add tags


1 Click Create Scene within the chapter you wish to place it 2 If you want to make the most of your previous research,
in. Give your scene a suitable title and click Save. It appears under click the Tags button on a scene’s main page to label each scene
Scenes with the usual embellishments: title, word count and and inform better analytics. The first lets you record who’s
status icon. Click the scene to open its main page, followed by narrating the scene, whether first, second or third-person. Other
Get Started to start typing out the prose that will make up your tags link to your characters, locations, objects and narrative
novel. When finished, click Save followed by Back strands, plus you can assign a time and date to the scene.

Make multiple revisions Rearrange scenes


3 Not sure how a scene will progress from its current point? 4 Another benefit of working with multiple scenes is that you
Look for the Revision drop-down menu on the main Scene page – can move them around. A simple reordering of scenes within
click this and choose Create A New Revision. Click OK to use your chapters is done through drag and drop on the main Chapter
current revision as a starting point for this version or Cancel to page – just click, drag and drop a scene into its new desired place.
start from a blank canvas. You can now develop alternative Moving a scene to another chapter is done via the More button
storylines, and switch between (and delete) revisions as required. on the Scene’s own page but is a Supporters Edition-only feature.

62    LXF298 February 2023 www.linuxformat.com


Write a book TUTORIALS

Timeline view, providing you with another means of


structuring your story. TRACK YOUR STORY’S PROGRESS
Record more research As your story unfolds, you’ll sometimes want to stop and take stock
The Locations tab is where you record details of the of where you are. Switch back to the Project tab for some handy
various places where your story takes place. Available statistics and progress bars to help you see how far you’ve come
fields are Nation, State, City and Name (effectively a (and how far there still is to go). Purchase the Supporters Edition
description), plus a free-form page of text. SE users and the goals section stands out, as it provides you with an overall
can also attach images and events, as with characters. progress bar as well as a guide to how well you’re keeping up with
There’s also an Objects tab for key items in your any self-imposed deadlines or word counts.
story, with the same level of detail as Locations – this Make use of tags in scenes and you unlock all kinds of useful
entire category is restricted to the Supporters Edition, information via the Analysis tab. You get a breakdown of chapter
so while you can access it using your free trial, it’s a lengths, plus detailed stats about the contribution from each
minefield of pop-up nags. You also need the SE for the character, location, object and narrative strand. Available stats cover
Relations section, where you can draw relationships overall distribution across the novel of individual character and
between characters in diagram form, and Notes, an object appearances, with date and time stamps, making it easy to
area to store miscellaneous ideas, cues and so on. ensure characters and objects don’t appear in two places at once.
You’re probably champing at the bit to stop planning Supporters Edition users also gain access to the Timeline, which
and start writing your story at this point but, you’ll see provides an alternative – and more detailed – view of your story’s
shortly the benefits of taking the time to record as chronology. Whereas the Analysis section is limited to character
much preparatory detail as you can. However, now is and location appearances, you can also track the progress of all
the time to let your creative juices flow. chapters, scenes and narrative strands from a single timeline. This
enables you to plot your story’s progress down to the exact minute,
Writing your story helping you to properly pace your novel (and ensure there are no
Your actual novel is stored in just one part of Bibisco: glaring time-related plot holes).
Chapters. Things start by clicking Create Chapter
to set up your first chapter – give it a suitable title
(Chapter I if you’re feeling uninspired, but each chapter produce a copy to print. Unsurprisingly, this involves
is numbered for easy reference), and then click the a trip to Bibisco’s Export page via the left-hand
chapter to access its own page. navigation pane.
Here you’ll find separate sections covering Reason Here you’ll find options for exporting your work in
(for recording the chapter’s role in your overall story PDF, Microsoft Word, plain text and a ZIP archive (an
arc) and Notes (unlike the other instances of Notes in additional EPUB option is – you guessed it – only
Bibisco, this one is not locked behind the SE paywall). available in the Supporters Edition). The ZIP archive is
And beneath this is the chapter’s contents, which is for sharing with other instances of Bibisco, so you’ll
split into scenes. You can write an entire chapter within probably want to choose PDF or Word (which can, of
a single scene or subdivide it into multiple scenes. course, be opened in LibreOffice Writer).
Follow the walkthrough to discover how to make the After selecting your chosen format, you can apply
most of the feature – in particular take a close look at various settings, from providing your name as the
tags, which are essential should you wish to take author to formatting the work, with such options as
advantage of Bibisco’s analysis tools (see the Track chapter title format and position, scenes separator, Take the time to
tag your scenes
Your Progress box). plus some optional extras in terms of formatting if
and it helps
As always, Bibisco also offers some additional required. You’re also given the option of exporting the you to unlock
goodies to the Supporters Edition – the ability to add entire work or just a subset of it. Finally, choose your a raft of useful
prologues and epilogues to the start and end of your export directory and let Bibisco do the rest. analytic data.
novel, plus SE users can add an additional layer of
organisation above the chapter level in the guise of
parts. All three options are accessed via the More…
menu under Chapters. Once you’ve created your
various parts, you’re prompted to choose which part
to store each new chapter when giving it a title.
Going forward, you can reorganise your chapters by
dragging and dropping them within the main Chapters
screen – if you’ve set up parts, you can drag them
between these, too.

Publish and be damned


There’s no way to preview your novel as a single,
continuous narrative within Bibisco itself; instead,
you need to export it to another format, which is the
process you’ll follow once your manuscript is complete
and you’re ready to share it with others or want to

GET A LOAD MORE FICTION… Subscribe now at http://bit.ly/LinuxFormat

www.techradar.com/pro/linux February 2023 LXF298   63


TUTORIALS Edit videos

KDENLIVE
Credit: https://kdenlive.org

Polish your video


footage with Kdenlive
Michael Reed looks at how you can use Kdenlive to produce high-
quality videos suitable for uploading all over the internet.

denlive is an open source application that

K gives you everything you need to edit video


footage into finished compositions. To this
end, you can add video files from various sources, alter
their length and position, and add effects to give the
finished production a professional look.
OUR It’s what is known as a non-destructive editor, which
EXPERT means that you don’t alter any of the underlying files.
Michael Reed Instead, data pointers within the program are updated,
hasn’t quite so you have almost unlimited scope to alter things and
broken into make fine adjustments at any stage of the process.
Hollywood yet, What we’re imagining is the sort of project where Here we’re creating a transition between two clips on the
but at least he you have a video of an event or a trip. You’ll want to timeline. On the right, we can edit its parameters.
can make a combine multiple video files and edit them down while
movie using adding some music, voice narration and title cards. file with a single frame rate and resolution. This means
Linux and open that it’s impossible for Kdenlive to maintain consistent
source software. Lights, cameras, edit! quality between clips that were recorded with different
We assume you have the latest version of Kdenlive specs. For this reason, it’s a good idea to choose specs
installed and you have some recorded footage you for the project that match the majority of the footage
would like to edit. The first task is to start a new that you are going to use. A shortcut here is to accept
Kdenlive project (File > New), and this launches the the defaults and drag and drop the most important
project configuration dialogue. Select Custom Project video file into the Project Bin panel. This causes the
Folder. Although video files are huge, it’s a good idea program to ask you if you’d like to change the project
to place them on your fastest drive, preferably an SSD. settings to match the clip.
Kdenlive is a
You can always move the files to a different drive, such Because video files can be huge and require a lot of
well-known
Linux program, as a network drive, after you have finished the project. processing to handle, we recommend using proxy clips
and this means You can mix and match footage types within the as they make Kdenlive’s editor far more responsive.
that it tends project, but a Kdenlive project can only output a video Proxy clips are versions of the video clips that are
to be in the stored at a lower quality and with less aggressive
repository compression settings. As they are exactly aligned with
of most the original video file, and because they are only used
distributions. in editing, there is no difference in quality when the
However, it’s final output video file is produced. You can enable
usually worth
proxy clips in the Proxy tab of the Project Settings tab.
checking the
Once you have a project set up, it’s time to start
version in
the repository adding clips to the project. Typically, these are in the
against the form of video files, image files and audio files, such as
latest version background music.
on the website Drag the clips from a file manager into the Project
(https:// Bin panel. If you’ve enabled proxy clips, as we
kdenlive.org). recommended, the transcoding process begins in the
AppImage, background. At the same time, if there are files in a
Flatpak and format that Kdenlive can’t work with, you’re asked for
Ubuntu PPA
To resize a clip, hover your mouse pointer over the end of permission to transcode those as well. There’s nothing
are available
the clip, then click and drag. to stop you from using Kdenlive at this point, but you’re

64    LXF298 February 2023 www.linuxformat.com


Edit videos TUTORIALS

explanatory, but video tracks include


anything that can be seen, which
covers video clips, still images and title Don’t be afraid
clips. By default, Kdenlive provides you to drag the
various areas
with four tracks – two audio and two
of the user
video – but you can easily add more
interface
if required (simply right-click on the around. For
Master area of the Timeline and click instance, we
Insert Track). found the
In recent versions of Kdenlive, if initial size of
you drag a video clip from the Project the project
Bin panel, the program automatically monitor to be a
splits that clip into a video clip and an bit conservative.
audio clip. Although they are separate Hover over the
gaps between
clips on the Timeline from that point
the different
onwards, they are locked together
areas of the
initially, meaning that if you move interface and do
one, the other moves with it. This is some pushing
because they are grouped clips, but and pulling to
As well as being categorised, the effects list is searchable. There’s a tiny toolbar it’s perfectly possible to ungroup them experiment.
at the top to filter effect types. (Ctrl+Shift+G or Ungroup Clips in the
right click menu) to cut, resize or delete
better off letting it finish the transcoding operations them separately. This is useful, for example, if you want
for consistent performance. to cut the audio picked up by the camera before the
end of the clip.
We’re on a Timeline Because Kdenlive is a non-destructive editor,
The basic workflow for creating a video in Kdenlive is nothing you do in this regard is irreversible. You could
to drag clips on to the tracks of the Timeline, where ungroup the aforementioned audio and video clips
you can move them around and resize and cut them. In again and stretch out the audio part of the clip that
addition, multiple clips can be overlaid on adjacent you shrank before. The converse is also true; it is often
video tracks. In situations such as this, tracks are handy to multiple-select clips (Shift+click) and group
evaluated in order, with the highest-priority video them (Ctrl+G) to make sure that they always move
lane at the top. You might like to add a title clip with a
transparent background on to a higher video track in
order to introduce a new section of the video. Audio GET TO KNOW KDENLIVE
tracks, such as background music or narration, play
simultaneously. Adjust the relative volume of such 4
tracks while they are playing by selecting the Audio
Mixer tab in the bottom-right side panel and adjusting
the volume faders. 1
Click at the top of the Timeline to move the
Timeline Cursor. This is the point from which playback
begins if you press the play icon underneath the
Project Monitor window. You can also start and stop 2
playback by pressing Space. The Timeline Cursor
is also used for other functions within Kdenlive. For
example, if you move it to a position and press G, it 6
places a useful guide marker that can be named and
colour-coded – invaluable when you’re navigating
around a complicated project. 3 5
The mouse wheel scrolls the Timeline backwards
and forwards, but note that this doesn’t move the
Timeline Cursor at all. This is handy when you’re just
checking things out, but it’s annoying if you forget,
press Space, and wonder why everything jumps back
to the position of the cursor when you start playback. Project Monitor Quick Layout Selector
You can zoom all the way from a detailed view to an
1 This enables you to play back the 4 The interface is helpfully tailored to
current project. Like most Kdenlive panels, suit the particular task in hand via the Quick
overview by zooming in and out (Ctrl+mouse wheel).
it’s tabbed for multiple functions. Layout Selector.
The tracks are also collapsible, and it’s worth collapsing
tracks for more space on the Timeline unless you need Project Bin Effect Editor
the detailed view. 2 This is where you drop media clips that 5 This is where you change parameters
you would like to use in the current project. for an effect or transition.
Clip to the Timeline Timeline Timeline Toolbar
Kdenlive works with two main track types: video 3 You can place clips, edit them and move 6 One of many toolbars scattered
and audio tracks. Audio tracks should be pretty self- them around on the Timeline. throughout Kdenlive.

www.techradar.com/pro/linux February 2023 LXF298   65


TUTORIALS Edit videos

together, and it’s usually worth regrouping clips after


you’ve split them to make edits.
There are sites
offering music Moving and cutting
that can be used Returning to the Timeline Toolbar, by default the Select
freely in your tool is activated. This enables you to select a clip with a
videos. Musopen single mouse click and move clips around by clicking
(https:// and dragging.
musopen.org) One problem with an editor like Kdenlive is that it’s
has an emphasis impossible for clips to overlap each other on the same
on older
track, meaning that it can be awkward to move a clip
recordings,
such as
on the Timeline if there are clips on either side. This
classical music, is where the Spacer tool (Timeline Toolbar) comes in.
while Free Select it and try moving a clip that’s surrounded by Kdenlive has an impressive collection of title templates with its own
Music Archive other clips, and you’ll notice it shunts earlier or later store-like interface complete with user ratings.
(https://free clips to maintain their order. As your project becomes
musicarchive. more complex, this is the main method used to move said this, on other occasions, the Snap feature is highly
org) offers clips around. The Spacer tool even shifts clips above useful, because it takes into account the alignment
original music and below the selected clip to preserve the timings. with the starts and ends of clips on other tracks as
released under To resize a clip, hover over the end (front or back well – perfect for accurate alignments.
the Creative
of the clip) and drag it to lengthen or shorten the clip. There are two main approaches to cutting clips in
Commons
licence.
It’s sometimes worth disabling the Snap feature while Kdenlive. Firstly, you can select the Razor tool in the
doing this (Timeline Toolbar) for extra precision. Having Timeline Toolbar. This enables you to cut a clip by
moving the mouse pointer and clicking on a clip. The
second method is to remain in Select mode to move
TITLE CLIPS the Timeline Cursor to the desired cut point. Press
Shift+R to cut at that point. The advantage of this
Title clips are used to overlay text on to your video, typically used is that it’s super-convenient to multiple-select clips
to add an explanation for what’s going on in the film or to introduce (Shift+click) and then cut through them simultaneously.
a section of a video. If you spend a lot of time coming up with Generally, Kdenlive assumes you’ll make the cuts in a
something that you think you’ll want to reuse, you can save a title rough way, then stretch or shrink the clip afterwards.
card for use in other projects.
To begin editing a clip, simply select Add Title Clip in the Project Transition talk
menu – this creates the clip and launches the editor. The editor is Quite often, you require a smooth fade between two
WYSIWYG, and you can click anywhere to start adding text. Any clips to avoid a jump cut, and this is where transitions
parameters, such as the font size and colour, can be altered at any come in. In Kdenlive, a transition is a device that
time. The default choice of white text with a black outline is a little combines two clips in some way. Traditionally, the
bland, but it makes sense because it’s legible on practically all app didn’t support clips that overlap each other on
backgrounds. If you click on the Show Background checkbox, you the same track, and a transition would have to be
can preview what the title card will look like over the video under the manually added between tracks that overlap.
Timeline Cursor. Things have been made a bit easier in that
There are also animation features (Animation tab), so you can have department in recent versions, because you can now
the text make an entrance from off screen. However, the best way to transition between clips on the same track. To do this,
swish something up a notch is to explore the downloadable preset shorten two clips at the point at which they meet, and
library that’s hidden away and accessed via an icon in the toolbar. push them together. The shortening of the front and
back of the clips is necessary so that there is some
overlapping material to transition between. If you now
double-click on the point where the two clips meet, a
transition is created. For precision while doing this, it’s
usually a good idea to disable snapping.
The default transition is a wipe (a smooth
crossfade), but it’s worth exploring some of the other
transitions, such as the slide, which moves the video
from one clip over the other.
To choose a transition or edit its parameters, click
on the transition and use the Effect/Composition panel
to the right of the Timeline Editor. The parameters are
often worth experimenting with. For example, the wipe
can transition faster, or the slide can bring the second
clip from the top of the frame rather than the default,
which is to slide it across from the left of the frame.

The Title Clip Editor is quite complex but allows for some interesting ways of presenting Cause and effects
text if you’re willing to put in the time. Kdenlive has quite a large palette of effects that can be
dropped on to tracks, and they work in a similar way to

66    LXF298 February 2023 www.linuxformat.com


Edit videos TUTORIALS

transitions, except that they work on a single clip rather


than combining two clips. RENDERING THE FINAL OUTPUT
To get started with effects, select the Effects tab
in the rightmost panel area that normally displays the Kdenlive offers many final output option presets, but a lot of these
Project Bin. The effects are categorised; click on the are for niche situations. In most cases, the preset Generic > MP4-
little triangle to expand the category. From here, you H264/AAC is the right one. It’s worth checking the More Options
can drop the effect directly on to a clip. This list is box to tweak things further, though. In here, don’t be afraid to check
searchable, which is just as well as we wouldn’t have Custom Quality and move the quality to 100%. This uses extra disk
thought to look for fades in the Motion category, for space, but it’s better to overdo it with the quality settings, because if
instance. There is also a small toolbar to filter the you intend to upload the video for online streaming on sites such as
effects built into the panel, which is useful because the YouTube, there will be some quality loss as it is re-encoded.
audio and video effects are all part of the same list. Because video encoding takes a long time, make sure that the
In previous versions of Kdenlive, it was tricky to threads box has a number that is the same as the total number of
apply an effect to multiple clips on the same track, but cores on your CPU. Video encoding is a process that scales very well
this has been improved as you can now drop the effect when split between CPU cores. That said, you may want to dial this
on to the Master area of the track to affect the entire back if you need to keep your computer responsive for other tasks
track – but you can still add effects to individual clips. while the encoding is taking place.
Whether adding effects to a clip or an entire track, As is the case with the Title Editor, the toolbar has a link to a
effects are stackable; just keep dropping them on to preset store browser. If nothing else, you can download these to
the same destination. The only thing to watch out for examine when you’re stuck for the right settings.
is that effects are CPU-heavy, so adding too many can
make the preview monitor sluggish and significantly
slow down the rendering of the finished project.
If you want to copy the entire effects stack from
one clip to the other, use the right-click context menu
to copy the clip and then use the Paste Effects option
in the right-click context menu on the destination clip.
This also works if you have used Shift+click to multiple-
select more than one destination clip.
If you come up with some settings that you’d like
to reuse in other projects, you can save the effect by
clicking on the Save icon in the Effects Parameter
panel. Access the effect again in other projects by
clicking on the Show All Custom Effects icon.

Working with multiple sources It’s better to err on the side of overkill with output quality if you intend to upload the
video to a streaming site.
Kdenlive has a useful trick to sync up multiple audio
and video clips. For example, you might record the
video of a lecture by pointing the camera at the person
speaking while capturing the audio with a recorder that that has to be done at this point as Kdenlive builds
is placed closer to the speaker. The task is therefore to up a map of the peaks and troughs of the audio.
sync the high-quality audio file with the video footage. Once the processing is complete, it’s possible to
To synchronise these, start by dragging both clips align the video footage with the audio clip as long as
on to the Timeline and placing them on separate tracks the audio is similar. In our example, click on the audio
in rough alignment. Mute the audio in the video file clip that is connected to the video clip, right-click and
(Mute icon on the Master section of the Timeline). Click select Align Audio To Reference. The clip should shunt
on the separate audio clip and then right-click and forward or back so that it’s exactly aligned.
select Set Audio Reference. There is some processing You can also use this to synchronise multiple video
sources by using their audio tracks as the sync source.
Imagine a situation where a musician is recording a
tutorial video. They might have a close-up camera
showing what their hands are doing, a zoomed-out
camera showing their face and body, and an audio
recording of their voice and their instrument. This
gives them three source files to deal with. They can
align all three perfectly by setting the audio clip as the
reference track and using Align Audio To Reference to
shift the two video files from the two cameras into
alignment with each other and the audio track.
Kdenlive has all the basic features to make good-
The Timeline can easily become messy and difficult to navigate, so looking videos, along with a few options to add pizzazz
consider dropping some guides (press the G key). to the finished product. Happy videography!

PUT US ON YOUR OWN TIMELINE Subscribe now at http://bit.ly/LinuxFormat

www.techradar.com/pro/linux February 2023 LXF298   67


BACK ISSUES

BACK ISSUES MISSED ONE?


ISSUE 297 ISSUE 296 ISSUE 295
January 2023 December 2022 November 2022

Product code: Product code: Product code:


LXFDB0297 LXFDB0296 LXFDB0295

In the magazine In the magazine In the magazine


Escape from Stay safe and Relive past
Windows by setting up and using protect your privacy online with our computers and games with our
the extremely user-friendly Firefox guide. Plus, discover what in-depth look at retro emulation.
Elementary OS. We also help you the future holds for 3D printing and We also round up five lightweight
take pro-level shots with our guide how to upgrade to the latest version distros, step into the exciting world
to RAW photography and present of Ubuntu 22.10 – Kinetic Kudu. of Windows Subsystem for Linux,
the inside scoop on the future of Elsewhere in the mag we look at and chat to Alex Jones, director
Audacity. There’s a Roundup of five vector drawing apps, review of Kubernetes Engineering at
the best note-taking outliner apps, Raspberry Pi OS and have tutorials Canonical, about Kubernetes and
too, plus tutorials on touch-typing, on recreating retro platform games, the cloud-native future. There are
password management, building a building static websites, creating a tutorials on internet bandwidth,
Django app and a whole lot more. cataloguing app and much more. PC search and loads more, too.

ISSUE 294 ISSUE 293 ISSUE 292


October 2022 September 2022 Summer 2022

Product code: Product code: Product code:


LXFDB0294 LXFDB0293 LXFDB0292

In the magazine In the magazine In the magazine


Get your We explain We demystify
system running the latest Mint, with coding principles, what editor to the world of graphics on Linux with
other distros and even Windows! use, how to use Git, and help you our in-depth feature. Elsewhere, we
Elsewhere, we assess five creative take your first steps writing your edit photos with Photoflare, explore
writing tools, show how to keep the own code and controlling physical RISC OS, try out dev environments
lights on in your smart home, build a Pi projects. We review five of the using Gitpod, control multiple LEDs
Raspberry Pi media centre, turn best 3D printers, put together a around the home with a Raspberry
smartphones into live cameras, CCTV system, assess a recreation Pi, and add gamepad support to
perfect 3D prints, create better cut- of the BeOS operating system, and Tetris. We also assess five software
outs in GIMP and recreate Pac-Man show how to create custom fonts. whiteboards for collaborative
in Python. Plus we reveal the latest There’s also tutorials on Web 3.0, teaching, and talk to the talented
AlmaLinux developments. screencasting and cloud hosting. coder behind the Amiberry emulator.

To order, visit www.magazinesdirect.com


Select Single Issues from the tab menu, then select Linux Format.

Or call the back issues hotline on 0330 333 1113


or +44 (0)330 333 1113 for overseas orders.
Quote the product code shown above and have your credit or debit card details ready.

68    LXF298 February 2023 www.linuxformat.com


UK readers
USA? EU? THE MOON?
*
turn to
p16

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 REST OF THE WORLD EUROPE


From $132 From $132 From €100
For 13 issues For 13 issues 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.
*We don’t actually deliver to the Moon. Yet.

www.techradar.com/pro/linux February 2023 LXF298   69


TUTORIALS Photo editing

GIMP
Credit: http://gimp.org

More fun with


Part Two!
Don’t miss
next issue,
subscribe on
page 16!

layers and masks


Karsten Günther reveals how GIMP manages layers, what the
different types are and how to use masks for subtle effects.

esides selections, layers are one of the most

B important elements when creating complex


images. GIMP is no different. Being familiar
with layers also helps if there seems to be an error –
often a different layer is active from the intended one.
Normally, we can think of layers as transparencies,
OUR slides or printouts stacked on top of each other. The
EXPERT viewer looks at the stack from above and sees what is
Karsten Günther still visible after covering it. In fact, layers are much
is not only a more complex objects, as will become apparent.
master of using The Layer Dock represents this stack of layers in a
layers and list. All layers present in an image appear there with
masks to edit their name – for transparent layers it is displayed in Lots of layers in one image are not rare but the rule. The Layer dock
photos, but he normal font, for opaque ones it’s in bold – in the current shows the connections and enables you to adjust multiple aspects.
also finds them order. All text layers, for example, are transparent, but
useful to keep other layers can be given this property by adding an created on a separate layer. It is still common practice
warm and alpha channel. If the eraser or cutting or deleting to duplicate layers before editing, such as blurring – as
incognito. removes image material from such a layer, these areas a backup – in order to be able to access the original
become transparent. With non-transparent layers, the image data at a later time. Then an area of the image
current background colour appears. Transparent layers is processed, possibly in different variants, which are
do not necessarily need to have transparent areas. temporarily stored on different layers.
GIMP uses layers for various purposes. Special Layers are therefore mainly used to edit parts of an
parts of an image, such as text, are automatically image. This is true even if an entire layer is duplicated

LAYER MODES
Layer modes are essentially an offsetting or turn. However, a lot of modes have very strong
rendering rule of the RGB values of the pixels in two effects, so they tend to only be used on layers that
neighbouring visible layers. The layer mode of the have reduced opacity.
upper layer determines how the pixel values are A typical application of layer modes is to darken
offset against the layer below. GIMP then displays or lighten highlights and shadows. To lighten dark
the result of this calculation. The outcome often images, for example, the Screen mode is a good
looks rather strange, but it can be extremely useful. choice. It has the effect that dark areas are lightened
For example, the positions of layers can be checked much more than light areas, which corresponds to
to make sure they are pixel perfect with the Grain how the human eye perceives things. You can see
Extract mode, where any deviations clearly stand GIMP’s Screen layer mode in action in the
out. The subject is covered in detail in the GIMP screenshot (above-right). In some situations, the
manual at https://docs.gimp.org/2.10/en_GB/gimp- Addition and Dodge modes can also be helpful.
concepts-layer-modes.html, including the formulas Several copies of a layer can be superimposed to
used for offsetting. intensify the effect.
In practice, it is often helpful to place your mouse For images that are too bright, the Overlay and
cursor over the Mode button and then use the Multiplication layer modes, along with the different
mouse wheel to try out all the different modes in Light modes (Soft, Hard, Vivid), should be tried.

70    LXF298 February 2023 www.linuxformat.com


Photo editing TUTORIALS

and offset against the copy via a layer mode. Layer the View menu. This way, several layers are positioned In Screen layer
mode, GIMP
modes have no counterpart in the physical world; they exactly and do not appear to be shifted by a few pixels.
lightens dark areas
are part of the magic of image editing. The position of layers is usually of great importance. of identical layers
When using a lot of layers, GIMP gives you a hand If they are shifted by only a few pixels, it can have a more than light
with several helpful features. For instance, layer groups very visible effect. GIMP therefore allows you to fix the ones. On the left is
are containers that can contain any number of layers. position of a layer – just click on the moving symbol in the original layer;
on the right Screen
They can be displayed together in the Layer Dock, the Layer Dock for the active layer in the Lock line. layer mode is used.
which increases your overview immensely. The layers Sometimes it is not the absolute position of layers
in the group can still be edited individually and their that is important but their relative position to each
visibility can also be controlled on an individual basis. In other. For example, text should often be placed directly
a group, all layers become invisible if the visibility of the above or next to an inserted object. In this case, several
layer group is deactivated. layers can be linked together. In the Layer Dock, this is
Wikipedia
The colour markers for layers are still a relatively done via the chain symbol next to the visibility eye. On
explains the
new feature (v2.10). Applied via Layer Attributes they linked layers, GIMP applies the same tools with the historical
can help with orientation and be set however you like. same settings one after the other. development,
Layers can be moved freely in an image, even if they The visibility of layers must not be confused with background and
are as large as the current canvas or larger. The canvas their opacity and other aspects. The eye on the left ideas behind
size automatically increases accordingly. For moving side of the Layer Dock shows whether each separate the alpha
layers, GIMP offers two tools in the toolbox: the move layer is currently visible. This is independent of whether channels quite
tool – accessed via the m key as a shortcut – and a layer is currently active – ie can be edited. In GIMP, well (https://
alignment, for automatically aligning lots of layers. The only one layer is ever active. GIMP shows which layer en.wikipedia.
org/wiki/alpha_
move tool works well with magnetic guides (Snap To is active in the Layer Dock with a colour bar. Basically,
compositing).
Guide) or with a magnetic grid (Snap To Grid), both in all actions carried out with GIMP always refer to this

ADD DRAMA WITH A SOFT LAYER MASK

Starting point Use a gradient Make corrections


1 The sky of the upper layer is given 2 Click the layer mask icon to activate 3 The tool still allows you to move the
a mask so it only covers the parts of the it for further editing (although it remains end points and even to create a base point
sky that appear too uniform on the image invisible). The gradient tool creates a within the gradient. Now, using a soft
below. If the layer mask is initially filled with colour gradient from black (invisible) to brush, small corrections can improve the
black, the layer above is initially invisible, white (fully visible) on the mask in any mask further. Holes in the mask can be
which is advantageous in this example. direction. The preview shows the effect. closed and the edges can be edited.

www.techradar.com/pro/linux February 2023 LXF298   71


TUTORIALS Photo editing

active layer. If it is not visible at the moment, GIMP


warns you. However, that only helps to a limited extent;
Text layers are if another layer covers the active one, the effects of the
special objects actions are often still not visible.
in GIMP. In the The other attributes a layer can have are shown in
dock, they are the now very extensive dialog for creating a new layer.
marked by the All attributes can be changed later, should this become
letter T. Their necessary. The corresponding functions can be found
content can
in the context menu of the layer in the Layer Dock.
be changed
GIMP is quite efficient with layers: they are always
until a graphic
operation rectangular and many tools create layers with a
converts minimum size, so that they are at least partially filled
the layers with pixels at the edges. However, layers can be
into normal adjusted to the current image size or any other
transparent dimension at any time.
image layers. All functions for editing layers can be found in
several places: in the normal menu under Layers and –
often more quickly accessible – in the context menu of
the Layer Dock, as well as being coupled to the buttons
that are available under the layer list.
One long-standing special peculiarity of GIMP is When creating new layers, a number of special settings can be made.
the so-called floating selection. It always occurs when The online help explains the details, including composite and blend
features: https://docs.gimp.org/2.10/en_GB/gimp-layer-new.html.
material saved from the clipboard is inserted into an
image. Many people find floating selections to be
particularly annoying, because they refer all actions to combination Ctrl+v inserts a floating selection, it must
themselves as long as they exist. So, if the key be converted into a normal layer – for example, by the
New Layer button under the layer list in the dock – if
another layer is to be activated for editing. However,
THE LAYER DOCK there is another way: layers inserted in this way are
often used as patches. Therefore, a floating selection
The linchpin for all layer operations is the Layer Dock. There, layers can be moved directly with the mouse, and at the
can be created, rearranged, deleted, named, marked, joined and correct position a mouse click near this layer anchors
more. With GIMP 2.10 the Layer Dock has become quite complex. it to the layer below.
Images can contain many layers, which are then grouped together
and often only partially visible. Transparent layers (layer name in Layer masks
normal font) and opaque layers (layer name in bold) can be mixed Masks, while analogous to alpha channels in many
and, if necessary, converted into each other with the alpha channel. ways – making parts of layers visible or invisible –
In the Lock section, GIMP allows individual aspects of layers to be are completely independent of them. Like an alpha
specifically locked. In this way, layers can be protected from being channel, a mask is a black-and-white representation,
painted over, moved or, in the case of transparent layers, having where the brightness represents the visibility of the
changes made to the alpha channel. masked pixels. Pixels that have a white background in
The most important general functions in the Layer Dock are linked the mask appear with maximum visibility, while pixels
to the buttons below the layer list. Functions for a selected layer can masked in black are invisible, and greyscale is
be found in the context menu. The Layereffects plugin also adds its interpreted by GIMP as attenuated visibility.
submenus for the individual effects at the end of the context menu These properties make layer masks particularly
in the Layer Dock. useful for three applications:

Layer dock
• Cropping or cutting out subjects, as described in the
GIMP tutorial in LFX297.
Layer mode
Coverage type
• Colourkey renderings, which are in some ways a
special variant of this.
Lock layer settings
Visibility
• Creating smooth transitions between two layers
with a gradient from black to white.
Colour label In the Layer Dock, GIMP shows layer masks as
Visible layer group an additional icon to the right of the layer icon. In an
Group with three active layer, either the layer itself or its mask is always
non-transparent selected for editing. GIMP indicates this by a white
visible layers frame around the corresponding icon. (This is often
not easy to see with masks.) A mouse click on one of
Image frame the icons then activates either the layer or the mask.
Masks can be edited manually if necessary. As
Background layer
long as the layer mask is active, it can be edited like
Dock buttons
a normal black-and-white layer. Normally this is done
The use of several layers in the layer dock is nowadays facilitated by colour with a soft brush, but other tools and filters can also be
marks, layer groups and so on. used. Often the Show Layer Mask function (procedure
name: layer-mask-show in the settings) can be helpful

72    LXF298 February 2023 www.linuxformat.com


Photo editing TUTORIALS

here. It can be useful to bind it directly to


a shortcut in order to be able to switch it
at any time. Important: the layer mask
must be activated in the dock in order
to edit it.
Using masks in combination with a
gradient is often a good choice because it
requires little post-processing. However,
you can also try to create a mask that is
as exact as possible. As an example, this
can be done as follows: the foreground
layer used as a mask is edited with the
Curves and/or Threshold tool so that
necessary parts appear black and
unnecessary parts appear white.

Separate colours
In some situations, it is important to be
able to process the colour components
in an image separately. This may be Two layers made this, the upper one desaturated and with a mask. The colour shines through from the bottom one.
the case when preparing an image for
printing or, for example, to avoid artefacts when components GIMP creates and how. Each of the
sharpening by processing only the brightness generated colour components is a greyscale image of
component of the image. The separation of colours the original layer; all together, they generate it again.
into their components is often called colour separation Colour models are complex mathematical systems
– in GIMP, the term decompose is used. In the colour that are described in detail in Wikipedia. The example There are some
menu, under Compose, there is a corresponding tool above uses LAB (or actually L*A*B*), an established interesting
for this task. colour model that stores brightnesses in the L functions, such
The application is simple and works on the current component. The new image created with the dialog as inverting
layer: after the call, GIMP shows a simple dialog. Here, now contains the three layers L, A and B, provided the layer stack,
it is only a question of which components are to be the option Decompose To Layers was active. All the minimising
layers and so
created. The components are created by direct layers are pure greyscale images. They can be edited
on, which are
conversion of the RGB pixel values and are output in separately. Compose puts them together again only listed in the
the form of three to four layers in a new image. The afterwards. GIMP also automatically updates the Layer menu.
colour model set in the dialog determines which original layer.

USE A HARD LAYER MASK

Threshold mask Insert the mask Correcting artefacts


1 You can also create a mask that is 2 If the layer mask is active, any 3 The requirements for a hard mask
as exact as possible, which hides the areas layers can be copied into the mask. This are high – for instance, it may be necessary
that are to be replaced (in the background). is how it works: the desired layer for the to rework the edges a little if artefacts
In this case, the lower layer contains the mask is first copied to the clipboard with appear in the layer. The Erode and Dilate
sky and has no mask. The upper layer Ctrl+c, then a mouse click activates the filters from the Generic submenu
contains the foreground and is masked layer mask selected as the target. Ctrl+v sometimes help here, but never forget you
black where the sky should appear from creates a floating selection in the dock, can directly draw and manipulate the mask
the background. Here, the Threshold which is displayed above the selected channel as any normal image. The Warp
tool can create a mask from a copy of the layer. A mouse click on the anchor symbol tool can be very useful here as you can
foreground layer. The mask generated in appearing in the button bar anchors the “nudge” parts of the mask edges into
this way only needs to be slightly adjusted. floating selection as a mask. position more easily than drawing them.

GET LAYERS AND LAYERS OF LXF! Subscribe now at http://bit.ly/LinuxFormat

www.techradar.com/pro/linux February 2023 LXF298   73


TUTORIALS QR codes

GIMP
Credit: www.gimp.org

Create better QR codes


Mike Bedford reveals how to get creative with your QR codes to draw
attention to them better and help people sign up to newsletters and more.

R codes, those two-dimensional barcodes that

Q whisk you off to a web page when you scan


them with your phone, have had a chequered
history. Invented in the ’90s and used extensively in
Japan, their belated introduction to the rest of the
world was short-lived before heading for apparent
OUR extinction. You’ll probably have noticed, though, that
EXPERT they’re now enjoying a resurgence in popularity. Fuelled
Mike Bedford by their use during the Covid pandemic – remember
has long been having to scan QR codes to enter restaurants and
fascinated by QR pubs? – we’re now seeing them everywhere as
codes, and has everyone has been trained up to use them.
been inspired by If you own a business, putting a code on your
their resurgence business card or brochure makes it far easier for The first step in our approach to making a creative QR code involves
in popularity to potential clients to access your website. If you edit a making a regular QR code. We suggest using QtQR.
create less newsletter for your sports team, code club or local
boring-looking community, QR codes can engage your readers better edit it. Because while there are plenty of tools for
variants. than a printed URL. What’s more, some publications generating basic ordinary QR codes, we don’t know of
allow images in their small advertisement columns, so any Linux utilities for producing artistic variants, but we
using QR codes there is another option. But here’s an do have some good image-editing tools, such as GIMP,
interesting thing: recent surveys have shown – hardly which we’re using here.
surprisingly – that if you move away from a boring To create the basic code, we’re almost tempted
black-and-white matrix to something more creative, to say that a GUI tool offers little benefit over a
you’ll get far more hits. So, the subject of this tutorial command-line tool. After all, typing qrencode LXF -l H
is how to create artistic QR codes. -o https://linuxformat.com is no more of a chore than
typing the same information and selecting the odd
The basic code menu entry in a GUI tool. However, you’re not done at
Our approach for creating QR codes that stand out that point because, after you’ve generated the QR
from the crowd is to create an ordinary QR code and code, you’re undoubtedly going to want to take a look
at it, so you need to issue a command to another utility,
which probably isn’t installed by default. So, we’re
ALTERNATIVE APPROACHES going to suggest you use the GUI tool QtQR, which
displays codes as soon as they’re generated.
We’ll have to leave you to figure out the details yourself, but here’s a Our main theme here is how to augment basic QR
couple of other ideas you might like to try. First, the black squares codes in GIMP, so we’re leaving you to figure out how
don’t all have to be the same colour. Using a rainbow of colours to use QtQR to produce the basic code, but it’s not at
might look gaudy, so we have a suggestion that’s more subtle and all difficult. There’s a couple of points we ought to
more likely to be readable. Use an image that comprises a fountain make, though. First, select the highest error correction
fill or similar pattern, in a range of similar darkish colours, imported level, sometimes referred to as just H, because our
as a layer in GIMP below the QR code, and make the black areas of subsequent modifications will make the code more
the QR code transparent. Second, so long as you don’t overdo it, the difficult to read. And second, if you’re going to
eyes can be made a different shape and this slight change can look customise it by adding an image, create a large QR
quite effective. Circles, or squares rounded off on one or all corners, code in terms of pixels, otherwise your image has to
have been used effectively, but the overall size shouldn’t change, and be very low resolution. Alternatively, resample the QR
they should still be a central shape surrounded by a border. code to a higher resolution using GIMP’s Image > Scale
Image option before you use it. That works perfectly

74    LXF298 February 2023 www.linuxformat.com


QR codes TUTORIALS

with a QR code, so long as you


choose None for Interpolation.

Squares and eyes


We’re going to look at several ways
of brightening up a QR code and
you can use these either singly or in
combination. However, bear in mind
that the more changes you make,
the less likely it’ll decode correctly.
So, be sure to test your modified
code before using it in earnest,
ideally using several different
phones and scanning apps. And
finally, before looking at specific
techniques, because all our
methods involve introducing colour,
after you’ve opened the QR code in
GIMP, ensure it’s a colour image by
choosing Image > Mode > RGB.
The simplest – but still quite
effective – way of brightening up
a QR code is to colour the black GIMP provides so many options for enhancing a boring monochrome QR code; changing colours couldn’t be much simpler.
squares. This is, perhaps, safer than
colouring the background (the white squares). The perhaps replacing about 100 squares, and it should
methods in this section can make quite a difference have a white background. The technique is quite
alone, but if you also want to add an image, as straightforward. Open the image you want to add as a A QR code with
discussed in the following section, we suggest you new layer (File > Open As Layers) and ensure the image the highest
recolour the QR code first. is the top layer. Now scale it, using Layer > Scale Layer. error correction
With the QR code open in GIMP, select Colors > It looks better if you size it so no partial black squares level (H) can be
read if 30% of
Map > Color Exchange. Now, in the Color Exchange are visible around it.
it is damaged.
dialog box, select black as the From Color, and your It’s not as common, but a different way of adding an
However,
selected new colour, which should be fairly dark, as image, which you might like to try, is to add that image don’t push it
the To Colour. All the black content of the QR code as a background behind all the black squares of the QR by placing too
changes to your chosen colour so, instead of black code. However, there’s a lot more scope for things to large an image
squares on a white background, you’ll have more go wrong here, because that image will be the full size in the centre,
colourful squares. of the code. An image in a few pale colours, say yellow because that
As well as colourising the black squares, using Color and light cyan, might work OK, but with a photographic means it’s much
Exchange also alters the colour of the so-called eyes, image, you first need to increase its brightness so all less immune
the square patterns in the top-left, top-right and the colours will be much fainter than the squares of the from accidental
damage or
bottom-left corners. Artistic QR codes sometimes QR code itself.
poor lighting.
have differently coloured eyes, but this needs us to Open the image as a new layer, but this time it
change just part of the QR code to a different hue. To should be the bottom layer. Resize it, if necessary, so
do that, first select one of the eyes using the Rectangle it’s about the same size as the code. With the image
Select tool. You can now use the method we used to layer selected, chose Layer > Transparency > Color To
recolour the squares, but this time it affects only the Alpha, and in the Color To Alpha dialog box, ensure that
selected area. Repeat this for the other two eyes and the default colour white is selected. The image now
you’re done. You could also vary this method slightly to shows through the QR code wherever it was white.
use different colours for the central
square of the eyes and their border.

Add images
Next are two different ways of adding
an image to a QR code. In both cases,
our instructions assume the QR code
is open in GIMP and you’ve made sure Using a small
the image mode is RGB. image in the centre
First up, we’re going to see how of a QR code is
to incorporate a small image in the common and
effective, but you
centre, this being one of the most might like to try a
common ways of customising a QR full-size but faint
code. The image must be fairly small, background image.

WE COULD USE A QR CODE HERE Subscribe now at http://bit.ly/LinuxFormat

www.techradar.com/pro/linux February 2023 LXF298   75


TUTORIALS Make notes

OBSIDIAN
Credit: https://obsidian.md

Nifty note-taking
with Obsidian
Nate Drake walks you through adopting the almighty Markdown-based
note-taking app Obsidian to see whether it lives up to its legend.

bsidian’s website describes the app as “a

O second brain for you, forever”. In plain English,


that means a tool that can help you take and
organise a colossal number of notes in a simple way,
from basic study notes to a full-blown wiki.
The program makes use of the Markdown markup
OUR language to format text, making it easy to import and
EXPERT export files. This simplifies tasks such as using links
Nate Drake to jump between notes and organising large amounts
is a tech of information.
journalist Obsidian is not FOSS but the free tier fully supports
specialising in Linux, doesn’t require registration and has some very Expand Obsidian’s features by installing free community plugins, such
cybersecurity powerful features. The program itself was developed as Advanced Tables, which supports inserting Excel-like sheets.
and retro tech. by Shida Li and Erica Xu, who were unhappy with the
Using Obsidian existing note-taking software on offer. your admin password. Once installed, Obsidian appears
to plan out his There’s also a thriving Obsidian community (https:// in Applications.
project for obsidian.md/community) and a host of devs creating The Obsidian website, however, uses a large purple
lighthouses plugins to improve its rather minimalist interface. button to push the AppImage option, which has the
has helped him advantage of working with virtually every flavour of
discover that Pick your package Linux. The AppImage can also run directly from the
they’re actually Obsidian is extremely Linux-friendly, being available folder where it’s downloaded.
very heavy. via Snap, Flatpak and an AppImage. Head over to If you want to install this way, first make sure you
https://obsidian.md/download to get started. have both fuse and libfuse2 by running sudo apt-get
Ubuntu users will find it easiest just to click Linux install fuse libfuse2 from the terminal. Next, right-click
(Snap) to download the file. Open the terminal and use the file in your Downloads folder. Choose Properties
cd to navigate to your Downloads folder. You can then and toggle Executable As Program. (Hardcore Linux
use snap on the relevant file to install it – for example: users may prefer to use chmod +x to do this.) Next
$ snap install –dangerous –classic obsidian_1.0.3_ double-click to run Obsidian.
amd64.snap The installers weigh in well under 100MB, making
Note that because this is a third-party Snap file, you Obsidian extremely lightweight.
must use the –dangerous flag. You also need to enter
One from the vaults
If you haven’t On your first launch, Obsidian offers three main
used Markdown
options. Resist the urge to do a Quick Start and click
before, check
Create to open a new so-called vault.
out Matt Cone’s
awesome You first need to set a name for the vault, which
guide at www. will contain all the Markdown files for this particular
markdown project. Next, click Browse to choose where to save it.
guide.org. Both Obsidian automatically creates a folder with the project
the Basic Syntax name – Lighthouse Project, for example – but we took
and Cheat Sheet the opportunity to create a parent folder for this and
pages have all future vaults, imaginatively named vaults. Click Open,
the information then Create to confirm your choices.
you need to
Obsidian uses Markdown to easily link between different notes and When the Obsidian dashboard itself launches, you’ll
get started.
images. The program suggests media in your vault as you type. see the interface is very spartan. This is deliberate and

76    LXF298 February 2023 www.linuxformat.com


Make notes TUTORIALS

in keeping with the Markdown philosophy of having a


simple, stripped-down text interface. On the plus side,
it’s easy to navigate.
Start your first Obsidian Markdown note by
clicking Create New File. We decided to begin with a
Statement of Intent for our project. Change Untitled
to give this note a name.
From here, you can enter text in Markdown format.
If this is your first time using Markdown, we should
explain that it’s extremely easy to pick up. Obsidian has
already created a main heading for you. You can also
create subheadings by placing ## before a new line of
text. Use one or two * before and after text to make it
italic or bold respectively.
You can also place web links in Markdown
documents – for example:
My favourite magazine is [Linux Format](https:// see the various links between notes and even group The graph view
is an excellent
linuxformat.com/). them in more advanced ways.
feature for seeing
There are several ways to write lists. The simplest One good way to better organise your notes is by all your notes in
is to number them with a bracket – for example, 1) , using tags. Tagging a note is just a matter of writing one place and
2) , 3) and so on – because Obsidian automatically # anywhere followed by your tag – for example, how they relate
recognises these and formats your text accordingly. #historynotes . Click Open Graph Settings on the to each other.
Place a ___ to draw a neat line. right while in Graph view to toggle displaying tags.
One particularly impressive aspect of Obsidian is
that you can also paste in formatted text and it does Observations
its best to preserve the formatting. In our tests, we There’s much to love about Obsidian. Setup is fairly
pasted in a paragraph from Wikipedia and all the easy and writing notes is a dream, even if you’re not
special characters and web links were preserved. This very familiar with Markdown. This article has focused
may be a relief if you have existing documents that you on the free version of the app, which doesn’t include
want to use with Obsidian. the billable Sync and Publish services.
It’s clear that Obsidian’s developers have tried to Sync enables you to save your notes in encrypted
make the editor as WYSIWYG as possible, although format across all your devices, though for only slightly
you can click the icon at the top-right to switch more trouble, you can install a plugin to encrypt your
between reading and editing mode. Markdown purists notes (see boxout, below) and save them to a cloud
may prefer to click the ... options icon to switch to folder. Obsidian supports exporting notes to PDF
Source Mode to see the raw text. format and Markdown plays well with most word
Click the New Note icon at the top-left each time processors, but Publish is probably the best way to go
you want to create a separate file. Alternatively, click + if you want to transform your notes into a website.
to open a new tab and create or open a note from If, however, you’re happy putting time into learning
there to switch between them easily. All notes are Markdown and with taking notes on one device,
saved automatically in Markdown format to your vault. Obsidian is very powerful and easy to navigate.

Pics and links


Markdown was built to allow easy cross-linking and OBSIDIAN AUGMENTATION
sharing of info, and Obsidian has turned this into an art
form. The easiest way to place an image inside a note Obsidian is designed to be a stripped-down note-taking app, ideal
is firstly to download it to the same folder as your vault. for importing existing projects or starting new ones. You can hugely
Then, when inside a note, just type ![[ to open a expand its functionality, though, by using plugins.
small menu and select your image. Click to embed the To get started, you need to manually enable community plugins.
image in your note. Click the Gear icon on the bottom-left and choose Community
There may be times where you want to link to Plugins > Turn On Community Plugins to leave Restricted Mode.
another note or picture without embedding the whole Next, click Browse to see what’s available. Search or scroll to find
thing in the file. For instance, our Statement of Intent a plugin you like and click Open In Obsidian. Firefox asks you to
has links to other notes containing more information confirm by clicking Open Link. Now click Install. Once installed, you
about the lighthouses we plan to restore. If you want may need to click Enable to get it working.
just to include a link, simply type [[ without the ! . We especially like the Day And Night theme, which lets Obsidian
If you’re managing a large project, navigating all automatically toggle between modes, and Advanced Tables, which
these links and pictures may not be easy. To make life makes drawing tables much easier than typing them in Markdown.
simpler, consider clicking the New Folder icon at the The Calendar plugin allows Obsidian to display a simple calendar in
top-left to drag and drop pictures or notes into logical the right-hand pane. (You need to click the Expand icon at the top-
categories, such as images. Obsidian automatically right to see this.) Click on a day to view your existing to-do list for
updates any existing links. that date or to create one.
For a full top-down oversight of your project, click Make sure you back up all your work first before installing plugins.
Open Graph View in the left-hand pane. This is where You may need to restart Obsidian for them to take effect.
Obsidian really comes into its own, because you can

www.techradar.com/pro/linux February 2023 LXF298   77


TUTORIALS Open source OS

SERENITYOS
Credit: https://serenityos.org

Get Serenity – direct


from the source
What do you get if you take a modern kernel, a classic GUI and a handful
of custom apps? Michael Reed investigates SerenityOS.

erenityOS is an alternative, free and open

S source operating system that combines a


modern technical approach with a healthy
nod to classic operating systems of the past. The
kernel has features such as pre-emptive multitasking,
memory protection and multithreading, and overall,
OUR the system is quite Unix-like, with many familiar tools
EXPERT available from the command line. It takes its visual
Michael Reed style directly from ’90s classic desktops from the likes
was already of Microsoft and Apple – a welcome sight to anyone
serene enough, who’s fatigued by the bland, flat look of modern GUIs.
even before he In some ways, it’s fairly early in its development, but
tried SerenityOS, it already has a full desktop with associated tools and The IDE Hack Studio is an example of the ambitious tools that the
thanks to his some runnable applications. One of the most admirable community is working on for SerenityOS.
experience with aspects of project is its highly active community, many
alternative OSes. of whom contribute to the code. This community has and running two scripts. The second script compiles
also funded the project, meaning that the main the code of the OS and runs it within the Qemu
developer, Andreas Kling, is able to work on it full-time. virtualiser. If you’re not familiar with Git, this might
This all adds up to an alternative operating system sound complicated, but it’s actually easy to get up
that is developing at a mile a minute, and it’s already and running. The only downside is that compiling the
good fun to play around with. To get the behind-the- system can easily take an hour on slower hardware.
scenes picture of what’s going on with the project, we When the script has completed its work, it launches
managed to shoot a few questions at Andreas himself. a properly configured Qemu instance, and it’s time to
start having some fun with the system.
Serenity from the source
For the moment, As always, we’ll start our exploration of the system by GUI and CLI
the default user obtaining it and installing it. At the present time, there When it comes to the graphical style of the user
is called ‘anon’ is no ISO and no traditional installer. The instructions interface, it’s obvious the developers are big fans of a
and the default for running SerenityOS involve cloning the Git certain Microsoft OS that came out in 1995. We put
password is ‘foo’. repository (https://github.com/SerenityOS/serenity) the point to Andreas. “Absolutely! The first OS I ever
Occasionally, used was MS-DOS, but I’ve always felt that Microsoft
you are reached peak GUI around Windows 2000. After that
prompted for
point, the industry became distracted with consumer
this password
when you
computing and professional, productivity-focused
invoke the GUI design became a niche rather than the norm. In my
settings tools. mind, SerenityOS is a return to that paradigm, and an
If you want to exploration of what comes next if we keep ourselves
become the (ie power users) as the target demographic.”
superuser at Aesthetically, the Windows 95 vibes are strong,
the command but many of the GUI support tools also look similar to
line, use the Windows ones. For example, the network configuration
‘su’ command, tool looks like that of Windows. Many of these older-
in the same
style configuration tools are starting to be pushed
way you would
on Linux. The text editor is a good example of the SerenityOS approach because out of sight on the modern Windows desktop, and
it combines classic looks with modern features. seeing them here fits in perfectly with the ethos of

78    LXF298 February 2023 www.linuxformat.com


Open source OS TUTORIALS

subdirectory within the source


code tree and runs the
package.sh script contained To update
within. This script downloads SerenityOS,
any needed files, compiles the type git pull
source code and installs the followed by
packages on the SerenityOS Meta/serenity.
disk image. It’s not pretty, but sh run while
it works for the most part. in the source
code directory.
The native SerenityOS GUI
Put the launch
apps include things like the
command into
system text editor (Text Edit). a text file and
This is fairly complete within use chmod
the lightweight category, and +x [name of
includes features such as script] to make
syntax highlighting. There is it executable
also a complete IDE called to save
Hack Studio. memorising
File Manager looks suspiciously similar to the Windows Explorer of older versions of the Microsoft
operating system. Fortunately, it’s a good design. Software development is the command
sequence.
obviously a priority for the
SerenityOS. It’s clear that the developers are aiming to SerenityOS community because, as well as the IDE,
take features that they admire from other systems. they are developing a programming language called
Stepping away from the graphical environment, Jakt. This translates into C++, which it resembles, and
much of the command-line environment will be familiar it aims to have robust memory safety features like
to Linux users in terms of how it works. You list the Rust. We could wonder if there is a danger that the
contents of the current directory with ls and change SerenityOS community is spreading itself too thin, but
directories with cd . You can list current processes by we’ll assume it knows what it is doing as it is producing
listing the contents of the /proc/ directory. Despite results at an impressive pace.
the GUI looking Windows-like, we would have been
disappointed if the command line was DOS-like. A ladybird’s web?
SerenityOS has a working TCP/IP stack, and Ladybird, SerenityOS’s own web browser, is the largest
running standard network tools such as ping works as single SerenityOS app. We took this for a spin, and it
expected. It comes with a simple web server that’s an worked reasonably well. An excellent web browsing
original piece of software created for SerenityOS.

Applications and more


SerenityOS already has a reasonable amount of
runnable software. It can only run its own software, but
this includes some that has been ported from other
systems. Looking at apps, most of what’s available for
it either falls into the category of GUI software that has
been created by the SerenityOS community or ports of
mostly text-mode applications and utilities. We were
happy to see text editor Nano in this list and some will
be pleased that there is a Vim port. There are also
ports of some games, such as Doom and Quake.
Speaking of ports, for the moment, the package
installation method is rather low tech, but it gets the
job done. Software installation is carried out outside
of SerenityOS. One navigates to the appropriate The YouTube channel of Linus Groh (www.youtube.com/@LinusGroh), one of the developers.

COMMUNITY AND SUPPORT


CREDIT: www.youtube.com/@LinusGroh

SerenityOS has an unusually active pointing to other resources. The GitHub updates about what the developers are
community by the standards of page (https://github.com/SerenityOS/ working on. It’s also often possible to
alternative OSes. It’s refreshing to see serenity) contains instructions for how catch a live coding stream to watch a
contributors on a project like this who to build and run SerenityOS. If you have developer actually solving bugs and
are actually making regular updates and questions about using the operating adding new features while explaining.
posting videos about their progress. system, the best place to ask is the Lead developer Andreas Kling regularly
The official website (https:// Discord server, which has a lot of posts updates, in which he has edited in
serenityos.org) isn’t exactly packed activity from the friendly community. updates from other developers as well,
with traditional documentation at the YouTube is great for finding out more on his YouTube channel (www.youtube.
moment, and it works as more of a hub about SerenityOS and getting the latest com/c/andreaskling).

www.techradar.com/pro/linux February 2023 LXF298   79


TUTORIALS Open source OS

probably just as good as, if not better than, the RISC


OS, Haiku and AROS operating systems that rely on
There are a few existing technology such as a standard layout engine.
games included As Ladybird can run under Linux, we wonder if it could
with SerenityOS, end up being a viable inclusion to those other systems?
and they
mostly fall into The kernel
the category Thankfully, the SerenityOS kernel is based on modern
of simple principles and it fully supports preemptive multitasking
distractions and and memory protection. Like Linux, it’s a monolithic
implementations
design, meaning that some of the system facilities
of classic game
types. There
such as drivers are located with the same memory
are some more Thankfully, the SerenityOS command-line interface leans more space as the kernel for good performance. SerenityOS
substantial towards Unix than DOS. Most of the familiar commands are present. is a 64-bit operating system and the 32-bit support
games, such that was once present is now largely deprecated.
as Quake and experience seems to be the holy grail for alternative The kernel also supports multithreading. In other
Doom engine OSes, and the main criteria we take into consideration words, a program can launch its own processes. To
ports, in the are browser speed and website compatibility. At the see why this improves performance, consider two
Ports directory time of writing, Ladybird’s speed leaves something to parts of an app in a case where one part is blocked as
in the source be desired, and it’s a roll of the dice whether a given it waits for a reply from a server on the network. In
code tree.
site will work. However, as with all things connected to OSes that don’t support multithreading, the whole
SerenityOS, the pace of development is encouraging. A program has to stop until that task is completed. As
number of complicated sites such as Google News are well as improving overall performance, multithreading
navigable, although the layout isn’t quite right, and full also provides a smoother experience, as an application
Discord support is a current goal of the developers. stops and starts less often and is more responsive.
Ladybird development is an interesting point of If you remember our examinations of RISC OS and
entry to discover a few things about the SerenityOS AROS, we noted that the lack of threading support at
development community. It’s quite interesting to watch the kernel level is a barrier to porting some apps.
one of the developers working on the browser code on SerenityOS doesn’t yet feature support for multiple
a YouTube livestream, for instance, testing different CPU cores. This lack doesn’t block the porting of any
sites and fixing the browser in real time. software, but working SMP (Symmetric Multi-
Creating a new browser from scratch might seem Processing) support can often greatly accelerate
unconventional, but SerenityOS has a browser that is the operation of complex software and improve the
experience. Experimental SMP support is already
working and USB support is also under development.
SAY HELLO TO SERENITYOS An Arm CPU port is ongoing, making us wonder
if we might one day see SerenityOS as a possible
Raspberry Pi operating system, although that seems
1 like something that’s still on the horizon for the project.
6
The competition
Comparing SerenityOS to other alternative desktops
5 out there, our feeling is that it’s heading in the right
direction. Systems like the AmigaOS-derived AROS
and RISC OS have huge legacies and a steep culture
underpinning them. Apart from the nostalgia factor, it
gives them a massive leg up when it comes to decades
of accumulated knowledge of how they work and a
large number of legacy apps that have been ported
from the original systems. On the downside, both of
those systems are held back by their legacy roots on
the technical side, particularly in the area of the kernel.
2 3 4
If you want modern features and loads of software
in every area, while staying away from the mainstream,
Desktop look and feel System monitors a Unix-based operating system might be the most
1 The overall aesthetic may remind you 4 SerenityOS adopts modern sensible option. Choices here include one of the
of popular desktops from the ’90s. accoutrements, such as handy monitors desktop-orientated BSD systems and the Solaris-
for the CPU, memory and network usage.
inspired OpenIndiana. The downside is that they might
Application launcher
2 At least sticking with a classic design Configuration feel a bit too similar to Linux, which is a shame if you
means you can easily guess where the 5 The familiar working methods of this fancy tipping your toe into something really different.
application launcher is. desktop even extend to system tools such as HaikuOS is the most appropriate alternative
configuration utilities. operating system to compare SerenityOS to. Both have
Familiar elements
3 The standard task switcher is a Applications modern design features at their core and desktops
tried-and-tested design, as are the 6 There are some impressive, homegrown that aspire to present the best of ’90s style. In terms
quick launch icons. apps, such as the Ladybird web browser. of being a complete system, HaikuOS is considerably

80    LXF298 February 2023 www.linuxformat.com


Open source OS TUTORIALS

ahead in features and maturity. It also has some really


useful ports of large apps. The main shortcoming of TALKING TO THE DEVELOPER
HaikuOS is that it doesn’t yet have a robust web
browsing experience, and this seems to be one of Lead developer Andreas helped
the toughest nuts to crack for any alternative OS. us fill in some technical details
about how SerenityOS works,
Daily driver capability but we were interested to
We wondered how close SerenityOS is to being a daily find out how the community
driver at this point, and to help us, we turned to the came together and how the
man himself, Andreas. “For me personally, I need good development of the OS has
multi-core performance for programming projects, affected him personally.
software and drivers for recording and editing videos,
and a web browser that can handle all the things I do Q. Were you surprised how
on the web daily. I’m working towards these things popular your YouTube videos
every day and it’s going to take quite a while longer! have turned out to be?
Of course, someone with different requirements could Definitely! I originally started
start daily-driving the system much sooner. That’s making videos to help with
something I love about our project: we’ve got many some personal insecurities, and
people pulling towards their own personal goals for hoped that maybe someone
the system, and I’m just one of them.” would find them interesting. I
That’s an assessment that we are mostly in never expected to find an audience in the tens of thousands!
agreement with. However, we did encounter some
stability problems from time to time, with occasional Q. What have been some of the great moments during
system crashes. We assume that these problems will development in the SerenityOS project? We’re talking about
be addressed as the system becomes more mature. the emotional milestones. Pinging a server on the outside
The rate that the community is developing the world? Booting to a desktop?
system is unusually fast for a small operating system Those were both great milestones! Hearing sound for the first
project. For that reason, we can afford to give it the time was also cool. And compiling a C++ program! Later, porting
benefit of the doubt in a few areas. The development classic games like Doom and Diablo. And the first time I did a
team has taken some unusual decisions in terms of Google search with our own browser. Most recently, taking the
developing so many applications and subsystems from browser out of SerenityOS and making it run on other systems has
scratch. But having said that, if it is a development been very fulfilling!
process that is producing impressive results and rapid
progress, it would be wrong to criticise it. Q. The community around SerenityOS is impressive. What has
As it’s a reasonably good target for ports, it should been the formula for success there? Do you have any tips for
be unlikely to have any massive holes in terms of app other developers who want to build a supportive and productive
types and utilities in the long term. That said, there community around their project?
are limits to what even a team as determined as I can’t pretend to understand exactly why it’s become so successful,
SerenityOS’s can manage, and we’d be excited to see but I do have three things in particular to offer as tips:
more ports of GUI apps. Hopefully, that will develop in 1. Create content! I’ve been putting out a steady stream of content
time as there is already a port of the Qt toolkit. about the project in the form of videos, streams, tweets, blogs and
We’d judge the project to be in an alpha state at the so on. Content is great at attracting new people, and makes the
moment, but it’s intriguing and fun to experiment with. project feel alive.
In its current state, it’s a compelling enough system to 2. Make a place to meet and collaborate! Communities are people,
get enthusiasts to take a look, and it must be nearly and people like to chat with each other. We used IRC up to 150
time for the community to create some downloadable users, and then moved to Discord, where we now have over 7,000
ISOs so that more people can look it over. users. Our spaces are highly focused on development, with
designated areas for off-topic conversation.
3. Keep high standards! By holding ourselves to a high standard for
code, version control, continuous integration and so on, we’ve scaled
the project from one developer to hundreds while steadily increasing
overall quality.

Q. When we looked at Haiku, we were impressed with the ports of


applications like LibreOffice and Krita. If you could choose a couple
of big-name apps to port to SerenityOS, what might they be?
To be honest, I’m much more interested in building our own
applications instead of porting existing ones. If I had to choose
something, it would be fun to have a digital audio workstation like
Reason or Ableton Live, and also get Steam working so I could play
Pixel Paint looks like a clone of the famous Microsoft Paint, but it has Dark Souls on SerenityOS.
some advanced features, such as layers and filters.

THERE ARE NO LXF ALTERNATIVES Subscribe now at http://bit.ly/LinuxFormat

www.techradar.com/pro/linux February 2023 LXF298   81


GET ALL THE ESSENTIAL BREAKING
NEWS FOR THE TECH ENTHUSIAST!
No matter if you're building a PC,
buying a laptop or learning about
robots, Tom's Hardware has all the
comprehensive knowledge you need.

Scan & Subscribe


for free!
THE BEST NEW OPEN SOURCE SOFTWARE ON THE PLANET

HotPicks
Cryptomator PowerShell JOSM Logseq Easy
Effects Ear Tag Gabut Download Manager 3D-
Mayank Sharma
is good at finding brilliant
open source software, but
can’t figure out what to do
until F1 2023 (and binge-
watching Drive to Survive
Puzzles Total Chaos Metadata Cleaner Hidamari doesn’t count).

CLOUD DATA ENCRYPTOR

Cryptomator
Version: 1.6.15
Web: https://cryptomator.org
ost cloud data providers only encrypt data

M during transmission. Usually the ones who do


encrypt the data, hold on to the decryption
keys, leaving users little option but to trust the cloud
providers to take adequate steps to keep the keys
from being stolen, copied or misused.
If this arrangement has put you off using online data Cryptomator is open source and has been audited by security researchers to
silos, Cryptomator encrypts your data before handing ensure it doesn’t contain any back doors.
it over to the cloud silo. This ensures only you can
decrypt your data, which remains undecipherable for
anyone else, be it the cloud provider or a threat actor. LET’S EXPLORE CRYPTOMATOR...
Cryptomator works with any cloud data storage
service as long as it gives you the ability to synchronise 3
with a local directory in your filesystem. This means it
can work with virtually all popular services, including
Dropbox, Google Drive, OneDrive, MEGA, pCloud,
OwnCloud and Nextcloud.
Ubuntu users can install Cryptomator via a PPA, but
your best bet is to use the official AppImage or Flatpak.
To install the app via Flathub, fire up a terminal and 1
type flatpak install flathub org.cryptomator.
Cryptomator to install the app. You can then launch 2
the app from the app launcher or with the flatpak run
org.cryptomator.Cryptomator command.
The app has an intuitive interface. You first have
to create an encrypted folder – or a vault, as the app
refers to it – within your filesystem. This is password-
protected, and everything inside it is encrypted using
AES encryption with 256-bit key length. 4
Now all you need to do is configure your cloud
storage service to synchronise this encrypted folder Encrypted folders App preferences
with the cloud drive, and you’re done. 1 All encrypted folders, whether locked 3 This button reveals the few settings for
Every time you store something on this drive, or unlocked, are listed here. Right-click on a the app, such as the option to choose where to
Cryptomator encrypts the data automatically, including locked vault to reveal its options. store the passwords, and make the app lock all
open vaults automatically on exit.
the files names and file structure. The cloud storage Unlocked drive
service does the rest and makes sure your encrypted 2 Once unlocked, you can use the Reveal Add encrypted folder
data is synced with the online silo. You can create Drive button to open the vault in the file 4 This button launches a brief wizard
multiple vaults – each one is protected by a password manager, and also view its complete path to help you create an encrypted folder in
in your filesystem. your filesystem.
and can contain as many files and folders as you like.

www.techradar.com/pro/linux February 2023 LXF298   83


HOTPICKS

CLI SHELL

PowerShell
Version: 7.3.0 Web: https://github.
com/PowerShell/PowerShell

ree and open source software from Microsoft

F that’s actually good is a rarity. One such gem is


PowerShell, which interestingly supports all of
the commonly known commands from CMD and
Linux’s command-line shell.
PowerShell is made up of a command-line shell, a directory. That said, there are plenty of scenarios Use the “Get-
scripting language and a configuration management where standard Linux commands make more sense Command” cmdlet
to view a list of
framework. System admins use it for automating the than PowerShell cmdlets. However, what’s particularly
the available
management of the computers in their realm. appealing about PowerShell is that it lets you use Linux PowerShell
One of the differences that’ll strike first-time users commands and cmdlets together. cmdlets.
when using PowerShell is the semantic clarity. For instance, consider Get-Process | Select-Object
As anyone who has worked with traditional POSIX -Property Name, Path, Responding, Id | grep firefox .
shells like BASH knows, most commands are heavily Even though Get-Process returns a number of
abbreviated. For instance, commands such as awk , ps properties for processes running on the computer, we
and top don’t make sense to a new user as the names pipe the output through Select-Object to narrow
don’t reveal the purpose of the command. down the list, which is further narrowed to display only
In contrast, commands in PowerShell are self- details about the running Firefox process using grep .
descriptive. They are called cmdlets and follow Binary packages for PowerShell are available for
the verb-noun naming convention. For instance, the several distros, but you can install it from the Snap
cmdlet Get-Childitem | Where-Object Length -gt store with sudo snap install powershell --classic .
50MB lists all files greater than 50MB in the current Once installed, use pwsh to switch to PowerShell.

OSM EDITOR

JOSM
Version: 22.10
Web: https://josm.openstreetmap.de

lthough we’re big fans of OpenStreetMap

A (OSM), its coverage isn’t as extensive as the


proprietary map app from Google. No worries;
being a crowd-sourced project, it doesn’t take much to
become a cartographer and extend its scope.
JOSM, or the Java OpenStreetMap Editor, is a
feature-rich, Java-based offline desktop map editor for
OSM that can help you plot GPS traces. visited recently. To do so, click on the green download Using JOSM
JOSM is available in the repos of several distros, arrow and zoom into the map until you find the area doesn’t take
much effort, but
but you can use the official distro-agnostic Flatpak you want to map. Select the area and click the please read some
to make sure you have the latest version. Head to Download button to fetch the existing data for that getting-started
the terminal and type flatpak install flathub org. area from the main server. For most places on Earth documentation if
openstreetmap.josm to install the app. It anchors there is also at least one image available. You can pick you haven’t edited
OSM maps before.
itself in the distro’s Applications menu and can also be one from the Imagery menu at the top of the editor.
launched with flatpak run org.openstreetmap.josm . JOSM is an offline editor, which means everything
You can upload your own GPS track data into JOSM, you do won’t be visible for anyone else until you
though it’s best to grab the map data from the OSM upload it to the server. This makes it possible to
database and enrich it by adding nodes, ways and tags. experiment and repeatedly move, tag, add and delete
The first step is to download some maps. You can elements without breaking anything. Once you’ve
practise using JOSM by downloading the map for your made the changes, click the green upload arrow to
neighbourhood or an area you’re familiar with or have ferry the changes to OSM.

84    LXF298 February 2023 www.linuxformat.com


HOTPICKS

KNOWLEDGE PLATFORM

Logseq
Version: 0.8.11
Web: https://logseq.com

n its most basic form, Logseq is a note-taking

I application. But there’s got to be more to this


software that separates it from the myriad of
other apps for jotting down notes, because Logseq
counts Google, Meta and MIT amongst its users.
You can use Logseq to jot down notes, and also add
images and other documents such as PDFs. The app
also enables you to organise notes using tags, which familiarise yourself with its distinguishing features and Part of Logseq’s
makes them easily searchable. Logseq is built with a how to use them. charm is that it
supports markup
privacy-first mindset, which means that by default all Logseq claims the problem with popular note-taking
languages
your notes are stored offline on your computer. That apps is their inability to resurface information. Sure, old including both
said, you do have the option to synchronise them using notes appear when you search for them, but with Markdown and
GitHub or iCloud. Logseq, you can link to old ones directly in the note Emacs’ Org Mode.
For every release, Logseq puts out an official itself, which makes it easier to find interlinked info. The
AppImage, which you can grab yourself and make project claims this helps you easily traverse your notes.
executable by using the chmod +x command, or It also has a view that shows all your notes as a graph,
from the file manager. to help you visualise the arrangement of your notes.
At first glance, the app might appear as a regular The project claims its ability to combine the
note-taking app, but what makes it different is its disparate notes, research, PDF markups and more
ability to link and refer to other notes. We advise can help you create a better and efficient system for
you to refer to its getting-started documentation to storing and retrieving information.

AUDIO MANIPULATION

Easy Effects
Version: 7.0.0 Web: https://github.com/
wwmm/easyeffects

udiophiles take note. To get the most oomph

A from your expensive audio gear, you can use


the Easy Effects audio manipulation tool. As
its name suggests, the tool helps you apply audio
effects to apps managed by PipeWire, with little effort.
It includes dozens of effects, such as an equaliser,
exciter, limiter, compressor, reverb tool and lots more.
To complement these it also features a built-in you aren’t an audiophile. Because Easy Effects uses The app lists all
spectrum analyser. With its latest version, you can use the default PipeWire sound server, its developers claim music-oozing
apps in the main
the app to not just include multiple effects to a stream, it works with most, if not all, apps on a modern distro.
window, from
but also change their order as per your audio pleasure. One convenient feature we particularly like is that where you can
The tool is included in the repos of several distros Easy Effects remembers the configuration from the enable or disable
but to make sure you have the latest version, just use last session, and restores it automatically when them as per
the Flatpak with flatpak install flathub com.github. launched. Of course, you can also save your custom your needs.
wwmm.easyeffects . Once it’s installed, launch it from arrangements as profiles that you can call upon
the distro’s Applications menu or with flatpak run whenever required in the future.
com.github.wwmm.easyeffects . Besides manipulating sound output, Easy Effects
Audio enthusiasts won’t have any trouble navigating can also apply effects to an input device, such as a
and using the app. Still, there’s a comprehensive microphone. This isn’t just useful when recording audio,
manual included, with details about the parameters for but can also help enhance conservations during online
each of the included effects, which is pretty useful if meetings and presentations.

www.techradar.com/pro/linux February 2023 LXF298   85


HOTPICKS

TAG EDITOR

Ear Tag
Version: 0.2.1 Web: https://github.
com/knuxify/eartag

ar Tag is a small and simple music tag


E editor, which unlike many of its peers,
doesn’t try to manage your entire library.
Its developers claim that the application is suitable
for editing a handful of files or even a single file, and
is particularly useful for people who don’t have a very
large library of music files.
Ear Tag is available in Arch’s AUR and a couple of
other distros. Your best bet, however, is to install it
via the official Flatpak package with flatpak install files, but if you have a rather large collection, it’s best to Thanks to
flathub app.drey.EarTag . Once it’s installed, you can look at something like Picard. LibAdwaita and
the app’s compact
fire up it from the distro’s application launcher or from If you open multiple files, make sure the one you
design, it can be
the CLI with flatpak run app.drey.EarTag . want to edit is selected on the left. This displays the used on any screen
Being a GTK4 application, Ear Tag is fairly attractive file’s existing tag data, including some irreplaceable size, including
and looks at home in modern Gnome-based distros information such as length of track, type and encoding. mobile Linux
such as Ubuntu and Fedora, and like other native You can now change the cover image of the file, devices.
apps, can also follow the system’s colour scheme to as well as use the text fields to edit other metadata
automatically switch between light and dark themes. information, such as the title, name of artist, the album,
To use the app, either drag and drop your music file track number, genre and more. Once you’ve made the
into the app or point it to the file by navigating your changes, click the Save button to make sure the
filesystem from within the app. You can open multiple updated tag information is saved to the file.

You can
DOWNLOAD MANAGER change default

Gabut
authentication
information and
enable folder
sharing from

Download
under the app’s
Settings window.

Manager
Version: 1.9.9 Web: https://github. and opens the download dialog box. Its interface
com/gabutakut/gabutdm resembles that of any download manager, and gives
all the usual information about ongoing downloads.
Gabut can also help you pass authentication details
abut Download Manager is a feature-rich all- if asked by the remote server, as with FTP downloads.

G in-one download manager that can grab files


using direct URLs, as well as from Metallinks,
Its distinguishing feature is its local web service.
When you click the home icon in the interface, it pops
Magnetlinks and Torrents. The icing on the cake is its up a window with a QR code along with an IP address.
built-in web service, which not only remote-controls You can scan the QR code from your mobile phone or
the manager but also share files over the local network. head to the displayed IP address from the web browser
Gabut isn’t available in distro repos but you can grab on any other computer on the local network.
it from the Snap store or Flathub. To install the Flatpak The default user and password for remote access
version, head to the terminal and type flatpak install are gabutdm and 123456. From the web interface,
flathub com.github.gabutakut.gabutdm . When done, you can manage the downloads remotely, transfer
you can launch it from the distro’s application menu or files from the device you are accessing the remote
with flatpak run com.github.gabutakut.gabutdm . interface on to the host that’s running Gabut, as well
The app actively monitors your clipboard and as transfer files from the computer with Gabut to the
automatically catches hold of any downloadable URLs device on which you are viewing the web interface.

86    LXF298 February 2023 www.linuxformat.com


Games HOTPICKS

The game is
CUBE PUZZLES functional but

3D-Puzzles
doesn’t offer
conveniences like
the ability to save
multiple games
or to select a

Version: N/A Web: https://github.com/


difficulty level.

volatilflerovium/3D-Puzzles

s its name suggests 3D-Puzzles is a simulator

A of 3D combination puzzle games. In addition


to the classic Rubik’s Cube, the game also
features the Dogic, and Dogic 12 puzzles.
To get started, download its official AppImage from with an option to either select a new game or load
the project’s website: the previous session.
$ wget https://github.com/volatilflerovium/3D- The current session is saved automatically when
Puzzles/raw/main/3D-Puzzles-x86_64.AppImage you exit the puzzle. But if you select to start a new
After grabbing the file, you have to make it game, the previous session is lost. If there is no
executable, which can be done in either of two ways. previous session, the puzzle is scrambled on launch.
Firstly, you can use the graphical user interface by To move the pieces, click near any edge of a
right-clicking on the file and selecting Properties piece and drag the mouse parallel to the edge in
from the context menu, then you need to head to the the desired direction, while holding down the button.
Permissions tab and toggle the Allow Executing File As This takes some getting used to, especially in Dogic
Program checkbox. 12, which has a large number of movable pieces. You
Or you can fire up the terminal and switch to the can also use the arrow keys to change puzzle view.
folder where you’ve downloaded the AppImage: Although this is the game’s first release, if you
$ chmod +x 3D-Puzzles-x86_64.AppImage enjoy solving 3D puzzles, it’s a must-have. As the
The game has a simple interface. The main window author acknowledges, the intention of the game
displays all the puzzles. Click the one you want to play. isn’t to produce stellar graphics, but rather to be
Irrespective of the puzzle you select, you’re presented functional, and it works as advertised.

FIRST-PERSON SHOOTER

Total Chaos
Version: 1.2.1 Web: www.moddb.com/
mods/total-chaos

here’s no shortage of Doom 2 mods, but Total

T Chaos is such a brilliant remaster that you


wouldn’t have guessed its Doom 2 roots if we
hadn’t spilled the beans.
The first-person shooter has six levels and does
a stellar job of transforming Doom 2 into a horror-
themed survival bloodfest. has now disappeared without a trace, leaving the Total Chaos is
It relies on GZDoom, which is a 3D-accelerated facility abandoned. really well done,
and does a stellar
Doom port that makes best use of the current The game launches with you waking up on the job of building
hardware to add support for things such as dynamic island after wrecking your ship. As you get your tension, with its
lighting, sloped floors and other things that modernise bearings, a voice on the walkie-talkie urges you to eerie soundscape
the game’s visuals and make the gameplay more find them. To make your way around, you must fight and the usual
tricks popular
engaging overall. your way through all kinds of horrifying creatures,
with the genre.
You can grab the game from Flathub with flatpak each with their own unique attack patterns.
install flathub com.moddb.TotalChaos . When it’s You fight through apartments, utility tunnels and
installed, you can run it from the distro’s application other buildings before making your way to the city
menu or by using the flatpak run com.moddb. centre. On the way, you unravel the mystery of what
TotalChaos command. happened through letters scattered around, along
Total Chaos is set on the fictitious Fort Oasis island with a large battery of weapons. Sure, there are guns,
in the midst of a wind-battered sea. The island was but mostly you have to defend yourself with tyre
once home to a buzzing coal mining community, which irons, pickaxes and such. A normal day at work!

www.techradar.com/pro/linux February 2023 LXF298   87


HOTPICKS

The app has an


PRIVACY TOOL approachable

Metadata
interface that
inexperienced
users will find
welcoming.

Cleaner
Version: 2.2.7 Web: https://
metadatacleaner.romainvigier.fr

s long-time readers can probably tell, we’re You can use the Add Files button in the app to

A suckers for privacy here at LXF Towers. One of


the sloppiest ways to leak privacy information
select a file you wish to sanitise or bring up the pull-
down menu adjacent to the button to point the app
is through metadata in files posted in public forums. to a folder and allow it to load all files in there.
Metadata is sensitive information that, with the right After it’s done analysing the files you’ve added,
context, can reveal a lot about you. you can click on them to view the metadata the app
Cameras record data about when and where a has found within each file. To clean all the files in the
picture was taken and which camera was used. window, press the Clean button.
Similarly, many office apps automatically add author The developers warn that in its bid to be thorough
and other details to all documents. With Metadata with the purging, the removal process could modify
Cleaner, you can easily view the metadata embedded the files in unexpected ways. However, you can
in a file and remove it without much effort. change this default behaviour by switching the app
The app recommends installing it via Flathub. Pull to the Light mode, which isn’t as harsh and doesn’t
up a terminal and type flatpak install flathub fr. make any destructive changes to the files.
romainvigier.MetadataCleaner to install it. When it’s The app has a detailed manual that does a good
done, you can launch it from the distro’s Applications job of explaining the various options and points out
menu or from the terminal with flatpak run fr. why removing metadata isn’t a foolproof mechanism
romainvigier.MetadataCleaner . for ensuring that files don’t leak personal data.

VIDEO WALLPAPERS

Hidamari
Version: 3.2 Web: https://github.com/
jeffshee/hidamari

tatic wallpapers are so passé, especially on

S modern machines with dedicated graphics


hardware. With Hidamari, you can run videos
as wallpaper, without taxing your computer.
The Python app praises itself for being minimal, and
yet offers features such as GPU video decoding. Best folder. Any files in there show up under the Local The app is smart
of all, it’s fully compatible with Wayland and supports Video tab. Select the video you want to use as the and automatically
pauses playback
multi-monitor setups as well. wallpaper and click the Apply button.
when a window is
Hidamari is available in the Arch’s AUR, but the To use a video from the internet as wallpaper, maximised or an
developers suggest installing it via the distro-agnostic switch to the Streaming tab and paste the URL of app is running in
Flatpak. Bring up a terminal and type flatpak install the video in the textbox. Similarly, head to the Web full-screen mode.
flathub io.github.jeffshee.Hidamari to install the app. Page tab to point to a website or an HTML file on
It then nests itself in the distro’s Applications menu your computer to use it as your wallpaper.
and can also be launched from the terminal with Once the wallpaper is set, you can right-click on
flatpak run io.github.jeffshee.Hidamari . the desktop to bring up relevant options, such as to
Besides setting local videos as wallpaper, the app mute and pause playback. Other options, such as
also enables you to use videos from YouTube and other the ability to control the volume of the video, are all
video-sharing sites, as well as set web pages as accessible from the hamburger menu in the app.
wallpaper. These options are exposed through three Here you’ll also find toggles to autostart the
separate tabs in the app. To play any of your videos as software and start the video wallpaper as soon as
wallpaper, drop them inside the ~/Videos/Hidamari you log into your desktop.

88    LXF298 February 2023 www.linuxformat.com


CODING ACADEMY
CODING ACADEMY Monitor networks

EBPF

Monitor your TCP/IP


Credit: www.ebpf.io

networks with eBPF


Naturally suspicious, Mihalis Tsoukalos keeps an eye on all his
network traffic using eBPF – and he’ll show you how, too.

ure to send a shiver down the nerdiest of

S geek’s spines, the idea of monitoring TCP/IP


packets and connections can be confusing at
best. Just scan this article and the output of the eBPF
tools, and you realise you need to be familiar with TCP/
OUR IP and its cryptic options in order to understand the
provided information. Before diving into the TCP/IP
EXPERT tools, we’ll begin by explaining how to trace eBPF
Mihalis related system calls with the help of the Strace utility.
Tsoukalos Let’s use Strace to trace eBPF-related system calls
is a systems along with their parameters. For example, we can find
engineer and a out the eBPF system calls executed with Opensnoop:
technical writer. $ sudo strace -e bpf /usr/share/bcc/tools/opensnoop
He is the author bpf(BPF_MAP_CREATE, {map_type=BPF_MAP_TYPE_
of Go Systems PERF_EVENT_ARRAY, key_size=4, value_size=4, max_
Programming entries=8, map_flags=0, inner_map_fd=0, map_ Here you can see the output from the TCPconnect utility,
and Mastering name=”events”, map_ifindex=0, btf_fd=0, btf_key_type_ which traces TCP connect calls.
Go, 3rd edition. id=0, btf_value_type_id=0, btf_vmlinux_value_type_id=0,
map_extra=0}, 72) = 4 ELEM and the last one using
bpf(BPF_MAP_UPDATE_ELEM, {map_fd=4, BPF_RAW_TRACEPOINT_OPEN . In LXF297, we
key=0x7f86f7370610, value=0x7f86f7370690, flags=BPF_ discussed eBPF maps and how each map has a file
ANY}, 144) = 0 descriptor associated with it – this can be seen in
bpf(BPF_RAW_TRACEPOINT_OPEN, {raw_ action here: the first call creates a map and returns a
tracepoint={name=NULL, prog_fd=7}}, 144) = 8 file descriptor with a value of 4, whereas the second
This is a small part of the generated output but you statement uses 4 as its map_fd parameter in order to
get the idea and the insights of the system calls related update the desired map.
to eBPF. Using filtering tools such as Grep can help you
This is the kind of
output generated
locate what you are looking for because Strace Traditional TCP/IP tools
by the TCPlife produces lots of output. Before deciding to use eBPF utilities, consider using
utility, which What we see here is three versions of the BPF one of the existing Unix ones. The list of such tools
system call. The first one using the BPF_MAP_CREATE includes but is not limited to the following:

traces the lifespan
of TCP sessions. command, the second one using BPF_MAP_UPDATE_ Netstat: Shows information about the network
status of a Unix machine. It’s a powerful tool that can
work on the Socket, TCP, UDP, IP and Ethernet levels.
Its main drawback is that it only works on the local
machine but doesn’t usually need root to operate.
• SS (Socket Statistics): A modern version of
Netstat. When used without any command-line
arguments, SS prints all TCP, UDP and socket
connections.
• TCPdump: Allows you to capture network data
using the capabilities of the libpcap library. However,
it cannot analyse the captured network data.

90    LXF298 February 2023 www.linuxformat.com


Monitor networks CODING ACADEMY


Output of “tcptop
WireShark: As well as Tshark, the command-line -C” – like “top” for
TCP connections.
version of WireShark, it can help you capture but most
The -C flag doesn’t
importantly analyse TCP/IP traffic. WireShark is more clear the screen
or less the standard tool for looking into TCP/IP traffic when printing new
at the network packet level. information.

• /proc/net This system folder has lots of useful


information, provided that you read up about it. The
following output shows the kind of information you
should expect to get from /proc/net/protocols:
$ sudo cat /proc/net/protocols
protocol size sockets memory press maxhdr slab module
UDPv6 1344 3 1 NI 0 yes kernel
TCPv6 2392 3 1 no 320 yes kernel
UDP 1152 1 1 NI 0 yes kernel However, TCPconnect supports a richer set of
TCP 2232 5 1 no 320 yes kernel command-line options than TCPconnlat offers.
In here we see information about the UDPv6, The TCPstates tool traces TCP session state
TCPv6, UDP and TCP protocols (we’ve removed some changes and durations. Its output looks like:
output for brevity). SKADDR C-PID C-COMM LADDR LPORT
RADDR RPORT OLDSTATE
TCP utilities… -> NEWSTATE MS
The TCPconnect tool traces TCP connections that are ffff98abbc689180 5630 ssh 192.168.1.7 0
initiated with the connect system call. The generated 195.251.38.180 22 CLOSE
output looks as follows: -> SYN_SENT 0.000
PID COMM IP SADDR DADDR DPORT ffff98abbc689180 347 irq/165-iw 192.168.1.7 40744
5481 ssh 4 192.168.1.7 195.251.38.18 22 195.251.38.180 22 FIN_WAIT1
5484 ssh 4 192.168.1.7 109.74.193.253 22 -> FIN_WAIT2 32.431
4760 Socket Threa 4 192.168.1.7 35.163.114.24 443 A particularly interesting feature of TCPstates is
Sometimes, there is a delay in the serving of that it presents both the old and the new state of a You can find
connect system calls. Should you wish to learn more TCP connection. Additionally, TCPstates supports many UDP
about that latency, you can look at the TCPconnlat many command line-options that can modify the eBPF tools
utility, which generates the following kind of output: information that is contained in the output. So, along with their
implementation
$ sudo /usr/share/bcc/tools/tcpconnlat tcpstates -4 traces IPv4 connections only,
in the BPF
PID COMM IP SADDR DADDR DPORT LAT(ms) whereas tcpstates -6 traces IPv6 connections only.
Performance
962 KCupsConnect 4 127.0.0.1 127.0.0.1 631 0.10 Please be sure to run $ sudo /usr/share/bcc/tools/ Tools book by
4752 ssh 4 192.168.1.7 195.251.38.180 22 27.47 tcpstates --help or look at the source code of the Brendan Gregg.
4756 ssh 4 192.168.1.7 109.74.193.253 22 66.75 tool to learn more about the rest of the supported Generally
4760 Socket Threa 4 192.168.1.7 54.187.120.38 443 252.38 command line options. speaking, this
4760 Socket Threa 4 192.168.1.7 54.187.120.38 443 240.15 is the best
4760 Socket Threa 4 192.168.1.7 54.187.120.38 443 248.26 TCPlife and TCPtop book to learn
Looking at the first line of output, you might think The TCPlife tool traces the lifespan of TCP sessions more about
that the remaining connections are pretty slow. and creates a summary for each completed TCP eBPF. However,
be prepared
However, this is not the case because the first connection. This tool is handy for viewing the list of
for lots of
connection is on the local machine. Additionally, completed TCP connections. The output from TCPlife
reading and
the output of TCPconnlat contains almost all of the looks similar to the following: experimenting.
information found in the default output of TCPconnect. PID COMM LADDR LPORT RADDR RPORT TX_KB

TCP/IP BOOT CAMP


TCP/IP is a family of protocols that particular packet again – this continues and destination IP addresses, are
help the internet to operate. The name until there is proof of delivery. combined to uniquely identify every TCP
comes from its two most well-known When a TCP connection is made connection. All these details are handled
protocols: TCP and IP. TCP stands for between two machines, a full duplex by TCP/IP as long as you provide the
Transmission Control Protocol, TCP virtual circuit, similar to a phone call, is required details without any extra effort.
software transmits data between created between those two machines. IP stands for Internet Protocol and
machines using segments, which are They constantly communicate to make it is not a reliable protocol by nature.
also called TCP packets. The main sure data is sent and received correctly. IP encapsulates the data that travels
characteristic of TCP is that it is a If the connection fails for some reason, over a TCP/IP network because it is
reliable protocol, which means that it the two machines try to find the problem responsible for delivering packets from
makes sure that a packet was delivered and report to the relevant application. the source host to the destination host
without needing any extra code from The TCP header of each packet includes according to the IP addresses. IP must
the programmer. If there is no proof the source port and destination port find an addressing method for sending
of packet delivery, TCP sends that fields. These two fields, plus the source a packet to its destination effectively.

www.techradar.com/pro/linux February 2023 LXF298   91


CODING ACADEMY Monitor networks

RADDR:RPORT STATE
15:32:40 0 4 192.168.1.7:39450 R> 93.184.220.29:80
SYN_SENT
15:32:46 0 4 192.168.1.7:50136 R> 194.63.247.211:443
FIN_WAIT1
The last column offers valuable information
because it presents the state of the TCP connection.
A high number of TCP retransmits is an indication of a
busy network, a network/hardware device problem, or
both. You might need to stress-test your local network
by downloading multiple large files from the internet
or other computers that belong to the same network
in order to find out how your network behaves under
heavy load. Additionally, you can use a tool such as AB,
which is the Apache HTTP server benchmarking tool,
Here you can see the output generated by the TCPrtt utility that calculates TCP RTT. to make multiple HTTP requests and see how your
network behaves.
RX_KB MS Using TCPretrans with the -c flag is going to
5867 ssh 192.168.1.7 47414 195.251.38.180 22 12 present a summary of retransmits as soon as you
6 1715.04 stop its execution by pressing Ctrl+C.
1080 skypeforli 192.168.1.7 54268 13.107.3.128 443 3
0 73.51 The TCPtracer utility
Because TCPlife generates lots of output, especially The TCPtracer tool traces TCP connections, which
when dealing with HTTP traffic, you might need to means that you should expect to get lots of output
filter the generated output on your own to be able to from it. Therefore, this should not be the first tool to
The status of a use it effectively. execute when trying to resole TCP issues. The kind of
TCP connection The TCPtop tool works like Top but for TCP output generated by TCPtracer is as follows:
from the client
connections. It shows a summary of TCP send/recv Tracing TCP established connections. Ctrl-C to end.
side can be one
throughput by host. The produced output of TCPtop T PID COMM IP SADDR
of SYN-Sent,
ESTABLISHED, looks as follows: DADDR SPORT DPORT
FIN-WAIT-1, PID COMM LADDR RADDR RX_KB TX_KB C 3169 pacman 6 [2a02:587:2f03:2300:c014:9781:d
FIN-WAIT-2 or 9032 b’sshd’ 192.168.1.7:22 192.168.1.3:63540 0 0 4b8:3455] [2606:4700:20::6819:5e05] 39498 443
TIME_WAIT. The If you execute TCPtop using the -C command-line C 3169 pacman 6 [2a02:587:2f03:2300:c014:9781:d
status of a TCP option, you can see all the presented information – this 4b8:3455] [2a0c:59c0:6::100] 54742 443
connection from enables you to process the collected data more easily. X 3169 pacman 6 [2a02:587:2f03:2300:c014:9781:d
the server side Type $ sudo /usr/share/bcc/tools/tcptop --help to see 4b8:3455] [2606:4700:20::6819:5e05] 39498 443
can be one of all the supported command-line options. X 3169 pacman 6 [2a02:587:2f03:2300:c014:9781:d
LISTEN, SYN-
4b8:3455] [2a0c:59c0:6::100] 54742 443
RCVD, CLOSE-
WAIT, LAST-
TCPaccept.bt and TCPretrans The previous output shows the IPv6 connections
ACK, CLOSED As its name suggests, TCPaccept.bt traces successful (the x:x:x:x:x:x:x:x addresses) created by Pacman (the
or CLOSING. accept() system calls. The kind of output you should Arch Linux package manager) when running an update.
expect from TCPaccept.bt is as follows:
$ sudo bpftrace /usr/share/bpftrace/tools/tcpaccept.bt Netqtop and Gethostlatency
TIME PID COMM RADDR RPORT LADDR LPORT BL The Netqtop utility traces the kernel functions
23:33:17 524 sshd 127.0.0.1 50662 127.0.0.1 22 0/128 performing packet transmit and packet receive on
23:33:38 524 sshd 192.168.1.3 56962 192.168.1.7 22 0/128 the data link layer, which is the reason that it needs a
The reason for using TCPaccept.bt instead of the network interface to operate. On a Lenovo ThinkPad,
BCC version (TCPaccept) is because TCPaccept does for instance, the name of the Wi-Fi interface is
not print any output, which looks like a bug that might wlp0s20f3. So, we are running Netqtop using the
be fixed in future versions. --name wlp0s20f3 command line argument. The
Output in the form
of a histogram The TCPretrans tool traces TCP retransmits. The generated output looks as follows:
generated by a generated output looks as follows: $ sudo /usr/share/bcc/tools/netqtop --name wlp0s20f3
BCC one-liner. TIME PID IP LADDR:LPORT T> Thu Jun 23 22:28:49 2022
TX
QueueID avg_size [0, 64) [64, 512) [512, 2K)
[2K, 16K) [16K, 64K)
0 338.0 0 2 1 0 0
Total 400.0 0 1 1 0 0
RX
QueueID avg_size [0, 64) [64, 512) [512, 2K)
[2K, 16K) [16K, 64K)
0 52.0 2 0 0 0 0
Total 52.0 2 0 0 0 0
This is pretty low level information that can be
handy when you suspect that there might be an issue

92    LXF298 February 2023 www.linuxformat.com


Monitor networks CODING ACADEMY

APPROACHING NETWORKING ISSUES


All the tools you need are here – usually more than we need – but
how do you approach a networking issue rationally? Such a strategy
might include the following steps:
1. Begin by trying to understand your issues using some of the
traditional Unix tools. Usually, Netstat, Tcpdump or WireShark are all
you need to get a better idea of what’s wrong.
2. Get statistics about open TCP/IP connections, packets and
connection rates. Use tools such as Netstat and SS.
3. Check the network interfaces of the system. Especially the
utilisation percent of each network interface.
4. Look for DNS issues – DNS can create nasty and difficult-to-find
TCP/IP errors. Use tools such as Host, Dig and Nslookup.
The output from two BPFtrace one-liners, the first working with 5. Calculate network latency. If needed, create synthetic traffic.
“tcp_sendmsg” and the second working with “udp_recvmsg”. 6. Start using eBPF tools to go deeper into your search. This
includes tracing new and existing TCP connections.
with one of your network interfaces. TX is for data 7. Keep looking – please look for DNS issues one more time!
sending, whereas RX is for data receiving. 8. Try WireShark or Tshark to look into actual TCP/IP traffic.
In the previous output, it looks as though the Generally speaking, networking issues can be from fairy simple to
network interface is working without any issues. extremely difficult to resolve, so please be patient.
However, the most accurate criterion is to try the tool
on a regular basis to get a better understanding of
what ‘normal’ and ‘working’ look like for a given Linux work with TCPv4 and tcp6* to work with TCPv6.
machine in order to better recognise abnormal The second one-liner counts TCP retransmits:
situations, which is a great tactic in general. $ sudo /usr/share/bcc/tools/funccount ‘t:tcp:tcp_
The Gethostlatency utility traces the latency of DNS retransmit_*’
calls by generating output in the following format: The final BCC one-liner calculates the UDP sent
TIME PID COMM LATms HOST bytes using a histogram:
18:09:00 1295 ThreadPoolForeg 27.06 static.asm. $ sudo /usr/share/bcc/tools/argdist -H ‘p::udp_
skype.com sendmsg(void *sk, void *msg, int size):int:size’
18:09:00 1295 ThreadPoolForeg 22.14 static-asm. The screenshot (bottom-left) shows sample output
secure.skypeassets.com from the previous one-liner, which can give you a very
18:11:39 12715 ssh 0.71 uop good idea of the UDP traffic on your system.
18:11:53 12752 pacman 647.72 cdn.repo.
archlinuxcn.org Bpftrace one liners
What does the output tell us? First, it tells us that Finally we’re going to present some handy Bpftrace
Skype keeps asking DNS questions even though it is one-liners. The first one counts TCP sends and
not being used on a call. Then, it tells us that the uop receives per application and process ID, and generates
hostname is resolved extremely fast, which makes the following kind of output:
perfect sense because it is hardcoded in /etc/hosts. $ sudo bpftrace -e ‘k:tcp_sendmsg,k:tcp_recvmsg { @
Last, it informs us that it takes 647.72ms to resolve the [func, pid, comm] = count(); }’
address of cdn.repo.archlinuxcn.org, which is pretty Attaching 2 probes...
slow. We can do many things based on the previous @[tcp_sendmsg, 1365, skypeforlinux]: 1 WireShark is
information. First, close Skype, second, put cdn.repo. @[tcp_recvmsg, 9613, sshd]: 1 the ultimate
tool for looking
archlinuxcn.org in /etc/hosts, third, find a different way @[tcp_sendmsg, 9613, sshd]: 1
into TCP/IP
to make its resolve time much faster because this host @[tcp_recvmsg, 1365, skypeforlinux]: 3
traffic and
is used for updating Arch Linux. Once again, Skype for Linux generates traffic in analysing
As mentioned before, DNS can create difficult-to- order to check for updates on chats. The second one- network traffic
find networking issues, so having a tool for calculating liner generates a histogram of TCP send bytes: of almost
the latency of DNS host resolution can be pretty handy. $ sudo bpftrace -e ‘k:tcp_sendmsg { @send_bytes = any kind. You
hist(arg2); }’ can learn
BCC one-liners The final Bpftrace one-liner generates a histogram more about
Here are some handy BCC one-liners. The first counts of UDP receive bytes: WireShark at
all UDPv6 functions and generates this kind of output: $ sudo bpftrace -e ‘k:udp_recvmsg { @send_bytes = www.wireshark.
org and by
$ sudo /usr/share/bcc/tools/funccount ‘udp6*’ hist(arg2); }’
looking at its
Tracing 13 functions for “b’udp6*’”... Hit Ctrl-C to end. You have learned a great deal about using eBPF
documentation
FUNC COUNT for TCP/IP connections and your horizons have been site at https://
b’udp6_proc_exit’ 5 expanded a lot. However, you are going to forget them www.wireshark.
b’udp6_proc_init’ 13 if you do not run and experiment with the presented org/docs/.
You can use udp_* to work with UDPv4, tcp_* to commands on your own.

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

www.techradar.com/pro/linux February 2023 LXF298   93


CODING ACADEMY Cataloguing app

PYTHON/DJANGO
Credit: www.djangoproject.com

Finish your
Part Three!
Don’t miss
last issue,
order it on

cataloguing app
page 68!

With a tear in his eye, Matt Holder finishes up our cataloguing


database app by adding search and export functionality.

n this series of articles, we’ve been working on

I a cataloguing application, where magazines,


newspapers and corresponding articles can
be added, stored and eventually searched. In parts
one and two, we introduced Django, described some
OUR basic database theory, created our database models,
explored the built-in shell, added some URLs and
EXPERT created some views and HTML pages to view output
Matt Holder from the software. We also explored the admin
has been a interface, which allows data to be added and deleted.
fan of the In this final article, we’re exploring the forms
open source functionality, which allows for HTML forms to be added
methodology to our web pages to provide data entry, and then we’re
for over two creating a page to enable us to search the database
decades and and return articles, authors and publications.
uses Linux and A completed project can be downloaded from
other tools GitHub (see the QuickTip, below-left) and contains the
where possible. functionality discussed in the three articles and more.
In his spare First, let’s create a search page. This will consist of a
time, Matt URL to link against the Python view, a Python view to
enjoys listening provide the functionality to search the database, and
to music an HTML page to display results. This will also use the By the end of this project, we will have reproduced this functionality.
and reading. forms functionality to provide the text and other fields
before taking the input and using it in search queries, HTML template there is a template item called {{form}}
and then the data will be output and displayed in the which is included and this ensures that the fields within
browser, along with links to open the original record. the ModelForm object are drawn on the page. Opening
Before entering the URL into the browser, make and closing the <form> tags are done within the HTML
sure you enter python ../manage.py runserver into the template as well as including the URL to post data to as
terminal, then the built-in web server is invoked. well as adding the Submit button.
When using forms in Django, there are some key First we need to add a URL to the urls.py document.
terms we need to know about. A form can be bound or The code below needs to the urlpatterns list:
unbound. An unbound form doesn’t contain any data, urlpatterns = [
More feature- while a bound one does contain data, which can be …
packed source processed by a view. The flow of using a form is as path(‘search/’, views.search, name=’search’),
code for this
follows: firstly a ModelForm object is created in forms. ]
project can be
py, which contains any fields that we want to gather Next, we need to create forms.py and add some
downloaded
from https:// data on. In this case, there are entries for the search code, which enables us to create our search form:
github.com/ term, a choice field to determine which database table from django import forms
mattmole/LXF- or model to search, and a button that allows for a fuzzy class SearchForm(forms.Form):
Django-Project. search. Next, an instance of this ModelForm needs to typeChoices = [(‘TAGS’,’Tags’),
be created in our search view, which is in views.py. The (‘ARTICLES’,’Articles’), (‘AUTHORS’,’Authors’),
ModelForm object is then passed into our context (‘PUBLICATIONS’, ‘Publications’),
object when loading the HTML template. Within the (‘PUBLISHERS’,’Publishers’), (‘ALL’,’All’)]

94    LX298 February 2023 www.linuxformat.com


Cataloguing app CODING ACADEMY

searchTerm = forms.CharField(label=’Search Term’,


max_length=100,required=False)
searchModel = forms.ChoiceField(label=’Area to
Search’, choices=typeChoices)
fuzzySearch = forms.BooleanField(label=’Fuzzy
Search’,required=False)
The format is very similar to that of a model. This is
because models and form objects can work hand in
hand and deal with similar sorts of information. First of
all, we import the necessary libraries and then define a
class, which inherits from the forms.Form library. We
then create a list of tuples to be used for a multiple-
choice field. In each tuple, we have a human-readable
value and a value that is used in the POST data that
gets passed to the model. Next we define an object for
each form item, which will be shown on the screen. searchResults = None A search page used
Each object is then linked to a HTML form object. if fuzzySearch == True: to provide criteria
for database
In the next code, we can see the HTML included in if searchModel == ‘TAGS’: searching.
the search.html file, which needs to be added to the if searchTerm == “” or searchTerm == “*”:
Catalogue/templates/Catalogue directory. tagResults = Tag.objects.all()
<!DOCTYPE html> else:
<html lang=””> tagResults = Tag.objects.filter(tagName__
<head> contains = searchTerm)
<meta charset=”utf-8”> searchResults = tagResults
Custom
<title>List of Tags</title> elif searchModel == ‘ALL’: validations can
</head> if searchTerm == “” or searchTerm == “*”: be included
<body> searchResults = chain(Tag.objects.all(), when writing
<h1>Search the Database</h1> Article.objects.all(), models:
<p>All results will be shown for a given model or Author.objects.all(), https://docs.
all models by using the fuzzy search option and leaving Publication.objects.all(), djangoproject.
the searchTerm blank or using the * character</p> Publisher.objects.all() com/en/4.0/
<form action=”{% url ‘search’ %}” method=”post”> ) releases/4.0
/#functional-
{% csrf_token %} else:
unique-
{{ form.as_p }} searchResults = chain(Tag.objects.
constraints.
<input type=”submit” value=”Submit”> filter(tagName__contains = searchTerm),
</form>
</body>
</html> CUSTOM VALIDATIONS
What’s happening here is that the Jinja-templated
HTML is being used to build a page containing the When creating the model for tags, as explained in article one of the
usual <head> information and then in the <body> we series, the only field that is required to be unique is that of the id
add a <form> tag, add a CSRF token to invoke the built- value. Interestingly, when defining the mode, the id field does not
in Cross Site Request Forgery support, render the form need to be defined, because this is automatically included by the
from the view code (see below) and then add a Submit database ORM. This means that multiple tags of the same name
button, before we close all the necessary tags. can be added to the database, which isn’t optimal. When creating
The next stage is that we need to write the Python the models, fields can have the unique=True option set. While this
code to link the URL to the program logic, which is is a step closer to what we want, it would not stop two tags being
used to both render the empty search form and then registered with the same name, but different casing of the letters.
take the submitted data and perform a database This is where custom validations become useful. See the Quick Tip
search. Add the function below to the views.py file. (above) for further information, but to ensure that only one tag,
from .forms import SearchForm representing Linux, can be added to the database, a constraint like
from itertools import chain the one below needs to be added to the model.
def search(request): class Tag(models.Model):
# if this is a POST request we need to process the tagName = models.CharField(“Tag”, max_length = 20)
form data tagDescriptor = models.CharField(“Description”, max_length = 200,
if request.method == ‘POST’: blank=True)
# create a form instance and populate it with data
from the request: class Meta:
form = SearchForm(request.POST) constraints = [
# check whether it’s valid: UniqueConstraint(
if form.is_valid(): Lower(‘tagName’),
searchTerm = form.cleaned_data[‘searchTerm’] name=’tagNameUnique’,
searchModel = form.cleaned_ ),
data[‘searchModel’] ]
fuzzySearch = form.cleaned_data[‘fuzzySearch’]

www.techradar.com/pro/linux February 2023 LXF298   95


CODING ACADEMY Cataloguing app

Article.objects.filter(articleName__ so on. In this part of the function’s logic, we also


contains = searchTerm), determine whether the fuzzy search option has been
The reportlab Author.objects.filter(authorName__ selected. The difference here is that instead of using
library can contains = searchTerm), Tag.objects.filter(tagName = searchTerm) to return
be used to Publication.objects. objects that match exactly, we use Tag.objects.
generate PDFs filter(publicationName__contains = searchTerm), filter(tagName__contains = searchTerm) to return
for output: Publisher.objects.filter(publisherName__ objects that contain the search term. Also, when using
https://docs. contains = searchTerm) the model type of ALL, we need to be able to search all
djangoproject. ) models for relevant objects. To accomplish this, we test
com/en/4.1/
else: for a modelType of ALL and then perform a database
howto/
if searchModel == ‘TAGS’: search in all models and use the chain function to join
outputting-
pdf/. tagResults = Tag.objects.filter(tagName = them all together, so that all results are stored in one
searchTerm) object, which can be passed to the search results page.
searchResults = tagResults Finally, when returning the search results, we
elif searchModel == ‘ALL’: construct a context dictionary, which contains the
searchResults = chain(Tag.objects. search results, and then use the HttpResponse
filter(tagName = searchTerm), function to render the searchResults.html template,
Article.objects.filter(articleName = while also giving it access to the search results data.
searchTerm), Should the function be called from a GET method, we
Author.objects.filter(authorName = simply render the search.html template because there
searchTerm), has been no data provided to the function and we are
Publication.objects.filter(publicationName = rendering the form, ready for the user to fill in.
searchTerm), Now that the logic has been described to allow
Publisher.objects.filter(publisherName = the database to be searched, we need to create the
searchTerm) template that will render the database results. You
) need to create a file called searchResults.html in the
template = loader.get_template(‘Catalogue/ Catalogue/templates/Catalogue directory and add
searchResults.html’) the following contents:
context = { <!DOCTYPE html>
‘searchResults’: searchResults <html lang=””>
} <head>
return HttpResponse(template.render(context, <meta charset=”utf-8”>
request)) <title>List of Search Results</title>
# if a GET (or any other method) we’ll create a blank </head>
form <body>
else: <h1>List of Search Results</h1>
form = SearchForm() {% if searchResults %}
return render(request, ‘Catalogue/search.html’, <table>
{‘form’: form}) <thead>
The first thing that we have to do, within this <tr>
function, is to determine whether it is being called <th>Result Type</th>
using the POST or GET method. We test this then add <th>Result Name</th>
the necessary function logic to search the database </tr>
based on the conditions shown in the data passed </thead>
into the function. This data is being described in the {% for result in searchResults %}
searchTerm, searchModel and fuzzySearch variables. <tr>
Next we use the searchModel variable to determine <td>{{result.modelType}}</td>
which database queries to run. Printed here is a cut- {% if result.modelType == “Tag” %}
down function, due to space constraints. When <td><a href=”{% url ‘tag’ result.id %}” >{{ result.
Searching the
database for all
selecting the Tags option in the search form, a tagName }}</a></th>
tags provides a database query runs to return Tag objects, when {% elif result.modelType == “Publication” %}
table of results. Articles is selected, Article objects are returned, and <td>{{ result.publicationName }}</th>
{% elif result.modelType == “Publisher” %}
<td>{{ result.publisherName }}</th>
{% elif result.modelType == “Article” %}
<td>{{ result.articleName }}</th>
{% elif result.modelType == “Author” %}
<td>{{ result.authorName }}</th>
{% endif %}
</tr>
{% endfor %}
</table>
{% else %}
<p>No results are available.</p>
{% endif %}

96    LX298 February 2023 www.linuxformat.com


Cataloguing app CODING ACADEMY

TESTING FOR RELIABILITY


While not the most exciting thing in the world, testing is crucial to
ensure that our programming projects work as they are intended.
While the example we have been working on for the last few months
is relatively simple, getting into the habit of testing is a really good
thing. So, do as your author says and not as he does! This is where
unit tests are really important. Unit tests are a way of creating
automated tests to ensure that a given input to a function returns
the correct result. A good example of this would be to ensure that
it is not possible to create two tags with the same name. The first
attempt to create the new tag should be successful and the second
time should return a failure. Another example of a unit test is that
Data can be exported from the database in many different when adding a publication with a type that is not in our list of
formats, with this example showing CSV. choices, it should return a failure. You can learn more about unit
tests at the following two web pages: https://docs.djangoproject.
</body> com/en/4.1/topics/testing/overview/ and https://docs.
</html> djangoproject.com/en/4.1/intro/tutorial05/.
As in previous template files, we first of all add the
usual boilerplate HTML to define the language type
and <head> information. Within the <body> tags, we To invoke this code, in the browser, visit
first of all test if data is available. If it isn’t, a message is http://localhost:8000/catalogue/exportTags.
rendered. If search results are available, we add them import csv Adding CSS
to a table within a new row. As the search results can def exportTagsToCsv(request): to style the
be from a range of different database objects, the tagList = Tag.objects.order_by(‘-tagName’) site is easy:
required URL to view information about the result response = HttpResponse( https://docs.
djangoproject.
needs to be known. This is handled using the result. content_type=’text/csv’,
com/en/4.1/
modelType variable from within the template. This headers={‘Content-Disposition’: ‘attachment;
intro/
data is provided by adding a function to each model filename=”exportTags.csv”’}, tutorial06/.
in the models.py file, where the function returns the )
name of the model/class. This simple function, when writer = csv.writer(response)
added to each model, accesses internal information writer.writerow([‘Tag Name’,’Tag Descriptor’])
about the class, so that the result type can be returned. for tag in tagList:
def modelType(self): writer.writerow([tag.tagName, tag.tagDescriptor])
return self.__class__.__name__ return response
When the search button has been selected, a page, In this code entry, we are first of all exporting all Tag
like the one in shown (below-left), is displayed. Test objects from the database and sorting it in reverse
this by opening a web browser and visiting http:// alphabetical order. We then create a response object,
localhost:8000/catalogue/search. where we set the content_type and headers, so that
In this final part of the article, we are creating the the browser knows to expect a CSV file, rather than
logic required to be able to export data from the HTML content. Next we create a csv.writer object,
database into a CSV file. Even though there are which is linked to the response object, which we return
hundreds of file formats that can be used to export at the end of the function. The next step is to write a
data, all the way from XML to JSON, a CSV file can still row to the writer object, which contains the column
be incredibly useful and can be used in many different headings. Next, we use a for loop to output the tag’s
applications. The first thing that needs to be done is for name and tag’s description for each item in the
another item to be added to the urlpatterns list within database. Finally, we return the response object. When
the urls.py file, within the Catalogue directory. the above URL is visited, a CSV file is downloaded.
urlpatterns = [ Available on GitHub (see Quick Tips, page 94), there
… is a second method that allows data to be exported as
path(‘exportTags/’, views.exportTagsToCsv, CSV. This uses JavaScript to read the values of the
name=’exportTagsToCsv’) results table and generates a CSV file, which can be
] downloaded. This second method is functional, but
You can see an example of the CSV export from could run into issues, should the table be so large that
the database (above). While the code detailed below is the JavaScript uses a large amount of memory.
specifically for tags, it could easily be generalised to The aim with this series of articles has been to
allow a choice of model to export from and then the introduce some useful concepts, such as database
export routine processes accordingly. theory, ORMs and the link between our models, views
Within the views.py file, add the exportTagsToCsv and controllers. We hope that you have enjoyed the
function, save the file and this then provides a link series and can now envisage how to use the concepts
between the URL we registered and this logic. learned in your own projects.

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

www.techradar.com/pro/linux February 2023 LXF298   97


NEXT MONTH
The #1 open source mag

Future Publishing Limited,


Quay House, The Ambury, Bath, BA1 1UA
Email [email protected]
EDITORIAL
Editor-in-chief Neil Mohr
Art editor Fraser McDermott
Production editor Katharine Davies
Group editor-in-chief Graham Barlow
Group art director Jo Gulliver
Editorial contributors
Mike Bedford, Denise Bertacchi, Jonathan Bolding,
Neil Bothwick, Anj Bryant, Nate Drake, Karsten
Günther, Christian Guyton, Matthew Holder,
Christopher Lloyd, Jon Masters, Nick Peers,
Aaron Peters, Les Pounder, Michael Reed,

FREE
David Rutland, Mayank Sharma, Shashank Sharma,
Mats Tage Axelsson, Mihalis Tsoukalos
Cover illustration Magictorch.com
Ubuntu is a trademark of Canonical Limited. We are not endorsed
by or affiliated with Canonical Limited or the Ubuntu project.
Raspberry Pi is a trademark of the Raspberry Pi Foundation.
Tux credit: Larry Ewing ([email protected]).
Content production Adequate Media Limited

YOUR
ADVERTISING
Commercial sales director Clare Dove
[email protected]
Senior advertising manager Lara Jaggon
[email protected]
Head of commercial – technology Dave Randall
[email protected]
Account director Andrew Tilbury

PHONES!
[email protected]
INTERNATIONAL LICENSING
Head of print licensing Rachel Shaw
Linux Format is available for licensing and syndication.
To find our more contact us at [email protected]
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

Linux has the power UK 0330 333 4333 World +44 (0) 330 333 4333
Subscription delays: Disruption remains within UK
and international delivery networks. Please allow up

to help revive old to seven days before contacting us about a late


delivery to [email protected]

phones, keep them


CIRCULATION
Head of newstrade Tim Mathers
PRODUCTION AND DISTRIBUTION

secure and running


Head of production UK & US Mark Constance
Production project manager Clare Scott
Senior ad production manager Jo Crosby

the latest apps.


Digital editions controller Jason Hudson
THE MANAGEMENT

LXF299
Editorial director technology group Paul Newman
Content director Joe Cox
Head of art and design Rodney Dive
Design director Brett Lewis

will be on sale Commercial finance director Dan Jotcham


Printed by Wyndeham Peterborough, Storey’s Bar

Tuesday
Road, Peterborough, Cambridgeshire, PE1 5YS
Distributed by Marketforce, 5 Churchill Place,
Canary Wharf, London, E14 5HU

7th February www.marketforce.co.uk Tel: 0203 787 9001


Linux® is the registered trademark of Linus Torvalds in the US and other countries.

2023
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 © 2023 Future Publishing Limited or published under
licence. All rights reserved. No part of this magazine may be used, stored,

Get packing
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 Publishing Limited cannot
accept any responsibility for errors or inaccuracies in such information. You are

A new generation of packaging formats is upon us. Love


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

them or loathe them, we take them for a spin. 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 Publishing Limited and its licensees a licence to publish your

Algorithmic art
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

From fractals to AI, learn how computer pixels are transforming


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.

what we think of as art and how you can give it a go.


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.

Inside Fedora Silver Blue Future is an award-winning international media group and

Fedora is redefining the desktop distro, providing a more secure


leading digital business. We reach more than 57 million
international consumers a month and create world-class
content and advertising solutions for passionate

immutable filesystem, OSTree and Flatpak installs. consumers online, on tablet & smartphone and in print.

Linux next-gen gaming


Is the Steam Deck really that good and what can it do to replace
your desktop? We reveal all and have some fun!

98    LXF298 February 2023 www.linuxformat.com


.
9000 9027

You might also like