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
extif="eth0" | |
set skip on lo | |
set block-policy drop | |
no rdr on { lo0 } from any to any | |
nat on $extif from ! ($extif) to any -> ($extif) |
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
# write UTF-8 to stdout | |
if sys.stdout.encoding != 'UTF-8': | |
import codecs | |
writer = codecs.getwriter( 'UTF-8' ) | |
sys.stdout = writer( sys.stdout ) |
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
#============================================================================= | |
class protected_iterator( object ): | |
""" | |
Provides object iteration that filters out self-proclaimed "protected" | |
attributes. | |
""" | |
#========================================================================= | |
def __init__( self, obj ): | |
""" |
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/csh | |
#============================================================================ | |
# | |
# Shell Console Color Previewer | |
# | |
# Prints out all the console colors using the shell ([t]csh). | |
# | |
# The color code mappings are based on these definitions: | |
# | |
# 0 | reset colors to 37;40 |
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
#============================================================================= | |
def is_sequence( subject ): | |
""" | |
Determines if any object/variable/whatever is a sequence. | |
""" | |
# assume the subject is not a sequence | |
result = False | |
# attempt to extract the iterable representation |
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/sh | |
############################################################################# | |
# | |
# Copy a range of lines from a source file into another file. | |
# | |
# Usage: | |
# range.sh <input> <first row> <last row> [<output>] | |
# | |
############################################################################# |
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
/** | |
* Returns a list of all file nodes for a given path. | |
* | |
* @param path The path for which to build a list of file node entries. | |
* @param pattern Optional filter pattern to test each node name against. | |
* The default pattern prevents returning hidden node entries. | |
* @return A list of node entries in the given path. | |
*/ | |
function get_dlist( $path, $pattern = '/^[^.]/' ) { | |
$nodes = []; |
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
/*=========================================================================*/ | |
int WINAPI WinMain( //Windows program entry point | |
HINSTANCE hInstance, //handle to this application | |
HINSTANCE hPrevInstance, | |
//handle to previous application | |
LPTSTR lpCmdLine, //executed command | |
int nCmdShow //window display options | |
) { //program exit status | |
//local variables |
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
#******************************************************************************* | |
# wxplot.py | |
# Zac Hester <zac.hester@gmail.com> | |
# 2012-08-10 | |
# | |
# Experimental numpy/matplotlib plotting within wxPython. | |
# | |
#******************************************************************************* | |
#------------------------------------------------------------------------------- |
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
# A simple attempt at faking title case on a phrase. | |
sub titlecase { | |
$_ = shift; | |
my @words = split( / / ); | |
my @twords; | |
foreach ( @words ) { | |
$_ = lc( $_ ); | |
$_ = ucfirst( $_ ); | |
push( @twords, $_ ); | |
} |
NewerOlder