Triaxx Web Log

Some notes on anything…

Restic

Use restic to backup a set of files/directories on several repositories.

Repo initialization

mkdir -p ~/.config/restic

echo "sftp:bak.triaxx.io:/srv/restic-repo" > .config/restic/repo-bak

cat > ~/.config/restic/passcmd << EOF
#!/usr/bin/env bash

ssh pass.triaxx.io pass restic
EOF
chmod +x ~/.config/restic/passcmd

restic --repository-file ~/.config/restic/repo-bak \
       --password-command ~/.config/restic/passcmd \
       init

Backup

find /etc /home -print > ~/.config/restic/files

restic --repository-file ~/.config/restic/repo-bak \
       --password-command ~/.config/restic/passcmd \
       backup \
       --files-from-verbatim ~/.config/restic/files \
       --skip-if-unchanged

Linux Automation

Create a systemd template service to execute restic backup for each repository:

EFI

Efibootmgr

List UEFI entries:

efibootmgr

Delete entry 0013:

efibootmgr -B -b 0013

Create new entry:

efibootmgr --create --label "HD001" --loader "\EFI\BOOT\BOOTX64.EFI"

Disk check

Bad blocks

badblocks is used to search for bad blocks on a device. It can be installed on NetBSD with:

pkgin install e2fsprogs

or on macOS with:

brew install e2fsprogs

A test can be launched by executing the following command:

# Device must first be unmounted on macOS
sudo diskutil unmountDisk /dev/<device>
badblocks -n -s -v /dev/<device>

where <device> can be identified by executing:

dmesg | tail

right after plugging in the USB flash storage on GNU/Linux or NetBSD and

Arch Linux

Boot image

curl --output archlinux-x86_64.iso https://mirror.srv.fail/archlinux/iso/2026.03.01/archlinux-x86_64.iso
# on macOS
sudo dd if=archlinux-x86_64.iso of=/dev/disk4 bs=1m status=progress
# on NetBSD
dd if=/home/triaxx/archlinux-x86_64.iso of=/dev/sd2d bs=1m progress=100

System configuration

After booting from USB disk:

localectl list-keymaps | grep fi
loadkeys fi
timedatectl set-timezone Europe/Helsinki

Partitionning

List available types for GPT:

sfdisk --label gpt --list-types

Create partitions:

echo "size=1GiB, name=boot, type=efi-system" | sfdisk /dev/sda
echo "size=40GiB, name=linux-swap, type=linux-swap" | sfdisk /dev/sda --append
echo "size=256GiB, name=linux-root, type=linux-root-x86-64" | sfdisk /dev/sda --append
echo "size=40GiB, name=freebsd-swap, type=freebsd-swap" | sfdisk /dev/sda --append
echo "size=256GiB, name=freebsd-root, type=freebsd-ufs" | sfdisk /dev/sda --append
echo "size=+, name=data, type=freebsd-zfs" | sfdisk /dev/sda --append

Make filesystems:

Figlet

File header

figlet Makefile | sed -e "s|^|# |" > Makefile

Hugo

Abstract

Hugo is an open-source static website generator. It is written in Go and uses Markdown file format as input to produce static HTML website.

Initialization

Site

hugo new project <path>
cd <path>
cat > hugo.toml << EOF
baseURL = 'https://triaxx.io/'
languageCode = 'fr-FR'
title = 'Triaxx Web Log'
EOF

Theme

A theme is mandatory to build sites.

hugo new theme <name>
echo "theme = '<name>' >> hugo.toml

A example menu can be copied from themes/<name>/hugo.toml: