Skip to content

Instantly share code, notes, and snippets.

View cmol's full-sized avatar

Claus Lensbøl cmol

View GitHub Profile
require "socket"
CONNECT_ADDR = "localhost"
CONNECT_PORT = 12345
MSG_LENGTH = 256
FLAGS = 0
Addrinfo.udp(CONNECT_ADDR, CONNECT_PORT).connect do |socket|
socket.send("Connected via unspecified address family socket", FLAGS)
message, server = socket.recvfrom(MSG_LENGTH)
message, client = server_socket.recvfrom(MSG_LENGTH)
2620:0000:0862:ed1a:0000:0000:0000:0001
@cmol
cmol / keybase.md
Created May 16, 2015 13:41
keybase.md

Keybase proof

I hereby claim:

  • I am cmol on github.
  • I am cmol (https://keybase.io/cmol) on keybase.
  • I have a public key whose fingerprint is 54C4 F886 5479 CCDB F367 DC13 720E 785B F86A EAD3

To claim this, I am signing this object:

@cmol
cmol / natPMP.py
Last active December 16, 2015 13:29
Script for requesting a port redirection via natPMP. Uses python3
"""
Script for requesting a port redirection via natPMP.
Follows the standart of:
http://tools.ietf.org/html/draft-cheshire-nat-pmp-07#section-3.3
with the exception of hold times. We are not going to wait a little
above 3 minutes to test for natPMP.
"""
import socket
import random