Skip to content

Instantly share code, notes, and snippets.

Nathan Ostgard noonat

Block or report user

Report or block noonat

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View sha1.js
window.sha1 = (function() {
/*
* A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
* in FIPS 180-1
* Version 2.2 Copyright Paul Johnston 2000 - 2009.
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
* Distributed under the BSD License
* See http://pajhome.org.uk/crypt/md5 for details.
*/
@noonat
noonat / coreos-virtualbox.md
Last active Oct 29, 2019
Installing CoreOS on VirtualBox
View coreos-virtualbox.md
  • Download and install VirtualBox.
  • Download the CoreOS ISO
  • Create a new VM in VirtualBox
    • For the OS, Other Linux, 64-bit should be fine
    • Give the VM 1gb of memory, like your physical hardware has.
    • Create a disk of whatever size you want. I made a VMDK file that could expand dynamically up to 8gb.
  • Mount the ISO in the VM
    • Right click on the VM and click settings
    • Go to the storage tab
@noonat
noonat / gist:1649543
Created Jan 20, 2012
Rake Quick Reference
View gist:1649543
# Rake Quick Reference
# by Greg Houston
# http://ghouston.blogspot.com/2008/07/rake-quick-reference.html
# -----------------------------------------------------------------------------
# Running Rake
# -----------------------------------------------------------------------------
# running rake from the command-line:
# rake --help
@noonat
noonat / webrtc-data-channels.js
Last active Jun 17, 2019
WebRTC Data Channels
View webrtc-data-channels.js
// This is a bare bones example of creating a data channel between two WebRTC
// peers. Let's imagine two peers trying to connect to each other. We'll call
// one the "offer peer", and the other the "answer peer". The offer peer will
// be the one initiating a connection, and the answer peer will be the one
// responding to it.
//
// The two peers must use a separate connection to negotiate their connection.
// A websocket connection to a shared server is often used for this negotiation.
// They will exchange offers and answers using the websocket. Each peer will
// also attempt to discover more details about themselves (ICE), such as their
View gevent_threads.py
"""This is an example of cooperating between a gevent hub and normal threads."""
import gevent
import socket as _socket
from gevent import hub, socket, _threading
conns = _threading.Queue()
@noonat
noonat / cube.mtl
Created Aug 8, 2011
Cube OBJ and MTL file
View cube.mtl
newmtl cube
Ns 10.0000
Ni 1.5000
d 1.0000
Tr 0.0000
Tf 1.0000 1.0000 1.0000
illum 2
Ka 0.0000 0.0000 0.0000
Kd 0.5880 0.5880 0.5880
Ks 0.0000 0.0000 0.0000
@noonat
noonat / extract_swf.py
Created Feb 10, 2011
Extract potential SWF files from projector binaries
View extract_swf.py
import os.path
import struct
import sys
import traceback
import zlib
if len(sys.argv) < 2:
print >> sys.stderr, "usage: %s <filename>" % sys.argv[0]
sys.exit(1)
filename = sys.argv[1]
@noonat
noonat / extract_pak.c
Created Aug 5, 2011
Extract files from a Quake PAK
View extract_pak.c
// Extract a PAK file (from Quake 1 and 2)
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
typedef struct {
char id[4];
View keybase.md

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@noonat
noonat / gevent_thread_wait.py
Created Feb 23, 2017
Spawn a thread and make the greenlet wait for it to exit.
View gevent_thread_wait.py
from __future__ import print_function
import time
import gevent
from gevent import hub, _threading
def ticker():
while True:
You can’t perform that action at this time.