Skip to content

Instantly share code, notes, and snippets.

View youyo's full-sized avatar

Naoto Ishizawa youyo

View GitHub Profile
curl -s -H "Authorization: $AWS_CONTAINER_AUTHORIZATION_TOKEN" http://localhost:1338/latest/meta-data/container/security-credentials | jq -r '"export AWS_ACCESS_KEY_ID=\(.AccessKeyId)","export AWS_SECRET_ACCESS_KEY=\(.SecretAccessKey)","export AWS_SESSION_TOKEN=\(.Token)"'
#!/bin/bash
set -u
# ENV
stream_name='aws_version4_signatures_test'
payload=`cat <<EOL
{"Data": "XzxkYXRhPl8x","PartitionKey": "partitionKey","StreamName": "${stream_name}"}
EOL
`
swagger: '2.0'
info:
title: swagger_sample
host: 127.0.0.1:3000
schemes:
- https
- http
x-amazon-apigateway-request-validators:
all:
validateRequestBody: true
@youyo
youyo / main.go
Last active October 2, 2018 19:12
proxy-server for conversion protocol from http to zabbix-tcp
package main
import (
"bufio"
"encoding/json"
"net"
"net/http"
"time"
"github.com/labstack/echo"
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDopDYvoAitNj43qNK1QLHMDm5DgkOoWwVXuSiBwJ306I1GWf+4plvMYgmo6eq1Wc5DbsVu6AN6N78FuwiX+zsWfe4oVIQUlL2JkWZenZEA/x04Y24FWC1AAFpiC9dfBjbg39xn3jVY9mIOeHhxozQLCMgEIuPt/iWz6mCNlRsUgSTVwvKv1GEThNjDInq8cziU0CmCbyrdH/MRAX+kCntx+zGiQUwECapenalDaHAAMpqGPEFZnqslzzP3guLhClSLyqhTGeig+tqKw0zZDGtnzqpMy2Ulv82HqCOKCeQnvgo+gIWCsNssTbvp4e70XOsEhfukATg6UcomGCo948bR

Keybase proof

I hereby claim:

  • I am youyo on github.
  • I am youyo (https://keybase.io/youyo) on keybase.
  • I have a public key whose fingerprint is F6EE D9F9 3150 CCB5 FC63 8E46 D3CA 327E FF11 7F0C

To claim this, I am signing this object:

provider "aws" {
region = "ap-northeast-1"
}
resource "aws_instance" "test_instance" {
ami = "ami-56d4ad31"
instance_type = "t2.nano"
}
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::xxxxxxxxxxx:role/role_name"
},
"Action": "es:*",
"Resource": "arn:aws:es:region:xxxxxxxxxxx:domain/ess_domain_name/*"
awsauth = AWS4Auth(
os.environ['AWS_ACCESS_KEY_ID'],
os.environ['AWS_SECRET_ACCESS_KEY'],
os.environ['AWS_REGION'],
'es',
session_token=os.environ['AWS_SESSION_TOKEN']
)
client = Elasticsearch(
hosts=[{'host': 'xxxxxxxxx.region.es.amazonaws.com', 'port': 443}],
http_auth=awsauth,
@youyo
youyo / cloud-config.yaml
Last active November 25, 2016 11:41
Notes when coreos install.
#cloud-config
hostname: coreos1
ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQClVm7p5ckjmscB4gfJrI9O9Pa7Wo/7VEVkkgACZut7xBDK7dpD2wsavCUe9s2Ll4jFDc4UjsvypgPYhAGu3k9tGb8v7ysPHC2ZMh1zCdqrvuNMl+w3EnoEJW9iY5/NgCT807TqW890CUww3rHAYyyB0msmN62UgHdELFQHWAa7wNcQeTPUG0r8FaxwTYiMAtKoHz9YQMQJdDrTd6UmOSBWx0SEyBk0RL5v9kWzz4hIsQV80psDcDoSxrj37fSkG3oZDu7sG2owjAaxG5bKgQ3g9e953LnGEiI8ywHVeerL/A1cZTWcoM91aqyiT3goLF7dQFzXzL3iw3OQN/BL3ExN
write_files:
- path: /etc/ssh/sshd_config
permissions: 0600