Skip to content

Instantly share code, notes, and snippets.

@ckcks12
Last active August 27, 2019 10:20
Show Gist options
  • Save ckcks12/4af665f56812b8248708145dcd23e1a1 to your computer and use it in GitHub Desktop.
Save ckcks12/4af665f56812b8248708145dcd23e1a1 to your computer and use it in GitHub Desktop.
#!/bin/bash
################################################################################
# echo setting
################################################################################
r='\033[0;31m'
y='\033[1;33m'
g='\033[0;32m'
b='\033[1;34m'
x='\033[0m'
function log() {
echo -e $@${x}
}
function notice() {
echo -e "${y}################################################################################"
echo -e ${y}$@
echo -e "${y}################################################################################${x}"
}
function info() {
echo -e ${g}$@
}
notice 08/26/2019 INIT SCRIPT FOR ${y}UBUNTU 18.04 LTS
notice sudo
apt-get install -y sudo
notice apt update
sudo apt-get update -y
notice build-essential
sudo apt-get install build-essential -y
notice gcc
sudo apt-get install -y gcc
notice g++
sudo apt-get install -y g++
notice gdb
sudo apt-get install -y gdb
notice vim
sudo apt-get install -y vim
notice openjdk-8-jre
sudo apt-get install -y openjdk-8-jre
notice python3 with pip3
sudo apt-get install -y python3 python3-pip
notice node10
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs
notice npm
sudo apt-get install -y npm
npm install npm
notice git
sudo apt-get install -y git
git config --global core.editor "vim"
git_path=~/.gitconfig
sudo cat >> ${git_path} << EOF
[alias]
lg1 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
lg = !"git lg1"
EOF
notice curl
sudo apt-get install -y curl
notice net-tools
sudo apt-get install -y net-tools
################################################################################
# NPM
################################################################################
notice pm2
sudo npm i -g pm2
notice gtop
sudo npm i -g gtop
notice yarn
sudo npm i -g yarn
################################################################################
# CONFIG SETTING
################################################################################
notice vimrc setting
git clone --depth=1 https://github.com/ckcks12/vimrc.git ~/.vim_runtime
sh ~/.vim_runtime/install_awesome_vimrc.sh
notice bashrc setting
rc=~/.bashrc
sudo echo alias l=\"ls -alFh\" >> ${rc}
source ${rc}
################################################################################
# POWERLINE (NOW BE REPLACED BY OH-MY-ZSH)
################################################################################
# notice powerline
# sudo apt install python-pip -y
# sudo pip install --upgrade pip
# sudo pip install setuptools
# sudo pip install powerline-status
# powerline_sh_path=/usr/local/lib/python2.7/dist-packages/powerline/bindings/bash/powerline.sh
# sudo chmod 744 ${powerline_sh_path}
# bashrc_path=~/.bashrc
# sudo cat >> ${bashrc_path} << EOF
# powerline-daemon -q
# POWERLINE_BASH_CONTINUATION=1
# POWERLINE_BASH_SELECT=1
# . ${powerline_sh_path}
# EOF
# sudo sysctl fs.inotify.max_user_watches=524288
# source ${bashrc_path}
################################################################################
# DOCKER
################################################################################
notice docker
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
################################################################################
# OH MY ZSH
################################################################################
notice OH MY ZSH
sudo apt install -y zsh
sudo apt-get install -y powerline fonts-powerline
git clone https://github.com/robbyrussell/oh-my-zsh.git $HOME/.oh-my-zsh
cp $HOME/.oh-my-zsh/templates/zshrc.zsh-template $HOME/.zshrc
sed -i 's/robbyrussell/agnoster/' ~/.zshrc
chsh -s /bin/zsh
################################################################################
# GOLANG
################################################################################
notice GOLANG
wget https://dl.google.com/go/go1.12.7.linux-amd64.tar.gz
sudo tar -xf go1.12.7.linux-amd64.tar.gz
sudo mv go /usr/local
echo "export GOROOT=/usr/local/go" >> $HOME/.zshrc
mkdir -p $HOME/go
echo "export GOPATH=$HOME/go" >> $HOME/.zshrc
echo "export PATH=/usr/local/go/bin:$PATH" >> $HOME/.zshrc
source $HOME/.zshrc
################################################################################
# MISCELLANEOUS
################################################################################
sudo apt install python-pip -y
sudo pip install --upgrade pip
sudo pip install setuptools
sudo sysctl fs.inotify.max_user_watches=524288
notice DONE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment