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
#!/bin/bash | |
# /usr/local/sbin/hashdeept $@: Hashdeep and trim "##" and "%%%%" lines | |
# author: https://github.com/adoc | |
# link: https://gist.github.com/adoc/8c117fb895c6dfdc962d | |
# resources: | |
# http://unix.stackexchange.com/a/174720 | |
# deps: | |
# hashdeep (http://md5deep.sourceforge.net/) | |
# todo: | |
# check incoming ards for -l and -j?? |
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
#!/bin/bash | |
# /usr/local/sbin/rndaz09 N: Cat N urandom characters and return limited [a-z0-9] | |
# link: https://gist.github.com/adoc/275cba7ef1639cc648bb | |
# resource: http://stackoverflow.com/a/2793856 | |
cat /dev/urandom | tr -cd 'a-z0-9' | head -c $1 |
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
ns: { | |
coerce: function (namespace, hash, back) { | |
hash = hash || {}; | |
back = back || false; | |
var nsSplit = namespace.split('.'), | |
newHash = hash, | |
stop = nsSplit.length - (back && 1 || 0), | |
ns; | |
if (_.isEmpty(namespace)) { |
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
""" Watcher. | |
""" | |
import logging | |
log = logging.getLogger(__name__) | |
import threading | |
class Watcher: |
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 bit_count(byte_or_num): | |
bits = 0 | |
if isinstance(bytes, byte_or_num): | |
n = ord(byte_or_num) | |
else: | |
n = byte_or_num | |
while n > 1: # n >= 1 ???? | |
n //= 2 | |
bits += 1 | |
return bits |
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
{ | |
"trunks": [ | |
"11003", | |
"21003" | |
], | |
"type": [ | |
"orig", | |
"peak", | |
"term" | |
], |
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
/* Collate at the given dimension namespace. | |
:param Object rawData: The raw data from the RESTful api. | |
:param Array dimensions: Array of string namespaces that define the | |
nesting and collation order. | |
:param String collateAt: Namespace to stop "digging" and begin to | |
collate the data. | |
*/ | |
function collateData(rawData, dimensions, collateAt, __forwardData, | |
__returnData) { |
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
#!/bin/bash | |
# Python 3.4 build/install | |
_py34_install_cwd="`pwd`" # Save current directory. | |
yum -y install wget | |
yum -y install openssl-devel | |
yum -y install zlib-devel | |
yum -y install bzip2-devel | |
yum -y install readline-devel | |
yum -y groupinstall development |
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/env python | |
""" | |
# Original Author: Tyler Lesmann | |
# Original Source: http://www.tylerlesmann.com/2009/apr/27/copying-databases-across-platforms-sqlalchemy/ | |
# TODO: Look at https://gist.github.com/thoas/1589496 if any | |
# "sequencing" issues come in to play. | |
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 DataFile: | |
"""Handle a data file using pickle. | |
""" | |
def __init__(self, filepath, init_data={}): | |
"""Initialize or load a pickled data file. | |
""" | |
self.__filepath = filepath | |
self.data = init_data |
NewerOlder