- Implementing pause
import os
os.system('read -s -n 1 -p "Press any key to continue...\n"')
import logging | |
import logging.handlers | |
from functools import wraps | |
LOGGER_NAME = "APPLOGGER" | |
LOGGER_HANDLER_NAME = "APPHANDLER" | |
LOGGER_FILENAME = "log.out" | |
LOGGER_FORMATTER = "[%(asctime)s] %(levelname)s : %(user)s : %(funcName)s : %(message)s" | |
LOGGER_DATEFMT = "%Y-%m-%d %H:%M:%S" | |
LOGGER_USER = "app" |
# Compile nginx standalone without root access | |
mkdir ~/installed | |
mkdir ~/installed/nginx | |
mkdir ~/src | |
cd ~/src | |
# for latest tar.gz files, refer this link: | |
# https://docs.nginx.com/nginx/admin-guide/installing-nginx/installing-nginx-open-source/#compiling-and-installing-from-source | |
# we will not compile any dependencies, only unzip them in different directories and pass their paths while configuring nginx |
import requests | |
from requests.adapters import HTTPAdapter | |
from urllib3.util.retry import Retry # or, from requests.packages.urllib3.util.retry import Retry | |
## to get rid of that SSL insecure warning ## | |
from requests.packages.urllib3.exceptions import InsecureRequestWarning | |
requests.packages.urllib3.disable_warnings(InsecureRequestWarning) | |
def requests_retry(url, total=3, backoff_factor=0.3, method_whitelist=None, status_forcelist=None): | |
"""Create and return a Retry object |
import os
os.system('read -s -n 1 -p "Press any key to continue...\n"')