Skip to content

Instantly share code, notes, and snippets.

View tianweiliu's full-sized avatar

Tianwei Liu tianweiliu

View GitHub Profile
@tianweiliu
tianweiliu / pysyslog.py
Last active October 26, 2021 15:08 — forked from marcelom/pysyslog.py
Tiny Python Syslog Server
#!/usr/bin/env python
## Tiny Syslog Server in Python.
##
## This is a tiny syslog server that is able to receive UDP based syslog
## entries on a specified port and save them to a file.
## That's it... it does nothing else...
## There are a few configuration parameters.
LOG_FILE = 'yourlogfile.log'
import sys
from ouimeaux.environment import Environment
from scapy.all import *
def on_switch(switch):
print "WeMo Switch found:", switch.name
print "Status:", "off" if switch.get_state() == 0 else "on"
def arp_display(pkt):