This file contains hidden or 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 | |
# | |
# Simple script to extract your notes from Notes.app's sqlite3 database. It | |
# places the HTML files in the current working directory. The database store | |
# should be located at: | |
# | |
# ~/Library/Containers/com.apple.Notes/Data/Library/Notes/NotesV1.storedata | |
# | |
# This file is released in the public domain. |
This file contains hidden or 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 | |
# | |
# This file is placed in the public domain. | |
import struct | |
coordinate_name_map = {'x': 'SpawnX', 'X': 'SpawnX', 'SpawnX': 'SpawnX', | |
'y': 'SpawnY', 'Y': 'SpawnY', 'SpawnY': 'SpawnY', |
This file contains hidden or 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 signal | |
import os | |
import psutil | |
def sighandler(signum, frame): | |
with open('/tmp/trapped', 'a') as f: | |
pid = os.getpid() | |
parent = psutil.Process(pid).parent | |
f.write('PID {3} captured signal {0}, parent {1} ({2}).\n'.format(signum,parent.name, parent.pid,pid)) |
This file contains hidden or 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 file is in the public domain. | |
class MyNumber(int): | |
def __init__(self, x=0, base=10): | |
super(int, self).__init__() | |
self.marked = False | |
This file contains hidden or 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 file is in the public domain. | |
class FizzBuzz(object): | |
def __init__(self, low, high=None): | |
if high is None: | |
self.high = low | |
self.current = 1 | |
else: |
This file contains hidden or 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
/* | |
force-inet4-or-inet6.c - hack to force applications to use IPv4 or IPv6 exclusively | |
compilation: cc -fPIC -shared -DUSE_INET4 -o force-inet4.so force-inet4-or-inet6.c | |
cc -fPIC -shared -DUSE_INET6 -o force-inet6.so force-inet4-or-inet6.c | |
usage: LD_PRELOAD=/path/to/library.so program args ... | |
This file is in the public domain. | |
*/ |
This file contains hidden or 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 | |
# Makes me mad that I had to write this. Damn you mac os x 10.5.8. | |
# I, Winston Weinert, hereby put this file in the public domain. | |
import hashlib | |
class Checksum(object): |
This file contains hidden or 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 php | |
<?php | |
// Config: | |
// [minecraft_users] | |
// env.host awesomeserver.com | |
// env.port 25566 | |
error_reporting(E_ERROR | E_PARSE); | |
$host = getenv('host'); |
This file contains hidden or 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
#!/bin/sh | |
now() { | |
date '+%F %T' | |
} | |
Tarsnap='/usr/local/bin/tarsnap' | |
Hostname="$(hostname -s)" | |
BackupTarget="$2" | |
JobName="$Hostname-$1" | |
BackupDate="$(date +%F)" | |
BackupName="$JobName-$BackupDate" |
This file contains hidden or 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 | |
import collections | |
import os | |
def make_email_dict(email): | |
"""Make an email dictionary. | |
OlderNewer