This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# | |
# Scapy docs: https://scapy.readthedocs.io/en/latest/ | |
# | |
# requirements: | |
# scapy | |
# scapy-http | |
# | |
from scapy.all import IP, sniff |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask | |
import logging | |
from logging.handlers import RotatingFileHandler | |
...some code jank... | |
def setup_logging(app): | |
log_file = app.config.get('LOG_FILE', 'tv-thinger.log') | |
log_level = app.config.get('LOG_LEVEL', 'INFO') | |
handler = RotatingFileHandler(log_file, maxBytes=10000000, backupCount=1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Chris's weird tv thing | |
After=network.target | |
[Service] | |
Type=simple | |
User=pi | |
ExecStart=/usr/bin/python program_name.py | |
Restart=on-failure |