vim /etc/nginx/sites-enabled/tunnel_yourdomain_com
server {
server_name tunnel.yourdomain.com;
# Add the below code in your Python file, | |
# then add @own_profiler as a decorator on the method you would like to profile. | |
# Note: | |
# - If there is already a decorator on the method, set @own_profiler above, | |
# - Each time the method is called, it generates a new profile file, | |
# don't set this decorator on a method called hundred of times or you will have hundred of profile files to analyze. | |
# | |
# To display the resulting profiling data file: | |
# | |
# Snakeviz: Callstack layer graph & stats table |
#!/usr/bin/env python3 | |
import webbrowser | |
from fnmatch import fnmatch | |
from optparse import OptionParser | |
import requests | |
from lxml import html |
Make sure to disable secure boot in bios, otherwise /usr/local/bin/dell-bios-fan-control 0
will return a segfault.
cd /tmp
git clone https://github.com/TomFreudenberg/dell-bios-fan-control
cd dell-bios-fan-control
make
sudo cp dell-bios-fan-control /usr/local/bin/
sudo apt install i8kutils
sudo mkdir /etc/systemd/system/i8kmon.service.d
echo "[Service]
#!/usr/bin/env python3 | |
import base64 | |
import requests | |
from argparse import ArgumentDefaultsHelpFormatter, ArgumentParser | |
from urllib.parse import urljoin | |
parser = ArgumentParser(description='Send an email to Odoo databases', | |
formatter_class=ArgumentDefaultsHelpFormatter) | |
parser.add_argument('eml_file', help='EML File to send') |
#!/usr/bin/python3 | |
import os | |
import re | |
import requests | |
import subprocess | |
from Levenshtein import distance | |
DOWNLOAD_DIR = '/media/Downloads/' | |
MOVIES_DIR = os.path.expanduser('~/Movies/') |
#!/usr/bin/env python3 | |
import base64 | |
import subprocess | |
import threading | |
import requests | |
def print_badge(barcode): | |
pdf_filename = "badge-%s.pdf" % barcode |
#!/usr/bin/env python3 | |
import threading | |
import time | |
from http.server import HTTPServer, BaseHTTPRequestHandler | |
from socketserver import ThreadingMixIn | |
USE_HTTPS = False | |
if USE_HTTPS: | |
import ssl |
#!/usr/bin/env python3 | |
import requests | |
import sys | |
import threading | |
from urllib3.exceptions import InsecureRequestWarning | |
# Suppress only the single warning from urllib3 needed. | |
requests.packages.urllib3.disable_warnings(category=InsecureRequestWarning) |
server { | |
include /etc/nginx/proxy.conf; | |
listen 80; | |
listen 443 ssl; | |
ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem; | |
ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key; | |
server_name test_nginx; | |
location / { | |
proxy_pass http://127.0.0.1:8000; | |
} |