Follow up from comment on: http://markbirbeck.com/blog/2012/03/16/using-knife-to-launch-ec2-instances-without-a-chef-server/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/awk -f | |
{sub(/^[ \t]+/,"");idx=0} | |
/\{/{ctx++;idx=1} | |
/\}/{ctx--} | |
{id="";for(i=idx;i<ctx;i++)id=sprintf("%s%s", id, "\t");printf "%s%s\n", id, $0} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:deis (master)$ make pull | |
vagrant ssh -c 'for c in registry logger database cache controller builder router; do echo docker pull deis/$c; docker pull deis/$c; done' | |
docker pull deis/registry | |
2014/04/18 16:18:49 Error: client and server don't have same version (client : 1.11, server: 1.10) | |
docker pull deis/logger | |
2014/04/18 16:18:49 Error: client and server don't have same version (client : 1.11, server: 1.10) | |
docker pull deis/database | |
2014/04/18 16:18:49 Error: client and server don't have same version (client : 1.11, server: 1.10) | |
docker pull deis/cache | |
2014/04/18 16:18:49 Error: client and server don't have same version (client : 1.11, server: 1.10) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# usage: | |
# gitaddsubdir foo https://mygit.repo | |
# | |
function gitaddsubdir () { | |
dirname=$1 | |
repo=$2 | |
git remote add -f $dirname $repo | |
git checkout $dirname/master -b $dirname | |
mkdir $dirname |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:~ (master)$ launchctl limit | |
cpu unlimited unlimited | |
filesize unlimited unlimited | |
data unlimited unlimited | |
stack 8388608 67104768 | |
core 0 unlimited | |
rss unlimited unlimited | |
memlock unlimited unlimited | |
maxproc 709 1064 | |
maxfiles 500 500 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
redis-cli EVAL "$(cat hello.lua)" 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
SIGINT wrapper for lighttpd graceful restart feature under runit. | |
by Zik | |
("inspired by" execwrap by Sune Foldager) */ | |
/* Errors */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ time ruby -e "puts 'hi'" | |
hi | |
real 0m0.060s | |
user 0m0.033s | |
sys 0m0.025s | |
$ time bundle exec ruby -e "puts 'hi'" | |
hi | |
real 0m1.635s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# immediately kill cf-component if its config files change. The crontab will take | |
# care of re-launching it within a minute. | |
"$(sys.workdir)/inputs/site/$(component).cf" | |
changes => detect_content, | |
classes => if_repaired("kill_$(component)"); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'github_api' | |
require 'statsd' | |
github = Github.new login: 'bpo', password: "xxxxx" | |
s = Statsd.new "stats.stovepipestudios.com" | |
# Send stvp stats | |
stvp = github.orgs.get "stvp" | |
s.gauge "bpo.git.stvp.public_repos", stvp.public_repos | |
s.gauge "bpo.git.stvp.private_repos", stvp.total_private_repos |