Skip to content

Instantly share code, notes, and snippets.

View kvz's full-sized avatar

Kevin van Zonneveld kvz

View GitHub Profile
@kvz
kvz / install_wkhtmltopdf.sh
Created September 14, 2011 14:58
Installing wkhtmltopdf as static is faster & dependency free
arch=i386
uname -m |grep 64 && arch=amd64
[ -d /usr/local/bin/ ] || mkdir -p /usr/local/bin/
wget -O /usr/local/bin/wkhtmltopdf.tar.bz2 http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.9.9-static-${arch}.tar.bz2
cd /usr/local/bin/
tar jxvf /usr/local/bin/wkhtmltopdf.tar.bz2
mv wkhtmltopdf-${arch} wkhtmltopdf
chmod 755 wkhtmltopdf
cd -
wkhtmltopdf --help && echo "You're welcome Carl"
@kvz
kvz / mac_apps_101_by_kvz.md
Created November 17, 2011 10:40
Mac Apps 101

kvz: "I'm recommending these Mac apps to a colleague who's losing his OSX virginity: https://gist.github.com/1372883. Anything you think I should add?"

Don't forget to look at the suggestions at the bottom, there's some cool stuff in there.

Essential

  • 1Password - password manager. intergrates with Dropbox & all main webbrowsers so you'll never lose a password again
  • Dropbox - a free 2GB folder in your homedir that stays in sync with all the devices you also install it on (linux/windows/mac/ipad/iphone/etc). Useful for backup, collaboration (share 1 folder with others), and keeping important documents with you.
  • Chrome - browsing
  • Colloquy - IRC
echo -e "\e[1;40m" ; clear ; while :; do echo $LINES $COLUMNS $(( $RANDOM % $COLUMNS)) $(( $RANDOM % 72 )) ;sleep 0.05; done|gawk '{ letters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*()"; c=$4; letter=substr(letters,c,1);a[$3]=0;for (x in a) {o=a[x];a[x]=a[x]+1; printf "\033[%s;%sH\033[2;32m%s",o,x,letter; printf "\033[%s;%sH\033[1;37m%s\033[0;0H",a[x],x,letter;if (a[x] >= $1) { a[x]=0; } }}'
@kvz
kvz / scan_logs.sh
Created January 9, 2012 14:58
Return serverlogs of a specific timeframe (between a few minutes)
DAY="2012-01-09"
HOUR="05"
MINUTE_FROM="48"
MINUTE_TO="53"
MATCH_TIME="${HOUR}:($(seq -f '%02g' -s '|' ${MINUTE_FROM} ${MINUTE_TO})):"
egrep -Ir "$(date --date="${DAY}" '+(%b %e|%d %b|%d/%b/%Y|%Y.%m.%d|%Y/%m/%d|%Y-%m-%d)[\ \-\.]')${MATCH_TIME}" /var/log
@kvz
kvz / resolving_dns_issues.txt
Created January 18, 2012 21:48
Amazon resolving DNS issues
root@cuc:~# grep nameserver /etc/resolv.conf
nameserver 172.16.0.23
root@cuc:~# time ssh git@github.com
ssh: Could not resolve hostname github.com: Temporary failure in name resolution
real 0m40.043s
user 0m0.000s
sys 0m0.008s
@kvz
kvz / navbar.less
Created March 13, 2012 16:17
First few lines from navbar.less from Twitter Bootstrap http://twitter.github.com/bootstrap/
.navbar {
// Fix for IE7's bad z-indexing so dropdowns don't appear below content that follows the navbar
*position: relative;
*z-index: 2;
overflow: visible;
margin-bottom: @baseLineHeight;
}
// Gradient is applied to it's own element because overflow visible is not honored by IE when filter is present
@kvz
kvz / gist:3889202
Created October 14, 2012 17:08 — forked from DanielNill/gist:3824266
composer example
{
"name": "My-New-Project",
"require-prod": {
"doctrine/orm": "2.2.1"
},
"require-dev": {
"doctrine/orm": "2.*"
},
"require":{
@kvz
kvz / gist:4110519
Created November 19, 2012 13:01
meta
# exiftool api2/test/fixture/file* \
> |awk -F: '{print $1}' \
> |sed 's/ *$//g' \
> |grep -v === \
> |sort -u \
> |tr [A-Z' '\'\&\(\)] [a-z_____] > /tmp/meta.txt
# cat /tmp/meta.txt
about
add_original_decision_data
@kvz
kvz / compile-galore.sh
Last active December 14, 2015 20:09
What we need to compile to have decent encoding over at Transloadit
$ ls deps/packets |sed 's#\.sh##g'
aws
curl
exiftool
ffmpeg
ghostscript
go_cmds
gpac
haproxy
imagemagick
@kvz
kvz / cake-2.x-nginx-vhost
Last active December 16, 2015 21:49
First swing at public cake 2.0 nginx vhost. please improve
# Be sure to checkout the official docs for a smaller example
# http://book.cakephp.org/2.0/en/installation/url-rewriting.html#pretty-urls-on-nginx
http {
# With this trick, you can pass per-environment variables and
# PHP settings to FastCGI depending on the host header value.
map $http_host $environment {
example.local development;
example.com production;