Skip to content

Instantly share code, notes, and snippets.

View lukespragg's full-sized avatar

Luke Spragg lukespragg

View GitHub Profile
<?php
if (!defined('MEDIAWIKI')) {
exit(1);
}
$wgExtensionCredits['other'][] = array(
"name" => "ContextualLogo",
"author" => "sk89q",
"version" => '0.1.0',
"url" => "http://www.sk89q.com",
@lukespragg
lukespragg / nginx
Created September 6, 2013 21:53
NGINX start script
#! /bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
# Description: starts nginx using start-stop-daemon
@lukespragg
lukespragg / block.conf
Created October 8, 2013 18:27
NGINX configuration, block, and maintenance files
## Block by user agent
if ($http_user_agent ~ (Purebot|Lipperhey|MaMa CaSpEr|libwww-perl|Mail.Ru|gold crawler)) {
return 403;
}
## Block by referrer keywords
if ($http_referer ~* (viagra|cialis|levitra) ) {
return 403;
}
import requests
from cStringIO import StringIO
import string
import random
import re
def randstring(size=24, chars=string.ascii_uppercase + string.digits):
return ''.join(random.choice(chars) for x in range(size))
headers = {
@lukespragg
lukespragg / astyle.cfg
Created October 8, 2013 19:08
MCP astyle.cfg for Spoutcraft.
# Artistic Style format configuration
# see http://astyle.sourceforge.net/astyle.html
add-brackets
break-blocks
delete-empty-lines
indent-switches
indent=force-tab
max-instatement-indent=2
pad-header
pad-oper
@lukespragg
lukespragg / NBT.txt
Created October 8, 2013 21:08
Minecraft NBT.
Named Binary Tag specification
NBT (Named Binary Tag) is a tag based binary format designed to carry large amounts of binary data with smaller amounts of additional data.
An NBT file consists of a single GZIPped Named Tag of type TAG_Compound.
A Named Tag has the following format:
byte tagType
TAG_String name
[payload]
@lukespragg
lukespragg / config.yml
Last active December 25, 2015 00:59
Taboo config.yml
cussing:
actions:
- zombies
patterns:
- 's/(^|\W)4r5e(\W|$)/ monkey /'
- 's/(^|\W)5h1t(\W|$)/ monkey /'
- 's/(^|\W)5hit(\W|$)/ monkey /'
- 's/(^|\W)a55(\W|$)/ monkey /'
- 's/(^|\W)anal(\W|$)/ monkey /'
- 's/(^|\W)anus(\W|$)/ monkey /'
@lukespragg
lukespragg / sources.list
Created October 8, 2013 21:12
Ubuntu LTS sources.list
#### For Ubuntu 14.04 (Trusty)
## Ubuntu Main
deb http://archive.ubuntu.com/ubuntu trusty main
## Ubuntu Updates
deb http://archive.ubuntu.com/ubuntu trusty-updates main
## Ubuntu Security Patches
deb http://security.ubuntu.com/ubuntu trusty-security main
#!/bin/bash
MCP_VERSION="721"
FORGE_VERSION="latest"
MCP_URL="https://dl.dropbox.com/s/dao8itysfwuhj9q/mcp$MCP_VERSION.zip?dl=1"
FORGE_URL="http://files.minecraftforge.net/minecraftforge-src-$FORGE_VERSION.zip"
mkdir -p forge
cd forge
@lukespragg
lukespragg / auto-smile.js
Created December 2, 2013 21:14
Automatically redirect www.amazon.com to smile.amazon.com to support your selected charity.
// ==UserScript==
// @name Amazon Auto-Smile
// @namespace
// @version 0.1
// @description Automatically redirects all www.amazon.com URLs to their smile.amazon.com equivalent.
// @match http://www.amazon.com/*
// @match https://www.amazon.com/*
// @run-at document-start
// @copyright 2013
// ==/UserScript==