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 | |
# | |
# Build a virtual environment suitable for running appengine. | |
# This uses virtualenvwrapper to make the virtual environment. | |
# Which you can activate with 'workon appengine' | |
# | |
# Everyone loves one-liners! | |
# Mac one-liner: | |
# $ curl -s https://raw.github.com/gist/1012769 | bash | |
# |
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/ruby | |
# | |
# This script installs to /usr/local only. To install elsewhere you can just | |
# untar https://github.com/mxcl/homebrew/tarball/master anywhere you like. | |
# | |
# | |
# 30th March 2010: | |
# Added a check to make sure user is in the staff group. This was a problem | |
# for me, and I think it was due to me migrating my account over several | |
# versions of OS X. I cannot verify that for sure, and it was tested on |
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 | |
# | |
# Build a virtual environment suitable for running appengine. | |
# This uses virtualenvwrapper to make the virtual environment. | |
# Which you can activate with 'workon appengine' | |
# | |
# Everyone loves one-liners! | |
# Mac one-liner: | |
# $ curl -s https://raw.github.com/gist/2839803 | bash | |
# |
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 struct | |
import SocketServer | |
from base64 import b64encode | |
from hashlib import sha1 | |
from mimetools import Message | |
from StringIO import StringIO | |
class WebSocketsHandler(SocketServer.StreamRequestHandler): | |
magic = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11' |
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/env python2.6 | |
""" | |
Manual Backup Script | |
==================== | |
This script is called by the agent to run a backup and stream to swift. | |
Setup Requires: | |
* Python >= 2.6 | |
* Requests |
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
def gen(): | |
print 'foo' | |
class Test(object): | |
@classmethod | |
def _uuid(cls): | |
return gen() |
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
class DatabaseModelBase(models.ModelBase):¬ | |
_auto_generated_atts = ['id'] | |
¬ | |
@classmethod¬ | |
def create(cls, **values):¬ | |
values = cls.get_auto_generated_values(**values)¬ | |
if hasattr(cls, 'deleted') and 'deleted' not in values:¬ | |
values['deleted'] = False¬ | |
values['created'] = utils.utcnow()¬ | |
instance = cls(**values).save()¬ |
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 os | |
class DebianPackagerMixin: | |
def boo(self): | |
print('debian') | |
class RedhatPackagerMixin: | |
def boo(self): | |
print('redhat') |
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 troveclient import auth | |
from troveclient import client | |
with_trove = True | |
except ImportError: | |
try: | |
from troveclient.compat import auth | |
from troveclient.compat import client | |
with_trove = True | |
except ImportError: |
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
Externalization of heat template | |
Reasons: preparing trove to support multi-datastores | |
Changes: template loading, heat-support update | |
This refactors the earlier code of instance creation using heat. | |
- Reorganize templates by datastore | |
- Config: trove/templates/<datastore_type>/config.template | |
- Heat: trove/templates/<datastore_type>/heat.template | |
- New parameter - ImageId |
OlderNewer