Skip to content

Instantly share code, notes, and snippets.

@gutchom
Created November 24, 2023 05:45
Show Gist options
  • Save gutchom/fa837faf34e488a2127671b8687b51c9 to your computer and use it in GitHub Desktop.
Save gutchom/fa837faf34e488a2127671b8687b51c9 to your computer and use it in GitHub Desktop.
Set up shell script for CentOS
#!/bin/bash
# Install basic tools
sudo yum -y install git vim zsh zip unzip wget curl
# Create basic directories
mkdir -p ~/projects ~/tmp ~/.vim/undo
# Change default shell to zsh
if [[ $SHELL == *"zsh"* ]]; then
echo "zsh is already default shell"
else
echo "Changing default shell to zsh"
chsh -s $(which zsh)
fi
if [[ ! -d ~/dotfiles ]]; then
git clone https://github.com/gutchom/dotfiles.git ~/dotfiles
rm -f ~/.zshrc ~/.vimrc ~/.tmux.conf
ln -s ~/dotfiles/zshrc ~/.zshrc
ln -s ~/dotfiles/vimrc ~/.vimrc
ln -s ~/dotfiles/tmux.conf ~/.tmux.conf
fi
# Install Node.js
curl https://get.volta.sh | bash
volta install node
volta install yarn
# Install Nginx
sudo yum -y install nginx
sudo systemctl start nginx
sudo systemctl enable nginx
# Install PostgreSQL
sudo yum -y install postgresql-server postgresql-contrib
sudo postgresql-setup initdb
sudo systemctl start postgresql
sudo systemctl enable postgresql
# Install Redis
sudo yum -y install redis
sudo systemctl start redis
sudo systemctl enable redis
# Install Docker
# sudo yum -y install docker
# sudo systemctl start docker
# sudo systemctl enable docker
# sudo usermod -aG docker $USER
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment