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
from __future__ import print_function | |
from base64 import b64decode | |
from urllib2 import Request, urlopen | |
import time | |
import json | |
import zlib | |
from datetime import datetime, timedelta | |
import boto3 | |
import os |
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 | |
set -eu | |
api_key="__MACKEREL_API_KEY__" | |
url="https://mackerel.io/api/v0/graph-defs/create" | |
curl -s -S -X POST \ | |
-H "X-Api-Key:${api_key}" \ | |
-H 'Content-Type: application/json' \ |
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
# To use this script, you need install jq command. | |
#!/bin/bash | |
set -u | |
app=$1 | |
s3bucket=$2 | |
s3key=$3 | |
region=${$4:-ap-northeast-1} |
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
import boto3, botocore, json | |
ec2_client = boto3.client('ec2', region_name='ap-northeast-1') | |
lambda_client = boto3.client('lambda', region_name='ap-northeast-1') | |
def validation_event(event): | |
if len(event) == 0: | |
print 'There is no Event source.' | |
return False | |
if not event.has_key("command"): |
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
import boto3, os, json, time | |
from base64 import b64decode | |
from urllib2 import Request, urlopen | |
encrypted_mackerel_api_key = "ENCRYPTED_MACKEREL_API_KEY" | |
org_id = "ORGANIZATION_ID" | |
lambda_client = boto3.client('lambda', region_name='ap-northeast-1') | |
kms_client = boto3.client('kms') | |
api_key = kms_client.decrypt(CiphertextBlob=b64decode(encrypted_mackerel_api_key))['Plaintext'] |
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 "fmt" | |
func main() { | |
max := 100 | |
for i := 1; i <= max; i++ { | |
if i % 3 == 0 && i % 5 == 0 { | |
fmt.Println("Fizz Buzz") | |
} else if i % 3 == 0 { |
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
/*** | |
# Usage | |
$ go run decide_on_charge_go_study.go member1 member2 member3 ... memberN | |
memberX | |
***/ | |
package main |
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
[ | |
{ | |
"mackerel": { | |
"host_id": "<MACKEREL_HOST_ID>", | |
"metric_name": "custom.rds.latency.commit" | |
}, | |
"cloudwatch": { | |
"namespace": "AWS/RDS", | |
"dimensions_name": "DBInstanceIdentifier", | |
"dimensions_value": "<AURORA_INSTANCE>", |
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
[ | |
{ | |
"mackerel": { | |
"service_name": "service_name", | |
"metric_name": "aurora-cluster.VolumeReadIOPS" | |
}, | |
"cloudwatch": { | |
"namespace": "AWS/RDS", | |
"dimensions": [ | |
{ |
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
[ | |
{ | |
"mackerel": { | |
"service_name": "service_name", | |
"metric_name": "redshift_cluster_name.CPUUtilization" | |
}, | |
"cloudwatch": { | |
"namespace": "AWS/Redshift", | |
"dimensions": [ | |
{ |