Skip to content

Instantly share code, notes, and snippets.

Avatar

Josh Delsman voxxit

View GitHub Profile
@voxxit
voxxit / track-import.sh
Last active Aug 9, 2021
Script I use to automate my workflow of importing newly purchased/downloaded tracks from Beatport and elsewhere
View track-import.sh
#!/bin/bash
INPUT_FOLDER="${HOME}/Music/Unprocessed"
OUTPUT_FOLDER="${HOME}/Dropbox/Music/$(date +%Y-%m)"
filecount=$(find "$INPUT_FOLDER" \( -name "*mp3" -o -name "*aif*" -o -name "*wav" \) -type f -print | wc -l)
if [[ $filecount -lt 1 ]]; then
printf "\nNo files found in '%s'. Time to find new beats!\n" "$INPUT_FOLDER"
exit 0
fi
View virtualdj-historian.sh
#!/bin/sh
#
# -- virtualdj-historian.sh --
# A helper script for proper OBS track IDs from Virtual DJ tracklist.txt
#
# USAGE:
#
# 1. Download to your home directory
# 2. chmod +x virtualdj-historian.sh
# 3. ./virtualdj-historian.sh
View README.md
brew install xml2
wget https://gist.githubusercontent.com/voxxit/2297cae982cf47e9388502bb03ed4e20/raw/202dbcaae8eaa2aaa9a562774d8dfd9a2c86b11a/gistfile1.txt
mv gistfile1.txt script.sh
chmod +x script.sh
./script.sh "/Applications/RingCentral Meetings.app"
View find-kexts.sh
#!/bin/bash
# Script to scan a system for kexts and gather the information needed for Apple whitelisting
# richard at richard - purves dot com
plist="com.apple.syspolicy.kernel-extension-policy.plist"
output="$HOME/Desktop"
override="false"
# Stop IFS linesplitting on spaces
@voxxit
voxxit / curlt
Created Jul 19, 2018
Wrapper script for curl to publish timings as JSON
View curlt
#!/bin/bash
#
# curl wrapper returning timing information.
#
# curl format adapted from
# http://josephscott.org/archives/2011/10/timing-details-with-curl/
#
# Example usage:
# $ curlt http://www.apple.com
# $ time curlt http://www.apple.com -v
@voxxit
voxxit / zt-authorize-node.sh
Created Jun 1, 2018
Short script to automatically register a new Kubernetes node with the ZeroTier One API
View zt-authorize-node.sh
#!/bin/bash
set -e
[ -z ${ZT_API_TOKEN} ] && echo "Missing API token" && exit 1
[ -z ${ZT_NETWORK_ID} ] && echo "Missing network ID" && exit 1
which zerotier-cli # Check whether the zerotier-cli is installed...
if [ $? -ne 0 ]; then
View Dockerfile
FROM debian
COPY slow /usr/bin/
RUN apt-get update \
&& apt-get -y install --no-install-recommends kmod wget
CMD ["slow", "--help"]
@voxxit
voxxit / s3-rename-mass.rb
Created Mar 31, 2017
Rename files en masse on Amazon S3
View s3-rename-mass.rb
require "aws-sdk"
s3 = Aws::S3::Client.new(region: ENV.fetch("region", "us-west-2"))
objects = []
start_after = nil
loop do
resp = s3.list_objects_v2(
bucket: ENV.fetch("bucket"),
View cloudflareToSumoLogic.js
var sumoURL = process.env.SUMO_ENDPOINT,
zoneID = process.env.CLOUDFLARE_ZONE_ID,
cloudflareAuthEmail = process.env.CLOUDFLARE_AUTH_EMAIL,
cloudflareAuthKey = process.env.CLOUDFLARE_AUTH_KEY,
sourceCategoryOverride = process.env.SOURCE_CATEGORY_OVERRIDE || 'none',
sourceHostOverride = process.env.SOURCE_HOST_OVERRIDE || 'api.cloudflare.com',
sourceNameOverride = process.env.SOURCE_NAME_OVERRIDE || zoneID;
var https = require('https');
var zlib = require('zlib');
View Dockerfile
FROM haproxy:1.7
ENV CT_VERS=0.16.0 \
CONSUL_HTTP_ADDR=demo.consul.io
RUN apt-get update \
&& apt-get -y install --no-install-recommends curl ca-certificates unzip \
&& curl -O https://releases.hashicorp.com/consul-template/${CT_VERS}/consul-template_${CT_VERS}_linux_amd64.zip \
&& unzip consul-template_${CT_VERS}_linux_amd64.zip \
&& mv consul-template /usr/local/bin/ \