diff --git a/bootstrap.zsh b/bootstrap.zsh index fac6017..68c8325 100755 --- a/bootstrap.zsh +++ b/bootstrap.zsh @@ -1,10 +1,7 @@ #!/usr/bin/env bash # this script initialises a new computer with shell settings I am familar with -set -e - -echo "Installing oh-my-zsh" -sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" +set -ex echo "Installing xcode CLI tools" xcode-select --install || true @@ -15,7 +12,6 @@ then /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" fi - echo "Linking RC files " mkdir -p ~/.dotfiles_backup @@ -34,19 +30,19 @@ for f in rc_files/*; do done -echo "link Sublime Text" -if [ -f "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" ] \ -&& [ ! -e /usr/local/bin/subl ]; then - ln -sv "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl -else - echo "already exists, skipping" -fi +# echo "link Sublime Text" +# if [ -f "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" ] \ +# && [ ! -e /usr/local/bin/subl ]; then +# ln -sv "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl +# else +# echo "already exists, skipping" +# fi echo "brew installs" -software_list=( gcc bash tig icdiff +software_list=( bash tig icdiff vim zsh-syntax-highlighting \ - zsh-autosuggestions python kubectx watch ) + zsh-autosuggestions watch ) for item in "${software_list[@]}"; do if ! brew list | grep -q "$item"; then echo "Installing fresh $item" @@ -73,6 +69,6 @@ fi echo "Configuring VIM" vim +PlugInstall +qall -cp patches/minimap_settings.py ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User +# cp patches/minimap_settings.py ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User echo "Done configuring the system......." diff --git a/install_zsh.sh b/install_zsh.sh new file mode 100755 index 0000000..448b783 --- /dev/null +++ b/install_zsh.sh @@ -0,0 +1,4 @@ +set -e + +echo "Installing oh-my-zsh" +sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" diff --git a/rc_files/aliases b/rc_files/aliases index 8800e0f..c554a4c 100644 --- a/rc_files/aliases +++ b/rc_files/aliases @@ -175,6 +175,3 @@ alias dc='docker-compose' alias dcr='docker-compose run --rm' alias dcb='docker-compose build' alias dcu='docker-compose up' - -alias python="python3" -alias pip="pip3" diff --git a/rc_files/exports b/rc_files/exports index bd18afc..01485b2 100644 --- a/rc_files/exports +++ b/rc_files/exports @@ -47,28 +47,14 @@ export MANPAGER='less -X'; export DOCKER_ID_USER='songgithub' -# for Py env -export PYENV_VERSION='3.6.3' -export PYENV_ROOT="$HOME/.pyenv" -export PATH="$PYENV_ROOT/bin:$PATH" - -## Prefer to use Pyvenv instead of virtualenv -export PYENV_VIRTUALENVWRAPPER_PREFER_PYVENV="true" - - -# virtualenv wrapper -export WORKON_HOME=$HOME/.virtualenvs -export PROJECT_HOME=$HOME/code -export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python3 -export VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv - - # GOPATH -export GOPATH=$HOME/go-workspace -export GOROOT=/usr/local/opt/go/libexec +export GOPATH=$HOME/go +export GOROOT=/usr/local/go/bin export GOBIN=$GOPATH/bin export PATH="$PATH:$GOPATH/bin" export PATH="$PATH:$GOROOT/bin" export PATH="$PATH:$HOME/bin" - +# NAB - brew without need for root permission +export PATH=~/apps/homebrew/bin:$PATH +export GOROOT=/Users/p783881/apps/homebrew/Cellar/go/1.12.5/libexec \ No newline at end of file diff --git a/rc_files/functions b/rc_files/functions index f092100..3610a77 100644 --- a/rc_files/functions +++ b/rc_files/functions @@ -276,3 +276,6 @@ function fetch-all() { git branch --track "${branch##*/}" "$branch" done } + +# open VsCode from terminal +code () { VSCODE_CWD="$PWD" open -n -b "com.microsoft.VSCode" --args $* ;} \ No newline at end of file diff --git a/rc_files/nab_rc b/rc_files/nab_rc new file mode 100644 index 0000000..5c4768b --- /dev/null +++ b/rc_files/nab_rc @@ -0,0 +1,7 @@ +export PATH=~/apps/homebrew/bin:$PATH +export PATH=/Users/$(whoami)/apps/homebrew/Cellar/go/1.12.5/bin:$PATH + +. ~/.profile +# run_cntlm + +source /Users/$(whoami)/apps/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh \ No newline at end of file diff --git a/rc_files/reece_rc b/rc_files/reece_rc deleted file mode 100644 index 664c7d4..0000000 --- a/rc_files/reece_rc +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env bash -# REECE specific settings - -function auth-non-prod-a() { - kubectl config set-cluster non-prod-a --server=https://10.99.10.225:6443 --certificate-authority=/tmp/nonprod-ca.crt --embed-certs=true - kubectl config set-credentials azure-user-config --auth-provider=azure --auth-provider-arg=apiserver-id=1f4e75bb-714c-4a10-985b-14ff3a1034dc --auth-provider-arg=client-id=449d806e-d055-485b-b453-a7b3b1425935 --auth-provider-arg=tenant-id=fa5a8b25-2ea1-4eba-80e2-a0a945e1dc36 - kubectl config set-context nonprod-a --cluster=non-prod-a --user=azure-user-config - kubectl config use-context nonprod-a -} - -function auth-non-prod-b() { - kubectl config set-cluster non-prod-b --server=https://apiserver.b.test.reecenet.org:6443 --certificate-authority=/tmp/nonprod-ca.crt --embed-certs=true - kubectl config set-credentials azure-user-config --auth-provider=azure --auth-provider-arg=apiserver-id=1f4e75bb-714c-4a10-985b-14ff3a1034dc --auth-provider-arg=client-id=449d806e-d055-485b-b453-a7b3b1425935 --auth-provider-arg=tenant-id=fa5a8b25-2ea1-4eba-80e2-a0a945e1dc36 - kubectl config set-context nonprod-b --cluster=non-prod-b --user=azure-user-config - kubectl config use-context nonprod-b -} - -function auth-prod() { - kubectl config set-cluster prod-a --server=https://10.99.10.151:6443 --certificate-authority=/tmp/prod-ca.crt --embed-certs=true - kubectl config set-credentials azure-user-config --auth-provider=azure --auth-provider-arg=apiserver-id=1f4e75bb-714c-4a10-985b-14ff3a1034dc --auth-provider-arg=client-id=449d806e-d055-485b-b453-a7b3b1425935 --auth-provider-arg=tenant-id=fa5a8b25-2ea1-4eba-80e2-a0a945e1dc36 - kubectl config set-context prod-a --cluster=prod-a --user=azure-user-config - kubectl config use-context prod-a -} - -function auth-dmz-non-prod() { - kubectl config set-cluster dmznon-prod --server=https://172.24.21.226:6443 --certificate-authority=/tmp/nonprod-ca.crt --embed-certs=true - kubectl config set-credentials azure-user-config --auth-provider=azure --auth-provider-arg=apiserver-id=1f4e75bb-714c-4a10-985b-14ff3a1034dc --auth-provider-arg=client-id=449d806e-d055-485b-b453-a7b3b1425935 --auth-provider-arg=tenant-id=fa5a8b25-2ea1-4eba-80e2-a0a945e1dc36 - kubectl config set-context dmznonprod --cluster=dmznon-prod --user=azure-user-config - kubectl config use-context dmznonprod -} - - -function auth-dmz-prod() { - kubectl config set-cluster dmzprod --server=https://172.24.17.226:6443 --certificate-authority=/tmp/prod-ca.crt --embed-certs=true - kubectl config set-credentials azure-user-config --auth-provider=azure --auth-provider-arg=apiserver-id=1f4e75bb-714c-4a10-985b-14ff3a1034dc --auth-provider-arg=client-id=449d806e-d055-485b-b453-a7b3b1425935 --auth-provider-arg=tenant-id=fa5a8b25-2ea1-4eba-80e2-a0a945e1dc36 - kubectl config set-context dmzprod --cluster=dmzprod --user=azure-user-config --namespace=kube-system - kubectl config use-context dmzprod -} diff --git a/rc_files/zshrc b/rc_files/zshrc index ceb90c6..d727905 100644 --- a/rc_files/zshrc +++ b/rc_files/zshrc @@ -51,7 +51,7 @@ plugins=( export PATH="$PATH:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" source $ZSH/oh-my-zsh.sh -custom_list=(.aliases .functions .exports .kuberc .admin_kuberc .myob_rc .reece_rc) +custom_list=(.aliases .functions .exports .kuberc .admin_kuberc .myob_rc .nab_rc) for item in ${custom_list[@]}; do source ~/"$item" done @@ -60,7 +60,7 @@ done test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh" # kb auto suggestions -source <(kubectl completion zsh) +# source <(kubectl completion zsh) # adding zsh-autosuggestions.zsh -source /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh +# source /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh