Skip to content

Instantly share code, notes, and snippets.

View yuta-imai's full-sized avatar

Yuta Imai yuta-imai

View GitHub Profile
#!/usr/bin/env ruby
require 'aws-sdk-core'
ec2 = Aws::EC2::Client.new(region:'ap-northeast-1')
images = ec2.describe_images(
owners: ['amazon'],
filters: [
{
name:"architecture",
values:["x86_64"]
#!/usr/bin/env python
import sys
import Queue
from threading import Thread
import boto
import boto.s3
s3 = boto.s3.connect_to_region('ap-northeast-1')
@yuta-imai
yuta-imai / coinlocker.py
Last active August 29, 2015 14:11
A sample S3 file uploader which uses DynamoDB to manage a list of files.
#!/usr/bin/env python
# [coinlocker]
#
# Copyright (c) 2014 Yuta Imai
#
# This software is released under the MIT License.
#
# http://opensource.org/licenses/mit-license.php
@yuta-imai
yuta-imai / s3upload.py
Created December 15, 2014 03:06
A code snippet for file upload for Amazon S3. The script uses DynamoDB to manage a list of uploaded files.
#!/usr/bin/env python
import re
import sys
import time
import boto.dynamodb2
import boto.s3
import boto.s3.bucket
import boto.s3.key
@yuta-imai
yuta-imai / ktail.py
Created December 12, 2014 07:26
Tailing utility for Amazon Kinesis
#!/usr/bin/env python
import signal
import sys
import time
from threading import Thread, Event
import boto.kinesis
stream_name = sys.argv[1]
#!/usr/bin/env python
import sys
import Queue
from threading import Thread
import boto
import boto.s3
s3 = boto.s3.connect_to_region('ap-northeast-1')
import boto
import boto.ec2
ip_range = [
"10.0.0.100",
"10.0.0.101",
"10.0.0.102",
"10.0.0.103"
]
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "AWS CloudFormation Sample Template VPC_with_PublicIPs_And_DNS.template: Sample template showing how to create a multi-tier VPC with multiple subnets DNS support. The instances have automatic public IP addresses assigned. The first subnet is public and contains a NAT device for internet access from the private subnet and a bastion host to allow SSH access to the hosts in the private subnet. You will be billed for the AWS resources used if you create a stack from this template.",
"Parameters" : {
"SSHFrom" : {
"Description" : "Lockdown SSH access to the bastion host (default can be accessed from anywhere)",
"Type" : "String",
@yuta-imai
yuta-imai / kinesis_checker.py
Last active August 29, 2015 14:05
A code snippet to pull records from Amazon Kinesis and dump it.
#!/usr/bin/env python
import base64
import time
import sys
import boto
import boto.kinesis
region = 'ap-northeast-1'