Skip to content

Instantly share code, notes, and snippets.

View cwesterfield's full-sized avatar

Colby Westerfield cwesterfield

  • Kentucky
View GitHub Profile
@cwesterfield
cwesterfield / video.
Last active July 24, 2017 21:18
Script for doing commands when interface comes up
####Location
####/etc/network/if-up.d/video
#### TEST WITH run-parts --test /etc/network/if-up.d
#!/bin/bash x~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Check for specific interface if desired x~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ "$IFACE" != "eth2" ] || exit 0 x~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#DHCP x~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
udhcpc -i eth2 -V minerva2500w
@cwesterfield
cwesterfield / tag.sh
Created August 7, 2017 18:49
bash script to write id3 tags
#!/bin/bash
# Write Album tag of the directory the file is in to all mp3s
find . -type d | while IFS= read -r d; do
cd "${d}"
DIR=`pwd | tail -c 5`
id3v2 -A "$DIR" *.mp3
cd -
done
@cwesterfield
cwesterfield / refresh.sh
Last active August 22, 2017 15:22
refresh fullscreenos webpage (raspi)
#!/bin/bash
# Send F5 to XSession
# Since fullpageOS only runs the browser,
# no window must be specified
#Specify Display
export DISPLAY=:0.0
#send command
/usr/bin/xdotool key F5
@cwesterfield
cwesterfield / gist:5592fff1e49d2a21d1e5dfb33ffc2dd4
Last active November 17, 2017 13:19
Brown noise Generator files
crontab -l
# m h dom mon dow command
@reboot /root/sib.sh
#11 10 * * * /root/crontest.sh >/dev/null 2>&1
#0 21 * * * /root/brown.sh >/dev/null 2>&1
0 21 * * 0-4 /root/brown.sh >/dev/null 2>&1
0 21 * * 5,6 /root/brown-we.sh >/dev/null 2>&1
root@DietPi:~# cat brown-we.sh
### Keybase proof
I hereby claim:
* I am cwesterfield on github.
* I am thetinman (https://keybase.io/thetinman) on keybase.
* I have a public key ASC2lS9yUCPZsI5WwZNmWBF1MEjC1QqnFzH8Lv4FfET0Awo
To claim this, I am signing this object:
@cwesterfield
cwesterfield / scan.sh
Created November 27, 2017 20:03
Scan network for dns names
#!/bin/bash
# host of IP-range It's possible to add more networks separated with space
# Usage:
# ./scan.sh | egrep -v ', *$'
#Currently set for 10.0.1.100-201
NETS="10.0.1"
#!/bin/bash
#Update Plex Libraries
#/usr/lib/Plex\ Media\ Scanner MUST be ran as user plex
#Script located in /bin/
#To use: su -c '/bin/plex-library-updater' plex
#Export required path
export LD_LIBRARY_PATH=/usr/lib/plexmediaserver
### Keybase proof
I hereby claim:
* I am cwesterfield on github.
* I am thetinman (https://keybase.io/thetinman) on keybase.
* I have a public key ASCN43rMM1F3NnOnOLbsg7WxDByjNsP5JlFhonJQcXHy0wo
To claim this, I am signing this object: