Mariadb Administration

Install MariaDB on Ubuntu sudo apt update sudo apt install mariadb-server sudo systemctl status mariadb mysql -V Securing MariaDB sudo mysql_secure_installation Manage MySQL Databases and Users from the Command Line mysql -u root -p Create a new MySQL database CREATE DATABASE database_name; CREATE DATABASE IF NOT EXISTS database_name; SHOW DATABASES; Delete a MySQL database DROP […]

JavaScript Scopes

Lexical Scope Global Scope var firstVar = 10; // firstVar can be accessed anywhere in the fileconsole.log(firstVar); // 10 Scope within function definitions function myFunc() { var secVar = 20; // secVar can be accessed anywhere inside the function braces {} console.log(secVar); // 20}console.log(secVar); // undefined var funcVar = function () { // funcVar can […]

Setup flask application with nginx for Ubuntu 18.06

sudo apt-get update sudo apt-get install python-pip   sudo pip install virtualenv   virtualenv venv source venv/bin/activate   application_uwsgi.ini [uwsgi] #application’s base folder base = /data/tools/application #python module to import app = application_entry module = %(app) home = %(base)/venv pythonpath =%(base) #socket file’s location socket = /data/tools/application/%n.sock #permissions for the socket file chmod-socket = 666 […]

How to install certificate in Linux for nginx

openssl req -newkey rsa:2048 -nodes -keyout <domain_name> -out csr_file_name.csr Use this csr key file to create certificate from CA, and generate for nginx (if the option is not available, use Apache) Receive the certificate from CA, it would be a certfile.txt To cross check the received certificate use the following command openssl x509 -in certificate.crt […]