Professional Documents
Culture Documents
008 Escape Windows 060 Code a cataloguing 072 Write your own classic
How to set up and use the application in Python Pong game
extremely user-friendly Using Python and the Django Take a trip down memory
Windows alternative, framework, learn how to lane and create your own
Elementary OS create a web-based Pong-style game for all your
cataloguing app retro gaming needs
016 Free our software!
How the free software 064 Code an admin back- 076 Website and RSS feed
movement got started end in Django Python scraping
Continuing with our How to use Python to scrape
020 Retro emulation
cataloguing app, find out how information from a webpage
Relive your favourite retro
to create admin controls and and RSS feed, and perform
gaming memories
basic view functions basic analysis
028 Open-source RAW
068 Finish your cataloguing app 080 Build a club on the
photography
Finish up our cataloguing next-gen web
Explore Linux’s pro-level
database app by adding Assemble your first Web 3.0
tools for better photos
search and export app using Solidity and
032 Free your phone! functionality Javascript
Discover the benefits
of running Linux on
your phone
4
FREE YOUR
LINUX PROJECTS
PHONE!
to creating a WiFi router
096 Deck the hardware
Trick out the Valve
Steam Deck
Discover the benefits of
100 Get started photo-editing
running Linux on your phone
Edit photos like a pro
using GIMP
104 More fun with layers
and masks
How GIMP manages layers
108 Using enhanced
032
layer features
Look beyond GIMP’s
standard layers
112 Universal layer text effects
Attract attention with layer
text effects in GIMP
5
6
050
032
020
042
016
008
7
Features features
Essential
ave you finally had enough the Ubuntu LTS distro and its many for both testing and as a rescue
switch. First, Linux runs beautifully friendly flavour of Linux – Elementary software to replace the tools you use in
even on older hardware, so you can OS, recently updated to version 7.0 – Windows. You’ll also get an insight into
avoid the need for an expensive and without touching your main PC. You can how to take the next steps into your
unnecessary upgrade. Second, many run it directly from a Live disk (a Linux Linux adventure. Ready to finally escape
Linux distributions – and in particular install media that provides a full desktop Windows? Good, let’s get cracking.
8
Escape Windows
9
Essential features
Install Elementary OS
alongside Windows
You’ve made your choice – it’s time to install Linux alongside Windows.
ou’ve road-tested several flavours of Linux
10
Escape Windows
11
Essential features
12
Escape Windows
1 2 3
5 6
series of clearly labelled buttons divided into categories list of pinned apps grows, you may wish to prune or
such as Personal, Hardware and Administration. rearrange it. Removing apps from here is done by right-
Areas that are worth exploring include Security clicking and unticking Keep In Dock – the app can still
& Privacy, where you can find options for cleaning be accessed via Applications – while you can rearrange
your online history, locking your PC after a period of apps simply by clicking and dragging them.
inactivity and enabling the built-in firewall (disabled Ultimately, Elementary OS’s Pantheon desktop is Elementary OS’s
by default). Look out for a prompt to unlock certain simple to navigate and won’t leave you head-scratching. Settings panel
includes a range of
settings using administrator rights – this basically With the fundamentals now in place, it’s time to turn handy tools as well
means entering your personal user password to the page and start exploring your new operating system as configuration
gain the required access. Also take the time to visit in more depth. options.
Applications to set default apps, manage startup and
set permissions on an app-by-app basis.
Ultimately, though, take the time to browse all
settings or use the Search Settings search tool in the
top-right corner to try to track down a specific setting
quickly – for example, type dock to find settings
relating to the Dock, which you’ll subsequently discover
are found under Desktop > Dock & Panel.
Launch applications
The Applications menu in the top-left corner is where
you can browse all pre-installed apps – as with Settings,
there’s a handy search tool to help work through this
list, although you’ll see Elementary OS ships with only
the most basic apps. Double-click an app icon to launch
it, or right-click for more options, such as uninstalling
the app, viewing its entry in AppStore (to find out more
about it), and pinning it to the Dock for one-click access
direct from the desktop. Speaking of the Dock, as your
13
Essential features
Elementary has built-in support for Flatpak apps as well as its own AppCenter software store. Other install sources
Many apps are also hosted on what are known as
repositories, or repos. Elementary OS supports all
ESSENTIAL ELEMENTARY OS APPS standard Ubuntu repos, and this is often the quickest
way to install software. While you can install these
Let’s cut to the chase – you’re looking for apps to replace those you packages through the terminal using the apt install
use in Windows. Which ones come recommended? You probably command, you need to know their exact name. A
already know LibreOffice as a free alternative to Microsoft Office, simpler option is to install a separate package manager
while GIMP replaces Photoshop if you need more features than that sits alongside AppCenter. To do this, open the
those offered by the basic built-in Photos app. If Videos refuses to terminal and issue the following two commands:
play your media, try VLC Media Player instead. $ sudo apt update
Many of your favourite Windows apps have also been ported to $ sudo apt install synaptic
Linux, too – visit the program’s own website to confirm this, or try After installation, you can launch the Synaptic
the https://alternativeto.net website to find alternatives. package manager via the Applications launcher to
Finally, last but not least, open a terminal window and type the browse and search for software. You can even pin it to
following commands, one line after the other: the Dock if you use it frequently.
$ sudo apt install software-properties-common Some programs can be downloaded directly
$ sudo add-apt-repository ppa:philip.scott/pantheon-tweaks from the app’s own website – look for DEB files
$ sudo apt update (packages that are similar to Windows installer files)
$ sudo apt install pantheon-tweaks and AppImages (portable versions). To make installing
This installs a handy tool called Tweaks, which is placed in the DEB packages easier to manage, we recommend
Personal section of System Settings. This gives you greater control installing GDebi through Synaptic.
over the Elementary OS desktop – for example, to add a much- Before attempting to run any AppImage, you
needed Minimise button to application windows, navigate to Tweaks need to right-click it in Files and choose Properties >
> Appearance, then scroll down and change Layout under Window Permissions before clicking Execute under Owner
Controls to Add Minimize Left. to change the permissions to 764. Click Close, then
double-click the file and the app should open.
14
Escape Windows
GO FURTHER IN ELEMENTARY
15
Features features
Essential
Free our
SOFTWARE!
Taking anything for granted is
dangerous, so Jonni Bidwell and
Mike Saunders revisit how the free
software movement got started to
help free us from proprietary tyranny!
TIMELINE
Prehistory – Linux Answers May 2000 – Linux Format #1
In late 1999, Future plc published a Renaming the title in line with Future’s
one-off magazine. This was borne off most successful print magazines,
the back of the success of the now- Amiga Format and PC Format, Linux
closed PC Answers and PC Plus [the Format was released with editor Nick
flashbacks! – ed]. All we’ll say is that Veitch of Amiga Format fame and
this was successful enough to launch writing talent from PC Plus mag. It
a monthly magazine… came with a CD and was an instant hit.
16
The free software movement IN DEPTH
17
Essential features
TIMELINE
February 2003 – January 2005 – LXF061 October 2006 June 2008 –
LXF037 LXF ran its Best Distro feature and – LXF084 LXF106
We asked, possibly Mandrake easily won, with poor The last major Boy genius
for the first time, is this the year Ubuntu coming joint ninth. Some redesign of LXF landed there Paul Hudson was promoted
of Linux on the desktop? We chap called Graham Morrison was another in LXF236, with to editor/high commander
said: “I expect 2003 to be a real started as staff writer and we ran the odd section change. The and we put the Asus Eee
breakout year.” We reviewed Ubuntu on the LXFDVD for the first LXFDVD was also moved PC centre stage. Jonni’s is
LindowsOS 3.0 and Unreal 2003. time, alongside Fedora Core 3. inside the mag. still running Arch Linux…
18
The free software movement IN DEPTH
LXF: Many use the term ‘free software’, some use ‘open source’. the Digital Millennium Copyright Act in the US, which censors
RMS: That’s different. Open source refers to different ideas free software that you can break digital handcuffs with. The
– a different philosophy. And the difference is fundamental, European Union has similar laws. Both the US and the EU try
because it’s at the level of values. It’s not a disagreement over to push nasty laws like that on to other countries, through
some detail; it’s a disagreement over the most basic thing. We treaties that they ask them to sign. So these are malicious
are aiming for a free society, where users have freedom. Open governments. Then there are the obstacles created by
source organisations say they’re aiming for better-quality code. manufacturers, working together often with Microsoft.
These are as far apart as you can get, because we’re saying it’s
for freedom and social solidarity; they’re saying it’s for quality. LXF: One of our readers wanted to ask: is a world of only free
software still feasible? Should that still be the ultimate goal?
LXF: But if you can ease a company that makes proprietary RMS: Yes, it’s the goal, I think. That’s my goal. Now, it may be
software into the idea of open source, by talking about the impossible to totally eradicate the last little bits of non-free
benefits of quality, perhaps you can expand to free software… software. After all, in almost 200 years of abolitionism, we
RMS: In fact, when the open source philosophy spreads a lot – haven’t eliminated slavery.
which it has – it tends to close people’s minds to the ideas of
free software. It even tends to cover up our existence. Most LXF: A lot more people are using smartphones and tablets as
of the articles that talk about the GNU system don’t call it the their primary computing platforms, with their app stores…
GNU system and don’t call it free software. They describe it as RMS: That doesn’t change anything, really. A smartphone is a
open source, and give the impression that we – its developers computer. So, everything we say about computers, that the
– agree with the open source ideas that readers have heard of, software you run should be free – you should insist on that –
and you’d never guess at what we really stand for. applies to smartphones just the same. And likewise to tablets.
What should we say about those app stores? First of all, the
LXF: When some people hear ‘free software’, they think of Apple App Store forbids free software. It only allows non-free
rubbish spyware on Windows machines. software. This shows how evil it is. But remember, it’s on the
RMS: It took me time to recognise that this distinction was vital. basis of a non-free operating system. If you want to live in
In 1983, when I announced [GNU], I hadn’t separated these freedom, you need to not just insist on apps that are free, but
concepts. It took a few years. So again, in the GNU Manifesto, to insist on an operating system that’s free, too.
posted in 1985, there’s still some confusion between the two The source code of Android is free as Google releases it,
meanings of ‘free’. After that I became aware of the need to but it uses a non-copyleft licence, except for the case of Linux
emphasise that it’s free as in freedom, not free as in price. – which is under GPL v2. The result is that the licence doesn’t
I notice there’s a statement here in your magazine [LXF143] protect the users from lockdown, or Tivoization – which is the
about LibreOffice, which is an important illustration. Sun practice of making a free program’s executable non-free, by
acquired StarOffice and released it as free software under the stopping the user from installing and using his own version.
name OpenOffice.org. But the people at Sun who did this were
not supporters, politically, of the ideas of free software. They LXF: There’s still a battle going on here to win the minds of a lot
were open source supporters. So their goal was to make their of people – they don’t even know what source code is.
program good quality and a success – not to give the users RMS: Absolutely.
freedom. That wasn’t their goal, although since their source
code was free software, it did respect the user’s freedom, but LXF: It’s a case of trying to find the right approach…
they weren’t thinking about it in those terms. So they made a RMS: I use the analogy of recipes. Cooks cook recipes freely,
list of extensions, and in it they put proprietary extensions. they study and change them when they wish, they redistribute
This shows that people who don’t think about or value copies, and if they make a modified version, they might
freedom can do things for other reasons that help freedom. distribute copies of their version. So imagine if businesses
But you can’t count on it. Sometimes it suits people’s motives and the state decided to impose proprietary recipes. Suppose
better to do things that work against our freedom. the state said: starting tomorrow, if you copy or change your
recipe, we will put you in prison and call you a pirate. Imagine
LXF: What is the biggest threat to free software in 2011? how angry all cooks would be. A lot of people who don’t know
RMS: There are several. There are legal prohibitions, such as anything about programming will understand this. The state
software patents in some countries that have foolish policies. hasn’t tried to do it with recipes – but that’s exactly what it’s
And there are laws that censor free software explicitly, such as tried to do with software.
19
Essential features
The Linux Format team all have their favourite retro memories,
and Jonni Bidwell is here to regale y’all with them.
e’re not saying our readership There are thousands Emulators abound for the machines
20
Retro emulation
21
Essential features
No 10 pences required
If you want to go all out though, get yourself a Picade
mini arcade cabinet from Pimoroni. The good pirate-
monkey-robot-ninjas at the Sheffield-based Pi
emporium were good enough to send us one, and we
can honestly say it’s a marvel of engineering. It’ll take a
couple of hours to build, but there are thorough
instructions (see https://learn.pimoroni.com/article/
assembling-your-picade). Once you’ve built it, you can
play games on its eight- or 10-inch screen with a quality
SETTING UP RETROPIE
22
Retro emulation
Legal ROMs
RetroPie doesn’t include any ROMs
out of the box, so initially you’re only
presented with configuration options.
RetroPie does helpfully set up Samba
though, so you can copy content over
without removing the SD card. The roms
share should appear in your File manager
on another PC connected to the LAN.
Inside you’ll see folders for the many
platforms supported by RetroPie.
To test things out we’ll grab a ROM
CREDIT: Pimoroni
23
Essential features
Those magnificent
machines of the 1980s
The eight-bit machines managed to do a huge amount with just a
smidgeon of memory and CPUs that would faint looking at long division.
he Pi A and Pi B monograms are a tribute to the *exec !boot
Commodore 64
People are still creating demos and games for the
If you can get the legendary Commodore 64. Often these use imaginative
BBC emulator techniques to produce impressive effects that, according
working through to conventional thinking, wouldn’t be possible on such
Mess, then you modest hardware. Even in its heyday many of the demos
may find yourself
with the Repton
exploited undocumented features (okay bugs) in the
soundtrack stuck 6502 CPU or VIC-II chip to do weird and wonderful
in your head. things. Even if used within operational parameters, the
ANATOMY OF RETROPIE
RetroPie is itself just a bundle The glue that binds everything installation with RetroPie. That’s what
comprising Pi builds of Emulation Station together, in a sense, is the RetroPie the first option (“Basic install”) is for.
(ES – the GUI frontend), RetroArch (a Setup Script. This is what handles all the Another important script is
frontend which some of the emulators package management, including adding Runcommand, which tells RetroPie which
plug into, the one with the funky green custom emulators as you might have emulator and options with which to run a
retro menu in-game) and the emulators done for the BBC Micro above, and as particular ROM. You can configure this
themselves. The emulators that integrate you might do for the Amiga and Atari ST by pushing any button when launching a
with RetroArch (or rather its libretro over the page. It can also be used to game. Options can be set for a particular
library) are known as “libretro cores”. augment a standard Raspberry Pi OS system, or in a ROM-specific way.
24
Retro emulation
MODERNISING GRAPHICS
Some of the machines we’ve emulated game) and select Resume. You should working after changing shader settings,
here did an awful lot with not an awful lot see that those jagged edges are a lot less but returning to the controls menu (or
of pixels. There’s a certain charm to jagged, and the fonts are much nicer too. restarting the game) seemed to fix it. If
playing games at their original resolution, There are all kinds of filters available, it’s any consolation, much worse things
but on a powerful system it’s possible to and they’re not all about improving happened on the original hardware.
do high-quality image resampling and the look. Some of them are quite
upscaling on the fly. If you summon the demanding, especially on early model
in-game RetroPie menu and scroll down Pis. Some of them, however, have been
you’ll find a submenu entitled Shaders. designed to be sparing on resources. In
Select Load and you’ll see a list of all particular the crt-rpi* and crt-blurPi
kinds of graphical customisations shaders were written in order to make
(implemented as OpenGL Shaders) that authentic-looking cathode ray tube
can be applied. Try selecting the effects that even an original Raspberry
2xScaleHQ preset. Now return to the Pi can manage. We noticed that our It’s worth messing around with Retroarch shaders to
quick menu (no need to restart the emulated Spectrum keyboard stopped improve the look of your games
25
Essential features
16-bit hits
For many, us included, the golden age of computing
was characterised by the Amiga 500 or Atari ST.
ur favourite home computer was the from source. It
26
Retro emulation
fantastic (and open hardware, yay!) C64 fans might recognise those four
board, the work of Claude Schwarz, sits digits from Commodore’s 1541 external
in between the 68000 slot on the Amiga disk drive, which is exactly what it
mainboard and a Raspberry Pi. So emulates. Unlike the original, it’s neither
instead of chugging along at 7MHz your noisy, slow nor cumbersome. It enables
Amiga will be running an emulated you to load 170kb disk images from an
68EC030 running at around 70-80MHz. SD card, ideal if your 1541 has chugged There are a few different Pi1541 designs on the
Furthermore, the Pi can share up to its last. Read more about the Pi1541 at market. This one, which is available at https://
128MB of its memory, which the Amiga https://cbm-pi1541.firebaseapp.com. myretrostore.co.uk, has a fetching OLED display.
27
Essential features
Plasticity, radiant
highlights and
precise control of
lighting effects in
this way are really
only possible with
RAW photography.
Open source
RAW photography
Linux offers all the pro-level tools you could possibly need for
better photos. Karsten Günther is your top-tips guide.
rofessional photographers only use RAW
• HDR images can be created from one RAW photo,
•
search provides of dealing with the subject and taking RAW photos: only shows the preview images embedded in RAW
access to all For landscape photography, good illumination must images, not the RAW data.
EXIF tags. In the be achieved across all tonal values, especially in Alternatively and complementary, DigiKam (www.
right sidebar, difficult lighting conditions; both the sky should have digikam.org) is the program for managing images
•
Filter offers structure, as well as the shadows in the foreground. under Linux. It reads virtually all RAW formats,
additional
With portraits, the overly smooth automatic mode evaluates the EXIF tags stored in the images and uses
options.
is deactivated, resulting in more realistic, vivid images. them for automatic management. In addition,
28
RAW photography
Geeqie
There are many good RAW viewers on Linux – Geeqie
stands out because it is particularly intuitive and easy
to use. The mouse wheel can be used to quickly scroll
through images, Ctrl+mouse wheel scales the display,
and Geeqie directly displays the preview images
embedded in RAW files. The preview images can
be displayed in the sidebar, new directories can be
created, and images can be moved or deleted with
the context menu. There are also functions to open
Geeqie is powerful
displayed RAW files directly in a RAW converter. quality can be determined automatically, and people and intuitive when
Geeqie has many additional functions, too, that we can be found and assigned to images. However, some displaying RAW
don’t discuss further here. Alternatives to Geeqie are of these functions are not yet fully developed. files, although
gThumb, XnViewMP or Okular. DigiKam is irreplaceable when it comes to searching the program was
actually developed
for images in large collections. In addition to the for displaying
DigiKam complete evaluation of filesystem data (file sizes, bitmap images.
This program is large, works with external databases, permissions and timestamps), all EXIF tags can be
manages over 100,000 images, and is rather accessed (for example, searching for “pictures taken
ponderous – at least, at the start. What makes DigiKam with ISO values greater than 1200”), geolocations (all
unique are its excellent functions for managing photos. pictures from the area) can be searched, if available,
Anyone who uses more than a few thousand the assigned keywords can be searched, and even
images knows how important it is to have good ways similarities to sketches can be used as criteria. With
of finding photographs again – as quickly as possible – Rawtherapee
and ART, it
after saving them. This requires a really powerful Converting is advisable
management tool. The EXIF tags of images – RAW files The main task of RAW converters is to convert the
to first set
are no exception – contain information about the time raw camera data stored in the RAW files into bitmap the exposure
the picture was taken and sometimes also about the images. However, the RAW converters available today with the two
geographical location, but there is usually nothing are not limited to this but also offer a variety of gradation
more immediately useful there. additional functions. For example, all of the RAW curves and
DigiKam is able to edit the EXIF tags as well as converters presented here are capable of batch then make the
write additional information into the image files. If this processing many images and also offer sophisticated corrections –
is not possible or desired – RAW files should not be management functions. The three RAW converters colours, spots
changed – DigiKam creates additional ‘sidecar files’ we’re discussing also allow processing of bitmap and so on.
for this information. Actually, editing EXIF tags is not
common either, but sometimes – for example if the
camera’s internal clock was set incorrectly – it can TAKING RAW PHOTOS
be immensely useful. The ability to tag pictures with
keywords is one of DigiKam’s most important features, Getting started with RAW photography is not difficult at all. It’s not
allowing quick retrieval later. DigiKam can also quickly even necessary to take RAW photos exclusively; all modern cameras
and easily take the position of the camera from tracks support a mixed mode where a RAW file is saved at the same time
created with an external navi. as the JPEG image that is normally produced. This gives beginners
DigiKam’s built-in RAW converter and image-editing the opportunity to directly compare their image developed from the
tools are mostly of modest quality, so it is better to RAW file with the taken JPEG image.
use the specialised tools for this. However, DigiKam’s In principle, care should be taken in digital photography to avoid
Image credit: Karsten Günther, Geeqie
good batch processing of images deserves a special overexposure. It is much more difficult to fix burnt-out highlights
mention. It enables you to quickly apply simple than to remove noise from too dark shadows, if that is necessary at
functions to lots of images at once. For example, it is all. Some noise often doesn’t even bother in the shadows. RAW
possible to use Lensfun to perform lens correction on photos utilise the full brightness resolution of the camera sensor,
a few thousand bitmap images in the background and typically 12 bits, which provides greater latitude for denoising.
then save the results under a new name in a new No thought needs to be wasted on white balance and effects
directory in a different format. DigiKam can also add (landscape, portrait, sharpen) when taking the photo. All this is taken
simple frames or watermarks, but an alignment of the into account later, in the RAW converter or image processing.
horizon or the brightness distribution in an image can RAW development requires practice, so it is good to work with one
not be achieved this way. RAW converter at first, to get to know it well and not be discouraged
Besides keywords, DigiKam supports many other by the first, often imperfect results. After all, the non-destructive
methods to mark selected images. There are the process is one of the great advantages of RAW development.
classic (star) ratings, colour marks and also flags. Image
29
Essential features
Lightzone
Lightzone is a formerly commercial (Java) program. It
offers relatively few functions, so is very easy to use
and it produces good results. A set of tutorials on
YouTube shows a number of features that are not
immediately obvious. Development is slow, so the
program can be considered stable and largely finished.
One of the very special advantages of Lightzone
compared to other RAW converters is the very easy
Complex, quite images in some selected formats, mostly JPEG and creation and editing of selections, here called regions.
intuitive and TIFF, sometimes also PNG. Processing with RAW They can be created quickly with the mouse, given a
extremely
converters is always non-destructive – the original soft edge and refined at any time. This is not so easy
useful: the image
management images remain unchanged. with other programs.
system DigiKam. The processing in the RAW converter is defined in Lightzone always saves all parameters relevant to
the form of recipes, in which the individual processing editing in the metadata of the images created. This
steps are described in detail. These recipes can be makes it possible to use one of these output images
quickly exchanged between several images. This for further processing at a later time and to generate a
makes it possible to first process one image of a series new version of the image from the original image.
and then use the same recipe to develop the next A practical example of the use of Lightzone is
images. If the conditions change during shooting, shown in the image below. Only three tools were
the recipe can easily be adjusted and is then available needed to generate the finished image from the
for the next images. Of the many RAW converters original photo. The RAW Adjustment and RAW Tone
available under Linux, three deserve special attention: Curve tools are always active and were used here with
Lightzone, Rawtherapee and Darktable. the default settings. Then the exposure was adjusted
All RAW converters presented here have two basic as well as possible with the standard Relight tool. A
modes: light table, in which the images can be viewed, second ZoneMapper darkened the background. To do
this, a region is created around the motif that is given a
soft edge. This region does not have to be exact; it is
RAW CONVERTERS sufficient if it does not contain the unwanted areas at
the edges. The region is inverted by the Invert Mask
Historically, DCraw by Dave Coffin (www.dechifro.org/dcraw/) was button in the Relight tool, and then it lowers the
the first free RAW converter under Linux. The program is available as brightness. As a result, the motif is already cut out. The
a pure command line program and initiated a development that led final touch is given by the SoftWow! tool to increase
to LibRaw (www.libraw.org). This library is used by modern RAW the contrast and moderately enhance the luminosity.
converters to read in and decode RAW files. With Lightzone, the order of the tools used plays a
UFraw was an early RAW converter developed mainly for GIMP, decisive role. If it is changed, the results change. This is
which is now replaced by Nufraw. It offers a simple GUI, but hardly not the case with Rawtherapee and Darktable.
any advanced features. Lightzone saves the order of all the tools used with
Lightzone (https://archive.org/details/lightzone4.2.0) is a their settings in the bitmap images created from them.
Java project that is free today. Although it only supports simple
processing, its usability and tools are very sophisticated. Rawtherapee and ART
Rawtherapee (www.rawtherapee.com) and variant ART (https:// Rawtherapee was also once commercial software, but
bitbucket.org/agriggio/art/wiki/Home) are classic RAW converters has been maintained as open source for years. Here,
with a whole range of important features. Performance and usability
are very good, and the programs are used intensively in production.
Image credit: DigiKam, Lightzone
30
RAW photography
to be able to harness its power. The now excellent satisfying to develop the stories contained in RAW
documentation helps immensely. Many modules are photos with the tools that are available today...
Rawtherapee is quality-conscious, powerful but not overloaded. It is Extremely powerful, extremely complex and relatively time-consuming
only updated relatively rarely and receives new tools even more rarely. to learn: Darktable, currently the most comprehensive RAW converter.
31
Essential features
YOUR PHONE!
can be sideloaded. Compare it with supposedly easier-to-understand license derivative. Next, we’ll explore running
Apple’s walled-garden, locked-down agreements, it’s difficult to comprehend ‘pure’ Linux in the form of UBports and
hardware approach in iOS, and you can what is being shared and how it’s used. PostmarketOS. If you’d rather not install
see why free software advocates might This has led to an orthogonal argument, a whole new OS, there are plenty of less
prefer to side with the Android camp. But that Apple (a fashion brand that makes risky measures you can take. Read on….
32
Linux on your phone
33
Essential features
Jump to LineageOS
Enjoy fully featured Android without all the proprietary bits.
AOSP, so custom ROM developers
must find another way.
LineageOS is the most popular
AOSP fork, having emerged from
the ashes of the almost-as-popular
CyanogenMod in 2016. LineageOS is
much easier to port to other devices
as the team has developed shims
and layers so that vendor blobs
can be used natively there. As such,
its official builds offer across-the-
board hardware support. So, newer
hardware can enjoy the latest
Android features without having to
wait for manufacturers’ updates.
And older hardware neglected by
manufacturers can stay secure.
In order to access the Play Store
and the plethora of proprietary
Xiaomi’s unlock tool makes you jump through all sorts of hoops. We used a burner SIM and throwaway email to register. programs there, users can add a
G-Apps package at install time. We
he Android Open Source Project is where strongly recommend trying life without G-Apps, but
34
Linux on your phone
35
Essential features
LineageOS desktop
1
5
Quick access settings Audio controls looks, select your choice of wallpaper and add
1 Entirely configurable, this pull-down 3 As devices have become ever active widgets such as the classic clock and
menu offers fast access to your most-used more proficient at handling media, so the media controls.
system settings. Toggle networks, data settings, requirement for finer control over that media
your torch and much more in just two actions. has grown. The slide-out audio control is one Notifications
step towards that, with better system, alarm 5 Modern app notifications can be a real
App drawer and notification settings. annoyance. While well-behaved programs offer
2 The aptly named Trebuchet launcher genuinely useful notifications – as seen here,
gives you swipe-up access to all your installed Control your home taking you directly to the relevant image for
apps. With people suffering app overload these 4 No, not that home – your mobile device’s editing – many are simply annoying. Long-press
days, there’s a handy search right at the top so home desktop. If you long-press on a blank to gain access to settings that can mute or limit
you can filter through to the one you need. area, you are able to configure how the home app notifications.
36
Linux on your phone
RASPBERRY PI
No one makes builds of The simplest way of trying out from the end of 2020, so remains
LineageOS for x86 PCs; they’ll LineageOS – if you don’t have a relatively recent.
point you in the direction of the suitable spare phone – is to crack A developer called Konsta
Android-x86 project – and rightly out your Raspberry Pi. Now, keeps a repository of non-
so. If you snoop around the there’s good news and bad news. commercial LineageOS builds for
LineageOS FAQ (https://wiki. So, the bad news is that if you the Pi. You can find a list and what
lineageos.org/emulator), you’ll want to try LineageOS 18.1 or they target at https://konsta
find detailed instructions on how newer, you need a Pi 4 with 2GB kang.com/tag/LineageOS/.
to compile your own emulator of memory – Google bumped Download the ZIP, extract the
that can run LineageOS rather the minimum specification just archive, check the md5 if you
slowly on a PC, but it’s aimed at recently to 2GB of memory. The like, and use dd or, for a GUI, use
CREDIT: Humax
developers and requires 32GB of good news is that for 1GB Pi 3 www.balena.io/etcher. Write the
memory and 300GB of space for and Pi 4 models, you can try image to a spare SD card and
the latest 18.1+ releases. builds of LineageOS 17.1 – this is boot your Pi with it. Simples!
37
Essential features
Install GNU/Linux
Touch base with Ubuntu Touch or branch out into PostmarketOS.
arly Nokia smartphones (notably the classic
38
Linux on your phone
(if indeed you’re using a Halium build – see box) version $ pmbootstrap install --add=networkmanager
of the build you’re trying to flash. You can check this on You’re asked for a password – note that this doubles
the device wiki. Check the documentation (https:// as a PIN for some interfaces (such as Plasma Mobile),
docs.ubports.com) once you are up and running. so it’s best if it only contains numbers at this stage.
Don’t worry – you can change this inside the system
First past the PostmarketOS later. So, let’s fire up our VM with:
If you want to run full-blown Linux on your phone, that is $ pmbootstrap qemu
with all the programs and UIs you’re (presumably) By default, the image is minimally sized, leaving only
running on your desktop PC (and ideally running an a little space for extra programs. Use the -image-size
upstream kernel), look no further then PostmarketOS parameter to change this. Our Plasma Mobile target
(PmOS). As the name suggests, the project’s primary builds a 4GB image, so we don’t need this. Note there’s
goal is to grant end-of-life devices a new lease of life. no sound in the VM; in theory, it should work if you add
Unless you have a PinePhone or Librem 5, there’s no --audio=pa , for example, to the previous command, but
official hardware support, though there are dozens of this did not work for us. Never mind, you should be
community-supported models (including the venerable presented with an odd-shaped window and a login
N900 and older Samsung Galaxies). Alternatively, you screen. Enter your PIN, then swipe (drag) left to open
can run it in a virtual machine (VM). Start by installing the Applications menu. Here you’ll find the Angelfish
PmOS’s bootstrapping utility, which isn’t yet in the browser, Elisa music player and a few things that don’t
Ubuntu repos (but is there on Arch, Debian and Fedora). work (such as Dialer and Megapixels, a camera utility).
Then we prepare our workspace for building the image: Do keep an eye on the size of the working directory
$ git clone https://git.sr.ht/~postmarketos/ by running:
pmbootstrap $ sudo du -sh ~/.local/var/pmbootstrap
$ cd pmbootstrap After getting to this stage, ours was already nearly
$ ./pmbootstrap.py init 14GB. It’s safe to delete everything in here when you’re
The SP Flash Tool
You’re asked for a working directory and then a done playing with virtual phones. But so that the effuses a sort of
release channel. The defaults should be fine, so hit chroots are all unmounted first, you need to run: espirit de ’95, but
Return to accept them. Next you’re asked for a target $ ./pmbootstrap.py shutdown for ancient phones.
device vendor, code name and kernel – happily, the
defaults build the required QEMU image. Then you’re
asked for a username and desktop environment. We’re
going with the rather slick plasma-mobile ; try sxso-
sway for the lightweight SXSO interface running on the
Sway Wayland compositor, or anything that takes your
fancy. Next you’re asked to confirm build options. Be
aware that building requires lots of free space in the
working directory, and that artefacts are all cached
(for faster rebuilding). So, you may want to tame some
settings here. The last questions we’re sure you can
figure out for yourself.
The next command prepares the chroots where
the system will build (so as not to interfere with
host packages). We’ll add in NetworkManager, but
networking can also be set up manually (in the VM itself
with PmOS’s setup-interfaces command) if you want a
lighter system:
39
Essential features
I running a Google-free
phone OS, you’ll
probably be wanting to get some
free (as in Mel Gibson shouting
“Freedom!”) apps. Even if you’re
still running Android and using
Play Store apps, the F-Droid
store is well worth checking out.
It’s easy to install – just visit
https://f-droid.org on a PC and
scan the QR code with a laptop.
This downloads the APK (the
Android package format), and
when you try to install it, you’ll A smorgasbord of glorious free software awaits you at the F-Droid store.
see a warning saying the browser
is not authorised to install unknown apps. This is A clearly labels such characteristics as Anti-Features,
Good Thing. Ordinarily, we’d never tell you to download though in a lot of cases they’re probably benign, it’s
and install APKs this way, but this an exception. You just there’s no way of knowing. So, if you place a
can check the PGP signatures if you are concerned. premium on privacy, avoid the Anti-Features.
You don’t need a Once you’re happy, you can grant your browser (called For a Google Maps replacement, look no further
Google Account to Browser on LineageOS, and Chrome on Android) than Organic Maps Offline. It uses data from
run Android; ignore
this warning. Think
permission on the next screen and install. OpenStreetMap to draw pretty maps and give sound
of all the tracking Before we look at F-Droid, let’s be sensible and directions. Don’t worry, you can use it online, too
you’ll subvert. revoke the browser’s permission to install software. Go (you’re prompted to download a local map to save
to Settings > Privacy Protection > bandwidth). In many cases, particularly cycling and
Special Permissions > Install walking paths, Organic Maps does better than Borg
Unknown Apps, then scroll down Maps. If you like to keep track of your runs, bike rides
to your browser and deactivate it. and joyrides, then a combination of OpenTracks and
Now we can explore and enjoy OSM Dashboard will provide at least the rudiments of
F-Droid. On first glance, it may your proprietary geotrackers. OpenTracks captures
not appear as exciting as the Play GPS data as you move around and OSM Dashboard
Store, or maybe that’s just because plots that data on a map for you.
it lacks brightly coloured ads and Amazingly, we’ve got this far without mention of any
apps screaming for your cash. The kind of mobile command-line interface. Let’s remedy
first thing you should do is refresh this by introducing Termux. This lets you incant Bash,
F-Droid’s cache, otherwise you’ll telecommunicate over SSH or even compile code, as
see an error when you try to install you would from your desktop terminal emulator.
your first app. Scroll down from the Termux even modifies the on-screen keyboard to
top and you’ll see an ‘Updating provide the extra keys so vital to hackers (cursors,
repositories’ banner. Ctrl). It includes a package manager, so getting started
Everything on F-Droid is with SSH (for example) is as simple as:
compiled from open source code $ pkg install openssh
by the F-Droid team, but it still may The pkg command is, in fact, a wrapper around
contain features that impinge on Debian’s Apt, with some tailoring to account for
your privacy. Free apps may still running on an Android base. This brings some
access proprietary services, where limitations. You can’t, for example, use Apt to install
you may potentially be tracked. Debian or Ubuntu packages. Find out more at https://
Fennec (the mobile edition of wiki.termux.com/wiki.
Firefox), for example, sends some If you use Nextcloud, you’ll certainly want to install
telemetry data back to Mozilla. Its the mobile app, too. There are also companion apps for
normal build process also involves its add-ons, such as Talk, Notes, News and Photos. Like
some blobs, which are removed many we mention on these pages, Nextcloud is also
from the F-Droid version. F-Droid available on the Play Store, but that doesn’t give you
40
Linux on your phone
Notification wars
For some time, efforts have been underway to find DISTINCTLY CLOSED GOOGLE APPS
an alternative to Google’s Firebase Cloud Messaging
(FCM) for push notifications. The only workaround has Some people (no matter how much we shout at the sky) want to run
been for apps to maintain direct connections with their Google apps on LineageOS. These can’t be distributed by LineageOS
servers, which is bad for batteries (as those apps then and have to be sideloaded at install time. New versions of Lineage
can’t be suspended). Now, thanks to the UnifiedPush recommend the MindTheGapps package. You’ll find download links
(UP) protocol (see https://unifiedpush.org), there’s a at https://wiki.lineageos.org/gapps. Grab the correct package for
way out of this mess. Matrix and Mastodon already your architecture (probably arm64) and Lineage version. Sideload it
support UP in their apps, as does the free from TWRP immediately after sideloading the main OS. A number of
FindMyDevice app. UP decentralises matters by other G-Apps packages are available, some larger than others.
allowing individuals their own notification distribution Alternatively, use the Aurora Store (on F-Droid) to access Play
Store apps without a Google Account. Aurora makes it clear which
apps use Google Services Framework (GSF) and whether or not they
include ads. If you want to access any paid-for apps, you can sign in
and do so. This might be a bit of a footgun, though – using Aurora is a
violation of Google’s Ts and Cs, so it might get your account banned.
The MicroG project aims to freely re-implement the services
provided by Google Play Services (and more). This allows apps
that depend on them to be run outside of the Google ecosystem.
However, for MicroG to function properly, it requires the underlying
OS to support signature spoofing, which LineageOS does not. See
https://github.com/microg/GmsCore/wiki/Signature-Spoofing for a
list of OSes that do. Signature spoofing allows MicroG to mimic
The Exodus project has an app that scans all your apps for egregious Google services, so its use is contentious.
permissions and dastardly trackers.
41
Essential features
Code monkey Jonni Bidwell’s firmware has glitched out, so he must teach
himself to code again. He hopes you’ll join him for the adventure…
he kids may all be headed functions, variables, loops, data structures, project you can beam down to your home
42
Get into coding!
Initial conditions
There are any number of best places to start coding,
which in practice is no help at all.
e’re going to cover a couple of techniques The Scratch
43
Essential features
44
Get into coding!
Flower of Life
and other ‘sacred
geometry’ figures
are easy to create,
and vaguely
hypnotic to
watch, too.
45
Essential features
46
Get into coding!
$ cd ~/pyturtle/examples
$ python spiral.py
Feel free to make changes and experiment with all
the code there. If you like you can even use Git to keep
track of your files. Suppose, for example, you made a
small change to pyturtle.py, maybe adding a function to
randomise the colours of the circles, or perhaps
changing the lengths and angles in lines 17-21.
Then, once you’ve checked it works, you can
commit that change to your local copy of our pyturtle
repository. First though, we need to set up usernames
and emails, so that Git know who is commiting code-
icide. This is easy:
$ git config –global user.email “you@example.com”
$ git config –global user.name “Your Name”
Don’t worry, we won’t be pushing code to any public
repositories (especially not Linux Format’s) so these might be woefully inefficient. The correct way to do this GitLab enables you
details won’t leave your machine. Now we’re ready to would be to run: to show commits
(in this case a
make our commit, but Git isn’t ready to receive it. Check $ git fetch origin
white-space fix)
this by running: This syncs the local index with that of the remote side by side as
$ git status source (usually called origin), but doesn’t change the well as annotate
You’ll see a message telling you that the pyturtle.py commit log or anything. Now we should switch to the your code.
file you modified hasn’t been staged for commit yet. We main (some projects still use ‘master’ here, but GitLab’s
need to tell Git which changed files we want to include in default is ‘main’) branch with:
our commit, which is straightforward: $ git checkout main
$ git add pyturtle.py You’ll see a message saying that you’re already on
If you run git status again you’ll see that the file is now the main branch and are a couple of commits ahead
“ready to be committed”. Great. Now we can make our
commit, as well as a short message describing the
changes made: MOVING ON FROM BITKEEPER
“Linus designed Git much differently
$ git commit -m “Messing around with turtle angles”
For larger changes involving multiple files, it’s easier
47
Essential features
Invaders, possibly
from space
We’ve resurrected a classic shoot-em-up project from a long
lost Linux magazine. All you need to do is save the world.
nce upon a time, there was a magazine called pivaders). If you look at the commit entitled “Update to
48
Get into coding!
On this occasion,
our attempts
to save the
world were not
successful…
where we define a bunch of classes and then by, display update (the pygame.display.flip() call that’s on
instantiating them, make objects. A class can have its own line 266).
methods (for example the __init__() method is called We do hope you’ve enjoyed Pivaders, and we do hope
whenever that class is brought to life). It’s easy to see why you’ve enjoyed this brief foray into the world of Python
classes might be useful for blocks and bullets, because coding. Of course, Python is not the only fruit, and one
we’re going to need lots. But it turns out they’re equally may equally well have coded something similar in C (or
useful for things that are only going to exist once. C++) or x86 assembly. That might make for a faster
For objects that move in our game, the associated game, but there would be more code and we’d struggle
classes all have an update() method. For example, the to explain most of it. PHP, JavaScript and Perl all have
Ammo class is updated (lines 82-85) by increasing its reputations as ‘web languages’, but they’re all capable of
y co-ordinate according to its speed. If the bullet goes manifesting a Space Invaders clone. In our Raspberry Pi
off the top or bottom of the screen, the object is temperature monitoring tutorial (see page 50), we’ll look
destroyed. Speaking of the Ammo class, it’s worth at combining Python with Bash scripting, so that we can
noting that this is used for both alien missiles and the use features of the shell (for example. Sed, Grep and
player’s bullets. Classes can inherit methods from other, Awk) to automate, analyse and hopefully ameliorate.
parent classes. Indeed, the Ammo class itself extends
Pygame’s own Sprite class, which is where all the
collision-detecting magic takes place. NAVIGATING THE LOOPS
Blits and pieces Having everything defined in functions and classes and what have you
Pygame makes it easy to use our own assets. The is undoubtedly ‘the right way’ to write code. But it does mean that the
graphics, fonts and sounds used in Pivaders are all open code that actually springs the game into life is right at the end. First
source, but feel free to experiment with alternatives. we create a new Game object, which sets up the game area, fonts
Graphics are dumped on the screen (technically a and theme music. Then we instigate the main_loop() method. Most
surface) using the blit() method. Blit (block transfer, applications have a main loop that typically runs for the whole lifetime
sometimes called bit-blit) is the traditional method for of that application, polling for input or updates and acting on them
copying bitmaps (or parts of bitmaps) from one surface accordingly. Our main loop in Pivaders is executed 20 times a second,
to another. In order for coin-op, bullet hell arcade so the code is working pretty hard while you blast aliens. The only way
classics to be so hellish, it was common for them to to escape our main loop (line 401) is for the Gamestate.end_game
have their own blitter chip. Robotron:2084 from 1982 flag to be set, which happens when the window is closed (line 163) or
included two Blitter chips, allowing for a (then) mind- when Escape is pressed while on the start screen (lines 166-167).
bending 80 objects moving on the screen at once. Assuming we’re not quitting, our main loop goes on to check if our
It might sound like a dated method, but as long as spaceship needs moving, creates an alien missile (subject to the one
we only care about two dimensions then blitting is the in 20 chance, see line 303) , checks for collisions and refreshes the
simplest way to move things around. Behind the scenes screen. Then each object from the player, bullet, alien and missile
Pygame will use your GPU (or fast software techniques groups is updated in a handy for loop (lines 411-414).
if it can’t) to speed up the blits. Consideration is still In order to check if the game is over there are is_dead() and
required though. Every time anything in our game defenses_breached() checks (commencing lines 333 and 346. If the
moves, part of the background will be covered up and game isn’t over, but the aliens are all dead, Lrrr’s “increase speed”
another part of it revealed. In order that the movement edict from earlier is enacted in a new level.
appears smooth we blit the background after each
49
Essential features
50
www.linuxformat.com
Protect your privacy
51
Essential features
52
Protect your privacy
53
Essential features
Firefox extensions
Let’s defend our browsing with some pointy
plugins that’ll keep the wolves at bay.
he world isn’t going to end when Google pulls
54
Protect your privacy
EXPLORE MY Pi-HOLE
In all of this panic about browser-based ad-blockers the millennium. If the only spare machine you have
and Google’s extension shenanigans, we neglected is a Windows box, you can install it using WSL.
to mention our own preferred solution. Installation is simple and, once set up, you can
Pi-hole was built to run on a Raspberry Pi. It can access Pi-hole’s admin functions through a web
run happily on a Pi Zero and sit behind your couch, interface, where you can update the blocklists, block
drawing less wattage than a solar-powered torch. new URLs on a one-off basis and, if you’re especially
Sitting between your browser and the wider sneaky, monitor what your kids are doing online.
internet, it intercepts all requests and checks URLs One huge advantage Pi-hole has over traditional
against lists of known ad servers. If a URL is on the extensions is that you can set it up so your entire
list, the resource (usually an advert) isn’t loaded. network is covered – this is a big deal if everyone
Although Pi-hole was designed with the Pi in in your house has at least one PC, a phone and a
mind, it runs happily on most hardware built since streaming device. You can save hours. Days even.
becomes obvious. And as for what badgers have to do block each tracker either just on the current page or
with anything, we don’t know. across the entire web. Ghostery doesn’t use blacklists
and leaves decisions in your hands.
•Privacy
Privacy Possum
Possum is based on the excellent Privacy
Ghostery is also very focused on performance
and improving user experience – by default, it
Badger and was created by one of the engineers who blocks trackers that slow down the web and unblocks
worked on the project. It takes a completely different trackers if blocking them breaks the web page you’re
approach to preventing companies from following you. attempting to access.
Put simply, it doesn’t. To our mind, however, this isn’t ideal, because it
Privacy Possum allows trackers to stalk you all they could lead to a situation in which tracking companies
want – but they’ll never ever be able to get an accurate deliberately create trackers that break websites if they
idea of who it is they’re following. are not allowed.
It blocks cookies that let trackers uniquely identify
you across websites. It blocks refer headers that reveal The bottom line
your browsing location. It blocks etag tracking, which Each of these anti-tracking extensions focuses on a
leverages browser caching to uniquely identify you. different area. UBlock Origin is for people who hate
And it blocks browser fingerprinting, which tracks the adverts and hate tracking; Privacy Badger is all about
inherent uniqueness of your browser. heuristic learning and making sure that trackers behave
Without these unique identifiers, it doesn’t matter themselves; Privacy Possum would prefer that tracking
who is tracking you, they will never be able to link any of companies go bust; while Ghostery is about a fast, clean
the information, and better yet – it actually costs them user experience.
money without giving anything in return. Which extension you go for is up to you, depending
Browser fingerprinting – using the attributes of your on which model best suits your needs. We like them all.
browser such as installed fonts, screen resolution and Earlier, we mentioned in passing that extensions
language packs – is also spoofed, rather than hidden. occasionally change ownership or are deliberately
Aww, look:
To use an analogy, if the tracking companies or compromised by their developers in order to make a Ghostery has
government agents on your tail are looking for a quick buck from users. We seriously doubt that the tiny Pac-Man-
short, blonde woman with tattoos, Privacy Possum creators of uBlock Origin, Privacy Possum, Privacy style ghosts
transforms you into a 6’ 5” skinhead bloke with a flat Badger or Ghostery are going to sell out, but we to illustrate its
spooky credentials.
cap and a natty moustache. Then it turns you into can’t guarantee it. Make sure you check the GitHub And there’s even
something else instead. repositories regularly for any reported problems or an emoticon of a
Why possums? Possibly because they pretend to be changes in contributors. frightened cat!
dead. The extension creator hasn’t said.
•Sounds
Ghostery
spooky, eh? We love that it conjures up
images of us coasting across the internet unseen and
undetected, like some child of an exotic phantasm –
especially as this feature was written in the run-up
to Halloween.
Ghostery advertises itself as enabling “cleaner,
faster, safer browsing”, and as its mascot, it has a
friendly little spook.
In reality, Ghostery isn’t that much different from
the other blockers and offers you control on a tracker-
by-tracker basis from a handy and visually pleasing
dashboard, which lists all of the trackers on the page
you’re viewing or interacting with. From there, you can
55
Essential features
56
Protect your privacy
57
060 Code a cataloguing application in Python
Using Python and the Django framework, learn how
to create a web-based cataloguing app
064 Code an admin back-end in Django
How to create admin controls and basic view
functions in your cataloguing app
068 Finish your cataloguing app
Add search and export functionality to your
cataloguing app
072 Write your own classic Pong game
Take a trip down memory lane and create your own
Pong-style game for all your retro gaming needs
076 Website and RSS feed Python scraping
How to use Python to scrape information from a
webpage and RSS feed, and perform basic analysis
080 Build a club on the next-gen web
Assemble your first Web 3.0 app
using Solidity and Javascript
58
060 064
068
080
076
072
59
Coding Academy
DJANGO
Credit: www.djangoproject.com
Code a cataloguing
application in Python
Strap in kids! Using Python and the Django framework, Matt Holder
can help you create a web-based cataloguing application.
60
Cataloguing app
61
Coding Academy
62
Cataloguing app
publisher.save() The ORM can also be used to filter objects and can
publication = Publication(publicationName = “Linux also navigate through relationships. The first line of
Format”, publicationType=”MAGAZINE”) the code below returns any publications that have a
publication.publisher = publisher publicationType set as NEWSPAPER . To test this,
publication.save() ensure that you have a publication added with the
Note how we are using the publisher object to publicationType argument set as NEWSPAPER .
create the link between the publication and the In the second line of code, we are looking for
publisher. Repeat these steps a few times so that you publications registered with a publisher that has the
have multiple publications and multiple publishers. name Future Publishing.
Next, we will investigate how to further use the ORM to Publication.objects.filter(publicationType =
return all publications and their linked publisher. “NEWSPAPER”)
from Catalogue.models import Publisher,Publication Publication.objects.filter(publisher__publisherName =
publications = Publication.objects.all() “Future Publishing”)
for publication in publications: In this tutorial, we have looked at the basics of
print (publication.publicationName, publication. what Django can do, created the model (database)
publisher.publisherName) structure for our application and investigated the
In the first line, we are importing the Publisher usage of the shell to create objects, which can be
and Publication model from the app, and then in written to the database. In the next article, we will
the second line we are returning all objects from the be investigating the admin interface, which removes
database. Line three is beginning a for loop, to iterate a lot of the hard work required to make a
through each publication object that was returned user interface, create some URLs that can be used
from the database. Finally, line four prints the name to access the application and write some basic views
of the publication and the name of the publisher. and controller code.
Database tables and indices, automatically created using the Django ORM. (More tables and indices exist than are in this image.)
63
Coding Academy
DJANGO
Credit: www.djangoproject.com
Code an admin
back-end in Django
Continuing with our magazine cataloguing application, Matt Holder
explains how to create admin controls and basic view functions.
64
Cataloguing app
second one references an object, which is known as a Publication, which in turn will need
ModelAdmin class. These objects are used to amend to be registered to a Publisher.
the default rendering of a model in the admin interface. Firstly, let’s set up the URLs for
For example, when viewing articles in the admin our application. To begin open the
interface, instead of a list showing something like, urls.py file and add a line to include
article1, article2 and so on, we wish to view a table the catalogue.urls file. Strictly
of entries with headings that show information about speaking, this step is unnecessary,
each article. There are a large number of items that can but is good practice as it separates
be added or tweaked using ModelAdmin objects and all URLs for the Catalogue app into
the details can be found on the Django website. a file within the app’s directory
The code sample above assumes that you have structure. Within this new file we
added all models from the code available on GitHub. will define URLs for an index page,
When adding the models, make sure to run the tags index page, article index page
following two commands to update the database: and a page to detail articles listed
python manage.py makemigrations and python to a particular tag. Each URL
../manage.py migrate If you have not done so, then you definition refers to a class within the views.py By the end of this
can simply add the Publication and Publisher sections file, which contains the application’s logic. project, we will
have reproduced
to the admin.py file to investigate the admin interface Some of these URLs will be used for index
this functionality.
in a more limited capacity. purposes, such as /tags, and some will expect a second
Now this has been added, run the built-in web / and argument, such as the page, which will be used
server with python ../manage.py runserver and then, to show details about a particular article.
in a browser, navigate to http://localhost:8000/admin. First of all, open the urls.py file from within the
Log in with the details created when first setting up PublicationCatalogue directory and ensure the
the project and then investigate the interface. What contents are as below:
you will find is a web page for each class created in from django.contrib import admin
models.py, which allows entries to be added for from django.urls import path, include
each database table. You will also find that where urlpatterns = [
relationships have been defined, these have been path(‘admin/’, admin.site.urls),
replicated in the interface. For example, when in the path(‘catalogue/’, include(‘Catalogue.urls’))
Publication page, you will be able to add a Publisher. ]
Similarly, when investigating the Articles page, you Secondly, open the Catalogue directory and create
will be able to add or select an Author. During the first a new file called urls.py. Add the following contents to
article, we created a couple of objects using the shell this file:
and these will be visible in the interface. To get used from django.urls import path
to the functionality, create a couple of records by using from . import views
the various pages. You can find out
What we will create now is a web page that can urlpatterns = [ about Django
be used to view all tags that have been registered in path(‘tags/’, views.returnTags,name=’tagList’), templating here:
the application; each tag will be a link, which then path(‘tags/<int:tag_id>/’, views.returnTagById, https://docs.
opens a page displaying the articles that have that tag name=’tag’), djangoproject.
com/en/4.1/
registered against it. We will then be able to click on a ]
ref/templates/
link to open the article and view all of the details about The code above enables us to call views (Python language/
it (this is further functionality and can be added using functions) when URLs are entered in a browser. When
the code on GitHub). New skills we need to learn are:
using URLs, to link a URL to the logic to generate the
functionality; writing the Python code to interact with THE OTHER AJAX
the database and return the tags and relevant articles;
templating to write the HTML and allow it to iterate Currently, the application we have written behaves like a website
through the data provided by the controller; and how written in the 1990s. This is because all the data needed by a single
to pass data between the view and the controller, so page is sent to the browser in one go and rendered accordingly. This
that when a link to a particular tag is clicked on, this works fine for a project of this size, but imagine we were working
then instructs the controller code to return the with hundreds of thousands of data items – rendering this client-
relevant items. side could cause real problems on slow internet connections or low-
Django uses a system called Jinja templating to be spec devices. Asynchronous JavaScript and XML (AJAX) is a method
able to access the data being passed from the view developed to provide communication between the server and client
code and then render this within the HTML output and for pages to be updated when required. For example, the page
file. Tags are used within the HTML to access various could be loaded with 100 rows of data and then extra loaded when
coding concepts. For example, for loops can be used the page is either scrolled down or the Next Page button is selected.
to build lists or table rows, and if statements can be Django has full support for AJAX and these concepts can be used
used to test logic and determine whether certain to write a much more responsive application than has so far been
information should be displayed. written. These concepts are out of this writer’s skill set and this
Make sure, from the admin interface, you have article, unfortunately, so expanding the functionality is left as an
created entries for all of the models and that articles exercise for you. An excellent description of these concepts can be
are linked to Edition(s), Tag(s) and Author(s). When found at https://djangocentral.com/django-ajax-with-jquery.
creating an Edition, this needs to be registered to a
65
Coding Academy
<head>
66
Cataloguing app
<meta charset=”utf-8”>
<title>Tag Details</title> STYLING THE APPLICATION
</head>
The aim of these articles is to introduce the concepts required to
<body> create applications that can be interacted with from a web browser,
<h1>Tag Details: </h1> are backed by a database and have some program logic to provide
{% if tag %} the necessary functionality. These aims are being met, but the
<h2>Tag Name: {{tag.tagName}}</h2> display of the information looks like it was created when the web
<p>Tag Descriptor: {{ tag.tagDescriptor }}</p> began. This is because we have not included any CSS to style the
output. There are plenty of libraries that can be used, but a good
<h2>Articles Registered With Tag</h2> one to get a headstart in styling output is bootstrap. This library was
{% if articlesRegisteredWithTag %} created by Twitter and has been released for free. There are plenty
<table border=”1”> of tutorials across the web on how to get started, the official one
<tr> being at https://getbootstrap.com/docs/3.3/getting-started/
<th>Article Name</th> Some other examples of incredibly useful JavaScript and styling
<th>Keywords</th> libraries are JQuery and DataTables. JQuery is used by a huge
<th>Notes</th> number of other libraries and allows for incredibly advanced
<th>Summary</th> tasks to be accomplished. One example of this is DataTables. This
<th>Edition</th> library can be used to make HTML tables searchable, sortable and
<th>Publication(s)</th> automatically paginated, which makes tables instantly more usable.
<th>Author(s)</th>
</tr>
{% for article in articlesRegisteredWithTag %} </tr>
<tr> {% endfor %}
<td>{{ article.articleName }}</td> </table>
<td>{{ article.keywords }}</td> {% else %}
<td>{{ article.notes }}</td> <p>No authors registered with this tag.</p>
<td>{{ article.summary }}</td> {% endif %}
<td>
{% for edition in article.edition.all %}
{{ edition.editionName }}<br /> {% else %}
{%endfor %} <p>This tag is not available.</p>
</td> {% endif %}
<td> </body>
{% for edition in article.edition.all %} </html>
{{ edition.publication.publicationName }}<br /> In this sample of HTML, we are generating a page
{%endfor %} that details the tag itself and then displays a table
</td> detailing every article that uses the tag. It then shows
<td> a second table, where authors using the tag can be
{% for author in article.author.all %} viewed.. We could add construct hyperlinks to open a
{{ author.authorName }}<br /> relevant article and author’s page. This extra
{% endfor %} functionality is available on GitHub in a copy of the
</td> project and has more code than can be printed here.
</tr> Django has many other modules that can be used
{% endfor %} to build a successful web app, such as forms. Forms
Here is the page
</table> can be used to build web pages, which can be used to that we have
{% else %} populate data into the app. We’ll look at this in the next just created to
<p>No articles registered with this tag.</p> article as well as how to generate files for download. view tags.
{% endif %}
</table>
<h2>Authors Registered With Tag</h2>
{% if authorsRegisteredWithTag %}
<table border=”1”>
<tr>
<th>Author’s Name</th>
<th>Notes</th>
</tr>
{% for author in authorsRegisteredWithTag %}
<tr>
<td>{{ author.authorName }}</td>
<td>{{ author.notes }}</td>
67
Coding Academy
PYTHON/DJANGO
Credit: www.djangoproject.com
Finish your
cataloguing app
With a tear in his eye, Matt Holder finishes up our cataloguing
database app by adding search and export functionality.
68
Cataloguing app
69
Coding Academy
70
Cataloguing app
71
Coding Academy
PONG
Write your own
classic Pong game
Matt Holder takes a trip down memory lane and creates
a Pong-style game, for all your retro gaming needs.
https://github. Before we begin coding, let’s quickly discuss the angle, to ensure that the game is different each time.
com/mattmole/
gameplay. A paddle is drawn on the left- and right-hand While describing the gameplay, we’ve introduced a
LXF300.
sides of the screen. Each player controls the vertical few of the elements for which we need to create code:
BREAKOUT
Another game that would be an the blocks to disappear. Levels are made playing Fireball 2 on the Acorn A5000 in
interesting project is one called more difficult by blocks having different the mid-’90s. In this similar game, blocks
Breakout. This game contains very capabilities. Some blocks disappear released power-ups that could do things
similar concepts to Pong, because a after being hit once and some require such as increase the paddle size, add a
paddle is used at the bottom of the multiple hits. Other ways of increasing second paddle or attach a blaster to the
screen, controlled horizontally this time, the difficulty include speeding up the paddle, which could cause the blocks to
to make the ball bounce between the ball and decreasing the paddle size. break and disappear. Breakout could
paddle and a series of blocks that are Breakout was first released as an also be reproduced in Pygame, using
drawn towards the top of the screen. arcade cabinet in 1976, then a software very similar techniques to that of our
The level is completed when the ball has version was released for the Atari 2600 Pong game, or the alternative game
bounced off all the blocks, which causes in 1978. We have fond memories of libraries discussed over the page.
72
Pong
class Sprite(pygame.sprite.Sprite):
def __init__(self, width, height, colour=white):
super(Sprite, self).__init__()
73
Coding Academy
In this code
sample, we handle
what happens
if the ball reaches
the top or bottom
of the screen,
hits the paddle or
leaves the left
or right side of
the screen.
74
Pong
75
Coding Academy
PYTHON
76
Data-scraping
pageLink = “https://www.mattmole.co.uk/LXF295/
demo1.html”
77
Coding Academy
colours = root.xpath('/html/body/table[@id =
“namesAndColours"]//td[@id = “colour"]')
#Iterate through each colour in the returned results
and add to the dictionary if missing.
#If it is not missing, then increment it
colourCount = {}
for colour in colours:
if colour.text not in colourCount:
colourCount[colour.text] = 1
else:
colourCount[colour.text] += 1
XML and similar structured text is used everywhere to represent what #Save and display the plot on the screen
we need to see. RSS feeds that are used for either news aggregation plt.savefig('pieChart.png')
or podcasts use XML to store information about the story or episode, plt.show()
and make it available to RSS readers or podcast tools. When you run this code. it’ll load the HTML from the
Another example is HTML (Hyper Text Markup Language), which webpage into an etree object and then the processing
is used to write the front end of every website on the web. HTML is carried out in two, nearly identical, stages. In stage 1,
was first released in 1993 and was an extension of the SGML XPath is run to return all <td> elements (columns) with
(Standardised General Markup Language). While the specification has the id value set to colour. This will therefore grab a list
been built on over the years, the basic elements, such as <title>, <p> of 1,000 colours.
for paragraph, <br> for break line and <table> for tables are still used. Once the list is available, it’s iterated through and a
Where things have changed is the delineation of responsibility. CSS is dictionary is built, which contains each colour set as the
used now for styling of the pages and JavaScript for both interactivity key. Then whenever a colour is discovered that’s in the
and adding functionality. dictionary, the value is incremented by one. If a colour is
As a brief trip down memory lane, hands up if you remember the not yet in the dictionary, it’s added with a value of 1.
<marquee> tag, which could be used to make text scroll across the Stage 2 is the same as stage 1, but instead of looking
screen as well as the <blink> tag , to make text flash on and off. Not for @id = “colours” we look for @id=”names” and
everything was better in the good old days! create a dictionary of names instead. In the final part of
the code we generate a pie chart using the dictionary
78
Data-scraping
79
Coding Academy
WEB 3.0
Build a club on
the next-gen web
Follow along with Mats Tage Axelsson as you assemble your
first Web 3.0 application using Solidity and JavaScript!
What’s needed?
You can choose your own IDE, although in this article
you’ll only learn about the code itself. If you want a
specialised solution then the Remix IDE (https://github.
com/ethereum/remix-desktop/releases) is the most
You can obtain popular. For the major editors, vim and Emacs, you have
the latest code linting and other tools to help you.
for this project In Web 3.0 development, you need libraries much like
from Mat’s Git at in any other development. These comes as contracts
https://github. from many sources, we’ll cover them in-depth at the
com/matstage/
You can see a practice code running on the Ganach local blockchain. end. The libraries you need are from OpenZeppelin,
Solidity-Club.
This project is available at https://trufflesuite.com/tutorial. which handle access for your code. The contract is
80
Writing for Web 3.0
81
Coding Academy
82
Writing for Web 3.0
83
086 Hot Pi Projects 116 Track down files and folders
From building a smart home to How to use a tool to search for
creating a WiFi router files and folders on your PC
096 Deck the hardware 118 Become a screencasting pro
Trick out the Valve Steam Deck How to make a screencast
100 Get started photo-editing 122 Nifty note-taking with Obsidian
Edit photos like a pro using GIMP Discover the almighty
104 More fun with layers and masks Markdown-based note-taking app
How GIMP manages layers 124 Back up and copy hard drives
108 Using enhanced layer features Learn to tame Clonezilla
Beyond GIMP’s standard layers 128 Using WordPress with OnlyOffice
112 Universal layer text effects Insert documents into
Attract attention with layer texts online posts
84
086
096
104
122
118
095
85
Pi projects
Linux projects
he problem with owning a mostly. We’ve selected self-contained ask Les Pounder about trying to get his
86
Pi projects
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.
87
Linux projects
88
Pi projects
89
Linux projects
90
Pi projects
91
Linux projects
92
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
93
Linux projects
94
Pi projects
95
Linux projects
he year 2022 will go down as the year grossing product on Steam – with new games
96
Steam Deck
the lovely types at iFixIt.com high-speed internal storage. SSD here – that’s an entire recovery image, writing it to
rank the Deck with a 7/10 for It would be tempting to buy tutorial in itself and we an 8GB (minimum) USB drive
repairability. Plus points are the biggest and fastest SSD, wouldn’t do it while you have or microSD and booting that
its modularity, single screw but do not do this; the 64GB a valid warranty, either. As it via the Boot Manager that’s
size use and its ease of Steam Deck uses a single- is, iFixIt maintains a detailed accessed by powering on
opening, while the main sided M.2 2230 Gen 2 x1, SSD replacement guide, while holding down the
negatives are that the while the larger capacity alongside instructions for Volume Up button.
97
Linux projects
absolutely must try is Decky needs to be removed or load. At this point, you can Return to Gaming Mode,
Loader. This is a widely changed, such as Syncthing. open a web browser, open the Quick Menu, locate
supported plugin system for Before doing anything, navigate to the GitHub above the new Plugin icon and then
SteamOS that offers a host let’s enable Developer Mode. and use the Download button use the Shop icon to install
of cool and handy plugins – Press the Steam button and to grab the installer and run Decky plugins.
98
Steam Deck
SteamGridDB
A huge issue with the otherwise slick SteamOS
interface is the default gaming artwork – the game
covers and ‘hero’ banner images that appear in the
background when you click on a title. They’re fixed and
can’t be changed, while non-Steam titles just appear as
Get all-new
blank rectangles. Enter SteamGridDB. Get it installed fancy artwork for
and when you select a game, click the Settings cog existing Steam and
on the far-right and Change Artwork (on the main non-Steam titles.
SteamOS list, select a game and use the menu button,
too). This opens a wide selection of artwork options. its limitations – the actual storefront of each is
essentially a browser window, for one – but it offers the
Autoflatpaks same compatibility options through Proton as Steam.
We’re all about laziness here at Linux Format Towers Switch to the desktop – press the Steam Button >
and this plugin cuts the need to manage any Flatpak Power > Desktop. Click the shopping bag icon in the
applications you might install for use with the Linux bottom-left. This opens the Discover store, where you
desktop. Once installed, you can select an update can search for Heroic Games Launcher in the search
interval of days or hours, plus there are options to bar. Click Install, wait for it to finish, then enter the
check at startup and install updates unattended. store page. Click Launch in the top-right corner.
Now you need to add the Heroic Games Launcher
ProtonDB to Steam. While you can open the launcher in Desktop
Wine and, more recently, ProtonDB offers ratings
on how well Windows games run, typically with a
Platinum, Gold, Silver or Bronze badge, but there are EXPANSIVE TASTE
user comments, too. This plugin sucks in these ratings
and displays them on the game page with a link to the “Before its release, Valve was vocal
dedicated ProtonDB page for complete details.
about the fact the Steam Deck is ‘just
Steam is vapourware
The Steam Deck has access to hundreds of games a PC’. That means you can expand or
through Valve’s own storefront, but there are even
more ways to get titles on to the portable powerhouse. upgrade it if the components allow.”
It’s remarkably easy to add game libraries from GOG
(Good Old Games) and the Epic Games Store through Mode, we recommend making it easily accessible on
an application called the Heroic Games Launcher. the main Steam interface first. To do this, open Steam
Both stores are present on Heroic, but this same (within Desktop Mode) and click Add A Game in the
process works with more launchers, too, including the bottom-left corner, then click Add A Non-Steam Game.
likes of Battle.net and Ubisoft Connect – although your Now select Heroic Games Launcher, then close Steam
mileage varies based on how well optimised the games and double-click the Return To Gaming Mode icon on
you play are for the Steam Deck (if at all). Bear in mind the desktop.
that just as with Steam’s catalogue, not all games will Now that you’re back in the Steam interface, head
run – Fortnite, for instance, is a big name that’s missing. into your Library and move to the Non-Steam tab. Here,
Heroic is a wrapper that enables the Epic Games you’ll find Heroic Games Launcher, which you can now
Store and GOG store to run on Steam Deck, and it can open – don’t forget to change the artwork if you’ve
open titles from both, where compatibility allows. It has installed SteamGridDB, mentioned above.
You’re asked to add login information
for both GOG and EGS here, so be sure to
have your passwords handy. Your library
should auto-populate, and if you regularly
take advantage of the free games
included on both stores, you may be
surprised by how much you have.
From here, it’s simply a case of
installing the titles you want to play,
before clicking the green Play button.
If you do have compatibility issues
with any game, clicking the yellow cog
underneath the library icon enables you
to pick different versions of Proton, which
may help fix audio or visual issues. From
this menu, you can also enable Esync and
You can get more than just Steam games on the Steam Deck… Fsync, too.
99
Linux projects
GIMP
Credit: www.gimp.org
CROP IMAGES
Keyboard
shortcuts Cropping and straightening an ignore the procedure altogether. rotation can get them looking
turbocharge image is one of the first tasks you The thing is, cropping and right again. As far as cropping is
your workflow; should learn to tackle when it straightening are easy things to concerned, it’s a great way of
learn how to
comes to editing in GIMP. Why achieve, so you can quickly do focusing on a particular part of an
move the image
exactly? Because all images must them with great results. Although image for effect, or it might just
around (Space),
zoom in and out have a sound base on which to you might think your images look be necessary in order to remove
(- and +), and proceed to the more advanced straight, chances are they’re ever certain objects that are getting in
lots more. steps, yet many people tend to so slightly on a slant, so a quick the way of the shot.
100
GIMP
the tiny left-arrow icons that live top-right in each dock, GETTING AROUND GIMP
and they provide control over how dock tabs are
displayed – you can choose just icons, text or both, plus
add and remove extra docks. If the current dock has
1
additional options, an extra entry appears at the top of 5
the menu when it’s selected and the menu opened.
The tabs themselves aren’t very distinct from one
another. You can enhance their visibility with options to 4
add text and icon alongside. Panel that just uses icons
are hard to see on HiDPI displays, the tabs below the
3
Layers dock are Brushes, Textures and Fonts. Under
the main Tool box is the Tools Options panel – you’ll
mostly just want the primary Tools Options tab here. If 6
you find you mess up the settings or rearrange things,
use the Tools Options menu’s Reset Tool option. This
menu also offers a Save Preset option, if you want to
reuse specific tool settings. 2
GIMP selections
Now we’ve taken a look at how the interface works, Tools Name bar
let’s get to grips with manipulation and movement 1 These icons represent the various tools 4 Click the name bar with your mouse
basics. We’ll look at creating selections and using you can use in GIMP to edit your photos. to drag the toolbox to any part of the screen
Hover to see the keyboard shortcut and that you like.
layers, as they’re required for any serious photo
right-click for more options.
manipulation. We’ll also use them later in the series, File tabs
so it’s good to get up to speed on the basics now. Tool options 5 When in single-window mode, all
Adding effects and getting the most out of photo 2 Tweak the current tool’s settings for your open files are present along here via a
editing often requires carefully selecting objects in more control; certainly worth a good explore . thumbnail tab.
your images and laboriously cutting them out with the Save presets Sidebar tabs
Path tool. In an ideal world, we’d all have the time and 3 Once you have finished customising 6 The tabs displayed can be fully
patience to do just that, but most of us don’t. Enter the tools in GIMP, click this save icon to customised, added, removed and moved
GIMP’s intelligent selection tools: Foreground Select save the preset, so you can quickly restore around. You can access settings through the
useful settings. top-right arrow icon.
and Intelligent Scissors. These build upon the long-
standing Fuzzy Select tool, otherwise known as the
Magic Wand in some photo-based shopping circles.
We’ll briefly look at Fuzzy Select, but what’s great select. The next stage works on it being an area of
about its modern replacements is that they enable the similar colour, but the important aspect here is that the
same speed of selection, but with greater refinements selection is a working area that can be easily adjusted. Hover your
in how the selection is made in the first place and The general idea is that the unselected area is now mouse over
greater control after it has been made. All of this adds blue; you just need to ‘draw’ through areas of similar each icon in
up to a better final selection, which means your cut- colour and the selection is made. You can keep adding the left-hand
toolbox to find
outs and final compositions look better. areas by holding Shift, and once you’re happy, press
out which tool
Click the Fuzzy Selection tool or press U. The Enter, or hit Escape to cancel the selection.
it represents.
Threshold is the important setting: 15-32 is about right. We find tweaking the Color Sensitivity settings
Clicking an area selects a continuous area of similar helps. These can be adjusted per selection, but a
colour. Hold Shift and click to add to the selection or higher 256 across the board is useful. Once the
Ctrl to remove from it. Drag the mouse and GIMP selection is made, you can use the Rectangle, Ellipse
highlights the area it will select. This won’t work well. and Free Select tools to edit the selection further,
A less crude alternative can be found in Tools > trimming off unwanted bits or adding new ones.
Select > Foreground Select. This is a two-step tool,
which starts off with you drawing a rough area to Scissor selections
The Scissors tool is about as close to Paths as any
semi-automated tool gets. Available in the Toolbox
or by pressing the I key, this enables you to quickly
create selections that bind to edges, can be staggered,
previewed and adjusted afterwards. It’s worth
practising with this for a while to learn its finer points.
Start by clicking on the boundary where you want
the path to begin. This creates the first control point,
which you need to click to close the path when you’ve
finished. Click and drag (or just click) to add more
points. When you drag, you’re shown a preview; if the
line goes off-kilter, move the mouse back and try again.
While making a Scissors selection, you can tweak
The default selection tool provides adjustable control points so you can the existing points or drop additional ones between
refine the selection before it’s finalised. existing points to fine-tune the selection. As soon as
101
Linux projects
Mask it Reveal it
3 Feel free to tweak or remake the selection – we’re going 4 On the lower layer, click the eye icon to hide it and you’ll
to transform this into a layer mask and that can be adjusted see the mask magic in action. Click on the mask’s thumbnail, we
anyway. Right-click the upper layer, select Add Layer Mask, suggest selecting Paintbrush; choose a fuzzy-edged brush type.
choose Selection in the dialog, then click OK. A new thumbnail White removes and black applies the masked area. Use x to
appears in the layer but nothing seems to have changed… toggle between white/black foreground/background colours.
102
GIMP
103
Linux projects
GIMP
Credit: http://gimp.org
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.
104
GIMP
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
105
Linux projects
Layer dock
• Cropping or cutting out subjects, as described in the
GIMP tutorial in LXF297.
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
106
GIMP
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.
107
Linux projects
GIMP
Credit: http://gimp.org
108
GIMP
109
Linux projects
Animation tools are limited but GIMP is able to directly play Align and inform
animations created with the program or with G’MIC. Also, GIMP can One group of G’MIC filters is not used directly but only
only save animations in two formats: the now completely outdated indirectly for image composition. These are filters that
GIF and the little-known but supported MNG. This format essentially serve for preliminaries or are useful in organising many
consists of a series of PNG images that can be extracted losslessly. layers in an image.
Ironically, GIMP is not able to read this format. Align Layers is a filter that only works correctly
However, MNG files can be converted to other formats on the with image layers; with text layers the results are often
command line with the ImageMagick command convert convert tst. incorrect. It tries to shift the position of the layers using
MNG tst.mp4 converts the animation into the popular video format. salient points, so the contents overlap as closely as
Conversely, convert -verbose tst.mng png:/tmp/x splits an MNG possible. The Rigid Alignment-Type tries to keep the
animation into frames. Specifying png: does this as PNGs. overlap as high as possible, taking into account the
If you want to have a greater influence on the result, you can take Smoothness parameter. Scales allows multiple sizes
a detour via the animation tool Imagination (http://imagination. of objects when aligning.
sourceforge.net). This enables you to generate MP4 animations Note: with this filter, the preview does not show the
from individual images that are manually controlled. This really result directly but an overlay of all aligned layers, as it is
has a far-reaching influence on the representations. The same is, created by Blend [Median] or Blend [Average].
of course, also possible with Kdenlive and probably other video- This filter is reminiscent of the shell command
editing programs, but there the effort is considerably greater. align-image-stack from the Hugin package, which
One more warning about the animations: with multiple input layers is used to align several individual images when
and many intermediate layers, GIMP really takes up a lot of RAM constructing panoramas.
space to edit them, with 16GB RAM and swap being quickly used The Layers To Tiles filter is also extremely simple,
up. It helps to reduce the colour depth set by GIMP when reading but useful – it collects all of the entrance layers and
images, in the Image menu under Precision. represents them sorted. Two other filters have similar
properties: Pack takes all the input layers and tries to
110
GIMP
111
Linux projects
GIMP
Credit: http://gimp.org
common requirement is to
Alpha On Logo
GIMP’s standard logos are worth seeing – often over the top and not very flexible. With some In many respects, text layers are also just normal image
distros, they are provided via the GIMP Extras package and no longer installed automatically. layers for GIMP. This is also largely true for logos, only
112
GIMP
PLUG-IN INSTALLATION
There are currently three plug-in is incredibly useful if many experiments the project only started in May 2022 and
variants for using the layer effects in are to be avoided. is initially limited to some parts of the
GIMP. They differ in their requirements Bevel And Emboss filter, as well as an
and details of the features. Furthermore, Python script: These can be installed implementation of some other effects.
this diversity reflects the importance of as an alternative to, but not with, the At the moment, the use of this filter is
the effects for users. ScriptFu variant. It requires the Python2 still quite different from the classic
support of GIMP, often provided via implementations…
Script: The simplest variant is a several packages. For Arch Linux, they The installation is quite simple and
ScriptFu script that is executed via are Python2 and gimp-python, for other is described in detail at https://github.
the built-in interpreter. It does not distros they’re likely similar. The Python com/LinuxBeaver. There are also ready-
require any special prerequisites script is installed under ~/.config/ made binaries available, which are
and runs on every GIMP installation. GIMP/2.10/plug-ins (or system-wide copied into the /home/<USERNAME>/.
(However, the script must be adapted under /usr/lib/gimp/2.0/plug-ins). The x local/share/gegl-0.4/plug-ins directory.
for the respective major GIMP version – permission flag should be set by chmod Sometimes it is necessary to delete
2.6, 2.8 or 2.10). The script provides a+x .../layerfx.py . existing settings to be able to use the
the essential features of the Python new version: rm -r ~/.config/GIMP/2.10/
variant, but it does not offer a GEGL variant: The first GEGL-based filters/GimpGegl-gegl-effects-config.
preview. However, in many cases this variant of these filters is still very new – settings does this.
113
Linux projects
Blend Mode decisively influences the result. Gradient also offer something new here. Contour allows you to
Overlay replaces the colour with one of the existing select the shape, taking into account other parameters,
colour gradients. Satin has a similar effect and covers of course. The effect of Spread becomes apparent in
the object with a light satin sheen. practice. This is also the case with Inner Shadow. The
Also very simple are the Inner and Outer Glow shadow always falls inwards. The effects of Choke and
filters. They create soft halos around the edge pixels Noise only become apparent with larger Size values.
in the input layer. Soft radius, opacity and blend mode One of the relatively frequently used effects –
can be adjusted. With Outer Glow, the preview only Stroke – should be described in more detail here:
shows a realistic image if there is a visible layer the idea of outlining pixels on a transparent layer is
underneath, with Inner Glow, this is normally the case simple and easy to implement. By means of Alpha To
anyway. Sometimes such glow effects are called Selection, a selection is created, which is then traced.
Orthon Effect if they create a fairy-tale impression. This effect is often necessary when fonts have to
More exciting are the two shadow filters. Drop appear over irregular backgrounds where they would
Shadow is one of the most widely known and used otherwise be unreadable.
GIMP and GMIC filters. Nevertheless, Layer Effects The Stroke dialog of Layer Effects goes a few
steps further. By default, the effect is created on a new
layer. This can be blended with any of the legacy blend
THE BEAVER TOOLS modes with the pixels of the input layer (under Blend
Mode). The first two parameters, Size and Position,
The GEGL modules provided by LinuxBeaver cover a range of use are self-explanatory, which also applies to Opacity.
cases. Many modules have been developed explicitly for text editing, The Fill Type section is interesting. While normal stroke
such as Jelly, Custom-Bevel, Grains_of_Sand and many others. But tools only support fixed, single-colour borders – here
the other modules also deserve some attention – for example, labelled Color – this dialog goes much further. Gradient
GEGL_Polygons, which simulates an overlay by polygonal features. enables you to select any colour gradient, while Pattern
Be aware that the provided modules are plugins for GEGL. does the same with an existing pattern.
Therefore they are not installed under ~/.config/GIMP/2.10/plug-ins The other options then depend on the Fill Type
but in the ~/.local/share/gegl-0.4/plug-ins directory. used. With Gradient, they correspond approximately to
The installation is simple in principle, as described above, but those in the tool settings. The Pattern type offers the
under Arch Linux a problem typical for rolling releases becomes necessary settings for a fill pattern that can also be
apparent: the modules provided by LinuxBeaver cannot be loaded, varied in size.
which causes GIMP to display the error message GEGL-Message: If Stroke is applied without the Merge With Layer
23:43:51.475: Module ‘~/.local/share/gegl-0.4/plug-ins/sketch.so’ load option, the current version of Layer Effects creates a
error: ~/.local/share/gegl-0.4/plug-ins/sketch.so: invalid ELF header . layer group for the layers involved in the effect. In the
Then the only way left is to recompile on the local system. case of Stroke, this is the effect layer in addition to the
But even here there are pitfalls. For example, meson in the input layer. With other Layer Effects tools, this can also
meson setup --buildtype=release build && ninja -C build command be several additional layers.
requires the installation of gegl 0.4.* and babl 0.1.* – the Git versions
of these, which are useful in another context, must not be installed. Bevel And Emboss
If you would like to develop your own modules, you do not have to By far the most comprehensive and powerful filter of
program directly in C, but can do so with the GEGL graph, which is Layer Effects is Bevel And Emboss. It is therefore also
based on easy XML files. Instructions can be found here: https:// the most often used. Strictly speaking, this dialog
github.com/4Evergreen4/pixelsort/issues/8 under ‘Do you plan on combines four basically similar filters that appear in
making more custom GEGL filters?’ one dialog. The Style parameter switches between the
variants. The complexity of the filter is shown not only
114
GIMP
by the high number of parameters, but also by the Bevel And Emboss
relatively long time needed to activate the preview. Of is powerful
and complex.
course, this is only available in the Python2 variant of The effect of
the filter. Therefore the preview is not active by default. the numerous
In a first step, a Style is always selected with this parameters is
filter. Then – with the preview activated – the other shown in the
Preview mode.
parameters can be set. This should be done step by
Parameters should
step, because it always takes a moment until the be chosen wisely.
preview is updated. Among other things, the Surface
Contour parameter has a great influence on the result,
as it can be used to create very interesting effects at
the edges of fonts.
For many tasks, it is quite sufficient to make a few
adjustments in the upper section of the filter dialog
(Structure) and to disregard the parameters at Shading
and Texture.
However, the Gloss Contour parameter needs a
little attention. Some of its settings lead to additional
effects, which can be partially compensated for with
the Color parameter.
As a result, this fourfold filter always creates a layer A great
group, in which, in addition to the original layer, there is advantage of
one layer for highlights and one for shadows. Logo Toolbox is
There are some minor problems with this filter in that the input
some situations. They do not always occur and can layer is not
destroyed. This
usually be quickly fixed. For example, the filter is
enables you to
typically used without the Merge With Layer option,
place the input
because otherwise the results do not match the layer - with a
preview. In particular, text layers can cover the shadow directly, and can have layer modes and some other suitable layer
and highlight layers in such a way that their effect is features that GIMP currently offers and that are mode - on top of
lost. In these cases, it helps to manually move the text displayed in the lower part of the dialogs. the generated
layer further down in the layer stack. Sometimes it is Due to the early stage of development, the use logo and offset
useful to manually replace the Screen and Multiply of this module still takes some getting used to and it afterwards.
layer modes automatically assigned by the filter and/or is inconsistent: on the one hand, one of three Sometimes
to increase the opacity. In very rare cases, additional components is selected under Part Of Filter To Be this improves
the result
layers created by these filters can also be doubled to Displayed, which may reshape the entire dialog. The
considerably.
enhance the effects. individual functions are partly activated via a slider
(--ENABLE XYZ) or via a checkbox (Enable XYZ).
The GEGL variant However, this does not detract from the function.
Since mid-2022 there has been a new version of Layer As of early 2023, there are about 20 other modules
Effects, which is quite contemporary and based on the with additional functions besides the GEGL effects.
GEGL framework (Generic Graphics Library, see These can then be integrated seamlessly – better
https://en.wikipedia.org/wiki/GEGL) of GIMP. For than the case so far with the GIMP plug-ins and scripts
several years now, all existing GIMP filters have been – and additionally also applied on the command line
in the process of being ported to this new graphical with the gegl command.
engine, and the task is largely completed now. Ideally,
Currently the best
new plug-ins should also only be developed for this GIMP provides for
interface, so they’re ready for future GIMP versions. designing three-
In addition to the normal GEGL functions that can dimensional texts:
be found everywhere in GIMP, there’s also a number Bevel And Emboss
from Layer Effects.
of functions not bound to keys. There is a universal
Most of the design
GEGL front-end for these functions in the toolbox. It details of the
is activated in the preferences under Toolbox in the rendering can be
Interface section, and appears at the last position in adjusted precisely,
the toolbox. and the transitions
are exceptionally
A number of additional modules can be found at smooth.
https://github.com/LinuxBeaver, which, among other
things, are intended to replace Layer Effects at some
point. The development is characterised by a strong
dynamic, so it’s worthwhile looking for new modules
from time to time. Functions implemented in GEGL are
characterised by high efficiency. They are fast, preview
115
Linux projects
FSEARCH
Credit: http://cboxdoerfer.github.io/fsearch
116
Smart search
117
Linux projects
OBS STUDIO
Credit: https://obsproject.com
How to become a
screencasting pro
Screencasts are excellent for creating application tutorials. Michael Reed
shows you how to make one with end-to-end open source software.
creencasts are videos with a voice narration, docks that we’re going to need minimised. We’re going
118
Produce a screencast
119
Linux projects
120
Produce a screencast
121
Linux projects
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.
122
Make notes
123
Linux projects
CLONEZILLA
Credit: https://clonezilla.org
124
Duplicate hard-drives
Prepare to flash
The first stage in this example is to prepare a USB flash
drive to boot Clonezilla from. Obtain the latest Clonezilla
build by downloading it from the official site (https://
clonezilla.org). Next, you need a medium such as a USB
flash drive to copy the files to. Because Clonezilla is
pretty small at less than 1GB in size, any old flash drive
you’ve got lying around should do the job.
To prepare it, remove the existing data and partitions
and create a FAT32 formatted partition. In this example,
we’ll use Gparted (https://gparted.org), a GUI partition
editing tool that’s in the repositories of most Linux
distributions. Start by installing it using your package
manager front end. On most distributions, you’ll need
to supply your root password before carrying out
operations using a partition editor. Click OK followed by clicking the tick icon to carry Clonezilla’s startup
We can’t emphasise enough the importance of being out the operation. Click the newly created partition and screen. Apart
from the first
absolutely sure that you’re operating on the correct select (Partition>Manage Flags). In this menu, check
option, there are
partitions. Measure twice, cut once. If you make a the Boot flag and click OK to make the partition some other useful
mistake, it’s easy to destroy your entire system with a bootable. The easiest way of mounting the newly utilities that are
few clicks of the mouse! You have been warned. Make created partition from this point is to quit GParted handy to have on a
some notes on a piece of paper if you need to. and remove and reinsert the flash drive. keyring flash drive.
There’s a drop-down menu in the top-right hand side Use a file manager to open the archive that you’ve
of Gparted. Use this to select the flash drive. Typically, downloaded from the Clonezilla website and expand the
the flash drive will be the last drive on the list because it files on to the flash drive. This is everything you have to
should be the most recently installed drive. Beyond that, do to prepare the Clonezilla distribution.
you should be able to identify it by the size of the drive.
For example, if you’re using a 16GB drive, the total size External drives
of the drive should be around the 16,000MB mark. Once the flash drive is prepared and ready, it’s worth
Typically, you’ll have to unmount a partition (select readying your external drive that you’ll use to store
Because
partition and then select Partition>Unmount in the Clonezilla images. The drive that you use doesn’t have
Clonezilla is
main GParted menu) before you can begin changing to be blank, and you should be able to use any drive open source it
the partition setup on the drive. that’s readable using a normal Linux distribution. For will, hopefully,
Once you’re sure that you’ve selected the right drive, convenience, you should create a directory for image continue to be
click each existing partition, and then click the delete storage on the external drive (remember to avoid having maintained and
icon in the toolbar. This should leave you with a spaces in the filename). older versions
completely blank drive. Click the Create Partition icon, Later on, you might appreciate it if you take the time will always be
and create a single partition that fills the entire drive. to make some notes at this stage about the sizes of available so that
Select FAT32 as the format. Give the partition a name, each drive that you’re going to be working with. This you’ll be able
such as Clonezilla by editing the Label: (not Partition to access your
helps to identify which drive is which when you’re
older backups.
name:) field. using Clonezilla.
125
Linux projects
126
Duplicate hard-drives
You’ll then be prompted to choose between different before, insert the external storage when prompted.
levels of expertise. Beginner is fine in this case. The next Also, when prompted, select the directory that you
screen is interesting because you can choose between created for the image. On legacy, non-
copying the entire disk or individual partitions. If you This is where things begin to change from before. UEFI systems,
copy an entire disk, all partitions and the boot record Rather than selecting the savedisk as we did last time, there’s a script
are copied. This is the simplest option. There are some select restoredisk. The next screen enables you to that must be
instances where you might want to copy individual select the image that we created before. After this, you run to make
partitions, but beware that the restoration process is can select the target disk. As always, be extra careful the flash drive
slightly more complicated. In this case, we’ll copy the that you’re selecting the right one. Unlike before, you bootable
entire disk. So, select the Savedisk option. could cause damage if you make a mistake. However, (sudo <mount
point>/
Moving on, you can name the image file. The default Clonezilla won’t offer the disk that you’re copying from
utils/linux/
choice is automatically generated from the current date, as a potential target. If you accept the default option,
makeboot.
and is sufficient in most cases. Next, select the drive you can choose to verify the image before restoring it, sh <name of
that shall be imaged. As ever, use the size of the drive which is probably a good idea in most cases because it partition>).
to identify the right one. can narrow down problems if they crop up.
The next sequence of screens should be fairly self- Select what you’d like Clonezilla to do when the
explanatory, and you can accept most of the defaults for operation is finished, and when you press Return, the
things like the compression method, using fsck on the restore operation will begin. This will erase all content
source drive, encryption options and finally, what to do on the target hard drive. This is fairly fast, but note that
when the process is complete. in the next stage you’ll be asked to verify the restoration
of each of the partitions individually. It’s worth knowing
Go time! this in advance in case you were planning on leaving the
Finally, we begin the copying procedure. While the machine unattended. Hopefully, this will restore a fully
imaging is taking place, Clonezilla gives a graphical bootable system in the same state as when the cloning
representation of the current progress along with details operating system was carried out.
about the speed of data transfer and an estimate of the Test out the system by booting the computer up in a
remaining time. Note that this display will stop and start normal way. And with that, hopefully, we’ve given you an
again for each partition that’s going to be copied, and overview of how to use Clonezilla Live. Happy cloning.
the time estimate is just for the current partition.
The image file that Clonezilla creates is actually a
collection of files stored inside a directory. These files
can be freely copied like any others, as long as they’re
kept together in a directory. Linux installations tend to
be highly mobile. So, if you had to deal with a machine
that wouldn’t even power up, you could restore the
backup image files to a different machine to quickly get
the setup back in action.
Copying in
progress. This
Restoring an image screen will restart
For this example, we’ll restore the image we created in for each individual
the previous scenario. The process is similar to creating partition that is
being copied. We
the image. Start by booting into Clonezilla as before. found the time
Again, select device-image and local_dev when estimates to be
prompted as the Clonezilla modes of operating. As fairly accurate.
ONLYOFFICE
Credit: www.onlyoffice.com
Using WordPress
with OnlyOffice
With OnlyOffice Docs connected to WordPress, authors are able to insert
documents into online posts. Kseniya Fedoruk explains how it works.
128
OnlyOffice plugins
Install certbot:
$ sudo snap install --classic certbot Server configuration file to enable the validation. You can see the
$ sudo ln -s /snap/bin/certbot /usr/bin/certbot Remember to save your settings after entering the inserted OnlyOffice
file in the final
Run the OnlyOffice Docs Docker container. Specify required credentials.
published post.
ports 80 and 443 and set your domain name and email: Once you’ve completed the installation and
$ sudo docker run -i -t -d -p 80:80 -p 443:443 \ configuration process, go ahead and start your work.
-e LETS_ENCRYPT_DOMAIN=yourdomain.com -e All uploaded files from the Media section appear on the
LETS_ENCRYPT_MAIL=email@example.com OnlyOffice Files page within your admin dashboard.
onlyoffice/documentserver Users with administrator rights are able to edit and
Once done, OnlyOffice Docs will be available under collaborate on .docx, .xlsx and .pptx files using real-time
https://yourdomain.com. and paragraph-locking co-editing modes, Track
Changes, comments and the built-in chat facility.
Integration plugin The corresponding OnlyOffice editor opens in the
OnlyOffice’s integration plugin for WordPress is free and same tab when you click the file name. All the changes
distributed under the GNU GPL v2.0 licence. To install it, are saved in the same file after each editing session
clone the plugin master branch: (when all co-authors leave the document).
$ cd wp-content/plugins When creating a post, you can add the OnlyOffice
$ git clone https://github.com/ONLYOFFICE/ block and then upload a new file or select one from the
onlyoffice-wordpress Media Library. OnlyOffice supports a range of document
Once ready, navigate to the Plugins section in your file formats, including the standard .doc, .docx, .odt, .pdf
WordPress administrative dashboard and activate the and many more.
OnlyOffice plugin. When you have the plugin installed, The new file is displayed as the OnlyOffice logo with
configure OnlyOffice via the WordPress interface. Go the file name in the currently edited post. After the post
to the administrative dashboard and switch to the is published, WordPress site visitors have access to this
OnlyOffice Settings page. You need to specify the file for viewing in the embedded mode. This enables
Document Editing Service address – this is the URL them to view the inserted file without downloading it.
of the installed OnlyOffice Document Server. That’s it! As you can see, connecting OnlyOffice Docs
and WordPress is a straightforward process thanks to
Enhancing data security the OnlyOffice integration plugin, which acts like a
To protect your documents from unauthorised access, bridge between two services. Such integration makes
enter the Document server JWT secret key. The JSON it possible for you to work with office documents right
Web Token (JWT for short) helps to verify users who in your WordPress session without having to switch
enter the editing sessions in the editors and attempt to between several applications.
perform certain actions within documents. You need to
specify the same secret key in the OnlyOffice Document
CHOOSE YOUR CLOUD PLATFORM
WordPress is just one of the many services that you can connect
OnlyOffice with. You are also able to use OnlyOffice Docs with other
popular cloud platforms such as Strapi, Jira, Moodle, Nextcloud,
Alfresco, ownCloud, Seafile, Plone, Confluence, Liferay and HumHub.
You can either install the free version of OnlyOffice Docs or choose the
scalable enterprise build, and then just connect the editors with the
required service using ready-to-use integration tools. If you need
professional editing features for a family-size team, opt for Home
Server, a special tariff plan that’s designed especially for non-
commercial home use. You can find detailed information about
Here you can see an OnlyOffice block being added to a OnlyOffice Docs on the official website – see www.onlyoffice.com.
normal WordPress post.
129
THERE’S A BOOKAZINE
FOR EVERYONE
Whether you’re a film buff, an avid gamer, or love all things sci-fi,
we’ve got you covered with our range of entertainment titles
www.magazinesdirect.com
THE COMPLETE GUIDE TO
Bookazine Editorial
Group Editor Dan Peel
Senior Designer Steve Dacombe
Senior Art Editor Andy Downes
Head of Art & Design Greg Whitaker
Editorial Director Jon White
Linux Format 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
Photography
All copyrights and trademarks are recognised and respected
Advertising
Media packs are available on request
Commercial Director Clare Dove
International
Head of Print Licensing Rachel Shaw
licensing@futurenet.com
www.futurecontenthub.com
Circulation
Head of Newstrade Tim Mathers
Production
Head of Production Mark Constance
Production Project Manager Matthew Eglinton
Advertising Production Manager Joanne Crosby
Digital Editions Controller Jason Hudson
Production Managers Keely Miller, Nola Cokely,
Vivienne Calvert, Fran Twentyman
Printed in the UK
Distributed by Marketforce, 5 Churchill Place, Canary Wharf, London, E14 5HU
www.marketforce.co.uk – For enquiries, please email:
mfcommunications@futurenet.com
Complete Guide to Linux First Edition (TCB5272)
© 2023 Future Publishing Limited
We are committed to only using magazine paper which is derived from responsibly managed,
certified forestry and chlorine-free manufacture. The paper in this bookazine was sourced
and produced from sustainable managed forests, conforming to strict environmental and
socioeconomic standards.
All contents © 2023 Future Publishing Limited or published under licence. All rights reserved.
No part of this magazine may be used, stored, transmitted or reproduced in any way without
the prior written permission of the publisher. Future Publishing Limited (company number
2008885) is registered in England and Wales. Registered office: Quay House, The Ambury,
Bath BA1 1UA. All information contained in this publication is for information only and is, as far
as we are aware, correct at the time of going to press. Future cannot accept any responsibility
for errors or inaccuracies in such information. You are advised to contact manufacturers and
retailers directly with regard to the price of products/services referred to in this publication. Apps
and websites mentioned in this publication are not under our control. We are not responsible for
their contents or any other changes or updates to them. This magazine is fully independent and
not affiliated in any way with the companies mentioned herein.
Part of the
bookazine series
THE COMPLETE GUIDE TO