Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import threading
import time
import sys
import pyrax
pyrax.keyring_auth()
cs = pyrax.cloudservers
@EdLeafe
EdLeafe / gist:5192405
Created March 19, 2013 00:23
Demonstration of creating Rackspace Cloud Files containers in different regions.
import pyrax
pyrax.keyring_auth()
cf_ord = pyrax.connect_to_cloudfiles("ORD")
cf_dfw = pyrax.connect_to_cloudfiles("DFW")
my_ord_cont = cf_ord.create_container("test")
my_dfw_cont = cf_dfw.create_container("test")
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import eventlet
from eventlet.green import urllib2
import time
url = "http://daboserver.com/eventlet/%s"
def getit(seq):
print "requesting", seq
@EdLeafe
EdLeafe / gist:4693677
Created February 1, 2013 19:57
output of eventlet test
(green)ed@MGM6AEDV7M:~/projects/green$ pw green_test.py
Spawning #0 at Fri Feb 1 13:46:56 2013
Spawning #1 at Fri Feb 1 13:46:56 2013
Spawning #2 at Fri Feb 1 13:46:56 2013
Spawning #3 at Fri Feb 1 13:46:56 2013
Spawning #4 at Fri Feb 1 13:46:56 2013
Spawning #5 at Fri Feb 1 13:46:56 2013
Spawning #6 at Fri Feb 1 13:46:56 2013
Spawning #7 at Fri Feb 1 13:46:56 2013
Spawning #8 at Fri Feb 1 13:46:56 2013
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import eventlet
import requests
import time
url = "http://daboserver.com/eventlet"
def getit(seq):
req = requests.request("GET", url)
@EdLeafe
EdLeafe / gist:3995892
Created November 1, 2012 19:31
Sample usage script
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime
import os
import pyrax
creds_file = os.path.expanduser("~/.rackspace_cloud_credentials")
pyrax.set_credential_file(creds_file)
clb = pyrax.cloud_loadbalancers