Skip to content

Instantly share code, notes, and snippets.

@leafstorm
leafstorm / craftr.rb
Created June 5, 2011 15:17
Minecraft server management script
#!/usr/bin/env ruby
# craftr
# This manages a Craftbukkit server. It helps you start it, stop it,
# back up your world, and download specific Craftbukkit builds.
# You must "gem install thor" first.
# Run it in your server directory.
require 'thor'
require 'yaml'
@leafstorm
leafstorm / activate.fish
Created August 15, 2011 17:39
Better activate function for fish
# drop this in your ~/.config/fish/functions
function activate --description "Activate a virtual environment"
# find the target
set target $argv[1]
if test -z $target
set target $PWD
end
# expand the path in $target
@leafstorm
leafstorm / index_template.html
Created September 8, 2011 02:19
UnWRAP, a WRAP authentication relay for NCSU. Actual UnWRAP script, Python library, and example Flask app with template. Released under the MIT license.
<!doctype html>
<html>
<head>
<title>UnWRAP Test</title>
<style type="text/css">
p.flash {
font-style: italic;
text-align: center;
}
p.message {
@leafstorm
leafstorm / distribute_installer.sh
Created October 18, 2011 22:56
Script that installs Distribute, pip, and virtualenv in your home directory.
#!/bin/sh
version=2.6
python=python$version
echo "== This script will install Distribute, pip, and virtualenv"
echo " in your home directory for Python $version."
DISTRIBUTE_TEMP=$(mktemp -p "${TMPDIR:-.}" -d distribute-XXX) || {
echo "Could not create temporary working directory"
exit 1
@leafstorm
leafstorm / benchmarks-aof-everysec.txt
Created February 11, 2012 21:43
Some Redis benchmarks on short.csc.ncsu.edu
# Benchmarks run with the Append Only File on everysec
# redis-server run with default settings, except for appendonly yes
# src/redis-benchmark -d 16 -n 1000000
# at the end of the benchmark, appendonly.aof was 48 MB
====== PING (inline) ======
1000000 requests completed in 6.54 seconds
50 parallel clients
16 bytes payload
@leafstorm
leafstorm / gist:2323188
Created April 6, 2012 21:43
PEG.js parser for DCPU-16 assembly language
/**
* Parser for DCPU-16 assembly language.
* This parser should accurately parse all of Notch's example code, and most
* of the community's code.
* It converts instructions to objects with fields {op, params, label}.
* op is the lowercased opcode, params is the parameters passed to it (as
* values), and label is the label prefixing the statement (null if the
* statement is unlabelled).
* Values have a type field and one or two others depending on the type.
*
@leafstorm
leafstorm / gist:2907123
Created June 10, 2012 19:53
ItemBox, A serialization format I never got around to implementing

ItemBox 1.0 draft 1

ItemBox is a binary format for serializing data in a language-independent way, similar to JSON, YAML, BSON, MessagePack, and other formats. ItemBox is specifically designed for encoding and decoding speed, space efficiency, and ease of implementation.

Types Representable

@leafstorm
leafstorm / gist:3342583
Created August 13, 2012 17:20
The LUG @ NC State Brand Book

LUG @ NC State Brand Book

This is our totally strict set of guidelines about how to refer to the Linux Users' Group at NC State University, and produce print media about the LUG.

Names

The official, formal name of the LUG is "the Linux Users' Group at North Carolina State University." Never use this except when drafting legal documents.

In situations where a "full" name (but not a legal name) is necessary, use "Linux Users' Group at NC State University." For a shorter name, use "LUG @ NC State."

@leafstorm
leafstorm / gist:4173435
Created November 30, 2012 02:37
Wolfline Route Naming and Numbering Proposal

Wolfline Route Naming and Numbering Proposal

Matthew Frazier, Department of Computer Science

With the new route restructuring proposed by HDR Engineering for the NC State Wolfline service, the Wolfline has an opportunity to rearrange its route names and numbering into a more cleanly organized system.

Demonstration Network

The original draft of this plan used the 10-year Wolfline service plan as proposed by HDR Engineering. However, at the publication of the Wolfline Fall 2012 system map, it became apparent that NC State Transportation did not plan to follow the plan exactly. (Not that I mind.)

@leafstorm
leafstorm / gist:4238078
Created December 8, 2012 01:35
LUG @ NC State Constitution, Markdownified

% Constitution of the Linux Users Group at North Carolina State University % % November 21, 2000

Name and Purpose

This organization shall be known as the Linux Users Group (LUG) at North Carolina State University.

The purpose of this organization is to promote the use and usability of