-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall_env.sh
More file actions
40 lines (35 loc) · 1.24 KB
/
install_env.sh
File metadata and controls
40 lines (35 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/sh
# Detect OS
OS="$(uname -s)"
if [ "$OS" = "Darwin" ]; then
# macOS
brew install vim curl git direnv
elif [ "$OS" = "Linux" ]; then
# Linux
sudo apt update
sudo apt install vim curl ssh git direnv -y
else
echo "Unsupported OS: $OS"
exit 1
fi
# install tmux
sudo apt remove tmux
sudo apt -y install build-essential libevent-dev libncurses5-dev
mkdir ~/tmux
cd ~/tmux
curl -LO https://github.com/tmux/tmux/releases/download/2.8/tmux-2.8.tar.gz
tar xfvz tmux-2.8.tar.gz
cd tmux-2.8/
./configure && make
sudo cp -p ~/tmux/tmux-2.8/tmux /usr/local/sbin/
# install oh-my-zsh
if [ ! -d "$HOME/.oh-my-zsh" ]; then
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
fi
# copy pubkey to login
mkdir -p $HOME/.ssh
cd $HOME/.ssh
cat <<EOF >> authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDTY//OSlDR2Fqvtprlf2jAeiqL2Bzr2Ny19tmGySYE9C/8weLtb7ZEQuKpLpGwLXZwUulH1Zn1mZl0uxTXfHNl2oYn1VdUkd0HAskKZ6IW17CMikD9WiFpa7mfnuATm7ZnGovWvCG8eLbqq709FR6T+0oDUYRuFI8tNGZCNSENlN+FguicrVNe1UCW50Qt19R71le7OhxnhtO20mT94eg8GUt+CpwNngrk0Q7lmgdD0D6viKH3p6/jIMV6A5jhz+uMERfjU/zcN3HVsLZ/UQp7wQkpVFjWG13LCRbBf5tHU9nmH4Njd1Mg6YIKV69nzjdsHxd7OYOvUjEPsVM7z4iR katayama@honnosuke.local
EOF
chmod 600 authorized_keys