Created
May 11, 2019 01:37
-
-
Save ykamez/a617f0b7efaf41145e17b2f4bdfeb7cd to your computer and use it in GitHub Desktop.
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 | |
user=$(whoami) | |
if [ $user != "isucon" ];then | |
echo "you aren't isucon user." | |
exit | |
fi | |
# 参考実装の切り替え | |
sudo systemctl stop isuda.go.service | |
sudo systemctl stop isutar.go.service | |
sudo systemctl disable isuda.go.service | |
sudo systemctl disable isutar.go.service | |
sudo systemctl start isuda.ruby.service | |
sudo systemctl start isutar.ruby.service | |
sudo systemctl enable isuda.ruby.service | |
sudo systemctl enable isutar.ruby.service | |
git init & echo '*' > .gitignore | |
ssh-keygen && cat $HOME/.ssh/id_rsa.pub | |
echo "Please copy this public key.↑https://github.com/settings/ssh" | |
while : | |
do | |
read -p "Have you added your ssh key?(y/N)" input | |
if [ $input = "y" ]; then | |
echo "Continue to setup!" | |
break | |
elif [ $input = "N" ]; then | |
echo "Please Add SSH Key." | |
else | |
echo "Input y or N" | |
fi | |
done | |
ssh -T git@github.com | |
sudo chown -R $user $HOME/.git/ | |
# conf系のファイルを移動して、シンボリックファイルを貼る | |
sudo mv /etc/nginx/nginx.conf $HOME/etc && sudo ln -sf $HOME/etc/nginx.conf /etc/nginx/ | |
sudo mv /etc/mysql/my.cnf $HOME/etc/ && sudo ln -sf $HOME/etc/my.cnf /etc/mysql/ | |
# git管理したいファイルを追加する(etc/xxx.conf etc/systemd/system, webapp,) | |
git add --force $HOME/etc $HOME/isucon/webapp/ruby | |
# ツールを入れる | |
sudo apt-get install zip unzip | |
sudo apt install -y vim git htop | |
# デフォルトのエディタがnanoになっていた時の対策 | |
sudo update-alternatives --set editor /usr/bin/vim.basic | |
# todo(kame) ダウンロード先をコントロールしたい | |
cd ~ & wget https://github.com/matsuu/kataribe/releases/download/v0.3.3/linux_amd64.zip | |
sudo unzip linux_amd64.zip | |
sudo ./kataribe -generate | |
# netadata | |
# bash <(curl -Ss https://my-netdata.io/kickstart.sh) | |
# myprofiler | |
cd ~ & wget https://github.com/KLab/myprofiler/releases/download/0.1/myprofiler.linux_amd64.tar.gz | |
tar xf myprofiler.linux_amd64.tar.gz | |
mv myprofiler ~/bin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment