Men at Arms is the fifteenth Discworld novel and a direct plot
sequel to Guards! Guards!. You could
start here without missing too much, but starting with Guards!
Guards! would make more sense. And of course there are cameos (and one
major appearance) by other characters who are established in previous
books.
Carrot, the adopted dwarf who joined the watch in Guards! Guards!,
has been promoted to corporal. He is now in charge of training new
recruits, a role that is more important because of the Night Watch's new
Patrician-ordered diversity initiative. The Watch must reflect the ethnic
makeup of the city. That means admitting a troll, a dwarf... and a woman?
Trolls and dwarfs hate each other because dwarfs mine precious things out
of rock and trolls are composed of precious things embedded in rocks, so
relations between the new recruits are tense. Captain Vimes is leaving
the Watch, and no one is sure who would or could replace him. (The reason
for this is a minor spoiler for Guards! Guards!) A magical weapon
is stolen from the Assassin's Guild. And a string of murders begins,
murders that Vimes is forbidden by Lord Vetinari from investigating and
therefore clearly is going to investigate.
This is an odd moment at which to read this book.
The Night Watch are not precisely a police force, although they are moving
in that direction. Their role in Ankh-Morpork is made much stranger by
the guild system, in which the Thieves' Guild is responsible for theft and
for dealing with people who steal outside of the quota of the guild. But
Men at Arms is in part a story about ethics, about what it means to
be a police officer, and about what it looks like when someone is very
good at that job.
Since I live in the United States, that makes it hard to avoid reading
Men at Arms in the context of the current upheavals about police
racism, use of force, and lack of accountability. Men at Arms can
indeed be read that way; community relations, diversity in the police
force, the merits of making two groups who hate each other work together,
and the allure of violence are all themes Pratchett is working with in
this novel. But they're from the perspective of a UK author writing in
1993 about a tiny city guard without any of the machinery of modern
police, so I kept seeing a point of clear similarity and then being
slightly wrong-footed by the details. It also felt odd to read a book
where the cops are the heroes, much in the style of a detective show.
This is in no way a problem with the book, and in a way it was helpful
perspective, but it was a strange reading experience.
Cuddy had only been a guard for a few days but already he had absorbed
one important and basic fact: it is almost impossible for anyone to be
in a street without breaking the law.
Vimes and Carrot are both excellent police officers, but in entirely
different ways. Vimes treats being a cop as a working-class job and is
inclined towards glumness and depression, but is doggedly persistent and
unable to leave a problem alone. His ethics are covered by a thick layer
of world-weary cynicism. Carrot is his polar opposite in personality:
bright, endlessly cheerful, effortlessly charismatic, and determined to
get along with everyone. On first appearance, this contrast makes Vimes
seem wise and Carrot seem a bit dim. That is exactly what Pratchett is
playing with and undermining in Men at Arms.
Beneath Vimes's cynicism, he's nearly as idealistic as Carrot, even though
he arrives at his ideals through grim contrariness. Carrot, meanwhile, is
nowhere near as dim as he appears to be. He's certain about how he wants
to interact with others and is willing to stick with that approach no
matter how bad of an idea it may appear to be, but he's more self-aware
than he appears. He and Vimes are identical in the strength of their
internal self-definition. Vimes shows it through the persistent, grumpy
stubbornness of a man devoted to doing an often-unpleasant job, whereas
Carrot verbally steamrolls people by refusing to believe they won't do the
right thing.
Colon thought Carrot was simple. Carrot often struck people as
simple. And he was. Where people went wrong was thinking that simple
meant the same thing as stupid.
There's a lot going on in this book apart from the profiles of two very
different models of cop. Alongside the mystery (which doubles as pointed
commentary on the corrupting influence of violence and personal weaponry),
there's a lot about dwarf/troll relations, a deeper look at the
Ankh-Morpork guilds (including a horribly creepy clown guild), another
look at how good Lord Vetinari is at running the city by anticipating how
other people will react, a sarcastic dog named Gaspode (originally seen in
Moving Pictures), and Pratchett's usual
collection of memorable lines. It is also the origin of the
now-rightfully-famous Vimes boots theory:
The reason that the rich were so rich, Vimes reasoned, was because
they managed to spend less money.
Take boots, for example. He earned thirty-eight dollars a month plus
allowances. A really good pair of leather boots cost fifty dollars.
But an affordable pair of boots, which were sort of OK for a season or
two and then leaked like hell when the cardboard gave out, cost about
ten dollars. Those were the kind of boots Vimes always bought, and
wore until the soles were so thin that he could tell where he was in
Ankh-Morpork on a foggy night by the feel of the cobbles.
But the thing was that good boots lasted for years and years. A man
who could afford fifty dollars had a pair of boots that'd still be
keeping his feet dry in ten years' time, while the poor man who could
only afford cheap boots would have spent a hundred dollars on boots in
the same time and would still have wet feet.
This was the Captain Samuel Vimes 'Boots' theory of socioeconomic
unfairness.
Men at Arms regularly makes lists of the best Discworld novels, and
I can see why. At this point in the series, Pratchett has hit his stride.
The plots have gotten deeper and more complex without losing the funny
moments, movie and book references, and glorious turns of phrase. There
is also a lot of life philosophy and deep characterization when one pays
close attention to the characters.
He was one of those people who would recoil from an assault on
strength, but attack weakness without mercy.
My one complaint is that I found it a bit overstuffed with both characters
and subplots, and as a result had a hard time following the details of the
plot. I found myself wanting a timeline of the murders or a better recap
from one of the characters. As always with Pratchett, the digressions are
wonderful, but they do occasionally come at the cost of plot clarity.
I'm not sure I recommend the present moment in the United States as the
best time to read this book, although perhaps there is no better time for
Carrot and Vimes to remind us what good cops look like. But regardless of
when one reads it, it's an excellent book, one of the best in the
Discworld series to this point.
Followed, in publication order, by Soul Music. The next Watch book
is Feet of Clay.
Rating: 8 out of 10
A new minor release 0.2.9 of RcppCCTZ is now on CRAN.
RcppCCTZ uses Rcpp to bring CCTZ to R. CCTZ is a C++ library for translating between absolute and civil times using the rules of a time zone. In fact, it is two libraries. One for dealing with civil time: human-readable dates and times, and one for converting between between absolute and civil times via time zones. And while CCTZ is made by Google(rs), it is not an official Google product. The RcppCCTZ page has a few usage examples and details. This package was the first CRAN package to use CCTZ; by now at least three others do using copies in their packages which remains less than ideal.
This version adds a header file for the recently-exported three functions.
Changes in version 0.2.9 (2020-08-30)
Provide a header RcppCCZT_API.h for client packages.
Show a simple example of parsing a YYYYMMDD HHMMSS.FFFFFF date.
What is this thing?
When you first open a command-line (note that I use the terms command-line
and shell interchangably here, they re basically the same, but command-line
is the more general term, and shell is the name for the program that executes
commands for you)
you ll see something like this:
This line is called a command prompt and it tells you four pieces of information:
jaadams: The username of the user that is currently running this shell.
bg7: The name of the computer that this shell is running on, important
for when you start accessing shells on remote machines.
/tmp/thisfolder: The folder or directory that your shell is currently
running in. Like a file explorer (like Window s Explorer or Mac s Finder) a
shell always has a working directory, from which all relative paths (see
sidenote below) are resolved.
When you first opened a shell, however, you might notice that is looks more
like this:
This is a shorthand notation that the shell uses to make this output shorter
when possible. ~ stands for your home directory, usually /home/<username>.
Like C:\Users\<username>\ on Windows or /Users/<username> on Mac,
this directory is where all your files should go by default.
Thus a command prompt like this:
actually tells you that you are currently in the /home/jaadams/Downloads
directory.
Sidenote: The Unix Filesystem and Relative Paths
folders on Linux and other Unix-derived systems like MacOS are usually
called directories.
These directories are represented by paths, strings that indicate where the
directory is on the filesystem.
The one unusual part is the so-called root directory .
All files are stored in this folder or directories under it.
Its path is just / and there are no directories above it.
For example, the directory called home typically contains all user directories.
This is stored in the root directory, and each users specific data
is stored in a directory named after that user under home.
Thus, the home directory of the user jacob is typically /home/jacob,
the directory jacob under the
home directory stored in the root directory /.
If you re interested in more details about what goes in what directory,
man hier has the basics and the
Filesystem Hierarchy Standard
governs the layout of the filesystem on most Linux distributions.
You don t always have to use the full path, however.
If the path does not begin with a /, it is assumed that the path actually
begins with the path of the current directory.
So if you use a path like my/folders/here, and you re in the /home/jacob
directory, the path will be treated like /home/jacob/my/folders/here.
Each folder also contains the symbolic links .. and ..
Symbolic links are a very powerful kind of
file that is actually a reference to another file.
.. always represents the parent directory
of the current directory, so /home/jacob/.. links to /home/.
. always links to the current directory, so /home/jacob/. links to
/home/jacob.
Running commands
To run a command from the command prompt, you type its name and then
usually some arguments to tell it what to do.
For example, the echo command displays the text passed as arguments.
jacob@lovelace/home/jacob$ echo hello world
hello world
Arguments to commands are space-separated, so in the previous example hello
is the first argument and world is the second. If you need an argument to
contain spaces, you ll want to put quotes around it, echo "like so".
Certain arguments are called flags , or options (options if they take another
argument, flags otherwise) usually prefixed with a hyphen,
and they change the way a program operates.
For example, the ls command outputs the contents of a directory passed as
an argument, but if you add -l before the directory, it will give you more
details on the files in that directory.
jacob@lovelace/tmp/test$ ls /tmp/test
1 2 3 4 5 6
jacob@lovelace/tmp/test$ ls -l /tmp/test
total 0
-rw-r--r-- 1 jacob jacob 0 Aug 26 22:06 1
-rw-r--r-- 1 jacob jacob 0 Aug 26 22:06 2
-rw-r--r-- 1 jacob jacob 0 Aug 26 22:06 3
-rw-r--r-- 1 jacob jacob 0 Aug 26 22:06 4
-rw-r--r-- 1 jacob jacob 0 Aug 26 22:06 5
-rw-r--r-- 1 jacob jacob 0 Aug 26 22:06 6
jacob@lovelace/tmp/test$
Most commands take different flags to change their behavior in various ways.
File Management
cd <path>: Change the current directory of the running shell to <path>.
ls <path>: Output the contents of <path>. If no path is passed, it prints
the contents of the current directory.
touch <filename>: create an new empty file called <filename>.
Used on an existing file, it updates the file s last accessed and modified times.
Most text editors can also create a new file for you, which is probably more useful.
mkdir <directory>: Create a new folder/directory at path <directory>.
mv <src> <dest>: Move a file or directory at path <src> to <dest>.
cp <src> <dest>: Copy a file or directory at path <src> to <dest>.
rm <file>: Remove a file at path <file>.
zip -r <zipfile> <contents...>: Create a zip file <zipfile> with contents
<contents>. <contents> can be multiple arguments, and you ll usually want
to use the -r argument when including directories in your zipfile, as otherwise
only the directory will be included and not the files and directories within it.
Searching
grep <thing> <file>: Look for the string <thing> in <file>.
If no <file> is passed it searches standard input.
find <path> -name <name>: Find a file or directory called <name> somwhere
under <path>. This command is actually very powerful, but also very complex.
For example you can delete all files in a directory older than 30 days with:
find -mtime +30 -exec rm \;
locate <name>: A much easier to use command to find a file with a given
name, but it is not usually installed by default.
Outputting Files
cat <files...>: Output (concatenate) all the files passed as arguments.
head <file>: Output the beginning of <file>
tail <file>: Output the end of <file>
How to Find the Right Command
All commands (at least on sane Linux distributions like Debian or Ubuntu)
are documented with a manual page, in man section 1 (for more information on
manual sections, run man intro).
This can be accessed using man <command>
You can search for the right command using the -k flag, as in man -k <search>.
You can also view manual pages in your browser, on sites like https://manpages.debian.org
or https://linux.die.net/man.
This is not always helpful, however, because some command s descriptions are
not particularly useful, and also there are a lot of manual pages, which can
make searching for a specific one difficult. For example, finding the right
command to search inside text files is quite difficult via man (it s grep).
When you can t find what you need with man I recommend falling back to
searching the Internet. There are lots of bad Linux tutorials out there, but
here are some reputable sources I recommend:
Hosting providers like Digital Ocean or Linode: Good intro documentation, but
can sometimes be outdated
https://tldp.org: The Linux Documentation project is great, but it can also be a little
outdated sometimes.
https://stackoverflow.com: Oftentimes has great answers, but quality varies wildly
since anyone can answer.
These are certainly not the only options but they re the sources I would
recommend when available.
How to Read a Manual Page
Manual pages consist of a series of sections, each with a specific purpose.
Instead of attempting to write my own description here, I m going to borrow
the excellent one from The Linux Documentation Project
The NAME section
is the only required section. Man pages without a name section are as useful as refrigerators at the north pole. This section also has a standardized format consisting of a comma-separated list of program or function names, followed by a dash, followed by a short (usually one line) description of the functionality the program (or function, or file) is supposed to provide. By means of makewhatis(8), the name sections make it into the whatis database files. Makewhatis is the reason the name section must exist, and why it must adhere to the format I described.
(Formatting explanation cut for brevity)
The SYNOPSIS section
is intended to give a short overview on available program options. For functions this sections lists corresponding include files and the prototype so the programmer knows the type and number of arguments as well as the return type.
The DESCRIPTION section
eloquently explains why your sequence of 0s and 1s is worth anything at all. Here s where you write down all your knowledge. This is the Hall Of Fame. Win other programmers and users admiration by making this section the source of reliable and detailed information. Explain what the arguments are for, the file format, what algorithms do the dirty jobs.
The OPTIONS section
gives a description of how each option affects program behaviour. You knew that, didn t you?
The FILES section
lists files the program or function uses. For example, it lists configuration files, startup files, and files the program directly operates on.
(Cut details about installing files)
The ENVIRONMENT section
lists all environment variables that affect your program or function and tells how, of course. Most commonly the variables will hold pathnames, filenames or default options.
The DIAGNOSTICS section
should give an overview of the most common error messages from your program and how to cope with them. There s no need to explain system error error messages (from perror(3)) or fatal signals (from psignal(3)) as they can appear during execution of any program.
The BUGS section
should ideally be non-existent. If you re brave, you can describe here the limitations, known inconveniences and features that others may regard as misfeatures. If you re not so brave, rename it the TO DO section ;-)
The AUTHOR section
is nice to have in case there are gross errors in the documentation or program behaviour (Bzzt!) and you want to mail a bug report.
The SEE ALSO section
is a list of related man pages in alphabetical order. Conventionally, it is the last section.
Remote Access
One of the more powerful uses of the shell is through ssh, the secure shell.
This allows you to remotely connect to another computer and run a shell on that
machine:
The prompt changes to reflect the change in user and host,
as you can see in the example above.
This allows you to work in a shell on that machine as if it was right in front
of you.
Moving Files Between Machines
There are several ways you can move files between machines over ssh.
The first and easiest is scp, which works much like the cp command
except that paths can also take a user@host argument to move files across
computers. For example, if you wanted to move a file test.txt to your
home directory on another machine, the command would look like:
scp test.txt other@example.com:
(The home directory is the default path)
Otherwise you can move files by reversing the order of the arguments
and put a path after the colon to move files from another directory on the
remote host. For example, if you wanted to fetch the file /etc/issue.net
from example.com:
scp other@example.com:/etc/issue.net .
Another option is the sftp command, which gives you a very simple shell-like
interface in which you can cd and ls, before either puting files onto
the local machine or geting files off of it.
The final and most powerful option is rsync which syncs the contents of one
directory to another, and doesn t copy files that haven t changed. It s powerful
and complex, however, so I recommend reading the USAGE section of its man page.
Long-Running Commands
The one problem with ssh is that it will stop any command running in your
shell when you disconnect. If you want to leave something on and come back
later then this can be a problem.
This is where terminal multiplexers come in. tmux and screen both allow
you to run a shell in a safe environment where it will continue even if you
disconnect from it. You do this by running the command without any arguments,
i.e. just tmux or just screen.
In tmux you can disconnect from the current session by
pressing Ctrl+b then d, and reattach with the tmux attach command.
screen works similarly, but with Ctrl+a instead of b and screen -r to
reattach.
Command Inputs and Outputs
Arguments are not the only way to pass input to a command. They can also take
input from what s called standard input , which the shell usually connects to
your keyboard.
Output can go to two places, standard output and standard error, both of which
are directed to the screen by default.
Redirecting I/O
Note that I said above that standard input/output/error are only usually
connected to the keyboard and the terminal? This is because you can redirect
them to other places with the shell operators <, > and the very powerful .
File redirects
The operators < and > redirect the input and output of a command to a file.
For example, if you wanted a file called list.txt that contained a list of
all the files in a directory /this/one/here you could use:
ls /this/one/here > list.txt
Pipelines
The pipe character, , allows you to direct the output of one command into
the input of another. This can be very powerful.
For example, the following pipeline lists the contents of the current directory
searches for the string test , then counts the number of results.
(wc -l counts the number of lines in its input)
ls grep test wc -l
For a better, but even more contrived example, say you have a file myfile,
with a bunch of lines of potentially duplicated and unsorted data
test
test
1234
4567
1234
You can sort it and output only the unique lines with sort and uniq:
$ uniq < myfile sort
1234
1234
4567
test
Save Yourself Some Typing: Globs and Tab-Completion
Sometimes you don t want to type out the whole filename when writing out a
command. The shell can help you here by autocompleting when you press the tab
key.
If you have a whole bunch of files with the same suffix, you can refer to them
when writing arguments as *.suffix. This also works with prefixes, prefix*,
and in fact you can put a * anywhere, *middle*. The shell will expand that
* into all the files in that directory that match your criteria
(ending with a specific suffix, starting with a specific prefix, and so on)
and pass each file as a separate argument to the command.
For example, if I have a series of files called 1.txt, 2.txt, and so on
up to 9, each containing just the number for which it s named, I could use
cat to output all of them like so:
Also the ~ shorthand mentioned above that refers to your home directory
can be used when passing a path as an argument to a command.
Ifs and For loops
The files in the above example were generated with the following shell
commands:
for i in 1 2 3 4 5 6 7 8 9
do
echo $i > $i.txt
done
But I ll have to save variables, conditionals and loops for another day because
this is already too long. Needless to say the shell is a full programming
language, although a very ugly and dangerous one.
[Disclaimer: this has been sitting as a draft for close to three months ; I forgot to publish it, this is now finally done.]
In my previous blog post, I built Firefox in a multiple different number of configurations where I d disable the CPU turbo, some of its cores or some of its threads. That is something that was traditionally done via the BIOS, but rebooting between each attempt is not really a great experience.
Fortunately, the Linux kernel provides a large number of knobs that allow this at runtime.
Turbo
This is the most straightforward:
$ echo 0 > /sys/devices/system/cpu/cpufreq/boost
Re-enable with
$ echo 1 > /sys/devices/system/cpu/cpufreq/boost
CPU frequency throttling
Even though I haven t mentioned it, I might as well add this briefly. There are many knobs to tweak frequency throttling, but assuming your goal is to disable throttling and set the CPU frequency to its fastest non-Turbo frequency, this is how you do it:
where $n is the id of the core you want to do that for, so if you want to do that for all the cores, you need to do that for cpu0, cpu1, etc.
Re-enable with:
(assuming this was the value before you changed it ; ondemand is usually the default)
Cores and Threads
This one requires some attention, because you cannot assume anything about the CPU numbers. The first thing you want to do is to check those CPU numbers. You can do so by looking at the physical id and core id fields in /proc/cpuinfo, but the output from lscpu --extended is more convenient, and looks like the following:
Now, this output is actually the ideal case, where pairs of CPUs (virtual cores) on the same physical core are always n, n+32, but I ve had them be pseudo-randomly spread in the past, so be careful.
To turn off a core, you want to turn off all the CPUs with the same CORE identifier. To turn off a thread (virtual core), you want to turn off one CPU. On machines with multiple sockets, you can also look at the SOCKET column.
Turning off one CPU is done with:
$ echo 0 > /sys/devices/system/cpu/cpu$n/online
Re-enable with:
$ echo 1 > /sys/devices/system/cpu/cpu$n/online
Extra: CPU sets
CPU sets are a feature of Linux s cgroups. They allow to restrict groups of processes to a set of cores.
The first step is to create a group like so:
$ mkdir /sys/fs/cgroup/cpuset/mygroup
Please note you may already have existing groups, and you may want to create subgroups. You can do so by creating subdirectories.
Then you can configure on which CPUs/cores/threads you want processes in this group to run on:
The value you write in this file is a comma-separated list of CPU/core/thread numbers or ranges. 0-3 is the range for CPU/core/thread 0 to 3 and is thus equivalent to 0,1,2,3. The numbers correspond to /proc/cpuinfo or the output from lscpu as mentioned above.
There are also memory aspects to CPU sets, that I won t detail here (because I don t have a machine with multiple memory nodes), but you can start with:
There are a number of tweaks you can do to this setup, I invite you to check out the cpuset(7) manual page.
Disabling a group is a little involved. First you need to move the processes to a different group:
$ while read pid; do echo $pid > /sys/fs/cgroup/cpuset/tasks; done < /sys/fs/cgroup/cpuset/mygroup/tasks
A new release 0.2.2 of the RcppSMC package arrived on CRAN earlier today (and once again as a very quick pretest-publish within minutes of submission).
RcppSMC provides Rcpp-based bindings to R for the Sequential Monte Carlo Template Classes (SMCTC) by Adam Johansen described in his JSS article. Sequential Monte Carlo is also referred to as Particle Filter in some contexts.
This releases contains two fixes from a while back that had not been released, a CRAN-requested update plus a few more minor polishes to make it pass R CMD check --as-cran as nicely as usual.
Changes in RcppSMC version 0.2.2 (2020-08-30)
Package helper files .editorconfig added (Adam in #43).
Change const correctness and add return (Leah in #44).
Updates to continuous integration and R versions used (Dirk)
Accomodate CRAN request, other updates to CRAN Policy (Dirk in #49 fixing #48).
Dealing with the void during MiniDebConf Online #1
Between 28 and 31 May this year, we set out to create our first ever online MiniDebConf for Debian. Many people have been meaning to do something similar for a long time, but it just didn t work out yet. With many of us being in lock down due to COVID-19, and with the strong possibility looming that DebConf20 might have had to become an online event, we rushed towards organising the first ever Online MiniDebConf and put together some form of usable video stack for it.
I could go into all kinds of details on the above, but this post is about a bug that lead to a pretty nifty feature for DebConf20. The tool that we use to capture Jitsi calls is called Jibri (Jitsi Broadcasting Infrustructure). It had a bug (well, bug for us, but it s an upstream feature) where Jibri would hang up after 30s of complete silence, because it would assume that the call has ended and that the worker can be freed up again. This would result in the stream being ended at the end of every talk, so before the next talk, someone would have to remember to press play again in their media player or on the video player on the stream page. Hrmph.
Easy solution on the morning that the conference starts? I was testing a Debian Live image the night before in a KVM and thought that I might as well just start a Jitsi call from there and keep a steady stream of silence so that Jibri doesn t hang up.
It worked! But the black screen and silence on stream was a bit eery. Because this event was so experimental in nature, and because we were on such an incredibly tight timeline, we opted not to seek sponsors for this event, so there was no sponsors loop that we d usually stream during a DebConf event. Then I thought Ah! I could just show the schedule! .
The stream looked bright and colourful (and was even useful!) and Jitsi/Jibri didn t die. I thought my work was done. As usual, little did I know how untrue that was.
The silence was slightly disturbing after the talks, and people asked for some music. Playing music on my VM and capturing the desktop audio in to Jitsi was just a few pulseaudio settings away, so I spent two minutes finding some freely licensed tracks that sounded ok enough to just start playing on the stream. I came across mini-albums by Captive Portal and Cinema Noir, During the course of the MiniDebConf Online I even started enjoying those. Someone also pointed out that it would be really nice to have a UTC clock on the stream. I couldn t find a nice clock in a hurry so I just added a tmux clock in the meantime while we deal with the real-time torrent of issues that usually happens when organising events like this.
Speaking of issues, during our very first talk of the last day, our speaker had a power cut during the talk and abruptly dropped off. Oops! So, since I had a screenshare open from the VM to the stream, I thought I d just pop in a quick message in a text editor to let people know that we re aware of it and trying to figure out what s going on.
In the end, MiniDebConf Online worked out all right. Besides the power cut for our one speaker, and another who had a laptop that was way too under-powered to deal with video, everything worked out very well. Even the issues we had weren t show-stoppers and we managed to work around them.
DebConf20 Moves Online
For DebConf, we usually show a sponsors loop in between sessions. It s great that we give our sponsors visibility here, but in reality people see the sponsors loop and think Talk over! and then they look away. It s also completely silent and doesn t provide any additional useful information. I was wondering how I could take our lessons from MDCO#1 and integrate our new tricks with the sponsors loop. That is, add the schedule, time, some space to type announcements on the screen and also add some loopable music to it.
I used OBS before in making my videos, and like the flexibility it provides when working with scenes and sources. A scene is what you would think of as a screen or a document with its own collection of sources or elements. For example, a scene might contain sources such as a logo, clock, video, image, etc. A scene can also contain another scene. This is useful if you want to contain a banner or play some background music that is shared between scenes.
The above screenshots illustrate some basics of scenes and sources. First with just the DC20 banner, and then that used embedded in another scene.
For MDCO#1, I copied and pasted the schedule into a LibreOffice Impress slide that was displayed on the stream. Having to do this for all 7 days of DebConf, plus dealing with scheduling changes would be daunting. So, I started to look in to generating some schedule slides programmatically. Stefano then pointed me to the Happening Now page on the DebConf website, where the current schedule block is displayed. So all I would need to do in OBS was to display a web page. Nice!
Unfortunately the OBS in Debian doesn t have the ability to display web pages out of the box (we need to figure out CEF in Debian), but fortunately someone provides a pre-compiled version of the plugin called Linux Browser that works just fine. This allowed me to easily add the schedule page in its own scene.
Being able to display a web page solved another problem. I wasn t fond of having to type / manage the announcements in OBS. It would either be a bit prone to user error, and if you want to edit the text while the loop is running, you d have to disrupt the loop, go to the foreground scene, and edit the text before resuming the loop. That s a bit icky. Then I thought that we could probably just get that from a web page instead. We could host some nice html snippet in a repository in salsa, and then anyone could easily commit an MR to update the announcement.
But then I went a step further, use an etherpad! Then anyone in the orga team can quickly update the announcement and it would be instantly changed on the stream. Nice! So that small section of announcement text on the screen is actually a whole web browser with an added OBS filter to crop away all the pieces we don t want. Overkill? Sure, but it gave us a decent enough solution that worked in time for the start of DebConf. Also, being able to type directly on to the loop screen works out great especially in an emergency. Oh, and uhm the clock is also a website rendered in its own web browser :-P
So, I had the ability to make scenes, add elements and add all the minimal elements I wanted in there. Great! But now I had to figure out how to switch scenes automatically. It s probably worth mentioning that I only found some time to really dig into this right before DebConf started, so with all of this I was scrambling to find things that would work without too many bugs while also still being practical.
Now I needed the ability to switch between the scenes automatically / programmatically. I had never done this in OBS before. I know it has some API because there are Android apps that you can use to control OBS with from your phone. I discovered that it had an automatic scene switcher, but it s very basic. It can only switch based on active window, which can be useful in some cases, but since we won t have any windows open other than OBS, this tool was basically pointless.
After some quick searches, I found a plugin called Advanced Scene Switcher. This plugin can do a lot more, but has some weird UI choices, and is really meant for gamers and other types of professional streamers to help them automate their work flow and doesn t seem at all meant to be used for a continuous loop, but, it worked, and I could make it do something that will work for us during the DebConf.
I had a chicken and egg problem because I had to figure out a programming flow, but didn t really have any content to work with, or an idea of all the content that we would eventually have. I ve been toying with the idea in my mind and had some idea that we could add fun facts, postcards (an image with some text), time now in different timezones, Debian news (maybe procured by the press team), cards that contain the longer announcements that was sent to debconf-announce, perhaps a shout out or two and some photos from previous DebConfs like the group photos. I knew that I wouldn t be able to build anything substantial by the time DebConf starts, but adding content to OBS in between talks is relatively easy, so we could keep on building on it during DebConf.
Nattie provided the first shout out, and I made 2 video loops with the DC18/19 pictures and also two Did you know cards. So the flow I ended up with was: Sponsors -> Happening Now -> Random video (which would be any of those clips) -> Back to sponsors. This ended up working pretty well for quite a while. With the first batch of videos the sponsor loop would come up on average about every 2 minutes, but as much shorter clips like shout outs started to come in faster and faster, it made sense to play a few 2-3 shout-outs before going back to sponsors.
So here is a very brief guide on how I set up the sequencing in Advanced Scene Switcher.
If no condition was met, a video would play from the Random tab.
Then in the Random tab, I added the scenes that were part of the random mix. Annoyingly, you have to specify how long it should play for. If you don t, the no condition thingy is triggered and another video is selected. The time is also the length of the video minus one second, because
You can t just say that a random video should return back to a certain scene, you have to specify that in the sequence tab for each video. Why after 1 second? Because, at least in my early tests, and I didn t circle back to this, it seems like 0s can randomly either mean instantly, or never. Yes, this ended up being a bit confusing and tedious, and considering the late hours I worked on this, I m surprised that I didn t manage to screw it up completely at any point.
I also suspected that threads would eventually happen. That is, when people create video replies to other videos. We had 3 threads in total. There was a backups thread, beverage thread and an impersonation thread. The arrow in the screenshot above points to the backups thread. I know it doesn t look that complicated, but it was initially somewhat confusing to set up and make sense out of it.
For the next event, the Advanced Scene Switcher might just get some more taming, or even be replaced entirely. There are ways to drive OBS by API, and even the Advanced Scene Switcher tool can be driven externally to some degree, but I think we definitely want to replace it by the next full DebConf. We had the problem that when a talk ended, we would return to the loop in the middle of a clip, which felt very unnatural and sometimes even confusing. So Stefano helped me with a helper script that could read the socket from Vocto, which I used to write either Loop or Standby to a file, and then the scene switcher would watch that file and keep the sponsors loop ready for start while the talks play. Why not just switch to sponsors when the talk ends? Well, the little bit of delay in switching would mean that you would see a tiny bit of loop every time before switching to sponsors. This is also why we didn t have any loop for the ad-hoc track (that would have probably needed another OBS instance, we ll look more into solutions for this for the future).
Then for all the clips. There were over 50 of them. All of them edited by hand in kdenlive. I removed any hard clicks, tried to improve audibility, remove some sections at the beginning and the end that seemed extra and added some music that would reduce in volume when someone speaks. In the beginning, I had lots of fun with choosing music for the clips. Towards the end, I had to rush them through and just chose the same tune whether it made sense or not. For comparison of what a difference the music can make, compare the original and adapted version for Valhalla s clip above, or this original and adapted video from urbec. This part was a lot more fun than dealing with the video sequencer, but I also want to automate it a bit. When I can fully drive OBS from Python I ll likely instead want to show those cards and control music volume from Python (what could possibly go wrong ).
The loopy name happened when I requested an @debconf.org alias for this. I was initially just thinking about loop@debconf.org but since I wanted to make it clear that the purpose of this loop is also to have some fun, I opted for loopy instead:
I was really surprised by how people took to loopy. I hoped it would be good and that it would have somewhat positive feedback, but the positive feedback was just immense. The idea was that people typically saw it in between talks. But a few people told me they kept it playing after the last talk of the day to watch it in the background. Some asked for the music because they want to keep listening to it while working (and even for jogging!?). Some people also asked for recordings of the loop because they want to keep it for after DebConf. The shoutouts idea proved to be very popular. Overall, I m very glad that people enjoyed it and I think it s safe to say that loopy will be back for the next event.
Also throughout this experiment Loopy Loop turned into yet another DebConf mascot. We gain one about every DebConf, some by accident and some on purpose. This one was not quite on purpose. I meant to make an image for it for salsa, and started with an infinite loop symbol. That s a loop, but by just adding two more solid circles to it, it looks like googly eyes, now it s a proper loopy loop!
I like the progress we ve made on this, but there s still a long way to go, and the ideas keep heaping up. The next event is quite soon (MDCO#2 at the end of November, and it seems that 3 other MiniDebConf events may also be planned), but over the next few events there will likely be significantly better graphics/artwork, better sequencing, better flow and more layout options. I hope to gain some additional members in the team to deal with incoming requests during DebConf. It was quite hectic this time! The new OBS also has a scripting host that supports Python, so I should be able to do some nice things even within OBS without having to drive it externally (like, display a clock without starting a web browser).
The Loopy Loop Music
The two mini albums that mostly played during the first few days were just a copy and paste from the MDCO#1 music, which was:
I have much more things to say about DebConf20, but I ll keep that for another post, and hopefully we can get all the other video stuff in a post from the video team, because I think there s been some real good work done for this DebConf. Also thanks to Infomaniak who was not only a platinum sponsor for this DebConf, but they also provided us with plenty of computing power to run all the video stuff on. Thanks again!
On Saturday 29 August 2020, the annual Debian Developers
and Contributors Conference came to a close.
DebConf20 has been held online for the first time, due to the coronavirus
(COVID-19) disease pandemic.
All of the sessions have been streamed, with a variety of ways of participating:
via IRC messaging, online collaborative text documents,
and video conferencing meeting rooms.
With more than 850 attendees from 80 different countries and a
total of over 100 event talks, discussion sessions,
Birds of a Feather (BoF) gatherings and other activities,
DebConf20 was a large success.
When it became clear that DebConf20 was going to be an online-only
event, the DebConf video team spent much time over the next months to
adapt, improve, and in some cases write from scratch, technology that
would be required to make an online DebConf possible. After lessons
learned from the MiniDebConfOnline in late May, some adjustments were
made, and then eventually we came up with a setup involving Jitsi, OBS,
Voctomix, SReview, nginx, Etherpad, and a newly written web-based
frontend for voctomix as the various elements of the stack.
All components of the video infrastructure are free software, and the
whole setup is configured through their public
ansible repository.
The DebConf20 schedule included
two tracks in other languages than English: the Spanish language MiniConf,
with eight talks in two days,
and the Malayalam language MiniConf, with nine talks in three days.
Ad-hoc activities, introduced by attendees over the course of the entire conference,
have been possible too, streamed and recorded. There have also been several
team gatherings to sprint on certain Debian development areas.
Between talks, the video stream has been showing the usual sponsors on the loop, but also
some additional clips including photos from previous DebConfs, fun facts about Debian
and short shout-out videos sent by attendees to communicate with their Debian friends.
For those who were not able to participate, most of the talks and sessions are already
available through the
Debian meetings archive website,
and the remaining ones will appear in the following days.
The DebConf20 website
will remain active for archival purposes and will continue to offer
links to the presentations and videos of talks and events.
Next year, DebConf21 is planned to be held
in Haifa, Israel, in August or September.
DebConf is committed to a safe and welcome environment for all participants.
During the conference, several teams (Front Desk, Welcome team and Community team)
have been available to help so participants get their best experience
in the conference, and find solutions to any issue that may arise.
See the web page about the Code of Conduct in DebConf20 website
for more details on this.
Debian thanks the commitment of numerous sponsors
to support DebConf20, particularly our Platinum Sponsors:
Lenovo,
Infomaniak,
Google
and
Amazon Web Services (AWS).
About Debian
The Debian Project was founded in 1993 by Ian Murdock to be a truly
free community project. Since then the project has grown to be one of
the largest and most influential open source projects. Thousands of
volunteers from all over the world work together to create and
maintain Debian software. Available in 70 languages, and
supporting a huge range of computer types, Debian calls itself the
universal operating system.
About DebConf
DebConf is the Debian Project's developer conference. In addition to a
full schedule of technical, social and policy talks, DebConf provides an
opportunity for developers, contributors and other interested people to
meet in person and work together more closely. It has taken place
annually since 2000 in locations as varied as Scotland, Argentina, and
Bosnia and Herzegovina. More information about DebConf is available from
https://debconf.org/.
About Lenovo
As a global technology leader manufacturing a wide portfolio of connected products,
including smartphones, tablets, PCs and workstations as well as AR/VR devices,
smart home/office and data center solutions, Lenovo
understands how critical open systems and platforms are to a connected world.
About Infomaniak
Infomaniak is Switzerland's largest web-hosting company,
also offering backup and storage services, solutions for event organizers,
live-streaming and video on demand services.
It wholly owns its datacenters and all elements critical
to the functioning of the services and products provided by the company
(both software and hardware).
About Google
Google is one of the largest technology companies in the
world, providing a wide range of Internet-related services and products such
as online advertising technologies, search, cloud computing, software, and hardware.
Google has been supporting Debian by sponsoring DebConf for more than
ten years, and is also a Debian partner sponsoring parts
of Salsa's continuous integration infrastructure
within Google Cloud Platform.
About Amazon Web Services (AWS)
Amazon Web Services (AWS) is one of the world's
most comprehensive and broadly adopted cloud platforms,
offering over 175 fully featured services from data centers globally
(in 77 Availability Zones within 24 geographic regions).
AWS customers include the fastest-growing startups, largest enterprises
and leading government agencies.
Contact Information
For further information, please visit the DebConf20 web page at
https://debconf20.debconf.org/
or send mail to press@debian.org.
This is another test-only release of my module for manipulating PGP
signatures in Perl. I'm trying to get the CPAN testing failures down to a
dull roar. This iteration fixes some testing issues with systems that
have only GnuPG v1 and tries to handle systems whose gpg is GnuPG v2 but
is older than 2.1.12 and therefore doesn't have the --pinentry-mode
flag that GnuPG uses to suppress password prompting.
I handled the latter by skipping the tests if the gpg on the user's PATH
was too old. I'm not certain this is the best approach, although it makes
the CPAN automated testing more useful for me, since the module will not
work without special configuration on those systems. On the other hand,
if someone is installing it to point to some other GnuPG binary on the
system at runtime, failing the installation because their system gpg is
too old seems wrong, and the test failure doesn't indicate a bug in the
module.
Essentially, I'm missing richer test metadata in the Perl ecosystem. I
want to be able to declare a dependency on a non-Perl system binary, but
of course Perl has no mechanism to do that.
I thought about trying to deal with the Windows failures due to missing
IPC::Run features (redirecting high-numbered file descriptors) on the
Windows platform in a similar way, but decided in that case I do want the
tests to fail because PGP::Sign will never work on that platform
regardless of the runtime configuration. Here too I spent some time
searching for some way to indicate with Module::Build that the module
doesn't work on Windows, and came up empty. This seems to be a gap in
Perl's module distribution ecosystem.
In any case, hopefully this release will clean up the remaining test
failures on Linux and BSD systems, and I can move on to work on the Big
Eight signing key, which was the motivating application for these
releases.
You can get the latest release from CPAN or from the
PGP::Sign distribution page.
The Debian Janitor is an automated
system that commits fixes for (minor) issues in Debian packages that can be
fixed by software. It gradually started proposing merges in early
December. The first set of changes sent out ran lintian-brush on sid packages maintained in
Git. This post is part of a series about the progress of the
Janitor.
Last week s blog post
documented how there are now over 30,000 lintian issues
that have been fixed in git packaging repositories by the
Janitor.
It's important to note that any fixes from the Janitor that
make it into a Git packaging repository will also need
to be uploaded to the Debian archive. This currently requires
that a Debian packager clones the repository and builds
and uploads the package.
Until a change makes it into the archive, users of Debian
will unfortunately not see the benefits of improvements
made by the Janitor.
82% of the 30,000 changes from the Janitor that have made
it into a Git repository have not yet been uploaded, although
changes do slowly trickle in as maintainers make other
changes to packages and upload them along with the lintian
fixes from the Janitor. This is not just true for changes
from the Janitor, but for all sorts of other smaller improvements
as well.
However, the process of cloning and building git repositories
and uploading the resulting packages to the Debian archive
is fairly time-consuming and it s probably not worth
the time of developers to follow up every change from the
Janitor with a labour-intensive upload to the archive.
It would be great if it was easier to trigger uploads from
git commits. Projects like tag2upload will hopefully help, and
make it more likely that changes end up in the Debian archive.
The majority packages do get at least one new source version
upload per release, so most changes will eventually make
it into the archive.
For more information about the Janitor's lintian-fixes efforts, see the landing page.
A new minor release of the anytime package arrived on CRAN yesterday. This is the twentieth release, but sadly we seem to be spinning our wheels just accomodating CRAN (which the two or three last releases focused on). Code and functionality remain mature and stable, of course.
anytime is a very focused package aiming to do just one thing really well: to convert anything in integer, numeric, character, factor, ordered, format to either POSIXct or Date objects and to do so without requiring a format string as well as accomodating different formats in one input vector. See the anytime page, or the GitHub README.md for a few examples.
This release once again has to play catchup with CRAN as r-devel now changes how tzone propagates when we do as.POSIXct(as.POSIXlt(Sys.time()) which is now no longer equal to as.POSIXct(Sys.time()) even for a fixed, stored Sys.time() call result. Probably for the better, but an issue for now so we effectively just reduced test coverage. Call it progress .
The full list of changes follows.
Changes in anytime version 0.3.9 (2020-08-26)
Skip one test file that is impossible to run across different CRAN setups, and life is definitely too short for these games.
Change remaining http:// to https:// because, well, you know.
DebConf20 is taking place online, from 23 August to 29 August 2020.
It is the 21st Debian conference, and organizers and participants are working hard
together at creating interesting and fruitful events.
We would like to warmly welcome the 17 sponsors of DebConf20, and introduce them to you.
We have four Platinum sponsors.
Our first Platinum sponsor is Lenovo.
As a global technology leader manufacturing a wide portfolio of connected products,
including smartphones, tablets, PCs and workstations as well as AR/VR devices,
smart home/office and data center solutions, Lenovo
understands how critical open systems and platforms are to a connected world.
Our next Platinum sponsor is Infomaniak.
Infomaniak is Switzerland's largest web-hosting company,
also offering backup and storage services, solutions for event organizers,
live-streaming and video on demand services.
It wholly owns its datacenters and all elements critical
to the functioning of the services and products provided by the company
(both software and hardware).
Google is our third Platinum sponsor.
Google is one of the largest technology companies in the
world, providing a wide range of Internet-related services and products such
as online advertising technologies, search, cloud computing, software, and hardware.
Google has been supporting Debian by sponsoring DebConf for more than
ten years, and is also a Debian partner.
Amazon Web Services (AWS) is our fourth Platinum
sponsor.
Amazon Web Services is one of the world's
most comprehensive and broadly adopted cloud platforms,
offering over 175 fully featured services from data centers globally
(in 77 Availability Zones within 24 geographic regions).
AWS customers include the fastest-growing startups, largest enterprises
and leading government agencies.
Our Gold sponsors are Deepin, the Matanel Foundation, Collabora, and HRT.
Deepin is a Chinese commercial company focusing on
the development and service of Linux-based operating systems. They also lead
research and development of the Deepin Debian derivative.
The Matanel Foundation operates in Israel,
as its first concern is to preserve the cohesion of a society and a nation
plagued by divisions. The Matanel Foundation also works in Europe, in Africa
and in South America.
Collabora is a global consultancy delivering
Open Source software solutions to the commercial world.
In addition to offering solutions to clients, Collabora's engineers and developers
actively contribute to many Open Source projects.
Hudson-Trading
is a company led by mathematicians, computer scientists, statisticians,
physicists and engineers. They research and develop automated trading algorithms
using advanced mathematical techniques.
Our Silver sponsors are:
Linux Professional Institute, the global
certification standard and career support organization for open source professionals,
Civil Infrastructure Platform,
a collaborative project hosted by the Linux Foundation,
establishing an open source base layer of industrial grade software,
Ubuntu,
the Operating System delivered by Canonical,
and Roche,
a major international pharmaceutical provider and research company
dedicated to personalized healthcare.
Bronze sponsors:
IBM,
MySQL,
Univention.
And finally, our Supporter level sponsors, ISG.EE
and Pengwin.
Thanks to all our sponsors for their support!
Their contributions make it possible for a large number
of Debian contributors from all over the globe to work together,
help and learn from each other in DebConf20.
Participating in DebConf20 online
The 21st Debian Conference is being held online, due to COVID-19,
from August 23 to 29, 2020. Talks, discussions, panels and other activities run from 10:00 to 01:00 UTC.
Visit the DebConf20 website at https://debconf20.debconf.org
to learn about the complete schedule, watch the live streaming and join the different
communication channels for participating in the conference.
Like each month, albeit a bit later due to vacation, here comes a report about the work of paid contributors to Debian LTS.
Individual reports
In July, 249.25 work hours have been dispatched among 14 paid contributors. Their reports are available:
Abhijith PA did 18.0h (out of 14h assigned and 6h from June), and gave back 2h to the pool.
Adrian Bunk did 16.0h (out of 25.25h assigned), thus carrying over 9.25h to August.
Ben Hutchings did 5h (out of 20h assigned), and gave back the remaining 15h.
Evolution of the situation
July was our first month of Stretch LTS! Given this is our fourth LTS release
we anticipated a smooth transition and it seems everything indeed went very well.
Many thanks to the members of the Debian ftpmaster-, security, release- and publicity-
teams who helped us make this happen!
Stretch LTS begun on July 18th 2020 after the
13th and final Stretch point release. and is currently scheduled to end on
June 30th 2022.
Last month, we asked you to participate in a survey and we got 1764 submissions, which is pretty awesome.
Thank you very much for participating!. Right now we are still busy crunching the results, but we already shared some early analysis during the Debconf LTS bof this week.
The security tracker currently lists 54 packages with a known CVE and the dla-needed.txt file has 52 packages needing an update.
Thanks to our sponsors
New sponsors are in bold.
The diffoscope maintainers are pleased to announce the release of diffoscope
version 158. This version includes the following changes:
* Improve PGP support:
- Support extracting of files within PGP signed data.
(Closes: reproducible-builds/diffoscope#214)
- pgpdump(1) can successfully parse some unrelated, non-PGP binary files,
so check that the parsed output contains something remotely sensible
before identifying it as a PGP file.
* Don't use Python's repr(...)-style output in "Calling external command"
logging output.
* Correct a typo of "output" in an internal comment.
Welcome to the 29th post in the randomly repeating R recommendations series or R4 for short. Our last post #28 introduced RSPM, and just before that we also talked in #27 about binary installations on Ubuntu (which was also a T4 video). This post is joined with I aki Ucar and mainly about work we have done with his bspm package.
Background
CRAN has been a cornerstone of the success of R in recent years. As a well-maintained repository with stringent quality control, it ensures users have access to highest-quality statistical / analytical software that just works . Users on Windows and macOS also benefit from faster installation via pre-compiled binary packages.
Linux users generally install from source, which can be more tedious and, often, much slower. Those who know where to look have had access to (at least some) binaries for years as well (and one of us blogged and vlogged about this at length). Debian users get close to 1000 CRAN and BioConductor packages (and, true to Debian form, for well over a dozen hardware platforms). Michael Rutter maintains a PPA with 4600 binaries for three different Ubuntu flavors (see c2d4u4.0+). More recently, Fedora joined the party with 16000 (!!) binaries, essentially all of CRAN, via a Copr repository (see iucar/cran).
The buzz currently is however with RSPM, a new package manager by RStudio. An audacious project, it provides binaries for several Linux distributions and releases. It has already been tested in many RStudio Cloud sessions (including with some of our students) as well as some CI integrations.
RSPM cuts across and takes the breadth of CRAN across several Linux distributions, bringing installation of pre-built CRAN packages a binaries under their normal CRAN package names. Another nice touch is the integration with install.packages(): these binaries are installed in a way that is natural for R users but as binaries. It is however entirely disconnected from the system package management. This means that the installation of a package requiring an external library may succeed and still fail, as a required library simply cannot be pulled in directly by RSPM.
So what is needed is a combination. We want binaries that are aware of their system dependencies but accessible directly from R just like RSPM offers it. Enter BSPM the Bridge to System Package Manager package (also on CRAN).
The first illustration (using Ubuntu 18.04) shows RSPM on the left, and BSPM on the right, both installing the graphics package Cairo (and both using custom Rocker containers).
This fails for RSPM as no binary is present and a source build fails for the familiar lack of a -dev package. It proceeds just fine on the right under BSPM.
A second illustration shows once again RSPM on the left, and BSPM on the right (this time on Fedora), both installing the units package without a required system dependency.
The installation of units works for BSPM as the dependency libudunits is brought in, but fails under RSPM. The binary installation succeeds in both cases, but the missing dependency (the UDUNITS2 library) is brought in only by BSPM. Consequently, the package fails to load under RSPM.
Summary
To conclude, highlights of BSPM are:
direct installation of binary packages from R via R commands under their normal CRAN names (just like RSPM);
full integration with the system package manager, delivering system installations (improving upon RSPM);
full dependency resolution for R packages, including system requirements (improving upon RSPM).
This offers easy, reliable, fast installation of R packages, and we invite you to pick all three. We recommend usage with either Ubuntu with the 4.6k packages via the Rutter PPA, or Fedora via the even more complete Copr repository (which already includes a specially-tailored version of BSPM called CoprManager).
We hope this short note wets your appetite to learn more about bspm (which is itself on CRAN) and the two sets of Rocker containers shown. The rocker/r-rspm container comes in two two flavours for Ubuntu 18.04 and 20.04. Similarly, the rocker/r-bspm container comes in the same two two flavours for Ubuntu 18.04 and 20.04, as well as in a Debian testing variant.
Feedback is appreciated at the bspm or rocker issue trackers.
If you like this or other open-source work I do, you can now sponsor me at GitHub. For the first year, GitHub will match your contributions.
The DebConf 20 song - a sea shanty - to the tune of "Fathom the bowl"
Here's to DebConf 20, the brightest and best Now it's this year's orga team getting no rest We're not met in Haifa - it's all doom and gloom And I'm sat like a lifer here trapped in my room
I'm sat in my room, it's all doom and gloom And I'm sat at my keyboard here trapped in my room
Now there's IRC rooms and there's jitsi and all But no fun conversations as we meet in the hall No hugs for old friends, no shared wine and cheese Just shared indigestion as we take our ease
I'm sat in my room, it's all doom and gloom And I'm sat with three screens around me in my room
But there's people to chat to, and faces we know And new things to learn and we're all on the go Algo en espanol - there's no cause for alarm An Indic track showcasing Malayalam
I'm sat in my room, it's all doom and gloom And I'm sat with my Thinkpads and cats in my room
With webcams and buffering, with lag and delay It's as well that there's Debconf time all through the day The effects of tiredness are hard to foresee For the Debian clocks all are timezone UTC
I'm sat in my room, it's all doom and gloom And I'll sing out of tune as I'm sat in my room
There's no social drinking, there's no games of Mao Keeping social distance, we can't think quite how This year is still friendly though minus some fun We'll catch up next year when we'll all get some sun
I'm sat in my room, it's all doom and gloom I'm sat with my friends around here in my room
There's loopy@debconf and snippets and such To cheer us all up, sure, it doesn't take much For we're all one big family, though we each code alone And we sometimes switch off or just complain and moan
I'm sat in my room, it's all doom and gloom And there's space for us all in the debconf chat room
This is my first DebConf - hope it won't be my last And we'll meet up somewhere when this COVID is past To all who have done this - we deserve the credit Now if you'll excuse me - I've web pages to edit
I'm sat in my room, it's not all doom and gloom And we're met as one Debian here in my room
Nightscout is an Open Source web-based CGM (Continuous Glucose Monitor) that allows multiple caregivers to remotely view a patient s glucose data in real time.
It is often deployed by non-technical people for their own use. The traditional method used a MongoDB Addon on Heroku that is now deprecated. I have sent patches to adapt the documentation on the relevant projects:
This app is life-changing. Some Nigthscout users may be impatient, so I am writing this blog post to guide them in the meantime.
Setting up Nightscout
If you want to setup Nightscout from scratch using MongoDB Atlas, please follow this modified guide.
However, note that you will have to make one modification to the steps in the guide. At the start of Step 4, you will need to go to this repository instead: https://github.com/aviau/cgm-remote-monitor. This is my own version of Nightscout and it contains small modifications that will allow you to set it up with MongoDB Atlas easily.
I will keep this blog post updated as I receive feedback. Come back here for more instructions.
How to access a command line on your laptop without installing Linux.
Linux is great, and I recommend trying it out, whether on real hardware
or in a virtual machine, to anyone interested in Computer Science.
However, the process can be quite involved, and sometimes you don t want to
change your whole operating system or sort out installing virtual machines.
Fortunately, these days you can try out one of Linux s greatest features, the
command line, without going through all that hassle.
Mac
If you have a Mac, all you need to do is open Terminal.app, which is usually
found under /Applications/Utilities. Note that Mac now defaults to zsh
instead of bash, which is usually the shell used on Linux.
This shouldn t matter, but it s something you should be aware of.
Windows
On Windows, things are much more complex. There s always Powershell,
but if you want a true Unix shell
experience like you d get on Linux,
you ll need to install the Windows Subsystem for Linux.
This allows you to run Linux programs on your Windows 10 computer.
This boils down to opening Powershell
(open the start menu, search for powershell ) as an administrator
(right-click, then Run as Administrator, then click Yes or enter an
administrator s password when the UAC prompt
appears).
In this new Powershell window, you need to run the following command to enable WSL:
When this command executes successfully you should see the following output:
After this output appears, you ll need to reboot your machine before you can
continue.
Once your machine is rebooted, you need to install a Linux distribution.
Different communities and companies ship their own versions of Linux and the
various services and utilities required to use it, and these versions are
called distributions.
If you re not sure which one to use, I would recommend Ubuntu,
as it was the distribution first integrated into WSL, and it s a common
distribution for new users.
After installing your chosen distribution, you ll need to perform the first-time
setup. You ll just need to run it, as it is now installed as a program on your
computer, and then it will walk you through the setup process, which requires
you to create a new user account for your Linux distribution.
This does not need to be the same as your Windows username and password,
and it s probably safer if it isn t.
You ll need to remember that password for running administrative commands with
sudo.
Introducing cryptsetup-suspend
Today, we're introducing cryptsetup-suspend, whose job is to protect the content of your harddrives while the system is sleeping.
TL;DR:
For cryptsetup-suspend to work properly, at least Linux kernel 5.6 is required
We hope that in a bright future, everything will be available out-of-the-box in Debian and it's derivatives
Before:
After:
Table of contents
What does this mean and why should you care about it?
If you don't use full-disk encryption, don't read any further. Instead, think about, what will happen if you lose your notebook on the train, a random person picks it up and browses through all your personal pictures, e-mails, and tax records. Then encrypt your system and come back.
If you believe full-disk encryption is necessary, you might know that it only works when your machine is powered off. Once you turn on the machine and decrypt your harddrive, your encryption key stays in RAM and can potentially be extracted by malicious software or physical access. Even if these attacks are non-trivial, it's enough to worry about. If an attacker is able to extract your disk encryption keys from memory, they're able to read the content of your disk in return.
Sadly, in 2020, we hardly power off our laptops anymore. The sleep mode, also known as "suspend mode", is just too convenient. Just close the lid to freeze the system state and lift it anytime later in order to continue. Well, convenience usually comes with a cost: during suspend mode, your system memory is kept powered, all your data - including your encryption keys - stays there, waiting to be extracted by a malicious person. Unfortunately, there are practical attacks to extract the data of your powered memory.
Cryptsetup-suspend expands the protection of your full-disk encryption to all those times when your computer sleeps in suspend mode. Cryptsetup-suspend utilizes the suspend feature of LUKS volumes and integrates it with your Debian system. Encryption keys are evicted from memory before suspend mode and the volumes have to be re-opened after resuming - potentially prompting for the required passphrases.
By now, we have a working prototype which we want to introduce today. We did quite some testing, both on virtualized and bare-metal Debian and Ubuntu systems, with and without graphical stack, so we dare to unseal and set free the project and ask you - the community - to test, review, criticize and give feedback.
Here's a screencast of cryptsetup-suspend in action:
State of the implementation: where are we?
If you're interested in the technical details, here's how cryptsetup-suspend works internally. It basically consists of three parts:
cryptsetup-suspend: A C program that takes a list of LUKS devices as arguments, suspends them via luksSuspend and suspends the system afterwards. Also, it tries to reserve some memory for decryption, which we'll explain below.
cryptsetup-suspend-wrapper: A shell wrapper script which works the following way:
Extract the initramfs into a ramfs
Run (systemd) pre-suspend scripts, stop udev, freeze almost all cgroups
Chroot into the ramfs and run cryptsetup-suspend
Resume initramfs devices inside chroot after resume
Resume non-initramfs devices outside chroot
Thaw groups, start udev, run (systemd) post-suspend scripts
Unmount the ramfs
A systemd unit drop-in file overriding the Exec property of systemd-suspend.service so that it invokes the script cryptsetup-suspend-wrapper.
Reusing large parts of the existing cryptsetup-initramfs implementation has some positive side-effects: Out-of-the-box, we support all LUKS block device setups that have been supported by the Debian cryptsetup packages before.
Freezing most processes/cgroups is necessary to prevent possible race-conditions and dead-locks after the system resumes. Processes will try to access data on the locked/suspended block devices eventually leading to buffer overflows and data loss.
Technical challenges and caveats
Dead-locks at suspend: In order to prevent possible dead-locks between suspending the encrypted LUKS disks and suspending the system, we have to tell the Linux kernel to notsync() before going to sleep. A corresponding patch got accepted upstream in Linux 5.6. See section What about the kernel patch? below for details.
Race conditions at resume: Likewise, there's a risk of race conditions between resuming the system and unlocking the encypted LUKS disks. We went with freezing as many processes as possible as a counter measurement. See last part of section State of the implementation: where are we? for details.
Memory management: Memory management is definitely a challenge. Unlocking disks might require a lot of memory (if key derivation function is argon2i) and the swap device most likely is locked at that time. See section All that matters to me is the memories! below for details.
systemd dependency: Our implementation depends on systemd. It uses a unit drop-in file for systemd-suspend.service for hooking into the system suspend process and depends on systemds cgroup management to freeze and thaw processes. If you're using a different init system, sorry, you're currently out of luck.
What about the kernel patch?
The problem is simple: the Linux kernel suspend implementation enforces a final filesystem sync() before the system goes to sleep in order to prevent potential data loss. While that's sensible in most scenarios, it may result in dead-locks in our situation, since the block device that holds the filesystem is already suspended. The fssync() call will block forever as it waits for the block device to finish the sync() operation. So we need a way to conditionally disable this sync() call in the Linux kernel resume function. That's what our patch does, by introducing a run-time switch at /sys/power/sync_on_suspend, but it only got accepted into the Linux kernel recently and was first released with Linux kernel 5.6.
Since release 4.3, the Linux kernel at least provides a build-time flag to disable the sync(): CONFIG_SUSPEND_SKIP_SYNC (that was called SUSPEND_SKIP_SYNC first and renamed to CONFIG_SUSPEND_SKIP_SYNC in kernel release 4.9). Enabling this flag at build-time protects you against the dead locks perfectly well. But while that works on an individual basis, it's a non-option for the distribution Linux kernel defaults. In most cases you still want the sync() to happen, except if you have user-space code that takes care of the sync() just before suspending your system - just like our cryptsetup-suspend implementation does.
So in order to properly test cryptsetup-suspend, you're strongly advised to run Linux kernel 5.6 or newer. Fortunately, Linux 5.6 is available in buster-backports thanks to the Debian Kernel Team.
All that matters to me is the memories!
One of the tricky parts is memory management. Since version 2, LUKS uses argon2i as default key derivation function. Argon2i is a memory-hard hash function and LUKS2 assigns the minimum of half of your systems memory or 1 GB to unlocking your device. While this is usually unproblematic during system boot - there's not much in the system memory anyway - it can become problematic when suspending. When cryptsetup tries to unlock a device and wants 1 GB of memory for this, but everything is already occupied by your browser and video player, there's only two options what to do:
Kill a process to free some memory
Move some of the data from memory to swap space
The first option is certainly not what you expect when suspending your system. The second option is impossible, because swap is located on your harddrive which we have locked before. Our current solution is to allocate the memory after freezing the other processes, but before locking the disks. At this time, the system can still move data to swap, but it won't be accessed anymore. We then release the memory just in time for cryptsetup to claim it again. The implementation of this is still subject to change.
What's missing: A proper user interface
As mentioned before, we consider cryptsetup-suspend usable, but it certainly still has bugs and shortcomings. The most obvious one is lack of a proper user interface. Currently, we switch over to a tty command-line interface to prompt for passphrases when unlocking the LUKS devices. It certainly would be better to replace this with a graphical user interface later, probably by using plymouth or something alike. Unfortunately, it seems rather impossible to spawn a real graphical environment for the passphrase prompt. That would imply to load the full graphical stack into the ramfs, raising the required amount of memory significantly. Lack of memory is currently our biggest concern and source of trouble.
We'd definitely appreciate to learn about your ideas how to improve the user experience here.
Let's get practical: how to use
TL;DR: On Debian Bullseye (Testing), all you need to do is to install the cryptsetup-suspend package from experimental. It's not necessary to upgrade the other cryptsetup packages. On Debian Buster, cryptsetup packages from backports are required.
First, be sure that you're running Linux kernel 5.6 or newer. For Buster systems, it's available in buster-backports.
Third, install the cryptsetup-suspend package from experimental. Beware that cryptsetup-suspend depends on cryptsetup-initramfs (>= 2:2.3.3-1~). Either you need the cryptsetup packages from testing/unstable, or the backports from buster-backports.
Now that you have the cryptsetup-suspend package installed, everything should be in place: Just send your system to sleep. It should switch to a virtual text terminal before going to sleep, ask for a passphrase to unlock your encrypted disk(s) after resume and switch back to your former working environment (most likely your graphical desktop environment) afterwards.
Security considerations
Suspending LUKS devices basically means to remove the corresponding encryption keys from system memory. This protects against all sort of attacks trying to read them from there, e.g. cold-boot attacks. But, cryptsetup-suspend only protects the encryption keys of your LUKS devices. Most likely there's more sensitive data in system memory, like all kinds of private keys (e.g. OpenPGP, OpenSSH) or documents with sensitive content.
We hope that the community will help improve this situation by providing useful pre-/post-suspend scripts. A positive example is KeepassXC, which is able to lock itself when going to suspend mode.
Related and similar projects
Systemd Homed: systemd recently got a new feature to manage home directories. It brings support for encrypting your home directory within a LUKS2 container and for suspending the LUKS2 container during system sleep. It all is limited to systemd home directories though and doesn't help with other LUKS devices.
There's several earlier luks-suspend-* implementations. Unfortunately, neither of them deal with all the Technical challenges and caveats we discovered. Still we'd like to mention some of them:
Feedback and Comments
We'd be more than happy to learn about your thoughts on cryptsetup-suspend. For specific issues, don't hesitate to open a bugreport against cryptsetup-suspend. You can also reach us via mail - see the next section for contact addresses. Last but not least, comments below the blogpost work as well.
Chemical Brothers Out Of Control (21 Minutes of Madness remix)
Copy 1143 of 1999
Also known as The Secret Psychedelic Mix.
I picked this up last year. It was issued to promote the 20th anniversary
re-issue of the parent album "Surrender". I remember liking this song back when
it came out. At that time I didn't know who the guest singer was Bernard
Sumner and if I had it wouldn't mean anything to me.
This is a pretty good mix. There's nothing "extra" in the mix, really, it's the
same elements as the original 7 minute version, for 21 minutes this time, with
perhaps some more production elements (more dubby stuff) but it doesn't seem to
overstay its welcome.