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
$ sudo vi /etc/rc.local |
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 create_stack_lambda_map(): | |
next_token = None | |
stack_map = cf_client.describe_stacks() | |
stack_lambda_map = {} | |
add_stack_lambda_map(stack_map, stack_lambda_map) | |
while next_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
response = cloudwatch_client.get_metric_data( | |
MetricDataQueries=[ | |
{ | |
'Id': 'm1', | |
'MetricStat': { | |
'Metric': { | |
'Namespace': 'AWS/DynamoDB', | |
'MetricName': 'ProvisionedWriteCapacityUnits', | |
'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
import json | |
import os | |
import sys | |
#lib配下にライブラリを配置するための前準備 | |
sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)), 'lib')) | |
import requests | |
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
response = client.get_metric_data( | |
MetricDataQueries=[ | |
{ | |
'Id': 'm1', | |
'MetricStat': { | |
'Metric': { | |
'Namespace': 'AWS/DynamoDB', | |
'MetricName': 'ProvisionedReadCapacityUnits', | |
'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
def is_over_time(target_metric, provisioned_cap): | |
is_over_time_num = 0 | |
result = False | |
sort_datapoints = sorted(target_metric['Datapoints'], key=lambda x: x['Timestamp']) | |
for data in sort_datapoints: | |
if float(round(data['Average']) / provisioned_cap) > float(LIMIT_VAL): | |
is_over_time_num += 1 | |
else: | |
is_over_time_num = 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
import sys | |
import csv | |
import math | |
from decimal import Decimal | |
from time import sleep | |
from datetime import datetime | |
import pandas | |
import random |
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
https://qiita.com/api/v2/users/{user_id}/items?page={page}&per_page=100 |
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
KINTONE_DOMAIN: xxxxxx.cybozu.com | |
KINTONE_API_KEY: XXXXXXXXX | |
KINTONE_APP: XXX | |
S3_BUCKET: XXXXXX | |
S3_OBJECT_PREFIX: XXXXXX |
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
$ git clone git://github.com/aws/aws-sdk-js | |
$ cd aws-sdk-js | |
$ npm install | |
$ node dist-tools/browser-builder.js all > aws-sdk-full.js |