Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 / 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 / lasi.rst
Created January 22, 2011 21:47
A draft of a Lua gateway interface to replace WSAPI.

Lua Application/Server Interface version 1.0

Author

Matthew "LeafStorm" Frazier <leafstormrush@gmail.com>

Date

February 4, 2011

Status

Early draft

This document specifies an interface between Web servers and Web applications written in the Lua programming language, to promote interoperability between Web servers and the development of an ecosystem of reusable components for Lua

@leafstorm
leafstorm / gist:782073
Created January 16, 2011 19:39
Example Thor file for testing using Gists with Thor.
class Hello < Thor
include Thor::Actions
desc "hello NAME", "says hello to the given NAME"
def hello (name="World")
say "Hello, #{name}! It's nice to meet you!"
end
end
@leafstorm
leafstorm / networking.rst
Created January 7, 2011 19:49
This is a sample chapter that doesn't make much sense after the first section intended to demonstrate reStructuredText for the Lua cookbook.

Networking with LuaSocket

Matthew Frazier <leafstormrush@gmail.com>

The most common library for networking in Lua is LuaSocket by Diego Nehab. In addition to low-level support for communicating directly through sockets, it also includes:

@leafstorm
leafstorm / shapefile-urls.txt
Created April 6, 2015 16:03
The URL's to every shapefile offered for download by Wake County. `wget -i shapefile-urls.txt`
ftp://wakeftp.co.wake.nc.us/GIS/WebDownloads/SHAPEFILES/Raleigh_Buildings_2013.zip
ftp://wakeftp.co.wake.nc.us/GIS/WebDownloads/SHAPEFILES/Raleigh_Communications_2013.zip
ftp://wakeftp.co.wake.nc.us/GIS/WebDownloads/SHAPEFILES/Raleigh_ElectricUtilities_2013.zip
ftp://wakeftp.co.wake.nc.us/GIS/WebDownloads/SHAPEFILES/Raleigh_FireResponse_2015_02.zip
ftp://wakeftp.co.wake.nc.us/GIS/WebDownloads/SHAPEFILES/Raleigh_Hydrology_2013.zip
ftp://wakeftp.co.wake.nc.us/GIS/WebDownloads/SHAPEFILES/Raleigh_HydrologyAreas_2013.zip
ftp://wakeftp.co.wake.nc.us/GIS/WebDownloads/SHAPEFILES/Raleigh_MiscLines_2013.zip
ftp://wakeftp.co.wake.nc.us/GIS/WebDownloads/SHAPEFILES/Raleigh_MiscPolys_2013.zip
ftp://wakeftp.co.wake.nc.us/GIS/WebDownloads/SHAPEFILES/Raleigh_Parking_2013.zip
ftp://wakeftp.co.wake.nc.us/GIS/WebDownloads/SHAPEFILES/Raleigh_Railroads_2013.zip
@leafstorm
leafstorm / tillis-letter.txt
Created February 4, 2015 03:15
Letter to Sen. Thom Tillis regarding his recent statements on hand-washing.
Dear Sen. Tillis,
While it may be the case that some unnecessary regulations are overburdening
our small businesses, the idea that requiring employees to wash their hands
after using the bathroom is unnecessary is completely disgusting. Washing
hands is acknowledged by every medical authority ever as a critical way to
prevent the spread of germs and other contaminants. The idea that public
establishments should be able to forgo such requirements shows a serious
lack of concern for the health of your constituents. I strongly encourage
you to apologize for your use of hand-washing as an example of an "unnecessary