Skip to content

Instantly share code, notes, and snippets.

View cmcqueen's full-sized avatar

Craig McQueen cmcqueen

View GitHub Profile
#!/bin/sh
# klg, Apr 2016
set -e
UPSVN="$(git log -n 1 --format=%H --grep '^git-svn-id:' -- "$@")"
if [ -z "$UPSVN" ]; then
echo >&2 "No git-svn commit found"
exit 1
fi
@chadmiller
chadmiller / getnifs.py
Last active February 26, 2022 17:00 — forked from provegard/getnifs.py
#!/usr/bin/python
# Based on https://gist.github.com/provegard/1536682, which was
# Based on getifaddrs.py from pydlnadms [http://code.google.com/p/pydlnadms/].
# Only tested on Linux!
from socket import AF_INET, AF_INET6, inet_ntop
from ctypes import (
Structure, Union, POINTER,
pointer, get_errno, cast,
@martinsik
martinsik / libwebsockets-webserver.c
Created July 31, 2012 11:34
Simple webserver based on libwebsockets library. Read full description at http://martinsikora.com/libwebsockets-simple-http-server
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <libwebsockets.h>
static int callback_http(struct libwebsocket_context *context,
struct libwebsocket *wsi,
enum libwebsocket_callback_reasons reason, void *user,