Update System

# Debian
apt update
# Fedora
dnf update

Install Most Used Tools

# Debain
apt install -y neofetch htop tree ncdu ranger zsh vim neovim git curl wget net-tools
# Fedora
dnf install -y neofetch htop tree ncdu ranger zsh vim neovim git curl wget util-linux-user

Create Sudo User

# Debian
adduser aimer
usermod -aG sudo aimer
# Fedora
useradd -G wheel aimer
passwd aimer

Test Root Privileges

su - aimer
sudo cat /etc/shadow

Setup SSH Public Key

Quickly Upload Your Local Key

# run this on your local machine
ssh-copy-id aimer@server

Import The Key You Hosted

# Import your own public key!
wget https://aimer.aiursoft.cn/authorized_keys -O ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys

Test if You Can Connect to Server

ssh aimer@server

Disable Root and Password Login

sudo vim /etc/ssh/sshd_config
  • Set PermitRootLogin as no To disable root login
  • Set PasswordAuthentication as no To disable password login

Delete this file /etc/ssh/sshd_config.d/50-cloud-init.conf

Skip Password for Sudo

sudo visudo

Add this on the end of file:

aimer ALL=(ALL) NOPASSWD:ALL

Delete Other User That Provider Created

sudo deluser default

Warning

Do not delete the root user.

Restart Your Server

sudo reboot

Other Config

Setup zsh Config

oh-my-zsh

# Install oh-my-zsh
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# Update config from github (Use your own config file!!!!!)
sh -c "$(curl -fsSL https://raw.githubusercontent.com/aimerneige/zsh/master/install.sh)"
# Install zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
# Install zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
# Install k
git clone https://github.com/supercrabtree/k $ZSH_CUSTOM/plugins/k
# Install starship
curl -sS https://starship.rs/install.sh | sh

lsd

Install lsd

# ubuntu
# https://github.com/Peltoche/lsd/releases
sudo dpkg -i lsd_0.23.1_amd64.deb

# fedora
sudo dnf install lsd -y

Edit .zshrc, add bellow alias record

alias ls=lsd

bat

Install bat

# ubuntu
sudo apt install bat -y

# fedora
sudo dnf install bat -y

Edit .zshrc, add bellow alias record

# add bellow line on ubuntu
# alias bat=batcat
alias cat=bat

Install Node

Install nvm

# use curl
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash

# use wget
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash

Reload your shell.

Use nvm Install latest LTS version of nodejs

nvm install --lts

Test if it works

node --version
npm --version

Install Python

# ubuntu
sudo apt install -y python-is-python3 python2 python3-pip

# fedora
sudo dnf install -y python-is-python3 python2 python3-pip

Setup neovim config

Install Requirements

pip install neovim
npm install --location=global neovim

Download config file

rm -rf ~/.config/nvim
# Use your own config file!!!!!
git clone https://github.com/aimerneige/nvim.git ~/.config/nvim

Install Plugin

# download will start automatically after start neovim
nvim

Remove snap

Remove snap from Ubuntu

bash -c "$(curl -fsSL https://raw.githubusercontent.com/BryanDollery/remove-snap/main/remove-snap.sh)"

List all of the installed snap package

snap list

Remove all of the snap package one by one

sudo snap remove --purge lxd
sudo snap remove --purge core20
sudo snap remove --purge snapd

Remove snapd

sudo apt remove --autoremove snapd

Edit config file to permit system download snap automatically

sudo vim /etc/apt/preferences.d/nosnap.pref

Write things like this:

Package: snapd
Pin: release a=*
Pin-Priority: -10

Update your system

sudo apt update

Manual Tool

tldr

# Debain
sudo apt install tldr
# Fedora
sudo dnf install tldr

cheat.sh

curl -s https://cht.sh/:cht.sh | sudo tee /usr/local/bin/cht.sh && sudo chmod +x /usr/local/bin/cht.sh