Skip to content

Instantly share code, notes, and snippets.

@gbarre
Created January 28, 2021 14:23
Show Gist options
  • Save gbarre/5b68ceab098f6a9466bbd5535ea3a613 to your computer and use it in GitHub Desktop.
Save gbarre/5b68ceab098f6a9466bbd5535ea3a613 to your computer and use it in GitHub Desktop.
How to install my zsh environment

MyScripts

A simple repo to store my srcipts.

Install procedure

# Prepare
sudo apt install -y vim curl
mkdir ~/git && cd ~/git

# Install git
sudo apt install -y git

# Clone repo
git clone [email protected]:gbarre/MyScripts.git

# Install zsh & colorls (&ruby) & colordiff
sudo apt install -y terminator zsh powerline fonts-powerline zsh-syntax-highlighting ruby ruby-dev ruby-colorize libncurses5-dev libtinfo-dev colordiff xclip
sudo gem install colorls

# Install oh-my-zsh
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

# Install Powerlevel9k theme
git clone https://github.com/bhilburn/powerlevel9k.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/themes/powerlevel9k

# Install Powerlevel10k theme
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/themes/powerlevel10k

# Install zsh autocompletion
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions

# Install kubectx
git clone [email protected]:ahmetb/kubectx.git
sudo mv kubectx /opt
sudo ln -s /opt/kubectx/kubectx /usr/local/bin/kubectx
sudo ln -s /opt/kubectx/kubens /usr/local/bin/kubens
mkdir -p ~/.oh-my-zsh/completions
chmod -R 755 ~/.oh-my-zsh/completions
ln -s /opt/kubectx/completion/kubectx.zsh ~/.oh-my-zsh/completions/_kubectx.zsh
ln -s /opt/kubectx/completion/kubens.zsh ~/.oh-my-zsh/completions/_kubens.zsh

# Install kubectl
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl

# Install fzf
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install

# Symlink `.zshrc` in my home
cd && rm .zshrc
ln -s ~/git/MyScripts/zshrc /home/gbarre2/.zshrc

# Symlink `.screenrc` in my home
cd && rm .screenrc
ln -s ~/git/MyScripts/screenrc /home/gbarre2/.screenrc

# Font
wget https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/Hack.zip
mkdir ~/.fonts/nerdFont
unzip Hack.zip -d ~/.fonts/nerdFont
sudo ln -s ~/.fonts/nerdFont /usr/share/fonts/nerdFont
sudo fc-cache -fv

# Install thefuck
sudo apt install -y python3-dev python3-pip python3-setuptools
sudo pip3 install thefuck

# Then configure terminator to use the nerd font
# Enjoy!

Content

  1. bernes : specifics scripts used @ bernes
  2. dagobah : backup scripts on dagobah
  3. functions :
    1. ch : check my /etc/hosts file
    2. dsiVPN : simple script to (dis)connect VPN @ DSI
    3. gitCommitPush : all in one
    4. lanScan : scan local lan
    5. MyNotes: open VS Code into my notes directory
    6. MyVPN : (un)set VPN with autocompletion (cf _MyVPNCompletion in sources)
    7. pullMyGits : simple script to pull all my git repo stored in myGitScriptsDir
  4. macos : MacOs scripts
  5. misc : included files, needed by other scripts
  6. sources :
    1. _MyVPNCompletion : add autocompletion for MyVPN
    2. common : some functions used in others scripts
    3. gclonecd : clone a git repo and cd into
    4. kubectlFunc : load/unload kubeconfig for managing k8s cluster => Useless with kubectx...
    5. myBashFunc : all my personnal functions
  7. p10k.zsh: oh_my_zsh theme config
  8. README : this file :-D
  9. zshrc : my zsh config, aliases & sourcing files from this repo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment