View vault_decrypt
#!/bin/sh
tmp=`mktemp`
cat "${1--}" > $tmp
ansible-vault decrypt $tmp > /dev/null 2>&1
if [ $? -eq 0 ]; then
cat "$tmp"
else
cat "${1--}"
View mandelbrot.sql
WITH RECURSIVE
x(i) AS ( VALUES (0)
UNION ALL SELECT i + 1
FROM x
WHERE i < 101),
Z(Ix, Iy, Cx, Cy, X, Y, I) AS (
SELECT
Ix,
Iy,
X :: FLOAT,
View keybase.md

Keybase proof

I hereby claim:

  • I am thomasbilk on github.
  • I am thomasbilk (https://keybase.io/thomasbilk) on keybase.
  • I have a public key whose fingerprint is 4B69 61F2 4655 D023 BCA1 13AC A4E4 E319 00C9 DF4B

To claim this, I am signing this object:

View gunicorn-initd-script
#!/bin/sh
### BEGIN INIT INFO
# Provides: webapp
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: gunicorn init.d script for ubuntu and debian
# Description: gunicorn init.d script for running gunicorn on ubuntu or debian based systems
# start script using `/etc/init.d/webapp start`
View ssl.sh
function makessl() {
if [[ -z ${1} ]]; then echo "please supply a domain name"; return 1; fi
echo "\n>> generating key and certificate for ${1} <<\n"
_filename=$(echo ${1} | tr '*' '_')
openssl genrsa -out ${_filename}.key 4096
openssl req -new -key ${_filename}.key -out ${_filename}.csr -subj "/CN=${1}"
openssl x509 -req -sha256 -days 3650 -in ${_filename}.csr -signkey ${_filename}.key -out ${_filename}.crt
cat ${_filename}.key ${_filename}.crt > ${_filename}.pem
}
View howto.md

Download jruby complete:

curl -O http://jruby.org.s3.amazonaws.com/downloads/1.7.13/jruby-complete-1.7.13.jar

Now rename it:

mv jruby-complete-1.7.13.jar scss.jar

Next install gems:

View fossil_rss.sh
#!/usr/bin/env bash
for fos in `ls /var/repos/*.fossil`; do
rss=`echo $fos | sed 's/\/var\/repos\/\(.*\)\.fossil/\1/'`;
/usr/local/bin/fossil rss -R $fos --url https://repos.com/$rss > /var/public/rss/$rss.rss;
done
View postgres.sql
WITH RECURSIVE x( s, ind ) AS
( SELECT sud, position( '.' IN sud )
FROM (SELECT '91.7......326.9.8...7.8.9...86.3.17.3.......6.51.2.84...9.5.3...2.3.149......2.61'::text
AS sud) xx
UNION ALL
SELECT substr( s, 1, ind - 1 ) || z || substr( s, ind + 1 )
, position('.' IN repeat('x',ind) || substr( s, ind + 1 ) )
FROM x
, (SELECT gs::text AS z FROM generate_series(1,9) gs) z
WHERE ind > 0
View gist:9387388
ffmpeg -i infile.mov -codec:v h264 -b:v 650k -codec:a aac -strict -2 -b:a 128k -s 640x360 -f mp4 -y outfile.mp4
ffmpeg -i infile.mov -codec:v theora -b:v 650k -codec:a vorbis -strict -2 -b:a 128k -s 640x360 -f ogg -y outfile.ogv
View firefox.conf
browser.fixup.alternate.enabled;false
browser.urlbar.trimURLs;false
general.smoothScroll;false
plugins.click_to_play;true
plugins.notifyMissingFlash;false