Skip to content

Instantly share code, notes, and snippets.

@austinmarton
austinmarton / sendRawEth.c
Created February 27, 2012 08:40
Send a raw Ethernet frame in Linux
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*/
#include <arpa/inet.h>
#include <linux/if_packet.h>
#include <stdio.h>
@vsajip
vsajip / easy_servers.py
Created April 27, 2011 20:41
Easy to use socket servers for testing
# Copyright (C) 2011 Vinay Sajip. All rights reserved.
# Encapsulate socket servers into an easy-to-use package
try: # Python 2.X
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from SocketServer import ThreadingUDPServer, DatagramRequestHandler, \
ThreadingTCPServer, StreamRequestHandler
except ImportError: # Python 3.X
from http.server import HTTPServer, BaseHTTPRequestHandler
from socketserver import ThreadingUDPServer, DatagramRequestHandler, \