Skip to content

Instantly share code, notes, and snippets.

@SiddheshNan
Last active December 12, 2019 20:27
Show Gist options
  • Save SiddheshNan/6d0a233dcea4d90b7a6b3ba586f941c6 to your computer and use it in GitHub Desktop.
Save SiddheshNan/6d0a233dcea4d90b7a6b3ba586f941c6 to your computer and use it in GitHub Desktop.
CentFreshStartScript
echo 'Updating Packages...'
sudo yum update -y
echo 'Adding EPEL...'
sudo yum install epel-release -y
echo 'Setting timezone...'
sudo timedatectl set-timezone Asia/Kolkata
echo 'Setting up firewall...'
sudo yum install firewalld -y
sudo systemctl start firewalld
sudo systemctl enable firewalld
sudo firewall-cmd --state
sudo firewall-cmd --permanent --zone=public --add-service=http
sudo firewall-cmd --permanent --zone=public --add-service=https
sudo firewall-cmd --permanent --zone=public --add-service=ssh
sudo firewall-cmd --reload
echo 'Installing essential packages...'
sudo yum install cmake gcc wget zip unzip curl rkhunter nano vim pv docker -y
echo 'Installing Nginx...'
sudo yum install nginx -y
sudo systemctl enable nginx
sudo systemctl start nginx
echo 'Please wait while Swapfile is Creating...'
sudo dd if=/dev/zero of=/swapfile count=4096 bs=1MiB
echo 'Setting up Swap...'
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo sh -c 'echo "/swapfile none swap sw 0 0" >> /etc/fstab'
echo 'Done! Please Reboot the system manually'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment