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
[program:hubot] | |
command=/srv/hubot/bin/hubot --adapter hipchat | |
user=hubot | |
autostart=true | |
autorestart=true | |
directory=/srv/hubot/ | |
environment=HUBOT_AUTH_ADMIN="XYZ",HUBOT_HIPCHAT_PASSWORD="XYZ",HUBOT_HIPCHAT_TOKEN="XYZ",HUBOT_HIPCHAT_JID="XYZ",HUBOT_HIPCHAT_ROOMS="ROOMS" |
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
# Description: | |
# Deploy branches to staging. | |
# | |
# Commands: | |
# hubot deploy <branch> to <environment> | |
# hubot show branches | |
{spawn, exec} = require 'child_process' | |
module.exports = (robot) -> |
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
# Deploy branch to staging | |
from fabric.api import cd, env, parallel, run, task | |
from fabric.decorators import roles | |
# Define your servers | |
env.roledefs = { | |
'staging-web-servers': ['s-web-01.example.com', | |
's-web-03.example.com', | |
's-web-03.example.com'], |
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
from django.core.cache import cache | |
cache_key = 'CM:recent-jobs' | |
cache.delete(cache_key) |
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
# Using conf.py (currently in master) | |
# Jenkins config... | |
# Wes Code (e.g. before any help) | |
#!/bin/bash | |
source /home/ubuntu/production/bin/activate | |
cd /srv/ | |
echo "Generating 'doc' folder..." |
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
# Useful when creating lists in config files... | |
<%= my_list.join(',') %> |
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
Very quick way to get some timing info... | |
import time | |
class Timer(): | |
def __enter__(self): self.start = time.time() | |
def __exit__(self, *args): print time.time() - self.start | |
with Timer(): | |
some_code() |
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
from django.utils import simplejson | |
#Go to a url | |
response = self.client.get(self.url) | |
foobar = simplejson.loads(response.content) | |
print foorbar['item'] |
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
#Connect to mysql command line... | |
$ mysql -u root -p | |
#Create user | |
$ create user USERNAME; | |
#Assign Permissions | |
$ grant PERMISSIONS on DATABASE.* to 'USERNAME'@'localhost' identified by 'PASSWORD'; |
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
Example File | |
AB101AA,394251,806376,57.1482995075,-2.09663094048 | |
Import file from command line: | |
$ mysqlimport -u root -p --local --fields-terminated-by=',' DATABASE FILENAME |