add linters and refactor bootstraping scripts

- giant refactoring
- add aliases and functions to ease work
- apply linters / fixers / fmt to most files
This commit is contained in:
MorganGeek
2020-07-11 12:25:30 +02:00
parent e48c7e700a
commit 228982a0a8
42 changed files with 1813 additions and 1637 deletions

View File

@ -1,38 +1,38 @@
---
- hosts: localhost
connection: local
become_method: sudo
become: yes
- hosts: localhost
connection: local
become_method: sudo
become: yes
tasks:
- name: Check yubikey binaries are installed
stat:
path: "{{ item }}"
with_items:
- /usr/local/bin/ykpamcfg
- "/Applications/YubiKey\ Manager.app/Contents/MacOS/ykman"
tasks:
- name: Check yubikey binaries are installed
stat:
path: '{{ item }}'
with_items:
- /usr/local/bin/ykpamcfg
- /Applications/YubiKey Manager.app/Contents/MacOS/ykman
- name: Check Yubico is recognized
shell: "'/Applications/YubiKey Manager.app/Contents/MacOS/ykman' list | awk '{print $6}'"
register: yubicoChallenge
failed_when: "yubicoChallenge.rc != 0 or yubicoChallenge.stdout == ''"
- name: Check Yubico is recognized
shell: "'/Applications/YubiKey Manager.app/Contents/MacOS/ykman' list | awk '{print $6}'"
register: yubicoChallenge
failed_when: yubicoChallenge.rc != 0 or yubicoChallenge.stdout == ''
- name: Get current user
become: false
local_action: command whoami
register: username_on_host
- name: Get current user
become: false
local_action: command whoami
register: username_on_host
- name: Check yubico challenge exists
stat:
path: "/Users/{{ username_on_host.stdout }}/.yubico/challenge-{{ yubicoChallenge.stdout }}"
- name: Check yubico challenge exists
stat:
path: /Users/{{ username_on_host.stdout }}/.yubico/challenge-{{ yubicoChallenge.stdout }}
- name: Ensure yubikey is needed for authentication at login screen
lineinfile:
path: "{{ item }}"
regexp: '^auth.*pam_yubico.so.*'
line: "auth required /usr/local/lib/security/pam_yubico.so mode=challenge-response"
insertbefore: "^account required pam_opendirectory.so"
state: absent
with_items:
- /etc/pam.d/screensaver
- /etc/pam.d/authorization
- name: Ensure yubikey is needed for authentication at login screen
lineinfile:
path: '{{ item }}'
regexp: ^auth.*pam_yubico.so.*
line: auth required /usr/local/lib/security/pam_yubico.so mode=challenge-response
insertbefore: ^account required pam_opendirectory.so
state: absent
with_items:
- /etc/pam.d/screensaver
- /etc/pam.d/authorization

View File

