Skip to content

Instantly share code, notes, and snippets.

@Jip-Hop
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 https://github.com/Jip-Hop/pop-up-videos. 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
Jip-Hop / README.md
Last active May 14, 2025 03:04
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
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)
ARG PACKAGES_TO_INSTALL="openjdk11-jre"
ARG REMOVE_SHELL=1
# 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
Jip-Hop / README.md
Last active April 30, 2025 15:38
Simple comment preserving ConfigParser class to read/update/write INI files WITHOUT indented sections/keys/comments.

See the example usage inside configparser.py. Output when running the configparser.py 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
Jip-Hop / install_and_run.py
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
Jip-Hop / truenas_scale_sysext_example.sh
Last active January 29, 2025 02:07
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
ROOTFS_PATH=/mnt/tank/some/dataset/ext/rootfs
# List of packages to install
PACKAGES="usbutils"
# Download minimal debian base rootfs
mkdir -p "$ROOTFS_PATH"
curl -L https://github.com/debuerreotype/docker-debian-artifacts/raw/dist-amd64/bookworm/slim/rootfs.tar.xz | tar -xJ -C "$ROOTFS_PATH" --numeric-owner