Skip to content

Instantly share code, notes, and snippets.

@duhdugg
duhdugg / vpn-notification.sh
Created June 27, 2017 15:00
VPN Notification Script
#!/bin/bash
while true; do
active=$( ifconfig | grep vpn )
if [ -n "$active" ]; then
notify-send -a "vpn-notification" "Reminder: VPN Active"
fi
sleep 10
done
/* first, "go get" these dependencies:
github.com/faiface/beep
github.com/hajimehoshi/oto
*/
package main
import (
"fmt"
"github.com/faiface/beep"
#!/bin/bash
youtube-dl -x -f 251 https://www.youtube.com/watch\?v\=2RicaUqd9Hg -o "output.(ext)" && \
ffmpeg -i output.opus output.wav && \
rubberband -p-6 -T0.85 -F output.wav shifted.wav && \
mpv shifted.wav
#!/usr/bin/env python
from time import sleep
from gpiozero import LED
red = LED(4)
green = LED(5)
blue = LED(6)
def cycle():
#!/usr/bin/env python3
from time import sleep
from gpiozero import LED
from ADCDevice import ADS7830
from threading import Thread
red = LED(4)
green = LED(5)
blue = LED(6)
@duhdugg
duhdugg / woofers.cow
Created April 3, 2022 22:22
small dog cowfile
##
## A good woofers
##
$the_cow = <<EOC;
$thoughts __
$thoughts /|$eyes|\\_____
\\(-_// | \\
$tongue||---||
EOC
@duhdugg
duhdugg / _lsd
Created September 12, 2022 17:05
zsh completion fix for lsd v0.23.0
#compdef lsd
autoload -U is-at-least
_lsd() {
typeset -A opt_args
typeset -a _arguments_options
local ret=1
if is-at-least 5.2; then
@duhdugg
duhdugg / find-mdi-nerdfont.sh
Created May 7, 2023 19:37
find retired mdi nerdfont codepoints
# nerd font v3 retired the nf-mdi- codepoints
# nerd font v3 release notes https://github.com/ryanoasis/nerd-fonts/releases/tag/v3.0.0
# mapping table here: https://github.com/ryanoasis/nerd-fonts/issues/1059#issuecomment-1404891287
# this script will help you find usage of the old codepoints in your files
BEGIN=$'\UF500'
END=$'\UFD46'
# in git repo