Skip to content

Instantly share code, notes, and snippets.

View ObjectBoxPC's full-sized avatar

Philip Chung ObjectBoxPC

View GitHub Profile
@ObjectBoxPC
ObjectBoxPC / dvdbackup.Dockerfile
Created March 26, 2025 07:56
Rip DVDs from a Docker container
FROM debian:12-slim
RUN ["sed", "-i", "s/^Components: .*/Components: main contrib/", "/etc/apt/sources.list.d/debian.sources"]
RUN apt-get update && apt-get install -y libdvd-pkg dvdbackup
RUN ["dpkg-reconfigure", "libdvd-pkg"]
@ObjectBoxPC
ObjectBoxPC / play-rockbox.sh
Created June 5, 2025 09:25
Convert and play a playlist originally created for Rockbox
#!/bin/sh
if [ $# -lt 1 ]; then
echo "Usage: $0 [playlist]" >&2
exit 1
fi
PLAYLIST_FILE=$1
if ! [ -f "$PLAYLIST_FILE" ]; then
@ObjectBoxPC
ObjectBoxPC / makehybridpass.py
Created July 29, 2025 05:28
Create "hybrid" passwords with a combination of Diceware words and random symbols
#!/usr/bin/env python3
import secrets
import string
WORD_LIST = "/usr/share/keepassxc/wordlists/eff_large.wordlist"
words = [w.strip() for w in open(WORD_LIST)]
symbols = string.ascii_letters + string.digits + string.punctuation
@ObjectBoxPC
ObjectBoxPC / chase-investment-rebalance.py
Last active January 5, 2026 17:20
Rebalance a J.P. Morgan (Chase) investment portfolio from a CSV export of positions
#!/usr/bin/env python3
import csv
import decimal
import itertools
import sys
def parse_desired_weights(weights_file):
weights = { e["Category"]: decimal.Decimal(e["Desired Weight"]) for e in csv.DictReader(weights_file) }
if sum(weights.values()) != 1:
@ObjectBoxPC
ObjectBoxPC / veracrypt-update.py
Last active June 15, 2026 01:30
Automatically update VeraCrypt (for Debian) from Launchpad
#!/usr/bin/env python3
import json
import datetime
import re
import shutil
import subprocess
import tempfile
import urllib.request
@ObjectBoxPC
ObjectBoxPC / captdriver-crossbuild.Dockerfile
Last active August 6, 2026 20:17
Dockerfile for cross-building captdriver for AArch64 (for Raspberry Pi)
FROM debian:trixie-slim AS build
WORKDIR /src
RUN ["dpkg", "--add-architecture", "arm64"]
RUN apt-get update && apt-get install -y gcc-aarch64-linux-gnu make automake libcups2-dev:arm64 cups-ppdc
COPY . .
RUN ["aclocal"]
RUN ["autoconf"]
RUN ["automake", "--add-missing"]
RUN ["./configure", "--host=aarch64-linux-gnu"]