Skip to content

Instantly share code, notes, and snippets.

function passenger_watcher {
while inotifywait -qq -e modify -e delete -e move -r @./.venv @./.git . ; do
touch tmp/restart.txt
done
}
$ npm -g list
...
npm ERR! missing: qs@~0.6.0, required by request@2.27.0
npm ERR! missing: json-stringify-safe@~5.0.0, required by request@2.27.0
npm ERR! missing: forever-agent@~0.5.0, required by request@2.27.0
npm ERR! missing: tunnel-agent@~0.3.0, required by request@2.27.0
npm ERR! missing: http-signature@~0.10.0, required by request@2.27.0
npm ERR! missing: hawk@~1.0.0, required by request@2.27.0
@198d
198d / gist:6188336
Last active December 20, 2015 20:09
vm.swappines:
sysctl.present:
- value: 20
echo hello:
cmd.wait:
- watch:
- sysctl: vm.swappines
java:
pkg.installed:
- name: openjdk-7-jre-headless
elasticsearch:
pkg.installed:
- sources:
- elasticsearch:all: https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.3.deb
- require:
@198d
198d / fabfile.py
Last active December 20, 2015 12:49
@task
@roles('web')
def deploy():
action1()
action2()
action3()
action4()
action5()
execute(reindex)
action6()
@198d
198d / fabfile.py
Last active December 20, 2015 10:39
from fabric.api import run, task, roles, env, execute
env.roledefs = {'web': ['host1.example.com',
'host2.example.com'],
'db': ['host3.example.com']}
@task
@roles('db')
@198d
198d / argparse.py
Last active December 19, 2015 13:09
def command(foo, bar, baz=10):
pass
parser = argparse.ArgumentParser()
parser.add_argument('foo')
parser.add_argument('bar')
parser.add_argument('--baz', default=10)
@198d
198d / gist:4949465
Last active December 13, 2015 17:38
class A(Document):
prop = StringProperty(default='something')
class B(A):
prop = StringProperty(default='something else')
class B(A):
pass
B.prop.default = 'something else'
var jsdom = require('jsdom'),
optimist = require('optimist'),
prompt = require('prompt'),
util = require('util'),
sprintf = require('sprintf').sprintf,
fs = require('fs'),
http = require('http'),
url = require('url');
@198d
198d / add.rb
Created October 14, 2011 17:26
RCelery Getting Started
task(:ignore_result => false)
def add(a,b)
a + b
end