Skip to content

Instantly share code, notes, and snippets.

View thewhodidthis's full-sized avatar
🔘

Sotiri Bakagiannis thewhodidthis

🔘
View GitHub Profile
@thewhodidthis
thewhodidthis / gist:b8c66d00785085d3da78
Last active October 10, 2015 04:27
Remove .DS_Store files from git repo
find . -name .DS_Store -print0 | xargs -0 git rm --ignore-unmatch
@thewhodidthis
thewhodidthis / gist:3e604dce47c30984bd66
Last active August 21, 2016 10:12
Combine stills using ImageMagick
# 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
@thewhodidthis
thewhodidthis / gist:d634827f6ef9d61ea0e5
Last active August 29, 2015 14:07
Secure wipe disk
dd if=/dev/urandom of=/dev/sda bs=1M
@thewhodidthis
thewhodidthis / gist:ce7597feee295890f723
Last active August 11, 2016 16:00
Batch convert jpegs in place using ImageMagick
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:99c46d44af9cffa3bb3b
Last active August 11, 2016 15:46
Make some noise
# 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:ab790849666c5dc57b2d
Last active September 24, 2019 10:11
Create animated gif from spritesheet using ImageMagick
# Resize, optimize and save sprite as looping animated gif
convert -resize 50% +repage -fuzz 1.6% -delay 8 -loop 0 *.png -layers OptimizePlus -layers OptimizeTransparency output.gif
@thewhodidthis
thewhodidthis / post-update
Created April 8, 2015 08:03
Git post update hook
#!/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:7aac75e220bd7198e5d0
Last active August 11, 2016 16:37
Pipe audio through local network using soundflower, esound, netcat, pacat
# 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 / gist:e23d1d0757c18600e97a
Last active August 11, 2016 15:37
Search Chrome history using omnibox
chrome://history/#q=%s
@thewhodidthis
thewhodidthis / gist:244fc60f73965e121be6
Last active August 11, 2016 15:38
Remove quotes from text file
sed 's/\"//g' file.txt > noquotes.txt