This file contains 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
# Show current git branch or SVN subfolder in prompt. | |
GREEN="\[\033[0;32m\]" | |
LIGHT_GREEN="\[\033[1;32m\]" | |
GRAY="\[\033[1;30m\]" | |
LIGHT_BLUE="\[\033[1;34m\]" | |
LIGHT_GRAY="\[\033[0;37m\]" | |
COLOR_OFF="\[\e[0m\]" | |
LAST_GIT_DIR="!" | |
function prompt_func() { | |
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' |
This file contains 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
apt-get install python-software-properties | |
add-apt-repository ppa:nginx/stable | |
add-apt-repository ppa:uwsgi/uwsgi | |
echo "# MongoDB" >> /etc/apt/sources.list | |
echo "deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen" >> /etc/apt/sources.list | |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 | |
apt-get update | |
apt-get install nginx uwsgi-common uwsgi-extra uwsgi-plugins-all mongodb-10gen |
This file contains 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 'formula' | |
class MongodbSrc < Formula | |
url 'http://downloads.mongodb.org/src/mongodb-src-r2.0.1.tar.gz' | |
homepage 'http://www.mongodb.org/' | |
md5 'cb8579074b7c9752eb382a2094ac4523' | |
depends_on 'boost' | |
depends_on 'pcre++' | |
depends_on 'scons' |
This file contains 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
import smtplib | |
class SmtpPlugin(object): | |
def __init__(self, config, logger, raw_config): | |
self.config = config | |
self.logger = logger | |
self.raw_config = raw_config | |
def run(self): |
This file contains 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
#!/bin/bash | |
# Add this to your .bashrc | |
# alias curl="/path/to/curl_wrapper.sh" | |
curl $* | |
echo |
This file contains 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
import json | |
import urllib2 | |
username = 'ignorethecrane' | |
url = 'https://twitter.com/statuses/user_timeline/%s.json' % (username,) | |
u = urllib2.urlopen(url) | |
tweets = json.loads(u.read()) |
This file contains 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
try: | |
from pymongo import binary | |
except ImportError: | |
import sys | |
from bson import binary | |
sys.modules['pymongo.binary'] = binary |
This file contains 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/env php | |
<?php | |
$bin = getcwd() . '/bin/'; | |
// Create dynamic paths for environment | |
if (!file_exists($bin)) | |
{ | |
mkdir($bin); | |
echo "Created ./bin" . PHP_EOL; | |
} |
This file contains 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
#!/bin/bash | |
# Install steps | |
sudo sed -i -e 's#us.archive.ubuntu.com#gb.archive.ubuntu.com#g' /etc/apt/sources.list | |
sudo apt-get update | |
sudo apt-get -y install redis-server python-software-properties build-essential g++ libssl-dev pkg-config | |
sudo add-apt-repository ppa:chris-lea/node.js | |
sudo apt-get -y install nodejs nodejs-dev npm | |
if [ ! -d /var/log/hubot ]; then |
This file contains 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
#!/bin/bash | |
for id in "4e4e1638c85e808431000003 4e4e1638c85e808431000004 4e4e1638c85e808431000005" | |
do | |
densli metrics.getRange metric=networkTraffic deviceId=$id -t 30m -s | |
done |