Skip to content

Instantly share code, notes, and snippets.

View TkTech's full-sized avatar
Converting coffee into code

Tyler Kennedy TkTech

Converting coffee into code
View GitHub Profile
Delivered-To: -snip-
Received: by 10.220.85.208 with SMTP id p16cs125450vcl;
Sat, 7 Jan 2012 16:12:54 -0800 (PST)
Received: by 10.182.197.10 with SMTP id iq10mr9514889obc.75.1325981573007;
Sat, 07 Jan 2012 16:12:53 -0800 (PST)
Return-Path: <mcbans@ddoscom.in>
Received: from bha (ddoscom.in. [176.31.206.194])
by mx.google.com with ESMTPS id zl3si13520493obb.65.2012.01.07.16.12.49
(version=TLSv1/SSLv3 cipher=OTHER);
* r3fuze
* Mischgasm
* iceli3
* fdsafd
* Symbicore
* ThePhoenix82
* Live4Chaos
* zumog
* b4bingo
* JasonFCP
#!/usr/bin/env python
# -*- coding: utf8 -*-
import re
import requests
# Regex used for authentication token.
_token_r = re.compile(r'name="authenticityToken" value="([0-9a-f]+)">')
# Regex used for server list entries.
_list_r = re.compile(
@TkTech
TkTech / pymineweb.py
Created March 13, 2012 06:45
Easy functions for playing with minecraft.net
#!/usr/bin/env python
# -*- coding: utf8 -*-
import re
import requests
# Regex used for authentication token.
_token_r = re.compile(r'name="authenticityToken" value="([0-9a-f]+)">')
# Regex used for server list entries.
_list_r = re.compile(
nbt = NBTFile('out.nbt')
for name, tag in nbt.value.iteritems():
print name, tag
-> % python silly_ip.py
{74: {125: {232: {211: 1, 20174: 1}}}, 79: {115: {74: {141: 1}}}}
> % python silly_ip.py
There are 1 items in the 74 bucket.
(74, 125, 232, 201) 1
(74, 125, 232, 211) 1
(74, 125, 232, 206) 1
There are 1 items in the 79 bucket.
(79, 115, 74, 141) 1
@TkTech
TkTech / test.py
Created May 30, 2012 00:00
test.py
======================================================================
ERROR: test_save (__main__.CreationTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "tests/creation_test.py", line 35, in test_save
self.nbt.save('__test__.nbt')
File "/home/tyler/Projects/PyNBT/pynbt/nbt.py", line 307, in save
g = gzip.GzipFile(fileobj=f, mode='wb') if compressed else f
File "/usr/lib/python3.2/gzip.py", line 201, in __init__
self._write_gzip_header()
#!/usr/bin/env python
# -*- coding: utf8 -*-
import sys
import json
import getopt
from jawa.core.jf import JarFile
from jawa.core.constants import ConstantClass, ConstantFieldRef
from __future__ import with_statement
import os
import sys
import random
import getopt
import string
from itertools import repeat
from urllib2 import Request, urlopen, URLError, HTTPError