Skip to content

Instantly share code, notes, and snippets.

@cybercase
cybercase / dns.py
Last active August 9, 2017 11:55
Simple (and limited) DNS query client
#!/usr/bin/env python
# -*- coding:utf8 -*-
import random
import socket
import struct
import StringIO
import argparse
from collections import namedtuple
MAX_PACKET_SIZE = 512
@attilaolah
attilaolah / imgcmp.py
Created February 29, 2012 11:30
Fast image comparison with Python
import math
import Image
import Levenshtein
class BWImageCompare(object):
"""Compares two images (b/w)."""
_pixel = 255