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 | |
""" | |
Public domain work by anatoly techtonik <techtonik@gmail.com> | |
History: | |
1.0 - parse URL string and split into attributes | |
2.0 - modify properties to reconstruct URL with str() | |
""" |
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
# --- communicating.. networking.. --- | |
__author__ = "anatoly techtonik <techtonik@gmail.com>" | |
__license__ = "MIT/Public Domain/CC0" | |
__version__ = "1.0.beta1" | |
import socket | |
IP4 = socket.AF_INET | |
UDP = socket.SOCK_DGRAM |
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
# Windows 4Gb memory limit patcher (unlocks access to 128Gb) | |
# (thanks to Geoff Chappell for original research) | |
# http://www.geoffchappell.com/notes/windows/license/memory.htm | |
# Check if patch for 128Gb Windows NT extensions is up to date | |
# | |
# [x] check that size of ntkrnlpa.exe and ntkr128g.exe (patched) matches | |
# [x] read File Version in .exe for reporting | |
# [ ] find signature in new original file | |
# [ ] show previous offsets for known File Versions and new |
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 | |
# Remove merged git branches. Cross-platform way to execute: | |
# | |
# git branch --merged | grep -v master | xargs git branch -d | |
# | |
# Requires gitapi - https://bitbucket.org/haard/gitapi | |
# License: Public Domain | |
import gitapi | |
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
# Windows stores configured WiFi networks as Profile | |
# [ ] this needs to be run under administrator | |
# [ ] detect that it is not | |
try: | |
import _winreg # Python 2 | |
except ImportError: | |
import winreg # Python 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
# Solve problem of Python 2.7 defaults | |
# 1. switch internal Python 2 encoging from internal ASCII to Unicode | |
# (this fixes interoperability of Jinja2 with tools that use binary | |
# utf-8 for passing strings instead of Unicode, e.g. Roundup) | |
import sys | |
reload(sys) | |
sys.setdefaultencoding('utf-8') | |
# 2. do not fail on printing stuff to stdout/stderr, but escape it | |
# (removes negative emotions trying to debug binary strings with print) | |
import codecs |
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
""" | |
The code is placed in to public domain by | |
anatoly techtonik <techtonik@gmail.com> | |
Produce readable representation of variable content, | |
including custom properties for complex objects. | |
Needed features: | |
[ ] easy import | |
[ ] sane defaults |
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
{ | |
"nodes": [ | |
"wesnothd", | |
"wesnothd.exe", | |
"ban.o", | |
"ban.cpp", | |
"forum_user_handler.o", | |
"forum_user_handler.cpp", | |
"game.o", | |
"game.cpp", |
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 | |
"""\ | |
ssh agent wrapper to detect or run agent, set environment | |
and either show it or execute specified command in this | |
environment. | |
usage: ssh-agent.py | |
ssh-agent.py <command> | |
examples: |
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
def get_svn_path_revision(path): | |
"""return latest modification revision of a path inside svn | |
:raise: EnvironmentError if SVN working copy format is unknown | |
:return: int | |
""" | |
from os.path import basename, dirname, join, isdir | |
if isdir(path): | |
entries_path = join(path, ".svn", "entries") |
OlderNewer