Skip to content

Instantly share code, notes, and snippets.

@crgwilson
crgwilson / http_sniffer.py
Created November 7, 2018 14:49
Get all HTTP/HTTPS requests a system makes
#!/usr/bin/env python
#
# Scapy docs: https://scapy.readthedocs.io/en/latest/
#
# requirements:
# scapy
# scapy-http
#
from scapy.all import IP, sniff
@crgwilson
crgwilson / app.py
Last active January 28, 2018 04:35
Logging for Chris's weird ol tv majig
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)
@crgwilson
crgwilson / tv-thing.service
Created January 28, 2018 04:18
Chris's weird TV script thinger
[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