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
| #!/usr/bin/python | |
| # | |
| # Example code for specifying multiple dimensions in a | |
| # query of Amazon EC2 CloudWatch using the boto library. | |
| # | |
| # Boto may be downloaded here: http://code.google.com/p/boto | |
| from datetime import datetime, timedelta | |
| from boto import connect_cloudwatch | |
| from boto.ec2.cloudwatch.metric import Metric |
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 simplejson | |
| from boto.s3.connection import S3Connection | |
| from boto.s3.key import Key | |
| class S3KeyStore(object): | |
| def __init__(self, access_key, secret_key, bucket): | |
| self.conn = S3Connection(access_key, secret_key) | |
| self.bucket = self.conn.create_bucket(bucket) | |
| def get(self, key): |
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
| <?php | |
| require_once 'sdk/sdk.class.php'; | |
| $hosts = array( | |
| 'linux' => array('id' => 'i-123ee456', 'ip' => '1.2.3.4'), | |
| 'windows' => array('id' => 'i-123ee457', 'ip' => '1.2.3.5'), | |
| ); | |
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
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
| Version 2, December 2004 | |
| Copyright (C) 2011 Jed Schmidt <http://jed.is> | |
| Everyone is permitted to copy and distribute verbatim or modified | |
| copies of this license document, and changing it is allowed as long | |
| as the name is changed. | |
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
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 os | |
| from log_exceptions import log_exceptions | |
| def throw_something(a1, a2): | |
| raise Exception('Whoops!') | |
| @log_exceptions(log_if = os.getenv('MYAPP_DEBUG') is not None) | |
| def my_function(arg1, arg2): | |
| throw_something(arg1 + 24, arg2 - 24) |
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
| """ | |
| List all S3 object versions | |
| """ | |
| import os | |
| from boto.s3.connection import S3Connection | |
| print '--- Connecting to S3' | |
| c = S3Connection(aws_access_key_id=os.environ['AWS_ACCESS_KEY_ID'], | |
| aws_secret_access_key=os.environ['AWS_SECRET_ACCESS_KEY']) |
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
| function getJSON(aUrl,sheetname) { | |
| //var sheetname = "test"; | |
| //var aUrl = "http://pipes.yahoo.com/pipes/pipe.run?_id=286bbb1d8d30f65b54173b3b752fa4d9&_render=json"; | |
| var response = UrlFetchApp.fetch(aUrl); // get feed | |
| var dataAll = JSON.parse(response.getContentText()); // | |
| var data = dataAll.value.items; | |
| for (i in data){ | |
| data[i].pubDate = new Date(data[i].pubDate); | |
| data[i].start = data[i].pubDate; | |
| } |
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
| #!/usr/bin/env python | |
| """ | |
| Recipe for creating and updating security groups programmatically. | |
| """ | |
| import collections | |
| import boto |
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
| #!/usr/bin/python | |
| # | |
| # Get Cloudwatch metrics for an ELB | |
| # | |
| # Inspired by http://onemoredigit.com/post/3263274796/single-instance-cloudwatch-stats-with-boto | |
| # | |
| import datetime | |
| import sys |
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
| #!/usr/bin/python | |
| # | |
| # Get Cloudwatch metrics for the EBS volumes attached to an instance | |
| # | |
| import datetime | |
| import logging | |
| import sys | |
| import urllib |
OlderNewer