
A Linux Development Desktop with VMware Horizon - Part III: Shell
High ⚡ Way to Shell
The operationalization of platforms such as e.g. Kubernetes, or the use of tools for building services or applications such as Docker, requires in both cases the use of the command-line. There are dozens of great plugins, themes and extensions out there to pimp your shell so that it´ll help you to increase velocity as well as useability.
Part III of my series is focused on the Shell and which “Highway” you can take to have the described tool available at the end.
1. ZSH aka Z shell
ZSH is a extended shell with lots of features, support for plugins and themes.
Ubuntu:
sudo apt install zshCentOS:
Should be installed by default.
sudo yum install zsh2. Oh My ZSH
A community-driven framework for managing your Z shell configuration.
Ubuntu:
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"CentOS:
sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"Verify if ZSH is set as your new default Shell:
echo $SHELL
cat /etc/passwd | grep "username"2.1 ZSH Syntax Highlighting
https://github.com/zsh-users/zsh-syntax-highlighting
This plugin enables highlighting of commands whilst they are typed and it´ll help you to avoid syntax erros before you run a command.
CentOS & Ubuntu:
Let´s clone the repository into our oh-my-zsh plugins directory:
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlightingEnable the plugin in your zsh config file (~/.zshrc) in the “plugins section”.
plugins=(git pks zsh-syntax-highlighting)Restart your terminal.
2.2 Install Powerline Fonts
https://github.com/powerline/fonts
Needed fonts for the Powerlevel9k theme (step 4.).
Ubuntu:
sudo apt install fonts-powerlineCentOS:
git clone https://github.com/powerline/fonts.git --depth=1
cd fonts
./install.sh
cd ..
rm -rf fonts2.3 Powerlevel9k
https://github.com/Powerlevel9k/powerlevel9k
This theme will give your shell a new shine.
CentOS & Ubuntu:
git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k
vim ~/.zshrcReplace the default ZSH_THEME with the new Powerlevel9k theme:
ZSH_THEME="powerlevel9k/powerlevel9k"The Powerlevel9k theme gives you some pretty neat customization options which makes your terminal even more powerful.
Here´s my configuration:
POWERLEVEL9K_SHORTEN_DIR_LENGTH=3
POWERLEVEL9K_SHORTEN_DELIMITER=””
POWERLEVEL9K_PROMPT_ON_NEWLINE=true
POWERLEVEL9K_SHORTEN_STRATEGY=”truncate_from_right”
POWERLEVEL9K_TIME_BACKGROUND=blue
POWERLEVEL9K_DATE_BACKGROUND=cyan
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(kubecontext time date)
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(user dir vcs)And you should also paste the following variable to the top of your .zshrc file, otherwise you will get an error when using tmux later.
export TERM="xterm-256color"A logout or reboot of the system is necessary for the changes to take effect.
The result:
I love it! And it doesn´t only looks good, it also comes in very handy if you work e.g. with Git as you can see on Figure II for example. The right screenshot shows you that I am in a git branch called featurebranch and the color indicates me, that my workingtree is either clean and theres nothing to commit (green) or that new files were added and needs to be commited (orange).
More! More! More!
3 Homebrew on Linux 🍺
https://docs.brew.sh/Homebrew-on-Linux
Homebrew is a package manager (like Snappy) which simplifies the installation of software on your OS and should not be missing if you ask me.
CentOS & Ubuntu:
sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"The installation-script will throw a Warning at the end, because it points out that /home/linuxbrew/.linuxbrew/bin isn´t in your PATH.
Add the path to your .zshrc dot-file.
vim ~/.zshrc
export PATH=$PATH:"/home/linuxbrew/.linuxbrew/bin"
source ~/.zshrc4 CLI´s and tools
…I´m using and I´d like to recommend
kubectl - https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl-on-linux
brew install kubectl4.1 ZSH Autocompletion for kubectl
https://v1-16.docs.kubernetes.io/docs/reference/kubectl/cheatsheet/#kubectl-autocomplete
source <(kubectl completion zsh)
echo "if [ $commands[kubectl] ]; then source <(kubectl completion zsh); fi" >> ~/.zshrc4.2 Powershell
https://snapcraft.io/powershell
Installation via snap:
sudo snap install powershell --classic4.3 KinD - Kubernetes in Docker
https://github.com/kubernetes-sigs/kind
4.4 Octant
https://github.com/vmware-tanzu/octant

4.5 tmux
tmux is a terminal multiplexer.Enable Mouse-scrolling: Scrolling the terminal pages by using the mouse-wheel is natural for me and because it´s not enabled by default when using tmux I need to enable it. Settings like this for example can be applied while running tmux. Press ctrl + b and then type :set -g mouse on.
4.6 bat
https://github.com/sharkdp/bat
bat is a cat clone with syntax highlighting and Git integration.4.7 glances
https://github.com/nicolargo/glances
glances is a cross-platform monitoring tool.4.8 htop
https://github.com/hishamhm/htop
htop is an interactive process viewer.4.9 ctop
https://github.com/bcicen/ctop
ctop provides a concise and condensed overview of real-time metrics for multiple containers:4.10 prettyping
https://github.com/denilsonsa/prettyping
prettyping is a wrapper around the standard ping tool with the objective of making the output prettier, more colorful, more compact, and easier to read.And all of them can be easily installed via brew:
brew install kind octant tmux bat glances htop ctop prettypingAddtionally to htop, ytop (former gotop) is a pretty neat process and system monitor.
4.11 ytop
https://github.com/cjbassi/ytop
brew tap cjbassi/ytop && brew install ytop
4.12 figlet
4.13 lolcat
https://github.com/busyloop/lolcat
brew install figlet lolcat
figlet cliFun | lolcat _ _ _____
___| (_) ___| _ _ __
/ __| | | |_ | | | | '_ \
| (__| | | _|| |_| | | | |
\___|_|_|_| \__,_|_| |_|4.14 cowsay
You should have a look at this post regarding cowsay 😄: “cowsay is the Most Important Unix-like Command Ever”
brew install cowsay
cowsay -f vader I am your...LOL!
__________________
< I am your...LOL! >
------------------
\ ,-^-.
\ !oYo!
\ /./=\.\______
## )\/\
||-----w||
|| ||
Cowth VaderLast but not least!
4.15 Asciinema
A perfect way how you can easily record your terminal sessions.
brew install asciinema
asciinema rec5 Shell Aliases
Put the following aliases for the individual commands to the end of your .zshrc file
tmux
alias tmuxinit="tmux new-session -n init"
alias c=clear
alias k=kubectl
alias w='watch -n1'
alias ping=prettyping
alias cat=batChange Log:
- [2020-03-10]: Added Enable Mouse-scrolling for
tmux; ZSH Syntax Highlighting; Powerlevel9k configuration - [2020-03-10]: Updated Figure II
- [2020-03-18]: Added Glances & Powershell