@ -1,46 +1,46 @@
---
- hosts: localhost
connection: local
become_method: sudo
become: yes
- hosts: localhost
connection: local
become_method: sudo
become: yes
tasks:
- name: Check yubikey binaries are installed
stat:
path: "{{ item }}"
with_items:
- /usr/local/bin/ykpamcfg
- "/Applications/YubiKey\ Manager.app/Contents/MacOS/ykman"
tasks:
- name: Check yubikey binaries are installed
stat:
path: '{{ item }}'
with_items:
- /usr/local/bin/ykpamcfg
- /Applications/YubiKey Manager.app/Contents/MacOS/ykman
- name: Check Yubico is recognized
shell: "'/Applications/YubiKey Manager.app/Contents/MacOS/ykman' list | awk '{print $6}'"
register: yubicoChallenge
failed_when: "yubicoChallenge.rc != 0 or yubicoChallenge.stdout == ''"
- name: Check Yubico is recognized
shell: "'/Applications/YubiKey Manager.app/Contents/MacOS/ykman' list | awk '{print $6}'"
register: yubicoChallenge
failed_when: yubicoChallenge.rc != 0 or yubicoChallenge.stdout == ''
- name: Get current user
become: false
local_action: command whoami
register: username_on_host
- name: Get current user
become: false
local_action: command whoami
register: username_on_host
- name: Check yubico challenge exists
stat:
path: "/Users/{{ username_on_host.stdout }}/.yubico/challenge-{{ yubicoChallenge.stdout }}"
- name: Check yubico challenge exists
stat:
path: /Users/{{ username_on_host.stdout }}/.yubico/challenge-{{ yubicoChallenge.stdout }}
- name: Ensure yubikey is needed for authentication at login screen
lineinfile:
path: "{{ item }}"
regexp: '^auth.*pam_yubico.so.*'
line: "auth required /usr/local/lib/security/pam_yubico.so mode=challenge-response"
insertbefore: "^account required pam_opendirectory.so"
with_items:
- /etc/pam.d/screensaver
- /etc/pam.d/authorization
- name: Ensure yubikey is needed for authentication at login screen
lineinfile:
path: '{{ item }}'
regexp: ^auth.*pam_yubico.so.*
line: auth required /usr/local/lib/security/pam_yubico.so mode=challenge-response
insertbefore: ^account required pam_opendirectory.so
with_items:
- /etc/pam.d/screensaver
- /etc/pam.d/authorization
- name: Ensure touch id is enough to authenticate with sudo
lineinfile:
path: "{{ item }}"
regexp: '^auth.*sufficient.*pam_tid.so.*'
line: "auth sufficient pam_tid.so"
insertafter: "^#.*"
with_items:
- /etc/pam.d/sudo
- name: Ensure touch id is enough to authenticate with sudo
lineinfile:
path: '{{ item }}'
regexp: ^auth.*sufficient.*pam_tid.so.*
line: auth sufficient pam_tid.so
insertafter: ^#.*
with_items:
- /etc/pam.d/sudo

View File

