start new:
tmux
start new with session name:
tmux new -s myname
# Adapted from: http://www.lucainvernizzi.net/blog/2015/02/12/extracting-urls-from-network-traffic-in-just-9-python-lines-with-scapy-http/ | |
# | |
# requirements | |
# scapy==2.3.1 | |
# scapy-http==1.6 | |
from scapy.all import IP, sniff | |
from scapy.layers import http | |
def process_tcp_packet(packet): |
"""Run PEP8 on all Python files in this directory and subdirectories as part of the tests.""" | |
__author__ = 'Christopher Swenson' | |
__email__ = 'chris@caswenson.com' | |
__license__ = 'CC0 http://creativecommons.org/publicdomain/zero/1.0/' | |
import os | |
import os.path | |
import unittest |
### Trash ### | |
# Trash anything from LinkedIn | |
# (Because LinkedIn is trash) | |
if address :all :is ["to", "cc", "resent-to", "x-delivered-to"] "linkedin@matthewhochler.fastmail.fm" { | |
fileinto "INBOX.Trash"; | |
stop; | |
} | |
# Trash Sony PSN 'Funds added' emails |
javascript:var re = new RegExp('(?:dp/)([0-9A-Z]+)'); var match = re.exec(location.href); if (match.length > 1) { var id = match[1]; var url = 'http://amzn.com/' + id; alert(url); } |
javascript: (function() %7B var doc = top.document; if(top.js && top.js.document) doc = top.js.document; var script = doc.createElement('script'); doc.todoist_script = script; script.type = 'text/javascript'; script.src = 'http://todoist.com/anywhere/getJavaScript'; doc.getElementsByTagName('head')%5B0%5D.appendChild(script); %7D)(); void(0); |
javascript:(function()%7B$('%23search_form_input').val('!g '+$('%23search_form_input').val());$('%23search_form').submit();%7D)() |
import sys | |
import tempfile | |
import hotshot | |
import hotshot.stats | |
from django.conf import settings | |
from cStringIO import StringIO | |
class ProfileMiddleware(object): | |
""" | |
Displays hotshot profiling for any view. |
#!/bin/bash | |
# Setup deployment target for Nginx + Python/uWSGI + Supervisor + Git | |
# From: https://gist.github.com/1210041 | |
function usage() { | |
cat << EOF | |
Usage: $0 PROJECT_NAME [DOMAIN] [OPTIONS] | |
Options: | |
-y No prompts, assume yes to all. |
javascript:(function(){ | |
var enc=encodeURIComponent, | |
w=window, | |
frames=w.frames, | |
d=document, | |
tn=w.getSelection?w.getSelection():(d.getSelection)?d.getSelection():(d.selection?d.selection.createRange().text:0), | |
pu=w.location.href, | |
isGMail=w.location.host.match(/mail\.google\.com/), | |
tt=pt=d.title, | |
subjSpans=d.getElementsByClassName("hP"),i,url; |