Skip to content

Instantly share code, notes, and snippets.

@DarkSuniuM
Last active March 7, 2020 07:37
Show Gist options
  • Save DarkSuniuM/f53a1711f7153dc341205fa73a9c13d2 to your computer and use it in GitHub Desktop.
Save DarkSuniuM/f53a1711f7153dc341205fa73a9c13d2 to your computer and use it in GitHub Desktop.
$ apt update && apt upgrade -y # Update packages list and the packages
$ apt install sudo # Install 'sudo'
$ adduser coolguy # Create a new user
$ visudo # Add new user to the sudo users
# Disconnect root session
# SSH using the new user
$ sudo apt install mariadb-server mariadb-client mariadb-common libmariadb-dev python3 python3-pip python3-dev python3-virtualenv nginx-full git
$ sudo mysql_secure_installation # Setup MySQL/MariaDB Server
$ sudo mysql # Open MySQL Command-line shell
# MySQL Shell:
$ CREATE DATABASE rest_dir; # Create a Database
$ CREATE USER 'rest_dir'@'localhost' IDENTIFIED BY 'somewhat-secure'; # Create a user
$ GRANT ALL PRIVILEGES ON rest_dir.* TO 'rest_dir'@'localhost'; # Grant privileges to the user on the specific database.
$ FLUSH PRIVILEGES; # Reload privileges table
# Exit MySQL Shell using 'CTRL + C' or 'CTRL + D'
$ git clone https://github.com/DarkSuniuM/ReST-Directory.git && cd ReST-Directory
$ python3 -m virtualenv .venv --python=python3
$ source .venv/bin/activate
$ pip install -r requirements.txt
$ cp .env.example .env && nano .env
$ pip install gunicorn
$ gunicorn -w 2 -b 0.0.0.0:5000 app:app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment