Skip to content

Instantly share code, notes, and snippets.

View davedash's full-sized avatar
🏠
Working from home

Dave Dash davedash

🏠
Working from home
View GitHub Profile
policy = """{
"Statement":[{
"Effect":"Allow",
"Action":["s3:*"],
"Resource":["arn:aws:s3:::mybucket"]}]}"""
import boto
c = boto.connect_iam()
instance_profile = c.create_instance_profile('myinstanceprofile')
role = c.create_role('myrole')
c.add_role_to_instance_profile('myinstanceprofile', 'myrole')
DOT_COM_TO_TODAY = {'kozmo.com': 'postmates'}
#!/bin/bash
CHUNK=5
MYSQL_CMD="SHOW SLAVE STATUS\G"
MYSQL="/usr/bin/mysql"
GREP="grep Sec"
START=$(echo $MYSQL_CMD|$MYSQL|$GREP|cut -d: -f2)
i=0
function slaving_stopped {
require "./test2.rb"
def hi_replacement
puts "new thing"
end
hi = hi_replacement
hi
Error attempting to use stored discovery information: <openid.consumer.consumer.TypeURIMismatch: Required type http://specs.openid.net/auth/2.0/signon not found in ['http://specs.openid.net/auth/2.0/server', 'http://openid.net/srv/ax/1.0', 'http://specs.openid.net/extensions/ui/1.0/mode/popup', 'http://specs.openid.net/extensions/ui/1.0/icon', 'http://specs.openid.net/extensions/pape/1.0'] for endpoint <openid.consumer.discover.OpenIDServiceEndpoint server_url='https://www.google.com/accounts/o8/ud' claimed_id=None local_id=None canonicalID=None used_yadis=True >>
{
"default" : "https://phabricator.whatever.com/"
}
#!/bin/bash
USAGE="Usage: $0 worker total_workers
Note: worker is 0-indexed"
if [ "$#" -ne "2" ]; then
echo "$USAGE"
exit 1
fi
@davedash
davedash / import.sh
Last active December 27, 2015 17:39
#!/bin/bash -xe
ssh admin@$OLD_HOST -- 'ghe-export-authorized-keys' | ghe-import-authorized-keys
ssh admin@$OLD_HOST -- 'ghe-export-es-indices' | ghe-import-es-indices
ssh admin@$OLD_HOST -- 'ghe-export-mysql' | ghe-import-mysql
ssh admin@$OLD_HOST -- 'ghe-export-redis' | ghe-import-redis
# ssh admin@$OLD_HOST -- 'ghe-export-repositories' | ghe-import-repositories
ssh admin@$OLD_HOST -- 'ghe-export-pages' | ghe-import-pages
ssh admin@$OLD_HOST -- 'ghe-export-ssh-host-keys' | ghe-import-ssh-host-keys
crons:
reindex:
hostgroup: crongrowth
schedule: H * * * *
command: /mnt/pinboard/bin/reindex.py
environment: PINLOG_LOG_TO_STDERR=1
# H is borrowed from Jenkins to automatically pick the best minute/hour/etc.
# If we have multiple crongrowth boxes this should balance across them.
@davedash
davedash / gist:6248964
Created August 16, 2013 10:52
pip with wheels vs not for a project with ~100-120 requirements.
$ virtualenv a
New python executable in a/bin/python
Installing setuptools............done.
Installing pip...............done.
$ . a/bin/activate
(a)$ time pip install -qr code/pinboard/requirements.txt
pip install -qr code/pinboard/requirements.txt 246.99s user 59.66s system 82% cpu 6:11.28 total
(a)$ virtualenv b
New python executable in b/bin/python
Installing setuptools............done.