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
parser.add_argument( | |
'--mode', | |
default="test", | |
choices=["test", "launch", "populate", "worker"], | |
help='''What operation to run: | |
"test": Run in testing mode (single process, all local). | |
"launch": Launch and run everything. | |
"populate": Populate the central redis queue. | |
"worker": Run as a worker against the redis server.''' | |
) |
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/python | |
# To activate: complete --command gcloud --arguments="(/home/richard/gcloud/google-cloud-sdk/autocomplete.py (commandline -cp))" | |
import re | |
import subprocess | |
import sys | |
def parse_help(h): | |
commands = {} |
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
# | |
# Automatically generated file; DO NOT EDIT. | |
# Linux/x86 4.4.0-rc6 Kernel Configuration | |
# | |
CONFIG_64BIT=y | |
CONFIG_X86_64=y | |
CONFIG_X86=y | |
CONFIG_INSTRUCTION_DECODER=y | |
CONFIG_PERF_EVENTS_INTEL_UNCORE=y | |
CONFIG_OUTPUT_FORMAT="elf64-x86-64" |
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
### Keybase proof | |
I hereby claim: | |
* I am rjohnsondev on github. | |
* I am rjohnsondev (https://keybase.io/rjohnsondev) on keybase. | |
* I have a public key whose fingerprint is 6BDB 29B4 497E 7532 E9AA 9288 2215 D5A0 D0BB FEBF | |
To claim this, I am signing this object: |
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
""" | |
For an arbitrary sequence of integers, identify all sub-sequences | |
with a sum of 0. | |
""" | |
import sys | |
def build_tree(ints, x): | |
""" |
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 set_proc_name(newname): | |
from ctypes import cdll, byref, create_string_buffer | |
libc = cdll.LoadLibrary('libc.so.6') | |
buff = create_string_buffer(len(newname)+1) | |
buff.value = newname | |
libc.prctl(15, byref(buff), 0, 0, 0) |
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
import os | |
import logging | |
def initLogging(level = logging.DEBUG): | |
if "color" in os.environ["TERM"]: | |
logging._levelNames[logging.CRITICAL]= '\033[1m\033[91mCRITICAL\033[0m' | |
logging._levelNames[logging.ERROR]= '\033[91mERROR\033[0m' | |
logging._levelNames[logging.WARNING]= '\033[93mWARNING\033[0m' | |
logging._levelNames[logging.INFO]= '\033[94mINFO\033[0m' | |
logging._levelNames[logging.DEBUG]= '\033[92mDEBUG\033[0m' |
NewerOlder