Skip to content

Instantly share code, notes, and snippets.

!/usr/bin/env python
import os
import json
from sys import argv
from time import strftime
def firstrun():
x = {}
x['jf'] = raw_input("File name?: ")
#!/opt/local/bin/python
BLOCK_THRESHOLD = 1000
from scapy.all import rdpcap,DNSQR
from sys import argv
# FIXME: Idiot proof this.
packets = rdpcap(argv[1])
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
setopt autocd extendedglob notify
bindkey -e
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
zstyle :compinstall filename '/home/dmcnish/.zshrc'
#!/usr/bin/bash
synclient HorizHysteresis=10 VertHysteresis=10 CircularScrolling=1 CircScrollTrigger=1 TapButton1=1 TapButton2=3 TapButton3=2
syndaemon -i 1.0 -t &
@flagranterror
flagranterror / oui3.py
Created April 10, 2014 18:04
Handy OUI lookup script reworked for Python 3+ and (hopefully) all platforms
#!/usr/bin/python
"""
Who owns the OUI? IEEE knows.
Auto-refreshes once a month.
Run with -u to force update.
"""
@flagranterror
flagranterror / oui.py
Last active December 25, 2015 00:59
OUI from MAC address
#!/usr/bin/python
"""
Who owns the OUI? IEEE knows.
Run with -u to force update.
"""
from __future__ import print_function
from urllib import urlopen
import sys
@flagranterror
flagranterror / macreport.py
Created September 4, 2013 03:09
Search a DHCP log file for a list of MAC addresses and print the last (up to) 10 lease times
#!/usr/bin/python
import re
from sys import argv
m = open('macs.txt', 'r').read()
log_file = ''
if '-z' in argv:
from gzip import open
@flagranterror
flagranterror / gist:5357783
Created April 10, 2013 19:40
Pull alarm stats from nagios web UI.
#!/usr/bin/python
import urllib2
from base64 import b64encode
import bs4
import time
hostname = 'nagioshost.example.tld'
nagios_prefix = '/nagios'
proto = 'http'
tell application "Google Chrome"
set the clipboard to URL of active tab of front window as string
end tell
tell application "Wedge"
activate
end tell
-- You will need to tick "Enable support for assistive
-- devices" in System Preferences -> Accessibility
tell application "System Events"
@flagranterror
flagranterror / Safari_URL_To_Wedge.applescript
Created February 6, 2013 17:42
Send front Safari URL to Wedge.app
tell application "Safari"
activate
set the clipboard to URL of front document as string
end tell
tell application "Wedge"
activate
end tell
-- You will need to tick "Enable support for assistive