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
# client | |
gem lists > gem-lists.txt | |
# server | |
gem install -v $(cat gem-lists.txt | cut -d' ' -f1 | tr '\n' ' ') |
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/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 \ |
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/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') |
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 | |
SERVER='8.8.8.8' | |
cat $1 | sed -E 's;^https?://(.*)/;\1;g' | xargs -I{} dig +short +time=5 @$SERVER {} |
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
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' |
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 | |
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 |
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
# 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 |
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/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' |
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 | |
# you shold modify /etc/resolv.conf | |
urls=$1 | |
cat $urls | xargs -P 0 -I{} curl -L -sSfk -m 10 -o /dev/null -w "%{http_code} %{url_effective}\n" {} |
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 | |
ruby -e "require 'mysql'; p Mysql.new('hostname', 'username', 'password', 'dbname')" |
OlderNewer