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
import inspect | |
import sys | |
def src(obj): | |
"""Read the source of an object in the interpreter.""" | |
def highlight(source): | |
try: | |
import pygments |
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
''' | |
Fabfile for running chef-client across a cluster of servers. | |
EC2 credentials are automatically read from the knife config file and servers | |
are discovered via the ec2 API. | |
Put this file in the root of your chef repo and tehn run ``fab ec2_instances run_chef`` to run "chef-client" on all of your EC2 | |
servers or run ``fab ec2_instances:group_id=web run_chef`` to run | |
"chef-client" on just the servers in a given security group. |
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
brew install git | |
brew update | |
brew install readline | |
brew link readline | |
brew install python | |
brew install postgres | |
brew install tmux | |
brew install pip | |
brew install nginx | |
brew install libevent |
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
import bisect | |
class NFA(object): | |
EPSILON = object() | |
ANY = object() | |
def __init__(self, start_state): | |
self.transitions = {} | |
self.final_states = set() | |
self._start_state = start_state |