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 hmac | |
from hashlib import sha1 | |
from time import time | |
path = 'v1/MossoCloudFS_db3a5ebc-f7dd-4108-ab6e-a0bc7b3fbc93/test' | |
redirect = 'http://mysite.com/thanks.html' | |
max_file_size = 104857600 | |
max_file_count = 10 | |
expires = int(time() + 600) | |
print "expires: " |
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 python | |
import os | |
import sys | |
import logging | |
import pyrax | |
import pyrax.exceptions as exc | |
import exceptions |
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 | |
import logging | |
import sys | |
import pyrax | |
import pyrax.exceptions as exc | |
logging.basicConfig(level=logging.DEBUG) |
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
- name: Launch a server in rax cloud # playbook name | |
hosts: local # target local host | |
connection: local # run actions locally | |
gather_facts: false # forget gathering facts, this is our local system | |
tasks: | |
- name: Create a server # task name | |
local_action: | |
module: rax # module to use | |
creds_file: /home/trellis/creds # path to your credentials |
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
# Successful request output | |
trellis@debian:~/rackspace-cloud-env$ python get-ip.py | |
INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): lon.servers.api.rackspacecloud.com | |
DEBUG:requests.packages.urllib3.connectionpool:"GET /v2/xxxxx/servers/detail HTTP/1.1" 200 1643 | |
Name: xxxx | |
ID: xxxx | |
Public IP: 1.2.3.4 | |
# Unsuccessful request output |
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 python | |
import os | |
import sys | |
import logging | |
import pyrax | |
import pyrax.exceptions as exc | |
# Set loglevel |
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 urllib3 | |
import pymongo | |
# connect to mongo | |
connection = pymongo.Connection("mongodb://localhost", safe=True) | |
# get a handle on the reddit db | |
db=connection.reddit | |
stories = db.stories |
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
# Build a basic CentOS 6 AMI | |
lang en_US.UTF-8 | |
keyboard us | |
timezone US/Eastern | |
auth --useshadow --enablemd5 | |
selinux --disabled | |
firewall --disabled | |
bootloader --timeout=1 | |
network --bootproto=dhcp --device=eth0 --onboot=on | |
services --enabled=network |
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/sh | |
# Eucalyptus CLC Backup & Restore script | |
# - includes DB & Keys | |
# Database Options | |
DBPORT="8777" | |
DBUSER="root" | |
DBDIR="/var/lib/eucalyptus/db/data" | |
DBSOCKET="${DBDIR}/.s.PGSQL.${DBPORT}" |
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 | |
# | |
# Check to see if a CC service is in ENABLED or DISABLED state using CCclient_full | |
# Author: Tom Ellis <tom.ellis@eucalyptus.com> | |
# | |
# Returns 1 if DISABLED or not installed | |
# Return 0 if ENABLED | |
export AXIS2C_HOME=/usr/lib64/axis2c | |
export LD_LIBRARY_PATH=$AXIS2C_HOME/lib:$AXIS2C_HOME/modules/rampart/ |