2019-11-22 22:58:28 +00:00
|
|
|
#!/usr/bin/env bash
|
2019-08-11 08:46:37 +00:00
|
|
|
# Make sure Code directory exists
|
2019-12-01 11:01:19 +00:00
|
|
|
|
|
|
|
echo "Hello $(whoami)! Let's get you set up."
|
|
|
|
|
2019-12-01 16:21:08 +00:00
|
|
|
echo "mkdir -p $HOME/Code"
|
2019-08-11 08:46:37 +00:00
|
|
|
mkdir -p ~/Code
|
2019-08-11 15:57:00 +00:00
|
|
|
ln -snf ~/Code/dotfiles/dot_scripts ~/.scripts
|
2019-08-11 08:46:37 +00:00
|
|
|
chmod +x ~/.scripts/*.sh
|
|
|
|
|
|
|
|
# Install missing package (Linux)
|
|
|
|
case "$(uname -s)" in
|
2020-02-15 14:16:45 +00:00
|
|
|
Linux)
|
|
|
|
echo "(Linux) Installing Development Tools"
|
|
|
|
yum install sudo -y
|
|
|
|
sudo yum groupinstall 'Development Tools' -y
|
|
|
|
sudo yum install git which zip unzip ruby curl file docker gcc make libxcrypt-compat vim-enhanced -y
|
|
|
|
;;
|
2019-08-11 08:46:37 +00:00
|
|
|
esac
|
|
|
|
|
|
|
|
# Install HomeBrew
|
|
|
|
case "$(uname -s)" in
|
2020-02-15 14:16:45 +00:00
|
|
|
Darwin)
|
|
|
|
echo "(Mac OS X) installing homebrew"
|
|
|
|
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
|
|
|
# Prevent `Error: Your Homebrew is outdated. Please run `brew update`.`
|
|
|
|
echo "Updating Homebrew"
|
|
|
|
brew update
|
|
|
|
;;
|
2019-08-11 08:46:37 +00:00
|
|
|
esac
|
|
|
|
|
2020-06-24 07:51:04 +00:00
|
|
|
# Path to ruby
|
|
|
|
export PATH="/usr/local/opt/ruby/bin:$PATH"
|
|
|
|
|
2019-08-11 08:46:37 +00:00
|
|
|
# Create symbolic links
|
2019-12-01 11:01:19 +00:00
|
|
|
echo "Creating symbolic links"
|
2020-02-15 14:16:45 +00:00
|
|
|
ln -snf ~/Code/dotfiles/dot_profile ~/.profile
|
2019-08-11 08:46:37 +00:00
|
|
|
ln -snf ~/.local/share/chezmoi/ ~/dotfiles
|
|
|
|
ln -snf ~/Code/dotfiles/Gemfile ~/Gemfile
|
|
|
|
ln -snf ~/Code/dotfiles/README.md ~/README.md
|
|
|
|
ln -snf ~/Code/dotfiles/dot_bash_profile ~/.bash_profile
|
|
|
|
ln -snf ~/Code/dotfiles/dot_gitconfig ~/.gitconfig
|
|
|
|
ln -snf ~/Code/dotfiles/dot_macos ~/.macos
|
|
|
|
ln -snf ~/Code/dotfiles/dot_scripts ~/.scripts
|
2020-06-24 07:51:04 +00:00
|
|
|
ln -snf ~/Code/dotfiles/dot_scripts/checkci.sh /usr/local/bin/checkci
|
2019-08-11 08:46:37 +00:00
|
|
|
ln -snf ~/Code/dotfiles/dot_vimrc ~/.vimrc
|
2020-06-24 07:51:04 +00:00
|
|
|
# custom linters
|
|
|
|
ln -snf ~/Code/dotfiles/dot_vim/ale_linters ~/.vim/ale_linters
|
|
|
|
|
2019-08-11 08:46:37 +00:00
|
|
|
ln -snf ~/Code/dotfiles/dot_zsh_aliases ~/.zsh_aliases
|
|
|
|
ln -snf ~/Code/dotfiles/dot_zsh_functions ~/.zsh_functions
|
|
|
|
ln -snf ~/Code/dotfiles/dot_zshrc ~/.zshrc
|
|
|
|
ln -snf ~/Code/dotfiles/dot_zshrc.pre-oh-my-zsh ~/.zshrc.pre-oh-my-zsh
|
|
|
|
ln -snf ~/Code/dotfiles/private_dot_ssh/config ~/.ssh/config
|
2019-08-15 07:52:49 +00:00
|
|
|
ln -snf ~/Code/dotfiles/requirements.txt ~/requirements.txt
|
2019-08-15 09:19:11 +00:00
|
|
|
ln -snf ~/Code/dotfiles/dot_surfraw.conf ~/.surfraw.conf
|
2019-11-16 09:46:56 +00:00
|
|
|
ln -snf ~/Code/dotfiles/private_dot_3llo/config.sh ~/.3llo_config
|
2019-12-01 11:01:19 +00:00
|
|
|
ln -snf ~/Code/dotfiles/dot_ansiweatherrc ~/.ansiweatherrc
|
2020-06-24 07:51:04 +00:00
|
|
|
ln -snf ~/Code/dotfiles/dot_p10k.zsh ~/.p10k.zsh
|
2020-02-15 14:16:45 +00:00
|
|
|
ln -snf ~/Code/dotfiles/dot_git-template ~/.git-template
|
2019-08-15 09:19:11 +00:00
|
|
|
|
2019-08-11 08:46:37 +00:00
|
|
|
# Other symblinks + Install Docker Desktop for Mac
|
|
|
|
case "$(uname -s)" in
|
2020-02-15 14:16:45 +00:00
|
|
|
Darwin)
|
|
|
|
echo "(Mac OS X) Adding symbolic links"
|
|
|
|
ln -snf "$HOME/.config/Code/User/settings.json" "$HOME/Library/Application Support/Code/User/settings.json"
|
|
|
|
ln -snf "$HOME/Library/Mobile Documents/com~apple~CloudDocs/Mackup/Library/Application Support/Code/User/snippets" "$HOME/Library/Application Support/Code/User/snippets"
|
|
|
|
ln -snf "$HOME/Library/Mobile Documents/com~apple~CloudDocs/Mackup/.mackup.cfg" "$HOME/.mackup.cfg"
|
|
|
|
echo "(Mac OS X) Installing Docker"
|
|
|
|
~/.scripts/install_docker_for_mac.sh
|
|
|
|
;;
|
2019-08-11 08:46:37 +00:00
|
|
|
esac
|
|
|
|
|
|
|
|
# Install dependencies (apps, fonts, ...) with Brew
|
2019-12-01 16:21:08 +00:00
|
|
|
case "$(uname -s)" in
|
2020-02-15 14:16:45 +00:00
|
|
|
Darwin)
|
|
|
|
echo "(Mac OS X) Brew installing stuff (apps, fonts, ...)"
|
|
|
|
ln -snf ~/Code/dotfiles/Brewfile ~/Brewfile
|
|
|
|
brew bundle
|
|
|
|
;;
|
2019-12-01 16:21:08 +00:00
|
|
|
esac
|
|
|
|
|
|
|
|
# Install dependencies (apps, fonts, ...) for CentOS
|
|
|
|
case "$(uname -s)" in
|
2020-02-15 14:16:45 +00:00
|
|
|
Linux)
|
|
|
|
echo "(CentOS) Installing stuff (apps, ...)"
|
|
|
|
chmod +x ~/Code/dotfiles/centos.sh
|
|
|
|
~/Code/dotfiles/centos.sh
|
|
|
|
;;
|
2019-12-01 16:21:08 +00:00
|
|
|
esac
|
2019-08-11 08:46:37 +00:00
|
|
|
|
|
|
|
# Switch to ZSH
|
2019-12-01 11:01:19 +00:00
|
|
|
echo "switching to ZSH"
|
2020-02-15 14:16:45 +00:00
|
|
|
command -v zsh >>/etc/shells
|
2019-12-01 11:01:19 +00:00
|
|
|
chsh -s "$(command -v zsh)"
|
2019-08-11 08:46:37 +00:00
|
|
|
|
2019-07-25 19:38:04 +00:00
|
|
|
# Use SDKMan to install development tools
|
2019-12-01 11:01:19 +00:00
|
|
|
echo "Installing SDKMan as development tools manager"
|
2019-07-25 19:38:04 +00:00
|
|
|
curl -s "https://get.sdkman.io" | bash
|
2019-12-01 11:01:19 +00:00
|
|
|
|
|
|
|
echo "SDKMan installing development tools"
|
2019-07-25 19:38:04 +00:00
|
|
|
sdk install java
|
|
|
|
sdk install gradle
|
2019-08-11 08:46:37 +00:00
|
|
|
sdk install java 8.0.222-zulu
|
2019-11-09 12:46:10 +00:00
|
|
|
sdk install kotlin
|
2019-12-01 11:01:19 +00:00
|
|
|
echo "SDKMan updating"
|
2019-08-11 08:46:37 +00:00
|
|
|
sdk selfupdate
|
2019-07-25 19:38:04 +00:00
|
|
|
|
2019-08-11 08:46:37 +00:00
|
|
|
case "$(uname -s)" in
|
2020-02-15 14:16:45 +00:00
|
|
|
Linux)
|
|
|
|
echo '(Linux) Installing ruby'
|
|
|
|
curl -sSL https://rvm.io/mpapis.asc | gpg2 --import -
|
|
|
|
curl -sSL https://rvm.io/pkuczynski.asc | gpg2 --import -
|
|
|
|
curl -L get.rvm.io | bash -s stable
|
|
|
|
source /etc/profile.d/rvm.sh
|
|
|
|
rvm reload
|
|
|
|
rvm requirements run
|
|
|
|
rvm install 2.3.7
|
|
|
|
;;
|
2019-08-11 08:46:37 +00:00
|
|
|
esac
|
2019-07-25 19:38:04 +00:00
|
|
|
|
2019-08-09 02:02:55 +00:00
|
|
|
# Install bundler for managing ruby dependencies and Gemfile
|
2019-12-01 11:01:19 +00:00
|
|
|
echo "Installing bundler for managing ruby dependencies and Gemfile"
|
2019-08-09 02:02:55 +00:00
|
|
|
sudo gem install bundler
|
2019-08-11 08:46:37 +00:00
|
|
|
bundle install
|
2019-07-25 19:38:04 +00:00
|
|
|
|
|
|
|
# Install Oh My Zsh and some cool dependencies
|
2019-12-01 11:01:19 +00:00
|
|
|
echo "Installing Oh My Zsh + customizing themes and plugins"
|
2020-06-24 07:51:04 +00:00
|
|
|
echo 'source /usr/local/opt/powerlevel10k/powerlevel10k.zsh-theme' ~/.zshrc >>!
|
2019-07-25 19:38:04 +00:00
|
|
|
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
|
2020-02-08 10:23:45 +00:00
|
|
|
git clone https://github.com/AlexisBRENON/oh-my-zsh-reminder "$ZSH_CUSTOM/plugins/reminder"
|
|
|
|
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "$ZSH_CUSTOM/plugins/zsh-syntax-highlighting"
|
|
|
|
git clone https://github.com/zsh-users/zsh-autosuggestions "$ZSH_CUSTOM/plugins/zsh-autosuggestions"
|
2019-08-11 08:46:37 +00:00
|
|
|
ln -snf ~/Code/dotfiles/dot_zshrc ~/.zshrc
|
|
|
|
ln -snf ~/Code/dotfiles/dot_zshrc.pre-oh-my-zsh ~/.zshrc.pre-oh-my-zsh
|
|
|
|
|
2019-12-01 11:01:19 +00:00
|
|
|
echo "Installing Vundle + VIM Plugins"
|
2019-08-17 20:26:53 +00:00
|
|
|
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
|
2020-02-15 14:16:45 +00:00
|
|
|
vim +PluginInstall +qall >/dev/null
|
2019-12-01 11:01:19 +00:00
|
|
|
#https://github.com/ycm-core/YouCompleteMe/blob/master/README.md#installation
|
|
|
|
cd "$HOME/.vim/bundle/YouCompleteMe" || exit
|
|
|
|
./install.py --all
|
|
|
|
cd "$HOME" || exit
|
2019-11-09 13:12:28 +00:00
|
|
|
git clone https://github.com/dbeniamine/cheat.sh-vim.git ~/.vim/cheat.sh-vim
|
2019-08-17 20:26:53 +00:00
|
|
|
|
2019-08-11 08:46:37 +00:00
|
|
|
# Install no-more-secrets
|
2019-12-01 11:01:19 +00:00
|
|
|
echo "Installing no-more-secrets (for fun)"
|
2019-08-11 08:46:37 +00:00
|
|
|
git clone https://github.com/bartobri/no-more-secrets.git ~/Code/no-more-secrets
|
2019-12-01 11:01:19 +00:00
|
|
|
cd "$HOME/Code/no-more-secrets" || exit
|
2019-08-11 08:46:37 +00:00
|
|
|
make nms sneakers
|
|
|
|
sudo make install
|
2019-12-01 11:01:19 +00:00
|
|
|
cd "$HOME" || exit
|
2019-07-25 19:38:04 +00:00
|
|
|
|
|
|
|
# OSX Defaults
|
2019-08-11 08:50:27 +00:00
|
|
|
case "$(uname -s)" in
|
2020-02-15 14:16:45 +00:00
|
|
|
Darwin)
|
|
|
|
echo "(Mac OS X) Loading preferences"
|
|
|
|
sudo sh .macos
|
|
|
|
;;
|
2019-08-11 08:50:27 +00:00
|
|
|
esac
|
2019-07-25 19:38:04 +00:00
|
|
|
|
2019-08-11 08:46:37 +00:00
|
|
|
# Customize /etc/hosts
|
2019-12-01 11:01:19 +00:00
|
|
|
echo "Overriding /etc/hosts"
|
2019-08-11 08:46:37 +00:00
|
|
|
curl https://someonewhocares.org/hosts/hosts -o /etc/hosts
|
|
|
|
|
2019-07-25 19:38:04 +00:00
|
|
|
# Install pip and pipenv
|
2019-12-01 11:01:19 +00:00
|
|
|
echo "Installing pip and pipenv"
|
2019-07-25 19:38:04 +00:00
|
|
|
sudo easy_install pip
|
|
|
|
sudo pip install --upgrade pip
|
|
|
|
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
|
|
|
|
sudo python3 get-pip.py
|
2019-08-11 08:46:37 +00:00
|
|
|
case "$(uname -s)" in
|
2020-02-15 14:16:45 +00:00
|
|
|
Darwin)
|
|
|
|
echo "(Mac OS X) Updating PATH for loading pip user installed packages"
|
|
|
|
ln -snf /usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/bin/pip pip3
|
|
|
|
export PATH="$PATH:/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/bin/:/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/bin:/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/bin"
|
|
|
|
;;
|
2019-08-11 08:46:37 +00:00
|
|
|
esac
|
2019-12-01 11:01:19 +00:00
|
|
|
echo "Upgrading pip"
|
2019-08-15 07:52:49 +00:00
|
|
|
sudo pip install --upgrade pip
|
2019-12-01 11:01:19 +00:00
|
|
|
echo "Pip installing stuff"
|
2019-08-15 07:52:49 +00:00
|
|
|
pip install -r requirements.txt
|
|
|
|
|
2019-08-11 08:46:37 +00:00
|
|
|
# was used for some slack cli in python... https://pypi.org/project/slack-cli/
|
|
|
|
# pip3 install pipenv
|
|
|
|
# pyenv install 3.6.0
|
2019-07-25 19:38:04 +00:00
|
|
|
|
2019-11-09 14:31:15 +00:00
|
|
|
# Install baton (CLI to manage Spotify playback) https://github.com/joshuathompson/baton
|
|
|
|
case "$(uname -s)" in
|
2020-02-15 14:16:45 +00:00
|
|
|
Darwin)
|
|
|
|
echo '(Mac OS X) Installing baton (spotify CLI)'
|
|
|
|
curl -sSL https://github.com/joshuathompson/baton/releases/download/0.1.7/baton-0.1.7-darwin-amd64 -o /usr/local/bin/baton && chmod +x /usr/local/bin/baton
|
|
|
|
;;
|
|
|
|
|
|
|
|
Linux)
|
|
|
|
echo '(Linux) Installing baton (spotify CLI)'
|
|
|
|
curl -sSL https://github.com/joshuathompson/baton/releases/download/0.1.7/baton-0.1.7-linux-amd64 -o /usr/local/bin/baton && chmod +x /usr/local/bin/baton
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo 'Non supported OS : Installation aborted for baton (spotify CLI)'
|
|
|
|
exit
|
|
|
|
;;
|
2019-11-09 14:31:15 +00:00
|
|
|
esac
|
|
|
|
|
2019-11-16 12:29:52 +00:00
|
|
|
# Use rustup to install the Rust compiler (rustc) and the Rust package manager (cargo).
|
2019-12-01 11:01:19 +00:00
|
|
|
echo "Installing Rust compiler and package manager"
|
2019-11-16 12:29:52 +00:00
|
|
|
rustup-init -y
|
2019-12-01 11:01:19 +00:00
|
|
|
rustup component add rustfmt
|
|
|
|
# Install pa11y tool for local webpage accessibility analysis
|
|
|
|
echo "Installing pa11y tool for local webpage accessibility analysis"
|
|
|
|
npm install -g pa11y
|
2019-11-16 12:29:52 +00:00
|
|
|
|
2019-12-01 17:39:47 +00:00
|
|
|
git clone https://github.com/sherlock-project/sherlock.git ~/Code/sherlock
|
|
|
|
cd sherlock || exit
|
|
|
|
python3 -m pip install -r requirements.txt
|
|
|
|
|
2020-02-15 14:16:45 +00:00
|
|
|
git config --global init.templateDir ~/.git-template
|
|
|
|
pre-commit init-templatedir ~/.git-template
|
|
|
|
|
|
|
|
terraform-docs completion zsh >/usr/local/share/zsh/site-functions/_terraform-docs
|
|
|
|
autoload -U compinit && compinit
|
|
|
|
|
2020-06-24 07:51:04 +00:00
|
|
|
go get -u -v github.com/jessfraz/dockfmt
|
2020-02-22 15:31:41 +00:00
|
|
|
go get -u -v github.com/dmlittle/scenery
|
|
|
|
go get -u -v github.com/camptocamp/terraboard
|
|
|
|
|
|
|
|
sudo curl -L git.io/scope -o /usr/local/bin/scope
|
|
|
|
sudo chmod a+x /usr/local/bin/scope
|
|
|
|
#scope launch
|
|
|
|
|
2019-07-25 19:38:04 +00:00
|
|
|
# Upgrade
|
2019-12-01 11:01:19 +00:00
|
|
|
echo "Upgrading apps"
|
2019-08-11 08:46:37 +00:00
|
|
|
~/.scripts/upgrade.sh
|
2019-07-25 19:38:04 +00:00
|
|
|
|
|
|
|
# Reload
|
2019-12-01 11:01:19 +00:00
|
|
|
echo "Reloading config"
|
2019-08-11 08:46:37 +00:00
|
|
|
~/.scripts/reload.sh
|