Skip to content

Instantly share code, notes, and snippets.

@emileswarts
emileswarts / gist:5382598
Created April 14, 2013 12:50
start postgres on my air
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
@emileswarts
emileswarts / gist:5244928
Created March 26, 2013 12:11
Check ips on server
netstat -tn 2>/dev/null | grep :80 | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -nr | head
@emileswarts
emileswarts / logkeys
Created December 4, 2012 14:34
logkeys
execve("/usr/local/bin/logkeys", ["logkeys"], [/* 36 vars */]) = 0
brk(0) = 0x9c33000
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb779b000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=125002, ...}) = 0
mmap2(NULL, 125002, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb777c000
close(3) = 0
open("/usr/lib/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0`f\4\0004\0\0\0"..., 512) = 512
@emileswarts
emileswarts / vim_compile.sh
Created September 14, 2012 12:04
Vim compiling with huge features
./configure --enable-perlinterp --enable-pythoninterp --enable-rubyinterp --enable-cscope --with-features=huge --prefix=/home/emile
@emileswarts
emileswarts / gist:3519001
Created August 29, 2012 21:09
Ack vs Ag time
ack renderHeader /server/www
1.41s user 0.67s system 56% cpu 3.653 total
ag renderHeader /server/www
0.62s user 0.19s system 99% cpu 0.815 total
@emileswarts
emileswarts / pythoncr.py
Created August 15, 2012 19:33
Python cr
python slash-n.py > slashn && python slash-r.py > slashr && vim -O slashn slashr
@emileswarts
emileswarts / append.sh
Created July 9, 2012 20:23
Append to file
cat localfile | ssh user@host "cat >>remotefile"
@emileswarts
emileswarts / print.sh
Created May 25, 2012 16:44
Print cups Brother
lp -d Brother_MFC_9465CDN testfile.txt
Show installed gems
bundle show
Generate scaffold
bundle exec rake db:migratls generate scaffold User name:string email:string
Install gems defined in Gemfile. Skip production group
bundle install --without production
Install db tables and fields
for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master`; do git branch --track ${branch##*/} $branch; done