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/python | |
# -*- coding: utf-8 -*- | |
# inspired by a comment in http://redd.it/mmr8m | |
import sys | |
letters = {' ': 'space', | |
'a': 'alfa', 'b': 'bravo', 'c': 'charlie', 'd': 'delta', |
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
/* | |
This script can be used to automatically rename a SQL Server | |
based on the current computer host name | |
Run this script after: | |
Computer Name Changed | |
Virtual Machine Cloned | |
*/ | |
DECLARE |
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/python | |
# This is a simple port-forward / proxy, written using only the default python | |
# library. If you want to make a suggestion or fix something you can contact-me | |
# at voorloop_at_gmail.com | |
# Distributed over IDC(I Don't Care) license | |
# http://voorloopnul.com/blog/a-python-proxy-in-less-than-100-lines-of-code/ | |
import socket | |
import select | |
import time | |
import sys |
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
r = requests.get(file_url) | |
size = int(r.headers['Content-Length'].strip()) | |
self.bytes = 0 | |
widgets = [name, ": ", Bar(marker="|", left="[", right=" "), | |
Percentage(), " ", FileTransferSpeed(), "] ", | |
self, | |
" of {0}MB".format(str(round(size / 1024 / 1024, 2))[:4])] | |
pbar = ProgressBar(widgets=widgets, maxval=size).start() | |
file = [] | |
for buf in r.iter_content(1024): |
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
# see http://msdn2.microsoft.com/en-us/library/bb201634.aspx | |
# | |
# *NdisDeviceType | |
# | |
# The type of the device. The default value is zero, which indicates a standard | |
# networking device that connects to a network. | |
# | |
# Set *NdisDeviceType to NDIS_DEVICE_TYPE_ENDPOINT (1) if this device is an | |
# endpoint device and is not a true network interface that connects to a network. | |
# For example, you must specify NDIS_DEVICE_TYPE_ENDPOINT for devices such as |
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 win32clipboard | |
# set clipboard data | |
win32clipboard.OpenClipboard() | |
win32clipboard.SetClipboardText('testing 123') | |
win32clipboard.CloseClipboard() | |
# get clipboard data | |
win32clipboard.OpenClipboard() | |
data = win32clipboard.GetClipboardData() |
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
Function HexDump(text) | |
hexdigits = "" | |
plaintext = "" | |
output = "" | |
For i = 1 to Len(text) | |
current = Mid(text, i, 1) | |
hexdigits = hexdigits & Right("0" & Hex(Asc(current)), 2) & " " | |
if Asc(current) >= 32 And Asc(current) < 127 Then | |
plaintext = plaintext & current | |
Else |
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 python3 | |
import struct | |
import re | |
class Wad(object): | |
"""Encapsulates the data found inside a WAD file""" | |
def __init__(self, wadFile): | |
"""Each WAD files contains definitions for global attributes as well as map level attributes""" |
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 python3 | |
# -*- coding: utf-8 -*- | |
import sys | |
import requests | |
import struct | |
import uuid | |
def java_uuid_hash_code(uuid): | |
leastSigBits, mostSigBits = struct.unpack('>QQ', uuid.bytes) | |
l1 = leastSigBits & 0xFFFFFFFF |
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
# coding: utf-8 | |
import urllib.parse | |
import praw | |
import configparser | |
import datetime | |
import http.server | |
import webbrowser | |
from dateutil.parser import parse as dateparser |
OlderNewer