Skip to content

Instantly share code, notes, and snippets.

@koheyamada
koheyamada / file3.txt
Created April 9, 2018 03:15
troposphereでCloudFormationのテンプレートを作成する。 ref: https://qiita.com/kooohei/items/17f6fa6facacfd0201b6
>>> from troposphere import Ref, Template
>>> import troposphere.ec2 as ec2
>>> t = Template()
>>> instance = ec2.Instance("myinstance", ImageId="ami-a77c30c1", InstanceType="t1.micro")
>>> t.add_resource(instance)
<troposphere.ec2.Instance object at 0x107c427b8>
>>> print(t.to_yaml())
Resources:
myinstance:
Properties:
@koheyamada
koheyamada / ETag
Created March 25, 2018 07:27
aws-cli で CloudFront の設定を変更する。 ref: https://qiita.com/kooohei/items/c6dcf9dfee6abf693656
$ aws cloudfront get-distribution-config --id "xxxxxxxxxxxxx" --profile proudit | jq '.ETag'
"EZLFL1SIXPXTL"
@koheyamada
koheyamada / df
Created March 9, 2018 15:18
EC2インスタンスに追加でEBSボリュームをアタッチする。 ref: https://qiita.com/kooohei/items/d692931cbebf97006f96
$ df -h
ファイルシス サイズ 使用 残り 使用% マウント位置
devtmpfs 236M 60K 236M 1% /dev
tmpfs 245M 0 245M 0% /dev/shm
/dev/xvda1 7.8G 1.2G 6.6G 15% /
@koheyamada
koheyamada / シェル確認①
Created March 2, 2018 00:59
Mac で aws-cli を利用する際にコマンド補完ができるように設定する。 ref: https://qiita.com/kooohei/items/8f8e38c5fc54e1b8b273
$ echo $SHELL
/bin/bash
@koheyamada
koheyamada / IP確認1
Created February 23, 2018 05:53
NLBを利用してRDSの負荷分散を行う。 ref: https://qiita.com/kooohei/items/c6443c2b455c62907832
$ host koh3i-01.cmhex6vatlc7.ap-northeast-1.rds.amazonaws.com
koh3i-01.cmhex6vatlc7.ap-northeast-1.rds.amazonaws.com has address 10.0.1.114
@koheyamada
koheyamada / log
Last active February 20, 2018 06:31
Amazon RDS for MySQL のログを Amazon CloudWatch Logs へ直接保存する。 ref: https://qiita.com/kooohei/items/729b7ae1c4f167bcbf21
/aws/rds/instance/<db-instance-id>/<log-type>
@koheyamada
koheyamada / コード
Last active February 6, 2018 08:04
AWS Step Functions を使ってワークフロー処理を行う。 ref: https://qiita.com/kooohei/items/150d03775536fe7ce273
{
"Comment": "A simple example of the Steps language using an AWS Lambda Function",
"StartAt": "Hello",
"States": {
"Hello": {
"Type": "Task",
"Resource": "arn:aws:lambda:eu-west-1:99999999999:function:HelloWord_Step",
"Next": "Parallel"
},
@koheyamada
koheyamada / manual
Last active November 9, 2017 09:05
Mac OS X に Python のインストールを行った際にエラー(BUILD FAILED)が出たのでその対応方法。 ref: http://qiita.com/kooohei/items/1b53ded69868472c786e
XCODE-SELECT(1) BSD General Commands Manual XCODE-SELECT(1)
NAME
xcode-select - Manages the active developer directory for Xcode and BSD tools.
SYNOPSIS
xcode-select [-h|--help] [-s|--switch <path>] [-p|--print-path] [-v|--version]
DESCRIPTION
xcode-select controls the location of the developer directory used by xcrun(1), xcodebuild(1), cc(1), and other Xcode and BSD development
@koheyamada
koheyamada / slackwebの格納
Created October 27, 2017 02:13
CloudWatchアラームでSlackへ通知を行う。 ref: http://qiita.com/kooohei/items/848eeb4cbb19c83b0b6d
$ pip install slackweb -t .
Collecting slackweb
Using cached slackweb-1.0.5.tar.gz
Installing collected packages: slackweb
Running setup.py install for slackweb ... done
Successfully installed slackweb-1.0.5
@koheyamada
koheyamada / apt更新
Last active October 11, 2017 08:03
Ubuntu で Docker Swarm クラスタを組む。 ref: http://qiita.com/kooohei/items/7cbf64154476a43ee250
$ sudo apt-get update