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 sys, os, glob | |
# amazon web services api | |
import boto | |
AWS_ACCESS_KEY_ID='****' | |
AWS_SECRET_ACCESS_KEY='****' |
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 sys | |
# amazon web services api | |
import boto | |
from boto.glacier.exceptions import UnexpectedHTTPResponseError | |
AWS_ACCESS_KEY_ID='****' | |
AWS_SECRET_ACCESS_KEY='****' |
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
function find_info(stream, status) { | |
var query = {}; | |
var key = stream + "_status"; | |
query[key] = status; | |
db.tasks.find(query).forEach( | |
function(doc) { | |
print("Task " + status + ": " + doc[stream+"_id"] +", owner: " + doc.task_owner); | |
} | |
); | |
} |
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 digitalocean | |
manager = digitalocean.Manager(token="****") | |
my_droplets = manager.get_all_droplets() | |
''' | |
for d in my_droplets: | |
print("Droplet name: ", d.name) |
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 digitalocean | |
droplet = digitalocean.Droplet( | |
token="****", | |
name='test', | |
region='nyc2', # NewYork 2 | |
image='ubuntu-14-04-x64', # ubuntu 14.04 x64 | |
size_slug='512mb', # 512MB |
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
# To store a function use the db.collection.save() method | |
db.system.js.save( | |
{ | |
_id: "foo_bar", | |
value : function(x, y) { return x * y; } | |
} | |
) | |
db.system.js.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
var cur = db.tasks.find({ | |
'$or': [ | |
{'upload_status': 'active'}, | |
{'upload_status': 'pending'}] | |
}); | |
while(cur.hasNext()) { | |
printjson(cur.next()); | |
} |
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
# user info | |
curl -XGET https://api.github.com/users/makeittotop -vv | |
# note the X-RateLimit-Limit and X-RateLimit-Remaining headers. This indicates how many requests | |
# a client can make in a rolling time period (typically an hour) and how many of those requests | |
# the client has already spent. | |
curl -XGET https://api.github.com/users/makeittotop -vv -i |
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
# https://cloud.google.com/storage/docs/gspythonlibrary | |
# https://github.com/pyca/pyopenssl/issues/128 | |
# faced issue with pyopenssl version 0.10 and 0.14 both on the system in different dirs, lib64 and lib respectively. Needed to remove | |
# lib64 one. | |
''' | |
In [1]: import OpenSSL |
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 boto | |
import gcs_oauth2_boto_plugin | |
import os, sys | |
import shutil | |
import StringIO | |
import tempfile | |
import time |
OlderNewer