Skip to content

Instantly share code, notes, and snippets.

@emptypage
emptypage / new.cmd
Created February 15, 2015 00:48
A batch to create new file(s) from templates.
@echo off
setlocal enabledelayedexpansion
set TemplateDir=new-templates
REM # If no args are given, show help (and exit).
if "%1"=="" goto HELP
REM # Options
if /i "%1" == "/?" goto HELP
@emptypage
emptypage / redirect-package.py
Last active August 29, 2015 14:15
Create hard links / junctions to the system-installed packages in a given virtualenv ("site-packages") directory.
#!/usr/bin/env python
#
# Create hard links / junctions to the system-installed packages in
# a given virtualenv ("site-packages") directory.
#
#
# Background
# ==========
#
# Some libraries such as wxPython do not support pip installation yet.
@emptypage
emptypage / wol.py
Created August 17, 2014 05:09
Send the magic packet of Wake on LAN
#!/usr/bin/env python
import binascii
import socket
PORT_DEFAULT = 9
IPADDR_DEFAULT = '<broadcast>'
_USAGE = """Usage:
python wol.py [options] <MAC address>...
#!/usr/bin/env python
"""Sample script which uses event.py (improved). """
import event
class Publisher(object):
# Set event object in class declaration.