Skip to content

Instantly share code, notes, and snippets.

@zerolagtime
zerolagtime / internal_envsubst.sh
Created June 1, 2020 20:01
envsubst in pure bash/sed
#!/bin/bash
# this is a poor man's substitute for the envsubst command
function internal_envsubst() {
tfile=$(mktemp)
# use sed to build a sed input file specific to the current environment variables
env | sed -E -e '
# delete any special cases that make a mess of things
/^_=/d;
# deal with variables that have backslashes in them: \\tsclient\home
@zerolagtime
zerolagtime / k3b_to_playlist.py
Created August 28, 2015 04:04
Convert K3B audio projects into M4A files suitable for use on Apple devices that cannot handle numerous audio file formats.
#!/usr/bin/env python3
# Copyright 2015 by Charlie Todd except where noted below.
# You are granted permission to adapt this gist for your own project,
# but not to claim the work as entirely your own. Attribution must
# be provided in any derivative works in such a fashion that the
# final user of the software can see and understand the attribution.
import sys
import zipfile
import xml
import xml.dom.minidom