Skip to content

Instantly share code, notes, and snippets.

@ijin
ijin / lamvery_deploy_and_notify.sh
Last active December 15, 2016 18:10
Deploy to Lambda using Lamvery and notify via Slack
#!/bin/bash
set -x
export SHA1=`echo ${CIRCLE_SHA1} | cut -c1-7`
export ENV=`echo $1 | rev | cut -d \- -f1 | rev`
case "$1" in
'production')
export ENV_PREFIX=$PROD_PREFIX
@ijin
ijin / s3_sync_and_notify.sh
Last active December 26, 2016 06:59
Sync to S3 and notify via Slack
#!/bin/bash
set -x
export S3=`echo $1`
export SHA1=`echo ${CIRCLE_SHA1} | cut -c1-7`
export ENV=`echo $1 | rev | cut -d \- -f1 | rev`
aws --region $REGION s3 sync . s3://$S3/ --exclude 'circle.yml' --exclude '.*' --exclude '*.swp' --exclude 's3*.sh' --delete
if [ $? -eq 0 ]; then
@ijin
ijin / go.sh
Last active June 6, 2016 08:19
install golang
#!/bin/bash
export VER=1.6.2
export GO=go$VER.linux-amd64.tar.gz
wget https://storage.googleapis.com/golang/$GO
tar xvfz $GO
cat >>~/.bash_profile <<EOF
export GOROOT=\$HOME/go
export GOPATH=\$HOME/golang
@ijin
ijin / mDNS_Web_Server.log
Created May 28, 2016 01:47
mDNS_Web_Server ESP8266
tail 0
chksum 0x0f
csum 0x0f
rld��|�l�| � $�c|ǃ��{�c� b��og�l'o��� #p��${ls$p�'� �l�� c n�|l�ć�c��g'�l��d`�gn d`or���n ��d{��o ��$��g�
ets Jan 8 2013,rst cause:4, boot mode:(3,6)
wdt reset
load 0x4010f000, len 1264, room 16
tail 0
chksum 0x0f
@ijin
ijin / eb-api-gw-tf-apply.sh
Created April 28, 2016 09:54
[Terraform Apply] API Gateway to get Elastic Beanstalk IP(s) Raw
$ terraform apply
aws_api_gateway_rest_api.EB: Creating...
description: "" => "get EB info"
name: "" => "EB"
root_resource_id: "" => "<computed>"
aws_api_gateway_rest_api.EB: Creation complete
aws_api_gateway_resource.eb: Creating...
parent_id: "" => "k9x3d7qlhd"
path: "" => "<computed>"
path_part: "" => "eb"
@ijin
ijin / eb-api-gw-tf-plan.sh
Last active April 29, 2016 03:07
[Terraform Plan] API Gateway to get Elastic Beanstalk IP(s)
$ terraform plan
Refreshing Terraform state prior to plan...
The Terraform execution plan has been generated and is shown below.
Resources are shown in alphabetical order for quick scanning. Green resources
will be created (or destroyed and then created if an existing resource
exists), yellow resources are being changed in-place, and red resources
will be destroyed.
@ijin
ijin / eb-api-gw.tf
Last active August 16, 2023 07:54
[Terraform] API Gateway to get Elastic Beanstalk IP(s)
provider "aws" {
region = "ap-northeast-1"
allowed_account_ids = ["${var.names.account_id}"]
}
variable "names" {
default = {
account_id = "$ACCOUNT_ID"
}
}
@ijin
ijin / add-ssh-key-to-auhorized_keys.sh
Last active April 2, 2016 06:38
Put public key in ~/.ssh/authorized_keys with mucho ease
IFS="$(printf '\n\t')"
mkdir -p ~/.ssh
if ! [[ -f ~/.ssh/authorized_keys ]]; then
echo "Creating new ~/.ssh/authorized_keys"
touch ~/.ssh/authorized_keys
fi
grep -q "$1" ~/.ssh/authorized_keys || echo "$1" >> ~/.ssh/authorized_keys
@ijin
ijin / aws-codedeploy.png
Last active March 4, 2016 12:57
AWS CodeDeploy Icon
aws-codedeploy.png
@ijin
ijin / lambda_git.py
Created February 18, 2016 03:01
use git from lambda
from __future__ import print_function
import os
import sys
import subprocess
import boto3
from botocore.client import Config
from dulwich.errors import (
SendPackError,