Skip to content

Instantly share code, notes, and snippets.

@BenjaminLawson
BenjaminLawson / m3u-absolutify
Last active June 6, 2018 20:34
Bash script to generate absolute m3u files
#!/usr/bin/env bash
# Usage: m3u-absolutify playlists_dir output_dir /absolute/path/to/music
# Description: generates absolute path versions of all m3u files in a directory
# Author: Ben Lawson
SOURCE_DIR=$1
DEST_DIR=$2
ABSOLUTE_MUSIC_DIR=$3
@BenjaminLawson
BenjaminLawson / press1.xml
Last active June 6, 2018 20:27
Twilio script to automate Duo 2 Factor Authentication
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Play digits="wwww1"></Play>
<Hangup/>
</Response>
@BenjaminLawson
BenjaminLawson / bmpc
Last active April 4, 2018 02:53
Shell script to replace mpd's playlist with the results of a Beets query
#!/usr/bin/env bash
# Replace the mpd playlist with the results of a Beets query
# Usage: 'bmpc QUERY'
# change BEETS_DIR to the name of your beets music directory
BEETS_DIR="beets"
RESULTS=$(beet ls -f '$path' "$@" | sed "s/.*\/$BEETS_DIR\///")
printf "$RESULTS\n\n"

Keybase proof

I hereby claim:

  • I am BenjaminLawson on github.
  • I am benlawson (https://keybase.io/benlawson) on keybase.
  • I have a public key whose fingerprint is CB98 289F 0226 23E0 F36C F70C F3E6 B480 FA35 1CE0

To claim this, I am signing this object: