Skip to content

Instantly share code, notes, and snippets.

View kachina's full-sized avatar

Tetsuya Chiba kachina

View GitHub Profile
@kachina
kachina / earthquake-notify-send.rb
Last active August 29, 2015 14:02
earthquake-notify-send.rb
require "fileutils"
require "digest/md5"
Earthquake.init do
dir = File.join(File.dirname(__FILE__), "userimage")
output do |item|
next if item.nil? || item['user'].nil? || item['_stream'].nil?
begin
image_url = item['user']['profile_image_url']
next unless image_url
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "AWS CloudFormation Example Template Copyright 2012 Serverworks Co, Ltd. All Rights Reserved",
"Parameters" : {
"InstanceType" : {
"Type" : "String",
"Description" : "Instance Type: t1.micro, m1.small, c1.medium, m1.medium, m1.large, m1.xlarge, m2.xlarge, m2.2xlarge, m2.4xlarge, c1.xlarge.",
"Default" : "t1.micro",
"AllowedValues" : [ "t1.micro","m1.small","c1.medium","m1.medium","m1.large","m1.xlarge","m2.xlarge","m2.2xlarge","m2.4xlarge","c1.xlarge" ],
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "This is a template for the AWS CloudFormation in order to build a CloudDesignPattern No17. Copyright 2012 Serverworks Co, Ltd. All Rights Reserved. ",
"Parameters" : {
"AMI" : {
"Type" : "String",
"Description" : "AMI ID",
"Default" : "ami-2819aa29",
# 'defaults' applies to all environments running this application.
# Environment specific options apply only to a single environment and override settings in defaults.
---
defaults:
bundle_without: test development mygroup
bundle_options: --local
copy_exclude:
- .git
maintenance_on_restart: false
maintenance_on_migrate: false
@kachina
kachina / ey-cloud-recipes_papertrail_syslog-ng-3.2.5_diff
Last active December 20, 2015 19:19
engineyard/ey-cloud-recipesのpapertrailが3.3.5を指定しているのを3.2.5で動作させる様に修正した際のdiff結果です。
diff --git a/cookbooks/papertrail/recipes/default.rb b/cookbooks/papertrail/recipes/default.rb
index f1ef49c..27ca836 100644
--- a/cookbooks/papertrail/recipes/default.rb
+++ b/cookbooks/papertrail/recipes/default.rb
@@ -13,9 +13,9 @@
app_name = node[:applications].keys.first
env = node[:environment][:framework_env]
PAPERTRAIL_CONFIG = {
- :syslog_ng_version => '3.3.5',
+ :syslog_ng_version => '3.2.5',
import os
import boto3
def main():
s3_client = boto3.client('s3')
response = s3_client.list_objects_v2(Bucket='example-bucket')
for content in response['Contents']:
import os
import boto3
def main():
s3_client = boto3.client('s3')
params = {'Bucket': 'example-bucket'}
while True:
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Globals:
Function:
Timeout: 900
Environment:
Variables:
TZ: Asia/Tokyo
OWM_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
OWM_PLACE=Tokyo,Jp
[flake8]
ignore = E501
exclude = .aws-sam