Skip to content

Instantly share code, notes, and snippets.

View bketelsen's full-sized avatar
💭
Making tools to make the tools.

Brian Ketelsen bketelsen

💭
Making tools to make the tools.
View GitHub Profile
@bketelsen
bketelsen / OCIFIX.md
Created February 23, 2026 16:06
OCI Fix Options

Fixing the PAX Header / OCI Layer Problem

The Root Cause

mkosi uses GNU tar with --xattrs --pax-option=delete=atime,delete=ctime,delete=mtime to create OCI tar layers. This produces PAX extension headers that composefs-rs's custom Rust tar parser can't handle correctly. composefs-rs has an open issue (#2) acknowledging their "home-brew header handling code" needs PAX cleanup, but no fix is imminent.

What podman export | podman import Actually Loses

The test script workaround sidesteps PAX headers but is lossy:

@bketelsen
bketelsen / later output.txt
Last active February 20, 2026 11:18
bootc test suite
=== Step 7: Run tests ===
--- Running: 01-installation.sh ---
01-installation.sh 100% 1605 7.2MB/s 00:00
# Tier 1: Installation validation
# system state: running
ok - System has booted
ok - Root filesystem is read-only
ok - Composefs is active
ok - usr is read-only
@bketelsen
bketelsen / install.md
Last active January 5, 2026 17:26
install snow or snowfield

Install Snow or Snowfield

get iso

Download ISO

Install

You can keep secure boot on, snow supports chained secure boot from debian's shim.

@bketelsen
bketelsen / convert-img-to-iso.sh
Created December 8, 2025 20:46
bootable img to iso
#!/bin/bash
set -e
# This script converts a raw image with 512 byte sectors to an iso with 2048 byte sectors. The conversion
# allows for booting of the resulting iso as a (virtual) CDROM.
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <input img>"
exit 1
#!/bin/bash
# filepath: /opt/scripts/daily_backup_docker_stacks.sh
set -e
# Configuration
## dockge stack directory
COMPOSE_ROOT="/opt/stacks"
## persistent data directory
PERSIST_ROOT="/opt/persist"
@bketelsen
bketelsen / devcontainer
Created May 1, 2025 14:26
bash scripts for devcontainers
#!/bin/bash
# copy dev container files from the template directory into the current directory
dc() {
local template_dir=~/projects/templates
# get the first argument
local template=$1
if [ -z "$template" ]; then
echo "Please provide a template parameter. Options:"
# list all the templates in the template directory
sudo bootc switch ghcr.io/ublue-os/bluefin-dx:beta
layers already present: 2; layers needed: 70 (4.7 GB)
Fetched layers: 4.35 GiB in 2 minutes (32.22 MiB/s) /proc/self/fd/30/usr/etc/selinux/targeted/contexts/files/file_contexts.bin: line 1 error due to: Non-ASCII characters found
/proc/self/fd/30/usr/etc/selinux/targeted/contexts/files/file_contexts.homedirs.bin: line 1 error due to: Non-ASCII characters found
⠈ Deploying /proc/self/fd/24/usr/etc/selinux/targeted/contexts/files/file_contexts.bin: line 1 error due to: Non-ASCII characters found
/proc/self/fd/24/usr/etc/selinux/targeted/contexts/files/file_contexts.homedirs.bin: line 1 error due to: Non-ASCII characters found
⠈ Deploying
(bootc:22581): GLib-CRITICAL **: 15:35:26.687: g_atomic_ref_count_dec: assertion 'old_va
@bketelsen
bketelsen / incus-startup.service.d-override.conf
Created July 15, 2024 13:07
Incus 6.3 dropins to fix move of /usr/lib/incus/*
[Service]
ExecStart=
ExecStart=/usr/libexec/incus/incusd activateifneeded
@bketelsen
bketelsen / incremental.sh
Last active June 29, 2024 22:32
incremental btrfs snapshots sent to remote synology
#!/bin/env bash
set -e
# This script is used to create incremental snapshots of the given btrfs volume.
# capture today's date
today=$(date +%Y%m%d)
# use yesterday's as base for incremental snapshot
yesterday=$(date -d "yesterday" +%Y%m%d)
@bketelsen
bketelsen / feature.sh
Created February 8, 2024 19:05
install "features" intended for devcontainers locally
#!/bin/bash
# install a "feature" from the devcontainers/features repo outside of a container
# requires git, jq
# for this to work well, you should already have a user with uid/gid 1000
FEATUREROOT="${FEATUREROOT:-"/opt/features"}"
FEATUREREPO="${FEATUREREPO:-"https://github.com/devcontainers/features"}"
echo $FEATUREROOT