I hereby claim:
- I am javiermon on github.
- I am javiermon (https://keybase.io/javiermon) on keybase.
- I have a public key whose fingerprint is 53F0 38AF 631E 38B7 0992 E5D4 BC67 49E8 F676 0D3E
To claim this, I am signing this object:
#!/usr/bin/python | |
# netaddr does this and more: | |
# >>> import netaddr | |
# >>> netaddr.EUI('d4:be:d9:23:d5:bf').words | |
import sys | |
if len(sys.argv) != 2: | |
print "usage %s mac-addr" % sys.argv[0] | |
sys.exit(-1) |
#!/usr/bin/env python | |
"""Simple HTTP Server With Upload. | |
This module builds on BaseHTTPServer by implementing the standard GET | |
and HEAD requests in a fairly straightforward manner. | |
""" |
/* | |
* "untar" is an extremely simple tar extractor: | |
* * A single C source file, so it should be easy to compile | |
* and run on any system with a C compiler. | |
* * Extremely portable standard C. The only non-ANSI function | |
* used is mkdir(). | |
* * Reads basic ustar tar archives. | |
* * Does not require libarchive or any other special library. | |
* | |
* To compile: cc -o untar untar.c |
/* | |
iflist.c : retrieve network interface information thru netlink sockets | |
(c) Jean Lorchat @ Internet Initiative Japan - Innovation Institute | |
v1.0 : initial version - Feb 19th 2010 | |
This file was obtained at the following address : | |
http://www.iijlab.net/~jean/iflist.c |
#include <stdint.h> | |
#include <stdio.h> | |
#define ETH_ALEN 6 | |
int main(void) | |
{ | |
uint8_t mac1[ETH_ALEN] = {0x00, 0x00, 0x00, 0x00, 0x00, 0xFF}; | |
uint8_t mac2[ETH_ALEN] = {0x00, 0x00, 0x00, 0x00, 0x01, 0x00}; | |
uint64_t a = (uint64_t)mac1[5] + |
I hereby claim:
To claim this, I am signing this object:
import fcntl | |
def set_close_exec(fd): | |
""" | |
Helper to add CLOEXEC to provided file descriptor. | |
:param fd: int | |
""" | |
flags = fcntl.fcntl(fd, fcntl.F_GETFD) | |
fcntl.fcntl(fd, fcntl.F_SETFD, flags | fcntl.FD_CLOEXEC) |
# dns server using dnslib and gevent | |
# based on https://bitbucket.org/paulc/dnslib/src/80d85555aae4/src/server/gevent_server.py | |
# set the key as | |
# set IP:name ip_addr | |
# set TXT:name txtfield | |
# fallback on gevent's dns resolver | |
# gleicon 2011 | |
import gevent |
#!/usr/bin/python | |
pos = [['0']*3,['1']*3,['A','B','C'],['D','E','F'], | |
['G','H','I'],['J','K','L'],['M','N','O'],['P','R','S'], | |
['T','U','V'],['W','X','Z']] | |
# number to list of digits | |
def int_to_list(i): | |
return [int(x) for x in str(i).zfill(len(str(i)))] |
#!/usr/bin/env python | |
import re | |
import sys | |
from subprocess import * | |
p = Popen("pylint -f parseable -r n --disable-msg-cat=C,R %s" % | |
sys.argv[1], shell = True, stdout = PIPE).stdout |