Skip to content

Instantly share code, notes, and snippets.

@hotakasaito
hotakasaito / docker-compose.yml
Created August 19, 2019 09:09
kong-konga-docker-compose.yml v2.1
version: '2.1'
volumes:
kong_data: {}
networks:
kong-net:
services:
kong-migrations:
image: "${KONG_DOCKER_TAG:-kong:latest}"
@hotakasaito
hotakasaito / file0.coffee
Last active January 23, 2017 06:55
Amazon EC2 Run Commandでコマンド発行から結果出力まで1アクションで実施 ref: http://qiita.com/hotakasaito/items/1650f983558555da70a1
AWS = require('aws-sdk')
AWS.config.region = 'ap-northeast-1'
ssm = new AWS.SSM()
Promise = require('bluebird')
retry = require('bluebird-retry')
Promise.promisifyAll(ssm)
checkStatus = (id) ->
params =
@hotakasaito
hotakasaito / file0.txt
Last active July 4, 2016 01:30
fluentdからAmazon Elasticsearch ServiceにPOSTする ref: http://qiita.com/hotakasaito/items/b59c28ca032b45b9ae49
sudo td-agent-gem install fluent-plugin-aws-elasticsearch-service
@hotakasaito
hotakasaito / file0.txt
Last active June 5, 2016 16:22
ELB+nginx構成でhttpをhttpsにリダイレクトする ref: http://qiita.com/hotakasaito/items/4af48c2afa4c6398abf1
server {
listen 81;
rewrite ^ https://$host$request_uri permanent;
}
@hotakasaito
hotakasaito / service.json
Last active May 17, 2016 08:08
consul serviceの定義サンプル
{
"service": {
"name": "VoIP",
"port": 9999,
"address": "xx.xx.xx.xx",
"tags": ["ap-northeast-1"],
"checks": [
{
"http": "http://localhost:9999/xxx",
"interval": "10s"
@hotakasaito
hotakasaito / file0.txt
Last active March 16, 2016 03:08
意外と知られてないかもしれないlinuxコマンドのオプション ref: http://qiita.com/hotakasaito/items/9387709f75e7a2c69d92
ps -Cruby ufw
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
webapp 19078 0.0 2.6 113468 26572 ? Ssl 22:08 0:00 puma 2.10.2 (unix:///var/run/puma/my_app.sock)
webapp 19084 0.3 18.3 845408 186564 ? Sl 22:08 0:16 \_ puma: cluster worker 0: 19078
healthd 2410 0.0 2.6 686832 27316 ? Ssl 2015 50:45 puma 2.11.1 (tcp://127.0.0.1:22221) [healthd]
ap-northeast-1 us-west-2
| 172.16.0.0/16 |<-->| VyOS |<==INTERNET==>| VPN |<-->| 172.17.0.0/16 |
@hotakasaito
hotakasaito / file0.txt
Created January 18, 2016 15:01
aws elastic beanstalkでdeployが失敗する ref: http://qiita.com/hotakasaito/items/918b1456bbd5d7d2a773
#!/usr/bin/env /opt/rubies/ruby-current/bin/ruby
#==============================================================================
# Copyright 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Amazon Software License (the "License"). You may not use
# this file except in compliance with the License. A copy of the License is
# located at
#
# https://aws.amazon.com/asl/
#
@hotakasaito
hotakasaito / file0.yml
Created January 14, 2016 11:03
werckerで複数の環境にdeployする ref: http://qiita.com/hotakasaito/items/d9d199b09760a0d6fff3
deploy:
steps:
- hotakasaito/elastic-beanstalk-deploy:
key: $AWS_ACCESS_KEY_ID
secret: $AWS_SECRET_KEY
app_name: app01
env_name: stg
region: ap-northeast-1
@hotakasaito
hotakasaito / s3zipdeploy
Created November 13, 2015 11:32
OpsWorks Deploy Sample
#!/usr/bin/env bash
set -xe
INSTANCE_ID=***
APP_ID=***
for i in opsworks_cookbooks contents
do
zip -9r ${i}.zip $i