container hack for build: unshare + chroot. unshare guarantees unmounts, given a ephemeral file system namespace :-)
#!/bin/sh
set -eu
rootfs_dir=$1
adm_user=$2
if [ "$#" -eq 3 ]; then
proxy_address=""
cmdline=$3
else
proxy_address=$3
cmdline=$4
fi
sudo unshare --mount --pid --fork sh -c "
mount --bind /sys '$rootfs_dir/sys'
mount --bind /dev '$rootfs_dir/dev'
mount -t proc proc '$rootfs_dir/proc'
mount -t devpts devpts '$rootfs_dir/dev/pts'
chroot '$rootfs_dir' su - '$adm_user' -c 'export PUAVO_CACHE_PROXY=\"$proxy_address\"; $cmdline'
"
My fourth Obnam 3 development session. Put into place the scaffolding to add chunk encryption, but didn't have the time to actually implement the encryption.
Small steps and tea is the way to reach goals while having fun.
(Obnam 3 is my Sunday project to experiment with implementing fundamental components for backup software.)
BREAKING: The C++ committee imposes tariffs on non-US locales.
Quite cool, I have to say. fwupdmgr managed to update my HP USB-C Dock G5.
fun Linux fact: because MAP_SHARED|MAP_ANONYMOUS
is actually a file-backed mapping under the hood, unmapping part of such a mapping does not discard the data stored in that part:
$ cat mremap.c
#define _GNU_SOURCE
#include <err.h>
#include <stdio.h>
#include <sys/mman.h>
int main(void) {
char *p = mmap(NULL, 0x2000, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_ANONYMOUS, -1, 0);
if (p == MAP_FAILED) err(1, "mmap");
p[0x1000] = 'X';
if (munmap(p+0x1000, 0x1000)) err(1, "munmap");
// that 'X' we just wrote... is it gone?
// nope, let's bring it back!
p = mremap(p, 0x1000, 0x2000, MREMAP_MAYMOVE);
if (p == MAP_FAILED) err(1, "mremap");
printf("p[0x1000]='%c'\n", p[0x1000]);
}
$ gcc -o mremap mremap.c
$ ./mremap
p[0x1000]='X'
$
US government’s attack on free speech, science, and research is causing a brain drain
How do you create a brain drain and lose your status as eminent destination for scientists and researchers?
The United States seems to be sending out questionnaires to researchers at universities and research institutes outside of the United States, asking them about their political leanings. Dutch universities are strongly advising Dutch researches not to respond to the questionnaire