Created
October 2, 2019 04:04
-
-
Save cuongtransc/e9f2028f4c2c8db3b0ab71b486cfc799 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
######################################## | |
# Functions | |
######################################## | |
function install_basic_tools() { | |
echo "Installing basic tools..." | |
sudo apt-get update -qq | |
sudo apt-get install -y byobu zsh vim | |
sudo apt-get install -y git | |
sudo apt-get install -y mosh | |
sudo apt-get install -y htop | |
} | |
function install_docker_and_tools() { | |
echo "Installing Docker..." | |
wget -qO- https://get.docker.com/ | sh | |
echo "Installing docker-compose..." | |
COMPOSE_VERSION=1.24.1 | |
sudo wget -q https://github.com/docker/compose/releases/download/$COMPOSE_VERSION/docker-compose-`uname -s`-`uname -m` \ | |
-O /usr/local/bin/docker-compose | |
sudo chmod +x /usr/local/bin/docker-compose | |
echo "Installing ctop..." | |
CTOP_VERSION=0.7.1 | |
sudo wget https://github.com/bcicen/ctop/releases/download/v$CTOP_VERSION/ctop-$CTOP_VERSION-linux-amd64 \ | |
-O /usr/local/bin/ctop | |
sudo chmod +x /usr/local/bin/ctop | |
} | |
function config_base_user() { | |
user=$1 | |
echo "Change shell" | |
sudo chsh -s /bin/zsh ${user} | |
echo "Add users to docker group" | |
sudo usermod -a -G docker ${user} | |
} | |
function config_dotfiles() { | |
user=$1 | |
# Download config | |
wget https://www.dropbox.com/s/g16is6tt523kwvl/coc-config_20180623_111010.tgz -O /tmp/coc-config.tgz | |
# Config dotfiles | |
sudo tar xzf /tmp/coc-config.tgz -C /home/${user} | |
sudo chown ${user}:${user} -R /home/${user} | |
sudo mv /home/${user}/peco /usr/local/bin | |
} | |
######################################## | |
# Setup | |
######################################## | |
# Variables | |
# USER=ubuntu | |
USER=`whoami` | |
# Setup | |
install_basic_tools | |
install_docker_and_tools | |
echo "Change default editor" | |
sudo update-alternatives --install /usr/bin/editor editor /usr/bin/vim 100 | |
config_base_user $USER | |
config_dotfiles $USER |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment