This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[hub] | |
protocol = https | |
[user] | |
name = <name> | |
email = n0ts@users.noreply.github.com | |
[alias] | |
ad = add |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ brew install nginx-full --with-mruby-module --no-sandbox | |
==> Installing nginx-full from homebrew/nginx | |
==> Downloading https://nginx.org/download/nginx-1.12.1.tar.gz | |
######################################################################## 100.0% | |
==> git init | |
==> git submodule init | |
==> git submodule update | |
==> git add build_config.rb | |
==> git commit -m 'build_config.rb' | |
Last 15 lines from ~/Library/Logs/Homebrew/nginx-full/05.git: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
rc = rebase --continue | |
ft = fetch | |
ftp = fetch --tags --prune | |
pr = pull --rebase | |
co = checkout | |
wd = diff --word-diff | |
br = branch | |
so = remote show origin | |
kc = commit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://www.dropbox.com/s/er3bofqrgnl6wue/Emacs-24.3.app.zip?dl=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# iam-and-s3 | |
# | |
require 'aws-sdk' | |
$: << File.dirname(__FILE__) | |
### common local library | |
require 'meta' | |
require 'aws' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IFS=$'\n' | |
for i in $(find . -type f -name '*.png'); do | |
dir=$(dirname "$i") | |
file=$(basename "$i" .png) | |
sips -s format jpeg $i --out "$dir/$file.jpg" | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for c in $(brew cask list); do | |
info=$(brew cask info $c) | |
installed_ver=$(echo "$info" | cut -d$'\n' -f1 | tr -d ' ' | cut -d':' -f 2) | |
current_ver=$(echo "$info" | cut -d$'\n' -f3 | cut -d' ' -f 1 | rev | cut -d'/' -f 1 | rev) | |
if [ "$installed_ver" != "$current_ver" ]; then | |
echo "$c is installed '$installed_ver', current is '$current_ver'" | |
brew cask reinstall $c | |
fi |
NewerOlder