@ -1,260 +1,51 @@
#!/usr/bin/env bash
# Make sure Code directory exists
echo "Hello $(whoami)! Let's get you set up."
# Make sure Code directory exists
echo "mkdir -p $HOME/Code"
mkdir -p ~/Code
ln -snf ~/Code/dotfiles/dot_scripts ~/.scripts
chmod +x ~/.scripts/*.sh
# Install missing package (Linux)
case "$(uname -s)" in
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
;;
esac
# Install HomeBrew
case "$(uname -s)" in
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
;;
esac
~/.scripts/install_linux_packages.sh
~/.scripts/install_homebrew.sh
# Path to ruby
export PATH="/usr/local/opt/ruby/bin:$PATH"
# Create symbolic links
echo "Creating symbolic links"
ln -snf ~/Code/dotfiles/dot_profile ~/.profile
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
ln -snf ~/Code/dotfiles/dot_scripts/checkci.sh /usr/local/bin/checkci
ln -snf ~/Code/dotfiles/dot_vimrc ~/.vimrc
# custom linters
ln -snf ~/Code/dotfiles/dot_vim/ale_linters ~/.vim/ale_linters
~/.scripts/symbolic_links.sh
ln -snf ~/Code/dotfiles/dot_aliases ~/.aliases
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
ln -snf ~/Code/dotfiles/requirements.txt ~/requirements.txt
ln -snf ~/Code/dotfiles/dot_surfraw.conf ~/.surfraw.conf
ln -snf ~/Code/dotfiles/private_dot_3llo/config.sh ~/.3llo_config
ln -snf ~/Code/dotfiles/dot_ansiweatherrc ~/.ansiweatherrc
ln -snf ~/Code/dotfiles/dot_p10k.zsh ~/.p10k.zsh
ln -snf ~/Code/dotfiles/dot_git-template ~/.git-template
ln -snf ~/Code/dotfiles/private_dot_newsboat ~/.newsboat
ln -snf ~/Code/dotfiles/private_dot_config/Code ~/.config/Code
ln -snf ~/Code/dotfiles/private_dot_config/neofetch ~/.config/neofetch
ln -snf ~/Code/dotfiles/private_dot_config/gh ~/.config/gh
ln -snf ~/Code/dotfiles/private_dot_config/htop ~/.config/htop
ln -snf ~/Code/dotfiles/private_dot_config/bashtop ~/.config/bashtop
ln -snf ~/Code/dotfiles/private_dot_config/wtf ~/.config/wtf
# Other symblinks + Install Docker Desktop for Mac
case "$(uname -s)" in
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
;;
esac
# Install dependencies (apps, fonts, ...) with Brew
case "$(uname -s)" in
Darwin)
echo "(Mac OS X) Brew installing stuff (apps, fonts, ...)"
ln -snf ~/Code/dotfiles/Brewfile ~/Brewfile
brew bundle
;;
esac
# Install dependencies (apps, fonts, ...) for CentOS
case "$(uname -s)" in
Linux)
echo "(CentOS) Installing stuff (apps, ...)"
chmod +x ~/Code/dotfiles/centos.sh
~/Code/dotfiles/centos.sh
;;
esac
# Install user applications
~/.scripts/install_macpackages.sh
~/.scripts/install_linux_user_apps.sh
# Switch to ZSH
echo "switching to ZSH"
command -v zsh >>/etc/shells
chsh -s "$(command -v zsh)"
# Use SDKMan to install development tools
echo "Installing SDKMan as development tools manager"
curl -s "https://get.sdkman.io" | bash
echo "SDKMan installing development tools"
sdk install java
sdk install gradle
sdk install java 8.0.222-zulu
sdk install kotlin
echo "SDKMan updating"
sdk selfupdate
case "$(uname -s)" in
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
;;
esac
# Install bundler for managing ruby dependencies and Gemfile
echo "Installing bundler for managing ruby dependencies and Gemfile"
sudo gem install bundler
bundle install
# Install Oh My Zsh and some cool dependencies
echo "Installing Oh My Zsh + customizing themes and plugins"
echo 'source /usr/local/opt/powerlevel10k/powerlevel10k.zsh-theme' ~/.zshrc >>!
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
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"
ln -snf ~/Code/dotfiles/dot_zshrc ~/.zshrc
ln -snf ~/Code/dotfiles/dot_zshrc.pre-oh-my-zsh ~/.zshrc.pre-oh-my-zsh
echo "Installing Vundle + VIM Plugins"
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
vim +PluginInstall +qall >/dev/null
#https://github.com/ycm-core/YouCompleteMe/blob/master/README.md#installation
cd "$HOME/.vim/bundle/YouCompleteMe" || exit
./install.py --all
cd "$HOME" || exit
git clone https://github.com/dbeniamine/cheat.sh-vim.git ~/.vim/cheat.sh-vim
# Install no-more-secrets
echo "Installing no-more-secrets (for fun)"
git clone https://github.com/bartobri/no-more-secrets.git ~/Code/no-more-secrets
cd "$HOME/Code/no-more-secrets" || exit
make nms sneakers
sudo make install
cd "$HOME" || exit
# OSX Defaults
case "$(uname -s)" in
Darwin)
echo "(Mac OS X) Loading preferences"
sudo sh .macos
;;
esac
# Customize /etc/hosts
echo "Overriding /etc/hosts"
curl https://someonewhocares.org/hosts/hosts -o /etc/hosts
# Install pip and pipenv
echo "Installing pip and pipenv"
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
case "$(uname -s)" in
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"
;;
esac
echo "Upgrading pip"
sudo pip install --upgrade pip
echo "Pip installing stuff"
pip install -r requirements.txt
# was used for some slack cli in python... https://pypi.org/project/slack-cli/
# pip3 install pipenv
# pyenv install 3.6.0
# Install baton (CLI to manage Spotify playback) https://github.com/joshuathompson/baton
case "$(uname -s)" in
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
;;
esac
# Use rustup to install the Rust compiler (rustc) and the Rust package manager (cargo).
echo "Installing Rust compiler and package manager"
rustup-init -y
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
echo "Installing moro, a productivity CLI tool"
npm install -g moro
echo "Install wiki cli tool"
npm install -g wikit
git clone https://github.com/sherlock-project/sherlock.git ~/Code/sherlock
cd sherlock || exit
python3 -m pip install -r requirements.txt
git config --global init.templateDir ~/.git-template
pre-commit init-templatedir ~/.git-template
~/.scripts/sdkmandeps.sh
~/.scripts/rubydeps.sh
~/.scripts/bundlerdeps.sh
~/.scripts/ohmyzshdeps.sh
~/.scripts/vimdeps.sh
~/.scripts/install_no-more-secrets.sh
~/.scripts/load_macos_defaults.sh
~/.scripts/configure_etc_hosts.sh
~/.scripts/pythondeps.sh
~/.scripts/install_baton.sh
~/.scripts/rustdeps.sh
~/.scripts/npmdeps.sh
terraform-docs completion zsh >/usr/local/share/zsh/site-functions/_terraform-docs
autoload -U compinit && compinit
go get -u -v github.com/jessfraz/dockfmt
go get -u -v github.com/dmlittle/scenery
go get -u -v github.com/camptocamp/terraboard
go get -u -v github.com/juliensalinas/torrengo
go get -u -v github.com/asciimoo/wuzz # Interactive cli tool for HTTP inspection
go get -u -v github.com/keilerkonzept/terraform-module-versions # detect new terraform modules versions
sudo curl -L git.io/scope -o /usr/local/bin/scope
sudo chmod a+x /usr/local/bin/scope
#scope launch
# Install bashtop (until brew manages it)
git clone https://github.com/aristocratos/bashtop.git ~/Code/bashtop
cd ~/Code/bashtop || exit
sudo make install
# Install awsls
BINDIR="/usr/local/bin" curl -sSfL https://raw.githubusercontent.com/jckuester/awsls/master/install.sh | sh -s v0.1.2
# Upgrade
echo "Upgrading apps"
~/.scripts/godeps.sh
~/.scripts/install_weavescope.sh
~/.scripts/install_bashtop.sh
~/.scripts/install_awsls.sh
~/.scripts/configure_git_hooks.sh
~/.scripts/upgrade.sh
# Reload
echo "Reloading config"
~/.scripts/reload.sh

View File

@ -0,0 +1,5 @@
#!/usr/bin/env bash
# Install bundler for managing ruby dependencies and Gemfile
echo "Installing bundler for managing ruby dependencies and Gemfile"
sudo gem install bundler
bundle install

View File

@ -1,9 +1,9 @@
#!/usr/bin/env bash
function _checkci() {
local username
username="$(git config --global -l | grep "user.email" | cut -d'@' -f1 | cut -d'=' -f2)"
local jenkinsfile="${1:-Jenkinsfile}"
curl --user "$username:$JENKINS_SECRET" -X POST -F "jenkinsfile=<$jenkinsfile" "$JENKINS_URL/pipeline-model-converter/validate"
local username
username="$(git config --global -l | grep "user.email" | cut -d'@' -f1 | cut -d'=' -f2)"
local jenkinsfile="${1:-Jenkinsfile}"
curl --user "$username:$JENKINS_SECRET" -X POST -F "jenkinsfile=<$jenkinsfile" "$JENKINS_URL/pipeline-model-converter/validate"
}
_checkci "$*"
exit 0

View File

@ -0,0 +1,4 @@
#!/usr/bin/env bash
# Customize /etc/hosts
echo "Overriding /etc/hosts"
curl https://someonewhocares.org/hosts/hosts -o /etc/hosts

View File

@ -0,0 +1,6 @@
#!/usr/bin/env bash
# Copy pre-commit hooks
cd ~/Code/dotfiles || exit
git config --global init.templateDir ~/.git-template
pre-commit init-templatedir ~/.git-template
copyhooks

8
dot_scripts/godeps.sh Normal file
View File

@ -0,0 +1,8 @@
#!/usr/bin/env bash
go get -u -v github.com/jessfraz/dockfmt
go get -u -v github.com/dmlittle/scenery
go get -u -v github.com/camptocamp/terraboard
go get -u -v github.com/juliensalinas/torrengo
go get -u -v github.com/asciimoo/wuzz # Interactive CLI tool for HTTP inspection
go get -u -v github.com/keilerkonzept/terraform-module-versions # detect new terraform modules versions
go get -u -v github.com/talos-systems/conform

View File

@ -0,0 +1,3 @@
#!/usr/bin/env bash
# Install awsls
BINDIR="/usr/local/bin" curl -sSfL https://raw.githubusercontent.com/jckuester/awsls/master/install.sh | sh -s v0.1.2

View File

@ -0,0 +1,6 @@
#!/usr/bin/env bash
# Install bashtop (until brew manages it)
git clone https://github.com/aristocratos/bashtop.git ~/Code/bashtop
cd ~/Code/bashtop || exit
sudo make install
cd "$HOME" || exit

View File

@ -0,0 +1,17 @@
#!/usr/bin/env bash
# Install baton (CLI to manage Spotify playback) https://github.com/joshuathompson/baton
case "$(uname -s)" in
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
;;
esac

View File

@ -1,13 +1,13 @@
#!/usr/bin/env bash
docker_app=$(find /Applications/ \
-name "Docker.app" -maxdepth 1 -mindepth 1 -type d)
-name "Docker.app" -maxdepth 1 -mindepth 1 -type d)
if [ -z "$docker_app" ]; then
echo 'Install Docker Desktop for Mac OS X'
curl -o ~/Downloads/Docker.dmg -sL https://download.docker.com/mac/stable/Docker.dmg
hdiutil verify ~/Downloads/Docker.dmg
hdiutil attach ~/Downloads/Docker.dmg -nobrowse
cp -R /Volumes/Docker/Docker.app /Applications/
hdiutil detach /Volumes/Docker
rm ~/Downloads/Docker.dmg
sudo /Applications/Docker.app/Contents/MacOS/Docker --quit-after-install --unattended
echo 'Install Docker Desktop for Mac OS X'
curl -o ~/Downloads/Docker.dmg -sL https://download.docker.com/mac/stable/Docker.dmg
hdiutil verify ~/Downloads/Docker.dmg
hdiutil attach ~/Downloads/Docker.dmg -nobrowse
cp -R /Volumes/Docker/Docker.app /Applications/
hdiutil detach /Volumes/Docker
rm ~/Downloads/Docker.dmg
sudo /Applications/Docker.app/Contents/MacOS/Docker --quit-after-install --unattended
fi

View File

@ -0,0 +1,12 @@
#!/usr/bin/env bash
# Install HomeBrew
case "$(uname -s)" in
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
;;
esac

View File

@ -0,0 +1,11 @@
#!/usr/bin/env bash
# Install missing package (Linux)
case "$(uname -s)" in
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
;;
esac

View File

@ -0,0 +1,9 @@
#!/usr/bin/env bash
# Install dependencies (apps, fonts, ...) for CentOS
case "$(uname -s)" in
Linux)
echo "(CentOS) Installing stuff (apps, ...)"
chmod +x ~/Code/dotfiles/centos.sh
~/Code/dotfiles/centos.sh
;;
esac

View File

@ -0,0 +1,10 @@
#!/usr/bin/env bash
# Install dependencies (apps, fonts, ...) with Brew
case "$(uname -s)" in
Darwin)
echo "(Mac OS X) Brew installing stuff (apps, fonts, ...)"
ln -snf ~/Code/dotfiles/Brewfile ~/Brewfile
brew bundle
;;
esac

View File

@ -0,0 +1,5 @@
#!/usr/bin/env bash
# Weave Scope is a visualization and monitoring tool for Docker and Kubernetes.
sudo curl -L git.io/scope -o /usr/local/bin/scope
sudo chmod a+x /usr/local/bin/scope
#scope launch

View File

@ -0,0 +1,8 @@
#!/usr/bin/env bash
# OSX Defaults
case "$(uname -s)" in
Darwin)
echo "(Mac OS X) Loading preferences"
sudo sh "$HOME/.macos"
;;
esac

11
dot_scripts/npmdeps.sh Normal file
View File

@ -0,0 +1,11 @@
#!/usr/bin/env bash
# Install pa11y tool for local webpage accessibility analysis
echo "Installing pa11y tool for local webpage accessibility analysis"
npm install -g pa11y
echo "Installing moro, a productivity CLI tool"
npm install -g moro
echo "Install wiki CLI tool"
npm install -g wikit
cd "$HOME" || exit

View File

@ -0,0 +1,10 @@
#!/usr/bin/env bash
# Install Oh My Zsh and some cool dependencies
echo "Installing Oh My Zsh + customizing themes and plugins"
echo 'source /usr/local/opt/powerlevel10k/powerlevel10k.zsh-theme' ~/.zshrc >>!
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
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"
ln -snf ~/Code/dotfiles/dot_zshrc ~/.zshrc
ln -snf ~/Code/dotfiles/dot_zshrc.pre-oh-my-zsh ~/.zshrc.pre-oh-my-zsh

26
dot_scripts/pythondeps.sh Normal file
View File

@ -0,0 +1,26 @@
#!/usr/bin/env bash
# Install pip and pipenv
echo "Installing pip and pipenv"
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
case "$(uname -s)" in
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"
;;
esac
echo "Upgrading pip"
sudo pip install --upgrade pip
echo "Pip installing stuff"
pip install -r requirements.txt
# was used for some slack CLI in python... https://pypi.org/project/slack-cli/
# pip3 install pipenv
# pyenv install 3.6.0
git clone https://github.com/sherlock-project/sherlock.git ~/Code/sherlock
cd sherlock || exit
python3 -m pip install -r requirements.txt

View File

@ -1,23 +1,28 @@
#!/usr/bin/env zsh
export SDKMAN_DIR="$HOME/.sdkman"
[[ -s "$SDKMAN_DIR/bin/sdkman-init.sh" ]] && source "$SDKMAN_DIR/bin/sdkman-init.sh"
# Reload
echo "Reloading config"
chmod +x ~/.scripts/*.sh
source ~/.zshrc
sdk use java 8.0.222-zulu
# Homebrew reloading stuff
case "$(uname -s)" in
Darwin)
echo "(Mac OS X) Homebrew reloading stuff"
brew bundle
;;
Darwin)
echo "(Mac OS X) Homebrew reloading stuff"
brew bundle
;;
esac
# OSX Defaults
case "$(uname -s)" in
Darwin)
sudo sh .macos
;;
Darwin)
sudo sh .macos
;;
esac
pip freeze >/Users/morganwattiez/Code/dotfiles/requirements.txt
bundle check

13
dot_scripts/rubydeps.sh Normal file
View File

@ -0,0 +1,13 @@
#!/usr/bin/env bash
case "$(uname -s)" in
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
;;
esac

5
dot_scripts/rustdeps.sh Normal file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env bash
# Use rustup to install the Rust compiler (rustc) and the Rust package manager (cargo).
echo "Installing Rust compiler and package manager"
rustup-init -y
rustup component add rustfmt

20
dot_scripts/sdkmandeps.sh Normal file
View File

@ -0,0 +1,20 @@
#!/usr/bin/env bash
# Use SDKMan to install development tools
echo "Installing SDKMan as development tools manager"
curl -s "https://get.sdkman.io" | bash
# Install missing package (Linux)
case "$(uname -s)" in
Linux)
source "/root/.sdkman/bin/sdkman-init.sh"
;;
esac
echo "SDKMan installing development tools"
sdk install java
sdk install gradle
sdk install java 8.0.222-zulu
sdk install kotlin
echo "SDKMan updating"
sdk selfupdate

View File

@ -0,0 +1,48 @@
#!/usr/bin/env bash
echo "Creating symbolic links"
ln -snf ~/Code/dotfiles/dot_profile ~/.profile
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
ln -snf ~/Code/dotfiles/dot_scripts/checkci.sh /usr/local/bin/checkci
ln -snf ~/Code/dotfiles/dot_vimrc ~/.vimrc
# custom linters
ln -snf ~/Code/dotfiles/dot_vim/ale_linters ~/.vim/ale_linters
ln -snf ~/Code/dotfiles/dot_aliases ~/.aliases
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
ln -snf ~/Code/dotfiles/requirements.txt ~/requirements.txt
ln -snf ~/Code/dotfiles/dot_surfraw.conf ~/.surfraw.conf
ln -snf ~/Code/dotfiles/private_dot_3llo/config.sh ~/.3llo_config
ln -snf ~/Code/dotfiles/dot_ansiweatherrc ~/.ansiweatherrc
ln -snf ~/Code/dotfiles/dot_p10k.zsh ~/.p10k.zsh
ln -snf ~/Code/dotfiles/dot_git-template ~/.git-template
ln -snf ~/Code/dotfiles/private_dot_newsboat ~/.newsboat
ln -snf ~/Code/dotfiles/private_dot_config/Code ~/.config/Code
ln -snf ~/Code/dotfiles/private_dot_config/neofetch ~/.config/neofetch
ln -snf ~/Code/dotfiles/private_dot_config/gh ~/.config/gh
ln -snf ~/Code/dotfiles/private_dot_config/htop ~/.config/htop
ln -snf ~/Code/dotfiles/private_dot_config/bashtop ~/.config/bashtop
ln -snf ~/Code/dotfiles/private_dot_config/wtf ~/.config/wtf
ln -snf ~/Code/dotfiles/private_dot_config/yamllint ~/.config/yamllint
ln -snf ~/Code/dotfiles/dot_git-template/.pre-commit-config.yaml ~/Code/dotfiles/.pre-commit-config.yaml
# Other symbolic links + Install Docker Desktop for Mac
case "$(uname -s)" in
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
;;
esac

View File

@ -3,14 +3,17 @@ export SDKMAN_DIR="$HOME/.sdkman"
[[ -s "$SDKMAN_DIR/bin/sdkman-init.sh" ]] && source "$SDKMAN_DIR/bin/sdkman-init.sh"
sdk selfupdate
# Upgrade
echo "Upgrading apps"
# Upgrading HomeBrew stuff
case "$(uname -s)" in
Darwin)
echo "(Mac OS X) Homebrew upgrading stuff"
brew update
#brew upgrade
brew outdated | xargs brew upgrade
;;
Darwin)
echo "(Mac OS X) Homebrew upgrading stuff"
brew update
#brew upgrade
brew outdated | xargs brew upgrade
;;
esac
bundle update --all
@ -25,3 +28,4 @@ pip freeze >~/requirements.txt
vim +PluginUpdate +qall >/dev/null
rustup-update
npm update -g moro
pre-commit autoupdate

9
dot_scripts/vimdeps.sh Normal file
View File

@ -0,0 +1,9 @@
#!/usr/bin/env bash
echo "Installing Vundle + VIM Plugins"
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
vim +PluginInstall +qall >/dev/null
#https://github.com/ycm-core/YouCompleteMe/blob/master/README.md#installation
cd "$HOME/.vim/bundle/YouCompleteMe" || exit
./install.py --all
cd "$HOME" || exit
git clone https://github.com/dbeniamine/cheat.sh-vim.git ~/.vim/cheat.sh-vim