This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
socket.create_connection(('127.0.0.1', 22)) | |
<socket._socketobject object at 0x9022bc4> | |
s=socket.create_connection(('127.0.0.1', 22)) | |
import gc | |
[ i for i in gc.get_objects() if type(i) == type(s) ] | |
[<socket._socketobject object at 0x9022bc4>, <socket._socketobject object at 0x92a4aac>] | |
t = [ i for i in gc.get_objects() if type(i) == type(s) ][0] | |
t | |
<socket._socketobject object at 0x9022bc4> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <arpa/inet.h> | |
#include <ifaddrs.h> | |
#include <net/if.h> | |
#include <netinet/in.h> | |
#include <sys/socket.h> | |
#include <sys/types.h> | |
int |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def hexdump(src, length=16): | |
FILTER = ''.join([(len(repr(chr(x))) == 3) and chr(x) or '.' for x in range(256)]) | |
lines = [] | |
for c in xrange(0, len(src), length): | |
chars = src[c:c+length] | |
hex = ' '.join(["%02x" % ord(x) for x in chars]) | |
printable = ''.join(["%s" % ((ord(x) <= 127 and FILTER[ord(x)]) or '.') for x in chars]) | |
lines.append("%04x %-*s %s\n" % (c, length*3, hex, printable)) | |
return ''.join(lines) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <sys/utsname.h> | |
inline static void | |
u() { | |
struct utsname uts; | |
uname(&uts); | |
printf("%s %s %s %s %s", uts.sysname, uts.nodename, uts.release, uts.version, uts.machine); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sys/socket.h> | |
#include <arpa/inet.h> | |
#include <sys/un.h> | |
#include <unistd.h> | |
#include <string.h> | |
#include <stdio.h> | |
#define _PATH_UNIX_X "/tmp/.X11-unix/X%d" | |
#define DISPLAY_PORT 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import time | |
import socket | |
_PATH_UNIX_X = "/tmp/.X11-unix/X%d" | |
DISPLAY_PORT = 0 | |
s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) | |
s.connect(_PATH_UNIX_X % DISPLAY_PORT) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import inspect | |
import logging | |
logger = logging.getLogger('application') | |
def logit(order, *largs, **kwargs): | |
return True | |
__line__ = int(inspect.stack()[1][2]) | |
__function__ = inspect.stack()[1][3] | |
with_color=False |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sys/capability.h> | |
#include <sys/types.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#define nitems(x) (sizeof(x) / sizeof(x[0])) | |
int | |
main(void) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <err.h> | |
#include <fcntl.h> | |
#include <gelf.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <sysexits.h> | |
#include <unistd.h> | |
static void |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sys/cdefs.h> | |
#include <sys/types.h> | |
#include <sys/ioctl.h> | |
#ifdef __FreeBSD__ | |
#include <sys/endian.h> | |
#endif | |
#include <net/if.h> | |
#include <net/pfvar.h> |
OlderNewer