Skip to content

Instantly share code, notes, and snippets.

View enokawa's full-sized avatar

Naoto Enokawa enokawa

View GitHub Profile
@enokawa
enokawa / README.md
Last active June 22, 2020 08:45
The Code that List Task size of ECS Service.

ECS Resources

The Code that List Task size of ECS Service.

Prerequisite

  • AWS CLI

Sample output

@enokawa
enokawa / circleci_config.yml
Created December 11, 2019 18:39
CircleCI Orbs Sample
version: 2.1
orbs:
aws-ecr: circleci/aws-ecr@6.2.0
aws-ecs: circleci/aws-ecs@0.0.3
workflows:
build_and_push_image:
jobs:
- aws-ecr/build-and-push-image:
name: nginx
context: dev
@enokawa
enokawa / config.fish
Last active November 30, 2018 18:50
dotfiles
# aliasses
alias l "ls"
alias g "git"
alias gd "git diff"
alias gb "git branch"
alias gl "git log"
alias gp "git push"
alias v "vim"
alias gip "curl http://ifconfig.io"
alias identity "aws sts get-caller-identity"

関連パッケージのインストール

centos@radius-01 $ sudo yum install freeradius freeradius-utils git gcc pam-devel qrencode qrencode-libs qrencode-devel autoconf automake libtool

GoogleAuthenticatorのclone&ビルド

centos@radius-01 $ git clone https://github.com/google/google-authenticator-libpam.git
centos@radius-01 $ cd /home/ec2-user/google-authenticator-libpam/
centos@radius-01 $ ./bootstrap.sh
{
"Version": "2012-10-17",
"Id": "PutELBLogsPolicy",
"Statement": [
{
"Sid": "PutELBLogsPolicy",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::ELB_ACCOUNT_ID:root"
},
@enokawa
enokawa / sendcommand.py
Last active April 23, 2017 09:15
use-auto-scaling-lifecycle-hook-with-cloudwatch-events-lambda
import os
import json
import boto3
import logging
logger = logging.getLogger()
logger.setLevel(logging.INFO)
def lambda_handler(event, context):
try:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadForGetBucketObjects",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::your-bucket-name/*"
},
$ openssl genrsa 2048 > server.key
$ openssl req -new -key server.key > server.csr
$ openssl x509 -days 3650 -req -signkey server.key < server.csr > server.crt
@enokawa
enokawa / SpecificHostedZoneChange.json
Created September 7, 2016 11:57
特定のRoute53のHostedZone変更権限IAMポリシー
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"route53:ChangeResourceRecordSets",
"route53:GetHostedZone",
"route53:ListResourceRecordSets"
],