Skip to content

Instantly share code, notes, and snippets.

View nathan-osman's full-sized avatar

Nathan Osman nathan-osman

View GitHub Profile

Keybase proof

I hereby claim:

  • I am nathan-osman on github.
  • I am nathanosman (https://keybase.io/nathanosman) on keybase.
  • I have a public key whose fingerprint is 067D 9B60 E117 F795 983D 9BED 743C 5E1A B4A5 3FD1

To claim this, I am signing this object:

@nathan-osman
nathan-osman / circles.user.js
Created December 24, 2014 19:11
StackExchange™ SuperCollider Freehand Circle™ Editor
// ==UserScript==
// @name StackExchange™ SuperCollider Freehand Circle™ Editor
// @author Nathan Osman
// @namespace http://quickmediasolutions.com
// @description Allows Freehand Circles™ to be added to the images on the page
// @include http://stackoverflow.com/*
// @include http://superuser.com/*
// @include http://serverfault.com/*
// @include http://meta.stackoverflow.com/*
// @include http://meta.superuser.com/*
@nathan-osman
nathan-osman / raspi_builder.sh
Last active October 21, 2016 12:40
Cross-compiles the Raspberry Pi kernel from source on Ubuntu
#!/bin/bash
set -e
######################################
# Raspberry Pi Kernel Builder Script #
# Copyright 2015 - Nathan Osman #
# Released into the Public Domain #
######################################
# Ensure that we are running as root
@nathan-osman
nathan-osman / resizedir.py
Created February 1, 2015 22:31
Resize images in a directory.
#!/usr/bin/env python2
"""
Sane Image Resizer
Copyright 2015 - Nathan Osman
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
@nathan-osman
nathan-osman / swf.py
Created April 21, 2015 23:07
Simple SWF Parser
import bitstring
import pylzma
import sys
import zlib
class SWF:
"""
Implements retrieval of basic information from a SWF file.
@nathan-osman
nathan-osman / ip-indicator.py
Last active April 2, 2018 23:37
IP Address AppIndicator
#!/usr/bin/env python2
import appindicator
import gtk
import urllib2
class IPIndicator(appindicator.Indicator):
"""
An indicator displaying public IP address.
@nathan-osman
nathan-osman / iface-bcast.go
Created May 26, 2015 03:39
Derive Broadcast Address from CIDR
package main
import (
"encoding/binary"
"fmt"
"net"
)
// Derive the broadcast address from an address in CIDR notation
func broadcastAddress(s string) (net.IP, error) {
@nathan-osman
nathan-osman / CMakeLists.txt
Last active August 29, 2015 14:24
Demonstration of socket bug
cmake_minimum_required(VERSION 2.8.11)
project(socketbug)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
find_package(Qt5Network REQUIRED)
find_package(Qt5Test REQUIRED)
add_executable(socketbug TestSocketBug.cpp)
@nathan-osman
nathan-osman / httpstress.py
Created July 13, 2015 19:32
Stress test an HTTP server
#!/usr/bin/env python2
"""
HTTP Stress Tester
Copyright 2015 - Nathan Osman
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
@nathan-osman
nathan-osman / CMakeLists.txt
Last active April 8, 2016 06:23
Enumerate OpenCL platforms available
cmake_minimum_required(VERSION 2.8.11)
project(cltest)
find_package(OpenCL REQUIRED)
add_executable(cltest cltest.cpp)
include_directories(cltest ${OpenCL_INCLUDE_DIRS})
target_link_libraries(cltest ${OpenCL_LIBRARIES})