Skip to content

Instantly share code, notes, and snippets.

View whitmo's full-sized avatar
💭
state 26

Whit Morriss whitmo

💭
state 26
View GitHub Profile
@whitmo
whitmo / gist:1039198
Created June 21, 2011 23:10
local chef config
log_level :info
log_location STDOUT
node_name 'whit'
client_key '/Users/whit/.chef/whit.pem'
validation_client_name 'chef-validator'
validation_key '.chef/validation.pem'
chef_server_url 'pa-lintools.corp.surveymonkey.com:4000'
cache_type 'BasicFile'
cache_options( :path => '/Users/whit/.chef/checksums' )
@whitmo
whitmo / gist:1176336
Created August 28, 2011 07:00 — forked from voodootikigod/gist:1155790
PyCodeConf Ticket Give-away
class GitHubGiveAway(object):
questions = "day job",\
"fav python project",\
"fav conference",\
"python foo"
answers = "Python DevOps Ninja Janitor Monkey @ SurveyMonkey, "\
"ZDjangoGears by Ian Bicking or Starkiller or pythong.org, "\
"Snow or Castle or Mountain Sprints or Pylons Project MiniCon, "\
"so drunk when I wrote this I only had one eye I open".split(', ')
@whitmo
whitmo / gist:1198577
Created September 6, 2011 18:44
/etc/supervisord.conf
[unix_http_server]
file=/tmp/supervisor.sock ; (the path to the socket file)
;chmod=0700 ; sockef file mode (default 0700)
;chown=nobody:nogroup ; socket file uid:gid owner
;username=user ; (default is no username (open server))
;password=123 ; (default is no password (open server))
[inet_http_server] ; inet (TCP) server disabled by default
port=127.0.0.1:9001 ; (ip_address:port specifier, *:port for all iface)
;username=user ; (default is no username (open server))
@whitmo
whitmo / gist:1198582
Created September 6, 2011 18:46
/etc/conf.d/doula.conf
[program:fabworker]
command = fabworker -l INFO 'doula.deploy'
numprocs = 1
process_name = %(process_num)s
priority = 11
redirect_stderr = true
autorestart = true
stdout_logfile=fabworker-out.log
stdout_logfile_maxbytes=4MB
stdout_logfile_backups=10
@whitmo
whitmo / doula-req.txt
Created September 6, 2011 19:07
doula reqs
# pip install -r doula-reqs.txt
supervisor
python-dateutil
lxml
Paste
PasteDeploy
PasteScript
-e [email protected]:SurveyMonkey/melk.util.git#egg=melk.util
-i http://yorick:9003/index
-e [email protected]:DevOps/ReleaseDoula.git#egg=ReleaseDoula
@whitmo
whitmo / gist:1199164
Created September 6, 2011 22:15
ssh cm
from fabric import network as net
@contextmanager
def ssh2(notify, raise_error=False):
try:
yield
except :
exc_t, exc, tb = sys.exc_info()
if isinstance(exc, exceptions.SystemExit):
notify('Task aborted. Check fabworker logs.')
@whitmo
whitmo / gist:1268196
Created October 6, 2011 18:26
caching property
from functools import partial
class CachingDescriptor(object):
def __init__(self, func):
self.cache = None
self.func = func
def __get__(self, obj, objtype):
if self.cache is None:
@whitmo
whitmo / gist:1424820
Created December 2, 2011 21:01
sshcm.py
from fabric import network as net
@contextmanager
def ssh2(notify, raise_error=False):
try:
yield
except :
exc_t, exc, tb = sys.exc_info()
if isinstance(exc, exceptions.SystemExit):
notify('Task aborted. Check fabworker logs.')
@whitmo
whitmo / gist:1448084
Created December 8, 2011 19:06
knife rsa error
DEBUG: Using configuration from /home/whit/chef-repo/.chef/knife.rb
DEBUG: Signing the request as whitmo
/var/lib/gems/1.8/gems/mixlib-authentication-1.1.4/lib/mixlib/authentication/signedheaderauth.rb:56:in `private_encrypt': data too large for key size (OpenSSL::PKey::RSAError)
from /var/lib/gems/1.8/gems/mixlib-authentication-1.1.4/lib/mixlib/authentication/signedheaderauth.rb:56:in `sign'
from /var/lib/gems/1.8/gems/chef-0.10.4/lib/chef/rest/auth_credentials.rb:51:in `signature_headers'
from /var/lib/gems/1.8/gems/chef-0.10.4/lib/chef/rest.rb:321:in `authentication_headers'
from /var/lib/gems/1.8/gems/chef-0.10.4/lib/chef/rest.rb:366:in `build_headers'
from /var/lib/gems/1.8/gems/chef-0.10.4/lib/chef/rest.rb:216:in `api_request'
from /var/lib/gems/1.8/gems/chef-0.10.4/lib/chef/rest.rb:114:in `get_rest'
from /var/lib/gems/1.8/gems/chef-0.10.4/lib/chef/api_client.rb:192:in `list'
@whitmo
whitmo / nginx.conf
Created January 5, 2012 22:37
nginx.conf
location /static {
alias /opt/webapp/cheese_emporium/src/cheese-emporium/cheese_emporium/static;
autoindex on;
}