Skip to content

Instantly share code, notes, and snippets.

View n0ts's full-sized avatar
🏠
Working from home

Naoya Nakazawa n0ts

🏠
Working from home
  • Freelancer
  • Tokyo, Japan
  • X @n0ts
View GitHub Profile
@n0ts
n0ts / install-verbose.out
Created October 17, 2017 23:15
nginx-full with mruby-module --verbose
$ brew install nginx-full --with-mruby-module --no-sandbox --verbose
==> Installing nginx-full from homebrew/nginx
==> Downloading https://nginx.org/download/nginx-1.12.1.tar.gz
Already downloaded: homebrew/nginx-full-1.12.1.tar.gz
==> Verifying nginx-full-1.12.1.tar.gz checksum
tar xzf homebrew/nginx-full-1.12.1.tar.gz
==> git init
Reinitialized existing Git repository in /homebrew/Cellar/mruby-nginx-module/1.20.1/share/mruby-nginx-module/.git/
==> git submodule init
==> git submodule update
[hub]
protocol = https
[user]
name = <name>
email = [email protected]
[alias]
ad = add
@n0ts
n0ts / run-aws-assume-role.sh
Last active June 23, 2024 21:32
aws-cli-assume-role-example
readonly aws_account_id=xxx
readonly aws_asusme_role=xxx
readonly credentials=$(aws sts assume-role \
--role-arn arn:aws:iam::$aws_account_id:role/$aws_assume_role \
--role-session-name session-$(basename $0 .sh) \
--query Credentials)
export AWS_ACCESS_KEY_ID=$(echo $credentials | jq -r '.AccessKeyId')
export AWS_SECRET_ACCESS_KEY=$(echo $credentials | jq -r '.SecretAccessKey')
export AWS_SESSION_TOKEN=$(echo $credentials | jq -r '.SessionToken')
@n0ts
n0ts / Makefile
Last active August 17, 2023 03:36 — forked from ryu1kn/Makefile
Encrypt/decrypt with AWS KMS using AWS cli
# How to encrypt/decrypt your text/blob secret with AWS KMS with AWS cli
# AWS_PROFILE=<profile> AWS_DEFAULT_REGION=<region> MY_KEY_ID=<kms key id> make (encrypt-text|decrypt-text|encrypt-blob|decrypt-blob)
KEY_ID=$(MY_KEY_ID)
SECRET_BLOB_PATH=fileb://my-secret-blob
SECRET_TEXT="my secret text"
ENCRYPTED_SECRET_AS_BLOB=encrypted_secret_blob
DECRYPTED_SECRET_AS_BLOB=decrypted_secret_blob # Result of decrypt-blob target