Skip to content

Instantly share code, notes, and snippets.

@nikolaysm
nikolaysm / pg_backup.config
Last active September 15, 2021 15:34
Automated Backup on Linux with admin notification by mail
##############################
## POSTGRESQL BACKUP CONFIG ##
##############################
# Optional system user to run backups as. If the user the script is running as doesn't match this
# the script terminates. Leave blank to skip check.
BACKUP_USER=
# Optional hostname to adhere to pg_hba policies. Will default to "localhost" if none specified.
HOSTNAME=
@lorey
lorey / selenium_xhr_requests_via_performance_logging.py
Last active April 14, 2024 09:11
Access Chrome's network tab (e.g. XHR requests) with Selenium
#
# This small example shows you how to access JS-based requests via Selenium
# Like this, one can access raw data for scraping,
# for example on many JS-intensive/React-based websites
#
from time import sleep
from selenium import webdriver
from selenium.webdriver import DesiredCapabilities
@GrahamDumpleton
GrahamDumpleton / gist:b380652b768e81a7f60c
Last active February 1, 2024 16:58
Setting environment variables for Apache/mod_wsgi hosted Python application.

Django documentation says to use:

WSGIScriptAlias / /path/to/mysite.com/mysite/wsgi.py
WSGIPythonPath /path/to/mysite.com

<Directory /path/to/mysite.com/mysite>
<Files wsgi.py>
Require all granted