Skip to content

Instantly share code, notes, and snippets.

@thewhodidthis
thewhodidthis / gist:d634827f6ef9d61ea0e5
Last active August 29, 2015 14:07
Secure wipe disk
View gist:d634827f6ef9d61ea0e5
dd if=/dev/urandom of=/dev/sda bs=1M
@thewhodidthis
thewhodidthis / post-update
Created April 8, 2015 08:03
Git post update hook
View post-update
#!/bin/sh
#
# An example hook script to prepare a packed repository for use over
# dumb transports.
#
# To enable this hook, rename this file to "post-update".
unset GIT_DIR
cd /path/to/site
git pull
@thewhodidthis
thewhodidthis / gist:b8c66d00785085d3da78
Last active October 10, 2015 04:27
Remove .DS_Store files from git repo
View gist:b8c66d00785085d3da78
find . -name .DS_Store -print0 | xargs -0 git rm --ignore-unmatch
@thewhodidthis
thewhodidthis / gist:e23d1d0757c18600e97a
Last active August 11, 2016 15:37
Search Chrome history using omnibox
View gist:e23d1d0757c18600e97a
chrome://history/#q=%s
@thewhodidthis
thewhodidthis / gist:244fc60f73965e121be6
Last active August 11, 2016 15:38
Remove quotes from text file
View gist:244fc60f73965e121be6
sed 's/\"//g' file.txt > noquotes.txt
@thewhodidthis
thewhodidthis / gist:99c46d44af9cffa3bb3b
Last active August 11, 2016 15:46
Make some noise
View gist:99c46d44af9cffa3bb3b
# https://blogs.fsfe.org/marklindhout/2013/02/need-to-play-high-fidelity-white-noise-listen-to-devurandom-on-osx/
cat /dev/urandom | sox -traw -r44100 -b16 -e unsigned-integer - -tcoreaudio
@thewhodidthis
thewhodidthis / gist:ce7597feee295890f723
Last active August 11, 2016 16:00
Batch convert jpegs in place using ImageMagick
View gist:ce7597feee295890f723
convert *.jpg -density 72x72 -units PixelsPerInch -strip -interlace Plane -gaussian-blur 0.05 -quality 85% -set filename:fname '%t' +adjoin '%[filename:fname].jpg'
@thewhodidthis
thewhodidthis / gist:7aac75e220bd7198e5d0
Last active August 11, 2016 16:37
Pipe audio through local network using soundflower, esound, netcat, pacat
View gist:7aac75e220bd7198e5d0
# Target
while true; do nc -l <PORT> | pacat --latency-msec=1; done
# Source
esd -tcp -bind ::1 & sleep 2 && esdrec -s ::1 | nc <CLIENT> <PORT>
# OR
# Source
esd -tcp -bind ::1 & sleep 2 && (esdrec -s ::1 | esdcat -s <CLIENT>)
# References
@thewhodidthis
thewhodidthis / post-receive
Last active August 21, 2016 10:11
Git hook for git2html
View post-receive
# http://hssl.cs.jhu.edu/~neal/git2html/
./git2html.sh \
-p git2html \
-l http://hssl.cs.jhu.edu/~neal/git2html.git \
-r /home/neal/public_html/git2html.git
~/public_html/git2html/src/
./git2html.sh ~/public_html/git2html/src/
@thewhodidthis
thewhodidthis / gist:3e604dce47c30984bd66
Last active August 21, 2016 10:12
Combine stills using ImageMagick
View gist:3e604dce47c30984bd66
# Create spritesheet from list of pngs
montage -background "transparent" -depth 8 -type TrueColorMatte *.png -geometry 50x50 -tile 10x1 -matte -transparent "transparent" -type TrueColorMatte -depth 8 sprite.png