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 | |
from boto.sqs.message import RawMessage | |
import tempfile | |
import json | |
import logging | |
import argparse | |
import gzip | |
import redis |
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
# gem install aws-sdk | |
require 'aws' | |
PRICE_PER_GB_MONTH = 0.11 | |
ACCESS_KEY = '...' | |
SECRET_KEY = '...' | |
ENDPOINT = 'eu-west-1.ec2.amazonaws.com' |
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 describe_pvgrub_images() | |
headers = ["Image ID", "Name", "Description", "Architecture", "Kernel ID"] | |
values = [] | |
AWS.memoize do | |
@ec2.images.with_owner('amazon').filter('name', '*grub*').each do | i | | |
values << [i.id, i.name, i.description, i.architecture, i.kernel_id] | |
end | |
end |
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
gem 'garb', :git => 'git://github.com/Sija/garb.git' |
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 | |
# | |
######################################################################### | |
#This software code is made available "AS IS" without warranties of any # | |
#kind. You may copy, display, modify and redistribute the software # | |
#code either by itself or as incorporated into your code; provided that # | |
#you do not remove any proprietary notices. Your use of this software # | |
#code is at your own risk and you waive any claim against Amazon # | |
#Digital Services, Inc. or its affiliates with respect to your use of # | |
#this software code. (c) 2006-2007 Amazon Digital Services, Inc. or its # |
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 ruby | |
# Add your gems here | |
# | |
gemfile_contents = <<-EOF | |
source "http://rubygems.org" | |
gem "fog" | |
gem "yajl-ruby" | |
EOF |
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/python | |
# | |
# Get Cloudwatch metrics for the EBS volumes attached to an instance | |
# | |
import datetime | |
import logging | |
import sys | |
import urllib |
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/python | |
import threading, Queue | |
import boto, sys, time | |
import argparse | |
import logging | |
parser = argparse.ArgumentParser(description="Multithreaded mass copier for Amazon S3") | |
parser.add_argument("-s", help="Source bucket", dest="src_bucket", type=str, required=True) | |
parser.add_argument("-d", help="Destination bucket", dest="dst_bucket", type=str, required=True) |
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 | |
from optparse import OptionParser | |
import boto.ec2 | |
import logging | |
import sys | |
def get_ec2_connection(aws_key=None, aws_secret=None, region='us-east-1'): | |
""" | |
Returns an EC2Connection to the specified region |
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
# i hope this helps... | |
# to set the username and picture send these events to fm | |
# -> you don't need to define any event handlers | |
# -> the session token (_session) could be your unique session id | |
# or the unique user id (it's hashed) | |
# set the user name | |
{ "_type": "_set_name", "name": "Tingle Tangle Bob", "_session": "mysessiontoken" } |
NewerOlder