Setup CentOS machine (AWS Amazon Linux 2023)
Installations
-
zsh
sudo yum install zsh
- set zsh as default by editing
/etc/passwd
sudo yum install git
- install OhMyZsh
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
- install PowerLevel10k:
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k
- change theme to it in
~/.zshrc
:ZSH_THEME="powerlevel10k/powerlevel10k"
source ~/.zshrc
- install zsh-autosuggestions: ref
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
- install zsh-syntax-highlighting: ref
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
-
tmux
git clone https://github.com/gpakosz/.tmux.git ~/.tmux
ln -s ~/.tmux/.tmux.conf ~/.tmux.conf
- add to zshrc:
work() { tmux new-session -A -s ${1:-work}; }
# ~/.tmux.conf
# make delay shorter
set -sg escape-time 0
### key bindings ###
bind r source-file ~/.tmux.conf \; display ".tmux.conf reloaded!"
# quickly open a new window
bind N new-window
# synchronize all panes in a window
bind y setw synchronize-panes
# pane movement shortcuts
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# enable mouse support for switching panes/windows
set -g mouse on
#### copy mode : vim ####
# set vi mode for copy mode
setw -g mode-keys vi
# copy mode using 'Esc'
unbind [
bind Escape copy-mode
# paste using 'p'
unbind p
bind p paste-buffer
set-option -g default-shell "/bin/zsh"
-
github
curl -Lo gh-cli.rpm https://github.com/cli/cli/releases/download/v2.30.0/gh_2.30.0_linux_arm64.rpm
sudo yum install -y ./gh-cli.rpm
-
docker
sudo dnf update -y
sudo dnf install -y docker
sudo systemctl enable docker
sudo curl -L "https://github.com/docker/compose/releases/download/$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version
1. mosh
# Install dependencies
sudo yum groupinstall "Development Tools" -y
sudo yum install openssl-devel protobuf-devel ncurses-devel zlib-devel perl cmake -y
# Download and build Mosh
curl -L -O https://github.com/mobile-shell/mosh/releases/download/mosh-1.3.2/mosh-1.3.2.tar.gz
tar -xzf mosh-1.3.2.tar.gz
cd mosh-1.3.2
./configure
make
sudo make install