Skip to content

Instantly share code, notes, and snippets.

Jip-Hop /
Last active July 22, 2024 08:54
Temporarily extend available packages in TrueNAS SCALE using systemd-sysext. For educational purposes. Use at your own risk!
#!/usr/bin/env bash
# Specify destination for extension rootfs
# List of packages to install
# Download minimal debian base rootfs
mkdir -p "$ROOTFS_PATH"
curl -L | tar -xJ -C "$ROOTFS_PATH" --numeric-owner
Jip-Hop /
Created June 18, 2024 13:03
Python script which installs packages it requires with pip inside a venv that's created on the fly.
#!/usr/bin/env python3
import os
import sys
__requirements__ = {"docker==7.1.0"}
def _setup_env():
venv = os.path.join(os.path.dirname(__file__), ".venv")
Jip-Hop /
Last active June 29, 2024 14:43
Simple comment preserving ConfigParser class to read/update/write INI files WITHOUT indented sections/keys/comments.

See the example usage inside Output when running the file:

# Comments may appear before the first section

[Simple Values]
key = value
spaces in keys = allowed
spaces in values = allowed as well
spaces around the delimiter = obviously
Jip-Hop / Dockerfile
Created March 26, 2023 07:15
Distroless alpine docker image: no shell, no package manager, no busybox. Only the specified packages + dependencies.
FROM alpine as bootstrap
# Optionally add e.g. coreutils (if you don't want to remove the shell)
# Create rootfs folder and enable apk repo
RUN mkdir -p /rootfs/etc/apk && \
cp -a /etc/apk/repositories /rootfs/etc/apk/repositories && \
cp -a /etc/apk/keys /rootfs/etc/apk/keys
Jip-Hop /
Last active April 9, 2024 07:20
Persistent Debian 'jail' on TrueNAS SCALE to install software (docker-compose, portainer, podman, etc.) with full access to all files via bind mounts. Without modifying the host OS at all thanks to systemd-nspawn!
Jip-Hop / pop-up-videos.js
Created October 3, 2021 10:18
Open all videos in a tab as pop-up windows. Basic (non-extension) version of To be copy-pasted in the browser console.
(function enable() {
var titleSuffixCounter = 0;
var popupWidth = 480;
var popupHeight = 270;
var xOffset = screen.availLeft,
yOffset = screen.availTop;
const data = {
windows: [],
Jip-Hop /
Last active July 18, 2024 21:35
Using Docker on TrueNAS SCALE (no Kubernetes)
#!/usr/bin/env bash
# Enable docker and docker-compose on TrueNAS SCALE (no Kubernetes)
# This script is a hack! Use it at your own risk!!
# Using this script to enable Docker is NOT SUPPORTED by ix-systems!
# You CANNOT use SCALE Apps while using this script!
# 1 Create a dedicated Docker zvol on one of your zpools: zfs create -V 100G data/_docker
Jip-Hop /
Created April 25, 2021 18:09
Booting from Custom Tiny Core Linux for Read Only Filesystem (SED PBA) Notes
# references
# follow these steps on Ubuntu
sudo su
qemu-img create core-image.img 120M -f raw
modprobe nbd max_part=8 && sleep 2 && qemu-nbd -c /dev/nbd0 core-image.img -f raw
Jip-Hop /
Created April 25, 2021 18:07 — forked from dankrause/
Create a custom tinycore linux iso. Adjust the config at the beginning of the script, or supply a conf as the first arg. Requires xorriso.
set -e
function cleanup() {
# clean up our temp folder
rm -rf "${TMPDIR}"
trap cleanup EXIT
Jip-Hop /
Created February 28, 2021 17:01
Autorun Synology Hyper Backup and Integrity Check with Email Notifications
# This script is to be used in combination with Synology Autorun:
# -
# -
# You need to change the task_id to match your Hyper Backup task.
# Get it with command: more /usr/syno/etc/synobackup.conf
# I like to keep "Beep at start and end" disabled in Autorun, because I don't