Skip to content

Instantly share code, notes, and snippets.

View davidhamann's full-sized avatar

David Hamann davidhamann

View GitHub Profile
@mprahl
mprahl / sid2str.py
Created October 30, 2016 01:53
Python 2.7/3.5 function to convert an Active Directory binary SID to string format (sid_to_str)
import sys
import struct
def sid_to_str(sid):
""" Converts a hexadecimal string returned from the LDAP query to a
string version of the SID in format of S-1-5-21-1270288957-3800934213-3019856503-500
This function was based from: http://www.gossamer-threads.com/lists/apache/bugs/386930
"""
# The revision level (typically 1)
@offsky
offsky / NewMacConfig.md
Last active July 3, 2017 15:50
Setup new mac for web development (Updated for Yosemite)
@phobson
phobson / process_cursor.py
Created July 5, 2012 23:34
Process a pyodbc database cursor into a numpy record array or pandas dataframe
import pyodbc
import numpy as np
import datetime
import pandas
def processCursor(cur, dataframe=False):
datatypes = []
colinfo = cur.description
for col in colinfo:
if col[1] == unicode: