Skip to content

Instantly share code, notes, and snippets.

View marcy-terui's full-sized avatar

Masashi Terui marcy-terui

View GitHub Profile
@marcy-terui
marcy-terui / file0.txt
Last active December 9, 2015 11:12
HubotにOpsWorksのDeploymentを監視させてSlackに流す ref: http://qiita.com/Marcy/items/ae46c336b9956d2bf8d0
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"opsworks:Describe*"
],
"Resource": [
"*"
@marcy-terui
marcy-terui / .kitchen.yml
Last active August 29, 2015 14:24
DockerCli-Driver + LocalShell-Provisoner(Itamae) + Shell-Verifier(Serverspec)でTest-Kitchen最速フロー ref: http://qiita.com/Marcy/items/7ca000f83d08266ee352
---
platforms:
- name: ubuntu-14.04
suites:
# Vagrant-Driver + Itamae-Provisioner + Busser-Verifier
- name: example1
provisioner:
name: itamae
driver:
@marcy-terui
marcy-terui / .kitchen.yml
Last active August 29, 2015 14:24
Test-KitchenでShell-VerifierとDockerCli-Driverで高速にServerspecテストを回す ref: http://qiita.com/Marcy/items/8a85ae78a21787f57bca
---
provisioner:
name: chef_zero
platforms:
- name: ubuntu-14.04
suites:
- name: vagrant
driver:
@marcy-terui
marcy-terui / ContentLengthMismatch.md
Last active August 29, 2015 14:23
Chef::Exceptions::ContentLengthMismatch
  • ~/.ssh/config
Host target
  Hostname xxx.xxx.xxx.xxx
  Port 22
  User root
  ProxyCommand ssh -W %h:%p basion
Host basion
 Hostname xxx.xxx.xxx.xxx
@marcy-terui
marcy-terui / file0.txt
Last active August 29, 2015 14:22
ChefのService Resourceで起動スクリプトのstatusコマンドに返り値が無くてうまく動かない時の対処法 ref: http://qiita.com/Marcy/items/e9db6dec6fb035a4b7fd
service "hoge" do
supports :status => true
end
@marcy-terui
marcy-terui / file0.txt
Created May 1, 2015 08:16
オレオレ証明書・秘密鍵・CSR全部まとめて作るワンライナー ref: http://qiita.com/Marcy/items/2f63d7f170ff82531245
openssl req -nodes -newkey rsa:2048 -keyout server.key -out server.csr -subj "/C=JP/ST=Hokkaido/L=Sapporo/O=Example INC./OU=IT Department/CN=example.com" && openssl x509 -req -days 3650 -in server.csr -signkey server.key -out server.crt
---
includes:
settings:
command_base: bundle exec knife
option_sets:
- name: ec2
options:
hint: ec2
@marcy-terui
marcy-terui / .knife.helper.yml
Last active August 29, 2015 14:18
knifeコマンドが面倒すぎるので「knife-helper」というpluginを作ったのでチュートリアル(knife-zero,knife-ec2で) ref: http://qiita.com/Marcy/items/a314d81b78bb01a9626f
---
settings:
command_base: /Users/marcy/github/knife-helper-example/vendor/bundle/ruby/2.1.0/bin/knife
commands:
- name: create
command: ec2 server create
options:
aws-access-key-id: <%= ENV['AWS_ACCESS_KEY_ID'] %>
aws-secret-access-key: <%= ENV['AWS_SECRET_ACCESS_KEY'] %>
@marcy-terui
marcy-terui / cloudformation
Created March 12, 2015 07:57
Multi Region & Multi AZで動作可能なCloudFormationテンプレートを書くためのAZの指定方法 ref: http://qiita.com/Marcy/items/5bc8a7581b8734526962
"Fn::Select": [
"0",
{
"Fn::GetAZs": {
"Ref": "AWS::Region"
}
}
]
@marcy-terui
marcy-terui / file0.txt
Last active August 29, 2015 14:16
Azure CLIとjqでPublicなLinux VMイメージのリストを取得する ref: http://qiita.com/Marcy/items/68ca2a2bb6148dbd6e11
azure vm image list --json | jq '. | map(select(.category=="public", .operatingSystemType=="Linux"))'