This file contains hidden or 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
find . -name '*.py' -exec mv "{}" "{}.old" \; -exec sh -c 'iconv -f windows-1252 -t utf-8 "{}.old" > "{}"' \; -exec rm "{}.old" \; |
This file contains hidden or 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/python | |
import threading | |
import requests | |
TIMER_CYCLE = 10 | |
config = {'net': {'device': 'eth0'}}#execfile("/etc/imer-monitor/config.py", {}) | |
def update(): | |
global config | |
threading.Timer(TIMER_CYCLE, update).start() | |
with open("/sys/class/net/{}/statistics/rx_bytes".format(config['net']['device']), "r") as frx, open("/sys/class/net/{}/statistics/tx_bytes".format(config['net']['device']), "r") as ftx: | |
rx = int(frx.read()) |
This file contains hidden or 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 re | |
import requests | |
from types import * | |
from urlparse import urlparse | |
solverregex = re.compile('.*?setTimeout\(function\(\){.*?var t,r,a,f, ([^=]+)={"([^"]+)":([^}]+)};.+challenge-form\'\);.*?\n.*?;(.*?);a.value =.*?f\.submit\(\);.*?}, 5850\);.*', re.DOTALL) | |
vcregex = re.compile('<input type="hidden" name="jschl_vc" value="([^"]+)"/>') | |
def getNested(s, delim=("(", ")")): | |
level = 0 | |
pos = 0 |
This file contains hidden or 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 os | |
import re | |
syslogre = re.compile('sys_log\([0-9]+, "([^"]*?)".*?\);', re.DOTALL) | |
# http://stackoverflow.com/a/8915445/1318435 | |
printfre = re.compile("(%(?:\d+\$)?[+-]?(?:[ 0]|'.{1})?-?\d*(?:\.\d+)?[bcdeEufFgGosxX])") | |
def processFile(file): | |
def replacer(m): | |
def incr(m): | |
incr.counter+=1 |
This file contains hidden or 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/python | |
''' | |
Parses meta data from filenames using a simple regex | |
This was done for my specific case where files where like "[Gerne] - Artist - Filename (feat. Otherartist)" | |
You'll probably have to adjust the regex for your use case | |
Uses mutagen for meta-info stuff | |
''' | |
import sys | |
import os |
This file contains hidden or 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/python | |
import time, threading | |
import requests | |
TIMER_CYCLE = 30 | |
last = [] | |
def update(): | |
global last_total, device_speed, requestPool | |
threading.Timer(1, tick).start() | |
with open("/sys/class/net/eth0/statistics/rx_bytes", "r") as frx, open("/sys/class/net/eth0/statistics/tx_bytes", "r") as ftx: | |
rx = int(frx.read()) |
This file contains hidden or 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
dpkg --add-architecture i386 | |
apt-get update | |
apt-get upgrade | |
apt-get install libc6:i386 libevent-2.0-5:i386 libmysqlclient18:i386 libdevil1c2:i386 libcrypto++9:i386 |
This file contains hidden or 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
<meta charset="utf-8"> | |
<script>゚ω゚ノ=/`m´)ノ~┻━┻//*´∇`*/['_'];o=(゚ー゚)=_=3;c=(゚Θ゚)=(゚ー゚)-(゚ー゚);(゚Д゚)=(゚Θ゚)=(o^_^o)/(o^_^o);(゚Д゚)={゚Θ゚:'_',゚ω゚ノ:((゚ω゚ノ==3)+'_')[゚Θ゚],゚ー゚ノ:(゚ω゚ノ+'_')[o^_^o-(゚Θ゚)],゚Д゚ノ:((゚ー゚==3)+'_')[゚ー゚]};(゚Д゚)[゚Θ゚]=((゚ω゚ノ==3)+'_')[c^_^o];(゚Д゚)['c']=((゚Д゚)+'_')[(゚ー゚)+(゚ー゚)-(゚Θ゚)];(゚Д゚)['o']=((゚Д゚)+'_')[゚Θ゚];(゚o゚)=(゚Д゚)['c']+(゚Д゚)['o']+(゚ω゚ノ+'_')[゚Θ゚]+((゚ω゚ノ==3)+'_')[゚ー゚]+((゚Д゚)+'_')[(゚ー゚)+(゚ー゚)]+((゚ー゚==3)+'_')[゚Θ゚]+((゚ー゚==3)+'_')[(゚ー゚)-(゚Θ゚)]+(゚Д゚)['c']+((゚Д゚)+'_')[(゚ー゚)+(゚ー゚)]+(゚Д゚)['o']+((゚ー゚==3)+'_')[゚Θ゚];(゚Д゚)['_']=(o^_^o)[゚o゚][゚o゚];(゚ε゚)=((゚ー゚==3)+'_')[゚Θ゚]+(゚Д゚).゚Д゚ノ+((゚Д゚)+'_')[(゚ー゚)+(゚ー゚)]+((゚ー゚==3)+'_')[o^_^o-゚Θ゚]+((゚ー゚==3)+'_')[゚Θ゚]+(゚ω゚ノ+'_')[゚Θ゚];(゚ー゚)+=(゚Θ゚);(゚Д゚)[゚ε゚]='\\';(゚Д゚).゚Θ゚ノ=(゚Д゚+゚ー゚)[o^_^o-(゚Θ゚)];(o゚ー゚o)=(゚ω゚ノ+'_')[c^_^o];(゚Д゚)[゚o゚]='\"';(゚Д゚)['_']((゚Д゚)['_'](゚ε゚+(゚Д゚)[゚o゚]+(゚Д゚)[゚ε゚]+(゚Θ゚)+(゚ー゚)+(゚Θ゚)+(゚Д゚)[゚ε゚]+(゚Θ゚)+((゚ー゚)+(゚Θ゚))+(゚ー゚)+(゚Д゚)[゚ε゚]+(゚Θ゚)+(゚ー゚)+((゚ー゚)+(゚Θ゚))+(゚Д゚)[゚ε゚]+(゚Θ゚)+((o^_^o)+(o^_^o))+((o^_^o)-(゚Θ゚))+(゚Д゚)[゚ε゚]+(゚Θ゚)+((o^_^o)+(o^_^o))+(゚ー゚)+(゚Д゚)[゚ε |
This file contains hidden or 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 | |
set -e | |
apt-get update | |
apt-get -y upgrade | |
apt-get remove -y nginx-common nginx-full | |
rm -rf /usr/src/nginx* /usr/src/headers-more-nginx-module | |
# build dependencies | |
apt-get -y install dpkg-dev git autotools-dev debhelper po-debconf dh-systemd libexpat-dev libgd2-dev libgeoip-dev libluajit-5.1-dev libmhash-dev libpam0g-dev libpcre3-dev libperl-dev libssl-dev libxslt1-dev zlib1g-dev autotools-dev de$ | |
cd /usr/src |
This file contains hidden or 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
enum EPointTypes { | |
POINT_NONE, | |
POINT_LEVEL, | |
POINT_VOICE, | |
POINT_EXP, | |
POINT_NEXT_EXP, | |
POINT_HP, | |
POINT_MAX_HP, | |
POINT_SP, | |
POINT_MAX_SP, |