a8667f01ae5b:~ hunhsieh$ telnet debug.pahud.net 80
Trying 54.236.168.77...
Connected to debug.pahud.net.
Escape character is '^]'.
GET / HTTP/1.1
Host: debug.pahud.net
HTTP/1.1 200 OK
Date: Wed, 27 Dec 2017 07:37:01 GMT
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
AWSTemplateFormatVersion: '2010-09-09' | |
Description: > | |
AWS CloudFormation template to create a new VPC | |
or use an existing VPC for ECS deployment | |
in Create Cluster Wizard. Requires exactly 1 | |
Instance Types for a Spot Request. | |
Parameters: | |
EcsClusterName: | |
Type: String | |
Description: > |
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 boto3 | |
client = boto3.client('waf-regional', region_name='us-east-1') | |
ipSetId='<YOUR_IP_SET_ID>' | |
def getChangeToken(): | |
response = client.get_change_token() |
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
'use strict'; | |
console.log('cold start lambda') | |
var AWS = require('aws-sdk'); | |
var P = require('bluebird'); | |
process.env.AWS_PROFILE='pahud' | |
var chain = new AWS.CredentialProviderChain(); | |
var credentials, |
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
'use strict'; | |
console.log('=> lambda start') | |
var AWS = require('aws-sdk') | |
AWS.config.update({ region: 'us-west-2' }); | |
const lambda = new AWS.Lambda() | |
const invokePromisified = (params) => { | |
return new Promise((resolve, reject)=> { |
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 redis, time, datetime, sys | |
endpoint='myred.dpchko.ng.0001.usw2.cache.amazonaws.com' | |
#endpoint='myred-001.dpchko.0001.usw2.cache.amazonaws.com' | |
def prepareConn(endpoint): | |
r = redis.StrictRedis(host=endpoint, port=6379, db=0, socket_timeout=1) | |
return r |
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
package main | |
import ( | |
"flag" | |
"fmt" | |
"log" | |
"strconv" | |
"strings" | |
"github.com/aws/aws-sdk-go/aws" |
export AWS_DEFAULT_REGION=ap-northeast-1
aws logs describe-log-groups --query 'logGroups[*].logGroupName' --output table | \
awk '{print $2}' | grep -v ^$ | while read x; do echo "deleting $x" ; aws logs delete-log-group --log-group-name $x; done
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
'use strict'; | |
var AWS = require('aws-sdk'); | |
var Promise = require('bluebird') | |
var s3 = Promise.promisifyAll(new AWS.S3()); | |
// var s3 = new AWS.S3(); | |
var fileInfo = { |