Skip to content

Instantly share code, notes, and snippets.

Avatar
🚴‍♂️

takuma-saito

🚴‍♂️
View GitHub Profile
View gem-installer.sh
# client
gem lists > gem-lists.txt
# server
gem install -v $(cat gem-lists.txt | cut -d' ' -f1 | tr '\n' ' ')
View create-instance-by-eip.sh
#!/bin/zsh
AMI="ami-xxxxxxx" # Official CentOS 7.0 AMI in ap-northeast-1 region
ALOCID="eipalloc-xxxxxxx" # Allocating ip address
SIZE="m3.large"
KEYNAME="jobfind"
SEC_GROUP="default"
InstanceId=$(aws ec2 run-instances \
--count 1 \
@takuma-saito
takuma-saito / change-ip-by-eip.sh
Last active Nov 16, 2015
change-ip-by-eip.sh
View change-ip-by-eip.sh
#!/bin/zsh
InstanceId="$1"
# allocation id of current ip
OldAllocationId=$(aws ec2 describe-addresses |
jq -r '.Addresses[] | select(.InstanceId == "'$InstanceId'") | .AllocationId')
# create address
NewAllocationId=$(aws ec2 allocate-address | jq -r '.AllocationId')
View parallel-domain-checker.sh
#!/bin/bash
SERVER='8.8.8.8'
cat $1 | sed -E 's;^https?://(.*)/;\1;g' | xargs -I{} dig +short +time=5 @$SERVER {}
View dns-benchmark.sh
dnsperf -d domain-1000000.txt -s 127.0.0.1 -p 53 -c 128 -t 10 -q 5000 -Q 150000 -S 1 2>&1 | grep -v -E 'Timeout|Warning'
View setup.sh
#!/bin/bash
brew update
brew tap sanemat/font
brew tap caskroom/cask
brew cask install coteditor
brew cask install evernote
brew cask install google-chrome
brew cask install iterm2
brew cask install menumeters
View tmux.conf
# prefixキーをctrl+tへ変更
set-option -g prefix C-t
bind-key C-t send-prefix
# ターミナルを256色にする
set -g default-terminal "xterm-256color"
# Shift + 上下左右でペインを移動できるようにする。
bind -n C-left select-pane -L
View ascii2decimal.sh
#!/bin/zsh
echo -en "$1" | hexdump -v -e '/1 "%02x "' | tr ' ' '\n' | xargs -I{} zsh -lc 'printf "\\\0%03d\n" $(echo $[[#8] 16#{}] | cut -b3-)' | tr -d '\n'
View parallel-link-checker.sh
@takuma-saito
takuma-saito / con-db.sh
Created Dec 4, 2015
ruby connect to mysql database
View con-db.sh
#!/bin/bash
ruby -e "require 'mysql'; p Mysql.new('hostname', 'username', 'password', 'dbname')"
You can’t perform that action at this time.