Skip to content

Instantly share code, notes, and snippets.

View wolfhechel's full-sized avatar

Pontus Jensen Karlsson wolfhechel

View GitHub Profile
@wolfhechel
wolfhechel / Vagrantfile
Created March 14, 2015 13:23
nftables router
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = '2'
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
@wolfhechel
wolfhechel / kevent_notification_asyncio.py
Created July 7, 2016 10:26
Testing KEvent notifcations with asyncio
import asyncio
import socket
import fcntl
import struct
import sys
SIOCSKEVFILT = 0x800c6502
@wolfhechel
wolfhechel / darwin_platform_uuid.py
Created July 7, 2016 10:14
ctypes implementation to retrieve platform UUID on OS X
from ctypes import *
from ctypes import util
from platform import mac_ver
import uuid
iokit = cdll.LoadLibrary(util.find_library('IOKit'))
cf = cdll.LoadLibrary(util.find_library('CoreFoundation'))
cf.CFStringCreateWithCString.argtypes = [c_void_p, c_char_p, c_int32]