This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Create storage | |
VBoxManage createhd --filename VMName.vdi --size 40000 --format VDI | |
VBoxManage modifyhd GoDial.vdi --resize 30500 | |
VBoxManage list hdds | |
VBoxManage closemedium disk $(UUID) --delete | |
#Create VM | |
VBoxManage createvm --name "VMName" --ostype Windows7_64 --register |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import dbus | |
import dbus.glib | |
import gobject | |
import subprocess | |
def lock(): | |
print "Screen saver turned on" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// homerunner is Brad's shitty Docker wrapper after he got tired of running | |
// HA nine-VM Kubernetes clusters. Earlier versions of this tried to use podman | |
// and fancy cloud-init and CNI stuff but then I decided to go to the other | |
// extreme and write something super specific to what I need and super dumb: | |
// run my containers from gcr.io, and use my home Ceph cluster for mounts/state. | |
// | |
// This primarily runs Home Assistant, HomeSeer, an MQTT server, and some cameras. | |
// And some omitted misc stuff. | |
package main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# When you need to process a hash with keys in sorted order | |
# you may have found the `sort()` function - but it only | |
# operates on an Array. | |
# | |
# Most of the time what is wanted is simply achieved | |
# by taking the keys of a hash and sorting those and | |
# then iterating over the keys. | |
# | |
# When, however the wanted result is a new Hash | |
# with all keys sorted recursively then this becomes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 127.0.0.1:9000; | |
location / { | |
proxy_pass http://unix:/var/run/docker.sock:/; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ grep -P "^[ABCDEFabcdefOoIi]{6,6}$" /usr/share/dict/words | tr 'OoIi' '0011' | tr '[:lower:]' '[:upper:]' | awk '{print "#" $0}' | |
#ACAD1A | |
#B0BB1E | |
#DEBB1E | |
#AB1DED | |
#ACAC1A | |
#ACCEDE | |
#AC1D1C | |
#BAB1ED | |
#BA0BAB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1. extract audio from all videos (assuming .mp4 videos). | |
for FILE in *.mp4; do ffmpeg -i $FILE ${FILE%%.mp4}.wav; done | |
# 2. use the first second of the first audio file as the noise sample. | |
sox `ls *.wav | head -1` -n trim 0 1 noiseprof noise.prof | |
# Replace with a specific noise sample file if the first second doesn't work for you: | |
# sox noise.wav -n noiseprof noise.prof | |
# 3. clean the audio with noise reduction and normalise filters. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"net/http" | |
"compress/gzip" | |
"io/ioutil" | |
"strings" | |
"sync" | |
"io" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if_dir = os.getenv('HOME') .. '/.imapfilter/' | |
--------------- | |
-- Options -- | |
--------------- | |
-- time in second before deciding the server timeouted | |
options.timeout = 120 | |
-- auto-subscribe to new directories | |
options.subscribe = true |
OlderNewer