Skip to content

Instantly share code, notes, and snippets.

View dgrisham's full-sized avatar

David Grisham dgrisham

View GitHub Profile
@dgrisham
dgrisham / ssl-setup.md
Last active February 9, 2023 19:15
simple ssl setup for nginx with acme.sh

Getting SSL certs setup for nginx with acme.sh

NOTE: All of the following commands should be run as root. The acme.sh commands won't work with just sudo.

Install acme.sh:

$ curl https://get.acme.sh | sh -s email=<your-email>
#!/usr/bin/env zsh
i=0
declare -a covers=()
mpc playlist -f '%file%' | # pull current mpd queue
while read song; do dirname $song; done | # get album directory for each song in the queue
awk '!x[$0]++' | # get unique album paths while retaining order
while read album; do
local cover=$(find "$MUSIC/library/$album" -name 'cover.*') # get name of cover file
local out="./$((i++)).${cover##*.}" # output name for resized cover
@dgrisham
dgrisham / gist:1ef4194c9f4da083ba9194674680b766
Created December 21, 2020 05:24
productivity playlist 2020-12-20
# updates
# - the `t%$((frames+1))==0` in the ternary makes it so I can delay/show the album covers longer than the transition frames
# i.e., in this case, the album covers are shown for 15 frames and each transition step is shown for 4 frames
# manual steps to be automated
# - moved all album covers into this directory
# - converted album covers to 600x600
frames=18
@dgrisham
dgrisham / rst2latex-fix_figure_label
Last active September 30, 2018 09:07
Patch rst2latex to put figure labels *after* captions (refs don't work otherwise)
#!/usr/bin/python3
"""
A minimal front end to the Docutils Publisher, producing LaTeX.
"""
try:
import locale
locale.setlocale(locale.LC_ALL, '')
except:
@dgrisham
dgrisham / examples.go
Created September 21, 2018 00:00
David's LUG pres
package main
import (
"fmt"
"sync"
"time"
)
func main() {
strs := make([]string, 2)
@dgrisham
dgrisham / keybase.md
Created February 24, 2018 21:33
keybase proof

Keybase proof

I hereby claim:

  • I am dgrisham on github.
  • I am dgrisham (https://keybase.io/dgrisham) on keybase.
  • I have a public key ASBncufYBW-WVPXqnYQSIz2C8Qff4z13-ymBraoieTZ12wo

To claim this, I am signing this object: