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 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
# minijinja is in public domain | |
class MiniJinja(object): | |
""" Template engine that knows how to render {{ tag }} """ | |
def __init__(self, templates='.'): | |
"""templates - template path""" | |
import re | |
import sys | |
self.PY3K = sys.version_info[0] == 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
# --- communicating.. networking.. --- | |
__author__ = "anatoly techtonik <[email protected]>" | |
__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
#!/usr/bin/env python | |
# | |
# the code is in public domain | |
# gist:4009c397f8f8aff31a46 | |
# | |
# history: | |
# 1.2 - rename to saveclip.py | |
# 1.1 - mention what library should be installed | |
# 1.0 - make get_avail_filename() function |
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 | |
""" | |
usage: python -m sha1 <filename> | |
""" | |
import sys | |
import hashlib | |
# --- these fields are required for packaging | |
__version__ = '1.0' | |
__author__ = 'anatoly techtonik <[email protected]>' |
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
#!/usr/bin/env python | |
""" | |
Public domain work by anatoly techtonik <[email protected]> | |
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
import sys | |
PY3K = sys.version_info[0] == 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
import os | |
def get_nic_ids(): | |
return os.listdir('/sys/class/net') | |
# Linux: Yes | |
# MacOS: Unknown | |
# FreeBSD: Unknown | |
# Windows: No |