This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
from PIL import Image | |
import sys | |
import struct | |
def r8(f): | |
return ord(f.read(1)) | |
if len(sys.argv) <= 2: | |
print("Usage: %s <input> <output>" % sys.argv[0]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#You may have to tweak some things here | |
CC = gcc | |
CXX = g++ | |
FLAGS = -I/usr/include/python2.7 | |
CFLAGS = | |
CXXFLAGS = | |
LDFLAGS = | |
#Do not change anything beyond this point | |
CXXFLAGS += -std=c++11 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
from PIL import Image | |
def rgb_rgba_cmp(a, b): | |
if a[0] != b[0]: | |
return False | |
if a[1] != b[1]: | |
return False | |
if a[2] != b[2]: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
import struct | |
import binascii | |
def mkchunk(tp, data): | |
return struct.pack("!L", len(data)) + tp + data + struct.pack("!L", binascii.crc32(tp + data) & 0xffffffff) | |
def getchunk(f, tp): | |
f.seek(0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pygame, time | |
from pygame.locals import * | |
OFFCOLOR = (25,25,25) | |
ONCOLOR = (42,65,89) | |
BGCOLOR = (36,36,36) | |
FIELDSIZE = 25 | |
def rect(s, c, r): # We need to use this because it isn't drawn for some unknown reason when using pygame.draw.rect | |
for xx in range(r[0], r[2]): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Missing Things: | |
* jquery.min.js ( http://jquery.com/download/ ) | |
* highstock.js ( http://www.highcharts.com/download ) | |
* A cronjob for executing getvals.py | |
* A webserver with PHP [with SQLite3] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
###### Options ###### | |
MINETESTDIR=/home/username/minetest | |
GAMENAME=minetest_game | |
WORLDDIR=none | |
MEDIADIR=./media | |
LEGACY_SYMLINKS=0 | |
# When settings this up be aware that the Minetest client |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Put this into (worldname)/players folder and execute it | |
find . -type f -not -name "*.sh" | xargs grep -iL PlayerArgsEnd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#include <string.h> | |
void xtea_encrypt(unsigned int num_rounds, uint32_t v[2], uint32_t const key[4]) { | |
unsigned int i; | |
uint32_t v0=v[0], v1=v[1], sum=0, delta=0x9E3779B9; | |
for (i=0; i < num_rounds; i++) { | |
v0 += (((v1 << 4) ^ (v1 >> 5)) + v1) ^ (sum + key[sum & 3]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
import sys, binascii, struct | |
def islower(c): | |
return (c.upper() != c) | |
def countin(s, c): | |
i = 0 | |
for b in s: | |
if b == c: | |
i += 1 | |
return i |