Skip to content

Instantly share code, notes, and snippets.

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
#!/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"""
@gschizas
gschizas / bot.py
Last active September 21, 2015 12:09
# coding: utf-8
import urllib.parse
import praw
import configparser
import datetime
import http.server
import webbrowser
from dateutil.parser import parse as dateparser
@gschizas
gschizas / autorename.sql
Created September 15, 2012 18:22
Automatically rename a SQL Server based on the current computer host name
/*
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
@gschizas
gschizas / win32clipboard.py
Created August 30, 2013 19:09
Interact with windows clipboard
import win32clipboard
# set clipboard data
win32clipboard.OpenClipboard()
win32clipboard.SetClipboardText('testing 123')
win32clipboard.CloseClipboard()
# get clipboard data
win32clipboard.OpenClipboard()
data = win32clipboard.GetClipboardData()
#!/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

Keybase proof

I hereby claim:

  • I am gschizas on github.
  • I am gschizas (https://keybase.io/gschizas) on keybase.
  • I have a public key ASD4uKtSwtlHfeC5nRdobKjAsWo_Eh7qGd7PWyTmtpYbZAo

To claim this, I am signing this object:

@gschizas
gschizas / spell.py
Created November 23, 2011 20:05
Spell almost any email in NATO phonetic alphabet
#!/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',
@gschizas
gschizas / build_install_tig.sh
Last active March 27, 2018 11:23
Build and install tig from sources
#!/usr/bin/env sh
ver=$(curl https://api.github.com/repos/jonas/tig/releases/latest | jq --raw-output '.tag_name[4:]')
sudo apt install -y libncurses5-dev
wget -c https://github.com/jonas/tig/releases/download/tig-$ver/tig-$ver.tar.gz
tar -xzvf tig-$ver.tar.gz
cd tig-$ver/
make prefix=/usr/local/
sudo make install install-doc prefix=/usr/local/
@gschizas
gschizas / build_install_git.sh
Last active March 31, 2018 08:12
Build and install git from sources
#!/usr/bin/env sh
ver=$(curl https://api.github.com/repos/git/git/tags | jq -r 'first(.[].name | select(test("v\\d\\.\\d+\\.\\d+$")))[1:]')
sudo apt install -y \
dh-autoreconf libcurl4-gnutls-dev libexpat1-dev \
gettext zlib1g-dev libssl1.0-dev \
asciidoc xmlto docbook2x
# getopt