Skip to content

Instantly share code, notes, and snippets.

View zph's full-sized avatar

Zander Hill zph

View GitHub Profile
@zph
zph / cloak.ovpn
Last active August 29, 2015 14:08
client
dev tun
comp-lzo
remote-cert-tls server
server-poll-timeout 10
auth-user-pass
auth-nocache
auth-retry interact
verb 1
remote openvpn.getcloakvpn.com 443 udp
while read -r line
do
echo "$line"
done < <(jobs)
@zph
zph / import.js
Created June 16, 2014 18:40 — forked from bkerley/import.js
var fs = require('fs');
var pg = require('pg').native;
global.Grailbird = {};
global.Grailbird.data = {};
var tweetFiles = fs.readdirSync("./data/js/tweets");
for (var f in tweetFiles) {
eval('global.'+fs.readFileSync('./data/js/tweets/'+ tweetFiles[f]));
def get_rstring(addr):
s = addr.cast(string_t.pointer())
if s['basic']['flags'] & (1 << 13):
return s['as']['heap']['ptr'].string()
else:
return s['as']['ary'].string()
def get_lineno(iseq, pos):
if pos != 0:
pos -= 1
# 20140327 - Backing up whole User directory from Macbook Air 2012 model.
# ``` shell
rsync -axv --numeric-ids --delete --progress \
--exclude 'Documents/Virtual Machines.localized' \
--exclude '.rvm/' \
--exclude '.vagrant.d/boxes/' \
--exclude '.vmdk' \
--exclude '.xbmc' \
--exclude 'Dropbox/' \
--exclude 'Application Support/Dash/' \

Screencasting Framework

The following document is a written account of the Code School screencasting framework. It should be used as a reference of the accompanying screencast on the topic.

Why you should care about screencasting?

You're probably aren't going to take the time to read this document if you're not interested, but there are a lot of nice side effects caused by learning how to create quality screencasts.

  1. Communicating more effectively - At Envy Labs we produce screencasts for our clients all the time. Whether it's demoing a new feature or for a presentation for an invester, they're often much more effective and pleasent than a phone call or screen sharing.
cat > Dockerfile <<\EOF
FROM ubuntu:12.04
RUN apt-get update
RUN apt-get install -y ruby1.9.3 build-essential \
libc6-dev libffi-dev libgdbm-dev libncurses5-dev \
libreadline-dev libssl-dev libyaml-dev zlib1g-dev
RUN gem install fpm --bindir=/usr/bin --no-rdoc --no-ri
RUN apt-get install -y curl
RUN curl ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p484.tar.gz|tar oxzC /tmp
WORKDIR /tmp/ruby-1.9.3-p484
# Run with: rake environment elasticsearch:reindex
namespace :elasticsearch do
desc "re-index elasticsearch"
task :reindex => :environment do
klass = Place
ENV['CLASS'] = klass.name
ENV['INDEX'] = new_index = klass.tire.index.name << '_' << Time.now.strftime('%Y%m%d%H%M%S')
@zph
zph / gist:8757230
Created February 1, 2014 19:22 — forked from philipn/gist:5274197

Running Ubuntu on a Macbook Air

You don't have to be a slave to OS X! Here's a guide to a sane dual-booting setup with Ubuntu 12.10 on your shiny MacBook Air. This is written and tested for a MacBook Air 5,2 (Mid 2012), but likely works the same with any modern Macbook.

Install according to instructions at this URL:

@zph
zph / gist:8591004
Created January 24, 2014 02:24 — forked from tonyc/gist:1384523

Using strace and lsof to debug blocked processes

You can use strace on a specific pid to figure out what a specific process is doing, e.g.:

strace -fp <pid>

You might see something like:

select(9, [3 5 8], [], [], {0, 999999}) = 0 (Timeout)