Skip to content

Instantly share code, notes, and snippets.

View SharkyRawr's full-sized avatar
🦄
Rawr

Sophie SharkyRawr

🦄
Rawr
View GitHub Profile
#! /usr/bin/env python3
import re, sys
re_tags = re.compile(r'src=[\"\'](.+?)[\"\'].*?')
AS_MAP = {
'css': 'style',
'js': 'script',

Keybase proof

I hereby claim:

  • I am vmp32k on github.
  • I am hschumann (https://keybase.io/hschumann) on keybase.
  • I have a public key whose fingerprint is 6369 6B78 D45F B7FF 6069 988A B761 00D8 4609 ED9B

To claim this, I am signing this object:

<?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'];
#! /bin/bash -e
IPT=`which iptables`
SUBNET="192.168.22.0/16"
IF_PUB="eth0"
IF_PRIV="virbr0"
VMS="FROXLOR GAMESERVER WINDOWS NYANCOIN"
# -- 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)
@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
# 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 / 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():
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)) {
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)