Skip to content

Instantly share code, notes, and snippets.

@digitalsignalperson
digitalsignalperson / zfs-force-inherit-example.sh
Created January 25, 2024 03:01
zfs force inherit encryptionroot on received dataset with pyzfs
#!/bin/bash
# Create test pool
dd if=/dev/zero of=/root/zpool bs=1M count=128
zpool create testpool /root/zpool
# Create encryptionroot and some datasets
echo "12345678" | zfs create -o canmount=off -o mountpoint=/mnt -o encryption=on -o keylocation=prompt -o keyformat=passphrase testpool/enc
zfs create testpool/enc/data1
zfs create testpool/enc/data2
@digitalsignalperson
digitalsignalperson / tabs.css
Created January 23, 2024 09:18
obsidian tabs in multiple rows
/* --------------compact tabs--------------------*/
.workspace .mod-root .workspace-tab-header {
width: unset;
max-width: var(--tab-width);
border: 1px solid var(--color-base-50);
}
/*.workspace-tab-header-inner {
width: unset;
}*/
@digitalsignalperson
digitalsignalperson / fish_merge.py
Last active January 18, 2024 02:21
Merge multiple fish history files together using flock (untested)
#!/bin/python
import pathlib
import fnctl
import yaml
import time
# Watch for changes in other_history and merge them into local_history
local_history = pathlib.Path('~/.local/share/fish/fish_history').expanduser()
other_history = pathlib.Path('~/.local/share/fish/other_history').expanduser()
@digitalsignalperson
digitalsignalperson / linux-rt-lts and zfs-dkms.sh
Created November 17, 2023 23:14
example for how to install linux-rt-lts and zfs-dkms
if ! grep -qF "[archzfs]" /etc/pacman.conf; then
cat >> /etc/pacman.conf << 'EOF'
[archzfs]
Server = http://archzfs.com/$repo/x86_64
Server = http://mirror.sum7.eu/archlinux/archzfs/$repo/x86_64
Server = https://mirror.biocrafting.net/archlinux/archzfs/$repo/x86_64
EOF
fi
pacman-key -r F75D9D76
@digitalsignalperson
digitalsignalperson / stream.sh
Last active September 1, 2025 21:03
xdp screen cast example, modified to pipe to ffmpeg
mkfifo /tmp/gfifo
./xdp-screen-cast-ffmpeg.py & # or run in another terminal
# Note the gstreamer pipeline
# 'pipewiresrc fd=%d path=%u ! videorate ! video/x-raw,framerate=60/1 ! videoconvert ! filesink location=/tmp/gfifo'
# I specified a 60/1 frameerate. You can do other pre-processing here, or offload it to ffmpeg.
# Encode the stream and pipe to netcat
# note: must specify correct resolution here
# we can now use h264_nvenc, mpegts, and anything else ffmpeg has
@digitalsignalperson
digitalsignalperson / lxd-common
Created September 12, 2023 00:32
arch linux LXD stuff
_source() {
source ${BASE_DIR}/lxd/lxd-common
}
#======================
# General VM functions
vm_bash() {
lxc exec "$VMNAME" -- bash "$@"
@digitalsignalperson
digitalsignalperson / zfs-native-encryption-test.sh
Last active June 27, 2023 17:58
zfs encryption speed test
#!/bin/bash
# From https://www.medo64.com/2022/10/native-zfs-encryption-speed-ubuntu-22-10/
# https://docs.google.com/spreadsheets/d/1spTTlEJESnVFSEsB98iVviA-l_unf6Hemx9Nh8KrBBI/edit#gid=1839759404
#
# Tweaks for faster test: only do 2 tests, only sleep 2 seconds, only use aes-256-gcm for zfs
# Tweaks to LUKS config
# don't use sync=always
# use only 1 vdev
@digitalsignalperson
digitalsignalperson / x-clickthrough.c
Last active February 18, 2025 01:18
Enable clickthrough, transparency, and always on top for a given X window
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <X11/Xlib.h>
#include <X11/extensions/shape.h>
#include <X11/Xatom.h>
// Enable clickthrough, transparency, and always on top for a given window
// x-clickthrough <windowid> <alpha (0-100)>
//
@digitalsignalperson
digitalsignalperson / disable-trackpad-timeout.py
Last active September 25, 2023 23:21
A script to auto-disable a trackpad N seconds after last press.
#!/bin/python
import time
import subprocess
import threading
def get_device_node(name, strip_path=False):
# output = subprocess.check_output(["xinput", "list-props", name]).decode('utf-8')
# for line in output.splitlines():
@digitalsignalperson
digitalsignalperson / readme.md
Last active March 31, 2023 08:24
Mixxx midi output mappings generator for touchosc-dj (WIP)

Summary

What this does: controlling volume for deck 1 or deck 2 from any interface (midi controllers, GUI, or TouchOSC) results in midi output sent back to TouchOSC to update their positions

Note: I did this without reading https://github.com/mixxxdj/mixxx/wiki/midi%20scripting and I think the midi scripting interface probably resolves the issues I had and simplifies the approach.

Work log

A google of mixxx osc turned my afternoon into this...

https://www.reddit.com/r/DJs/comments/rwq59j/djing_on_a_budget_homemade_touchosc_controller/