Categories
Uncategorized

Setting up Django with Apache2

SSL Certificate

Make Virtual Hosts, Lets Encrypt

https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-18-04

Setting.py

with open('/etc/db_pass.txt') as g:
        DB_PASS = g.read().strip()

wkhtmltopad

Make sure hkhtmltopdf is installed in /usr/bin/wkhtmltopdf

Git Clone Project

Install Requirements.txt

Django 2.2

Pip install PDF kit https://pypi.org/project/pdfkit/

pip install pdfkit
sudo apt-get install wkhtmltopdf
pip install django-wkhtmltopdf

Install xlsxwriter

pip install xlsxwriter

Set up Permissions Apache

chown -R $USER:$USER /directory
chmod -R 775 /directory
Categories
Uncategorized

MySQL backups

Back up a database

mysqldump -u [username] –p[password] [database_name] > [dump_file.sql]

Restore a database

mysql -u [username] –p[password] [database_name] < [dump_file.sql]
Categories
Uncategorized

Search for programs or files in command prompt

Search Command:

dir /s /b filename

The /s command allows you to view all files of a certain type within all subsequent folders of your current path. You can search for a specific file, as in the example above, or use a wildcard ‘*’ to view all files of a certain type. The below example will search for all pdf files within your current directory and all subsequent folders of your current path.

dir /s /b *.pdf