Install Homebrew, the "missing package manager for macOS"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Install iTerm2
Install the ZSH Shell
and make sure it is your default shell.
brew install zsh
chsh -s /bin/zsh
-
kubectl
necessary for kubernetes -
kubectx
fast switch between your kubectls -
vundle
the vim package manager -
fzf
useful search tool -
YouCompleteMe
basically best "IDE" -
Zsh syntax highlighting
smart syntax highlighter for shell -
bpytop
personal recommendation when it comes to system monitoring -
dive
tool for exploring a docker image and its layer contents -
watch
executes a program periodically, showing output fullscreen
-
dockly
clear and handy docker container manager -
k9s
pretty much dockly for k8s -
httpie
universal HTTP REST client, better than postman! -
neovim
basically the future of vim - use vim if you spend serious time inside the terminal -
fx
handy json viewer -
jq
lightweight and flexible command-line JSON processor -
hacker-quotes
why not -
cpulimit
limit cpu usage of a process, helpful in diverse ways -
step-cli
inspect JWT tokens -
colima
Container Runtime without unnecessary UI (I'm looking at you DockerDesktop)
alias watch='watch '
# required to make alias work with watchalias sudo='sudo '
alias k=kubectl
alias ktx=kubectx
alias kns=kubens
alias ll="ls -color -ahl"
alias ports="lsof -i -P -n | grep LISTEN"
alias nano=nvim
alias p3="python3"
alias gpgkeys="gpg --list-secret-keys --keyid-format LONG"
alias trim="sed -i 's/[ \t]*$//'"
alias ggrep="git grep -n"
alias dc=docker-compose
alias pip=noglob pip
alias prep-dive='sudo ln -sf ~/.colima/docker.sock /var/run/docker.sock'
git config --global alias.cp cherry-pick
git config --global alias.pr pull --rebase
Errors regarding gnupg might occurre once you want to sign your commits using gpg keys.
brew upgrade gnupg
brew link --overwrite gnupg
brew install pinentry-mac
echo "pinentry-program /usr/local/bin/pinentry-mac" >> ~/.gnupg/gpg-agent.conf
killall gpg-agent
Load Git config depending on repo path
[user]
name = zk
email = [email protected]
signingkey = foobar
gpgsign = true
[alias]
cp = cherry-pick
pr = pull --rebase
[includeIf "gitdir:/Users/zk/dev/github.com/**"]
path = /Users/zk/.gitconfig-zk
[includeIf "gitdir:/Users/zk/dev/github.work/**"]
path = /Users/zk/.gitconfig-work
function whaling() {
ps ax|grep -i docker|egrep -iv 'grep|com.docker.vmnetd'|awk '{print $1}'|xargs kill
}
function mouse() {
ps ax|grep -i Options.app/Contents/Support/LogiMgrDaemon.app/Contents/MacOS/LogiMgrDaemon|egrep -iv 'grep --color=auto --exclude-dir'|awk '{print $1}'|xargs kill
}
function jwtd() {
if [[ -x $(command -v jq) ]]; then
jq -R 'split(".") | .[0],.[1] | @base64d | fromjson' <<< "${1}"
echo "Signature: $(echo "${1}" | awk -F'.' '{print $3}')"
fi
}
Display the current kubectx as iTerm2 Badge:
- install
iTerm2 Shell Integration
:wget https://iterm2.com/misc/install_shell_integration.sh
- to prevent misconfiguration adapt the script do directly detect
zsh
as your shell (line 10) - execute install script (
chmod +x ...
) - append following function to
.zshrc
right aftersource iterm_shell_integration
function iterm2_print_user_vars() {
iterm2_set_user_var kube_context $(kubectl config current-context 2>/dev/null)
iterm2_set_user_var kube_ns $(kubectl config view --minify --output 'jsonpath={..namespace}'; echo)
}
- go to iTerm > Preferences > Profiles > General and set
\(user.kube_context)\n\(user.kube_ns)
as badge - I recommand to re-init
zsh
the the very end of.zshrc
Install GnuCoreUtils with g-prefix
brew install coreutils findutils gnu-tar gnu-sed gawk gnutls gnu-indent gnu-getopt grep
If you want to use them without g-prefix, adjust your PATH and MANPATH (add before anything else).
PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
MANPATH="/usr/local/opt/coreutils/libexec/gnuman:$MANPATH"