Linux system setup
Basic Installations
Arch Linux
sudo pacman -Syu gcc make cmake python3 python-pip git wget nvim zsh cloudflared openssh rsync rclone
sudo chsh -s $(which zsh) $(whoami)
# Then, ensure visudo has:
# %wheel ALL=(ALL:ALL) ALL
Debian / Ubuntu
# To add 'myuser' to the 'sudo' group
sudo usermod -aG sudo myuser
Fedora / RHEL / CentOS
# To add 'myuser' to the 'wheel' group
sudo usermod -aG wheel myuser
# Typically, wheel group is already configured in /etc/sudoers
oh-my-zsh installation
## Install oh-my-zsh
sh -c "$(wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
## Install plugins
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-history-substring-search ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-history-substring-search
## Replace the default plugins with the following
sed -i.bak '/^plugins=.*/c\
plugins=(\
git\
zsh-syntax-highlighting\
zsh-autosuggestions\
zsh-history-substring-search\
)' ~/.zshrc
Generate SSH keys
ssh-keygen -t ed25519 -C "pc"
cat ~/.ssh/id_ed25519.pub
Add servers
mkdir -p ~/.ssh
echo "Host gila
Hostname gila.navraj.me
User gila
Port 22
ProxyCommand cloudflared access ssh --hostname %h
Host sol
Hostname sol.asu.edu
User sroy85
Port 22
ProxyJump gila" >> ~/.ssh/config
Add zshrc functions
mo() {
# Check if an argument was provided
if [ -z "$1" ]; then
echo "Usage: mo <directory_name>"
return 1 # Indicate an error
fi
# Attempt to create the directory.
# -p: no error if existing, make parent directories as needed
# --: ensures that $1 isn't misinterpreted as an option if it starts with '-'
if mkdir -p -- "$1"; then
# If mkdir was successful, try to cd into it
if cd -- "$1"; then
return 0 # Success
else
echo "Error: Successfully created directory '$1', but could not cd into it." >&2
return 1 # Indicate an error
fi
else
# mkdir failed. mkdir itself usually prints an error.
# We can add a generic one too.
echo "Error: Could not create directory '$1'." >&2
return 1 # Indicate an error
fi
}
Enjoy Reading This Article?
Here are some more articles you might like to read next: