Skip to content

Instantly share code, notes, and snippets.

View SharkyRawr's full-sized avatar
🦄
Rawr

Sophie SharkyRawr

🦄
Rawr
View GitHub Profile
@SharkyRawr
SharkyRawr / libnbt_25.patch
Created April 10, 2011 16:15
Patch for libnbt issue #2
# HG changeset patch
# User schumann2k <schumann2k ]at[ googlemail [dot] com>
# Date 1302451499 -7200
# Node ID 8b9db3a4df0184c66c40c11b20a500a39391f802
# Parent 86ae6c959e53ec7ad6756d60fbe3e39d9b15da76
Added support for specifying the type of a NbtList (crucial for exporting .schematic files).
diff -r 86ae6c959e53 -r 8b9db3a4df01 LibNbt.Test/NbtFileTest.cs
--- a/LibNbt.Test/NbtFileTest.cs Sat Sep 18 17:07:44 2010 -0500
+++ b/LibNbt.Test/NbtFileTest.cs Sun Apr 10 18:04:59 2011 +0200
@SharkyRawr
SharkyRawr / backup.sh
Last active July 26, 2020 22:20
Aprilon Minecraft Server backup script
#!/bin/bash
SESSION="survival"
BACKUPDIR="/home/mc/backups/$SESSION"
WORLDS="world world_nether"
# For debugging
#set -x
#trap read debug
import os, sys, subprocess, shlex, argparse, multiprocessing
def dir(path):
if os.path.isdir(path):
return path
else:
raise argparse.ArgumentTypeError("%s is not a valid directory" % (path))
def process_dir(path, dest):
files = os.listdir(path)
bool quit = false;
SDL_Event e;
Uint32 tick = SDL_GetTicks(), lastTick = tick;
while (!quit) {
SDL_SetRenderDrawColor(ren, 0, 0, 0, 255);
SDL_RenderClear(ren);
// Processing, drawing, advance time, etc...
while (SDL_PollEvent(&e)) {
@SharkyRawr
SharkyRawr / valve2cube.py
Created March 21, 2015 06:48
Valve GoldSrc/Source engine skybox to Cubemap composer
from PIL import Image
import sys, os, re
from os import path
transforms = (
('FT', 90), ('BK', 270), ('LF', 180), ('RT', 0), ('UP', 0), ('DN', 180)
)
def usage():
# Source: http://www.hakspek.com/security/updates-make-windows-7-and-8-spy-on-you-like-windows-10/
# Discussion on HN: https://news.ycombinator.com/item?id=10110155
KB2505438
KB2670838 - Windows 7 Only (corrupts AERO and blurry fonts on some websites)
KB2952664
KB2976978 - Windows 8 only
KB3021917
KB3035583
KB3075249
@SharkyRawr
SharkyRawr / webstats.py
Created January 8, 2016 08:49
Python webalizer wrapper
#! /usr/bin/env python3
import os, sys, re
from subprocess import call
from os.path import join
LOGDIR = '/var/log/nginx'
OUTDIR = '/home/htdocs/internal/stats/'
WEBALIZER_OPTS = [
'/usr/local/bin/webalizer-RB30', # Binary
# -- parf of a class that handles all User API interactions --
def upload_video(self, path, title):
import os
if not os.path.exists(path):
raise IOError("file not found", path)
info = os.stat(path)
size = info.st_size
fn = os.path.basename(path)
#! /bin/bash -e
IPT=`which iptables`
SUBNET="192.168.22.0/16"
IF_PUB="eth0"
IF_PRIV="virbr0"
VMS="FROXLOR GAMESERVER WINDOWS NYANCOIN"
<?php
define('CACHE_ENABLED', true);
define('CACHE_TTL', 60*60); // 1 minute
define('DEBUG', FALSE);
// NEEDS PATH_INFO env var !!!
// nginx: fastcgi_param PATH_INFO $fastcgi_path_info;
$fr = $_SERVER['PATH_INFO'];