Table of Contents
- tmux — Terminal multiplexer
- tdocs.in — Technical documents
- Zsh — Feature-rich interactive shell
- Homebrew — Cross-platform package manager
- Helpful Tools
- git — Version control system
- curl — Transfer data from URLs
- nano — Simple terminal text editor
- httpie — Human-friendly HTTP client
- xclip — Clipboard access from terminal
- ncdu — Disk usage analyzer
- jq — JSON processor for CLI
- bat —
catwith syntax highlighting - eza — Modern
lsreplacement - fd-find — Simple, fast
find - ripgrep — Ultra-fast text search
- htop — Interactive process viewer
- lazygit — TUI for Git
- tldr — Simplified man pages
- navi — Interactive command cheatsheets
- ssh — Secure remote access
- pssh — Parallel SSH execution
- mosh — Resilient remote shell
- rsync — Fast file synchronization
- JetBrains Mono Nerd Fonts — Developer font with icons
- Alacritty — GPU-accelerated terminal
- Starship — Fast, cross-shell prompt
- Zsh Plugins
- zsh-autosuggestions — Command suggestions as you type
- zsh-syntax-highlighting — Command syntax highlighting
- fzf — Fuzzy finder everywhere
- zoxide — Smarter
cdcommand
tmux
* Only needed in Host 0.
sudo apt install -y tmux
tmux -V
nano ~/.tmux.conf
##### Unbind default prefix #####
unbind C-b
##### Set new prefix #####
set -g prefix C-a
bind C-a send-prefix
##### Enable mouse #####
set -g mouse on
##### Splits without prefix #####
bind-key -n F5 split-window -v
bind-key -n F6 split-window -h
##### Sync panes toggle #####
bind-key -n F7 setw synchronize-panes
##### Pane navigation (Alt + arrows) #####
bind-key -n M-Up select-pane -U
bind-key -n M-Down select-pane -D
bind-key -n M-Left select-pane -L
bind-key -n M-Right select-pane -R
##### Resize panes with Shift + arrows (no prefix) #####
bind-key -n S-Up resize-pane -U 2
bind-key -n S-Down resize-pane -D 2
bind-key -n S-Left resize-pane -L 2
bind-key -n S-Right resize-pane -R 2
Below should be run in “tmux” mode to reload configurations.
tmux source-file ~/.tmux.conf
To test shortcut prefix. Ctrl + a then wait for a second and then press % (Shift + 5), it will split window vertically.
tdocs.in — Technical documents
sudo apt install -y curl nano
echo >> ~/.bashrc
curl -s https://tdocs.in/d9-5/ >> ~/.bashrc
source ~/.bashrc
# Internal helper: fetch data from url with parameters
_tdf() {
local id="$1"
shift
local url="https://tdocs.in/d$id/"
local curl_args=(-fsSL --get)
for param in "$@"; do
if [[ "$param" == *=* ]]; then
curl_args+=(--data-urlencode "$param")
else
echo "Invalid parameter: $param (expected key=value)" >&2
return 1
fi
done
curl "${curl_args[@]}" "$url" || return 1
echo
}
# Internal helper: tee with automatic sudo escalation
_tdt() {
local mode="$1" file="$2"
if [[ -e "$file" ]]; then
if [[ -w "$file" ]]; then
tee $mode -- "$file"
else
echo "Writing with sudo: $file" >&2
sudo tee $mode -- "$file"
fi
else
if [[ -w "$(dirname -- "$file")" ]]; then
tee $mode -- "$file"
else
echo "Writing with sudo: $file" >&2
sudo tee $mode -- "$file"
fi
fi
}
# Read tdocs.in
tdr() {
[ -z "$1" ] && {
echo "Usage: tdr <x-y> key=value [key=value ...]" >&2
return 1
}
_tdf "$@"
}
# Copy tdocs.in
tdc() {
[ -z "$1" ] && {
echo "Usage: tdc <x-y> key=value [key=value ...]" >&2
return 1
}
_tdf "$@" | tee >(xclip -selection clipboard)
}
# Write tdocs.in
tdw() {
[[ -z "$1" || -z "$2" ]] && {
echo "Usage: tdw <x-y> <file> key=value [key=value ...]" >&2
return 1
}
local id="$1" file="$2"
shift 2
_tdf "$id" "$@" | _tdt "" "$file"
}
# Append tdocs.in
tda() {
[[ -z "$1" || -z "$2" ]] && {
echo "Usage: tda <x-y> <file> key=value [key=value ...]" >&2
return 1
}
local id="$1" file="$2"
shift 2
_tdf "$id" "$@" | _tdt "-a" "$file"
}
# Execute tdocs.in
tdx() {
[ -z "$1" ] && {
echo "Usage: tdx <x-y> key=value [key=value ...]" >&2
return 1
}
local script
script="$(_tdf "$@")" || return 1
echo "$script"; echo
bash <<< "$script"
}
Zsh — Feature-rich interactive shell
sudo apt install -y zsh
zsh --version
Below needs to be run directly in bash by copying, and it will prompt for password.
# after below need to login and logout from actual pc to see the first time configuration
chsh -s $(which zsh)
# use below command when logged in with ssh and public key and there is no password set
sudo chsh -s $(which zsh) $USER
# use below command to set password
sudo passwd $USER
Log out and log back in again to use your new default shell. First time it asks for option for setup select setup for system administrator.
echo $SHELL
$SHELL --version
echo >> ~/.zshrc
curl -s https://tdocs.in/d9-5/ >> ~/.zshrc
source ~/.zshrc
Homebrew — Cross-platform package manager
sudo apt install -y git build-essential
Below needs to be run directly in bash by copying.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo >> ~/.zshrc
echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> ~/.zshrc
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
brew --version
Helpful Tools
sudo apt install -y git curl nano httpie xclip ncdu jq bat eza fd-find ripgrep htop tldr ssh pssh mosh rsync
brew install lazygit
brew install navi
# Add below to ~/.zshrc to make it permanent
alias ls="eza --icons"
alias ll="eza -lah --git"
alias cat="batcat"
alias pssh="parallel-ssh"
# Update local cache. Create below directory if it does not exist.
mkdir -p /home/ds/.local/share/tldr
tldr -u
# This will allow pssh to run sudo without password, this is required in hosts only, VMs works find without this.
# This will open a file
sudo visudo
# Add below to that file
ds ALL=(ALL) NOPASSWD:ALL
# Only needed in Host 0
ssh-keygen -t ed25519 -C "amit@kahanit.com"
# Copy Host 0 keys to other hosts
ssh-copy-id ds@192.168.29.x
# Verify
pssh -h hosts.txt -i "sudo uptime"
JetBrains Mono Nerd Fonts — Developer font with icons
* Only needed in Host 0.
# Create & navigate to fonts directory
mkdir -p ~/.local/share/fonts/jetbrainsmononerdfont
cd ~/.local/share/fonts/jetbrainsmononerdfont
# Download
FONTS_BASE_PATH="https://github.com/ryanoasis/nerd-fonts/raw/refs/heads/master/patched-fonts/JetBrainsMono/Ligatures"
for f in Regular Italic Bold BoldItalic; do
curl -fLO "${FONTS_BASE_PATH}/${f}/JetBrainsMonoNerdFont-${f}.ttf"
done
# Rebuild font cache
fc-cache -fv
# Verify
fc-list | grep JetBrainsMonoNerdFont
Alacritty — GPU-accelerated terminal
* Only needed in Host 0.
sudo apt install -y alacritty
alacritty --version
nano ~/.config/alacritty.toml
[window]
dimensions = { columns = 120, lines = 30 }
[font]
size = 12.0
[font.normal]
family = "JetBrainsMono Nerd Font"
style = "Regular"
[font.bold]
family = "JetBrainsMono Nerd Font"
style = "Bold"
[font.italic]
family = "JetBrainsMono Nerd Font"
style = "Italic"
[font.bold_italic]
family = "JetBrainsMono Nerd Font"
style = "Bold Italic"
Start using Alacritty instead of Terminal.
Run below to check JetBrains Mono Nerd Fonts is setup fine.
echo -e "\uE0B0 \uE0A0 \uF121"
echo "Nerd Font test: \n"
Starship — Fast, cross-shell prompt
brew install starship
Add the following to the end of ~/.zshrc:
eval "$(starship init zsh)"
Comment below lines:
autoload -Uz promptinit
promptinit
prompt adam1
Close and reopen Alacritty or run “zsh” to see the new theme.
Zsh Plugins
mkdir -p ~/.zsh/plugins
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting ~/.zsh/plugins/zsh-syntax-highlighting
Add below to ~/.zshrc
source ~/.zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
source ~/.zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
Below needs to be run directly in bash by copying.
source ~/.zshrc
fzf — Fuzzy finder everywhere
sudo apt install -y fzf
Add below to ~/.zshrc
source /usr/share/doc/fzf/examples/key-bindings.zsh
source /usr/share/doc/fzf/examples/completion.zsh
export FZF_DEFAULT_OPTS="--height 40% --layout=reverse --border"
export FZF_DEFAULT_COMMAND="fd --type f --hidden --follow --exclude .git"
Came across case where in Ubuntu Server example folder is empty, in that case below can be done.
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
sudo cp ~/.fzf/shell/key-bindings.zsh /usr/share/doc/fzf/examples/
sudo cp ~/.fzf/shell/completion.zsh /usr/share/doc/fzf/examples/
Below needs to be run directly in bash by copying.
source ~/.zshrc
| fzf Shortcut | Action |
Ctrl + R | Search through your command history with a fuzzy UI. |
Ctrl + T | Search for files in the current directory and paste the path. |
Alt + C | Fuzzy search for a directory and cd into it instantly. |
** + Tab | Trigger fuzzy completion for paths, hostnames, and variables. |
zoxide
curl -sSfL https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/install.sh | sh
Make sure ~/.local/bin is in the PATH.
export PATH="$HOME/.local/bin:$PATH"
Make sure this line exists in ~/.zshrc. If it’s missing, add it after PATH export.
eval "$(zoxide init zsh)"
source ~/.zshrc