Moved Docker stuff to "Docker" folder

Created k8s folder for k8s stuff
Added early-stage service.yaml for K8s deployment
This commit is contained in:
erichardso
2018-08-28 11:51:23 -07:00
parent 176e2f2062
commit d880f44ca6
138 changed files with 11 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
#=============================================================================
#
# Hex string/byte utilities
#
#=============================================================================
from .dump import dump
from .toBytes import toBytes
#=============================================================================

View File

@@ -0,0 +1,32 @@
#===========================================================================
#
# Dump hex bytes to a table.
#
#===========================================================================
import StringIO
#===========================================================================
def dump( buf ):
"""Input is bytes buffer,
Returns a string w/ the hex values in a table
"""
# Convert to hex characters
h = [ i.encode( "hex" ).upper() for i in buf ]
f = StringIO.StringIO()
f.write( "---: 00 01 02 03 04 05 06 07 08 09\n" )
for i in range( len( h ) ):
if i % 10 == 0:
if i > 0:
f.write( "\n" )
f.write( "%03d: " % i )
f.write( "%2s " % h[i] )
f.write( "\n" )
return f.getvalue()
#===========================================================================

View File

@@ -0,0 +1,23 @@
#===========================================================================
#
# Convert a hex string to bytes
#
#===========================================================================
import math
#===========================================================================
def toBytes( hexStr ):
"""Input is a string containing hex values (w/ or w/o spaces)
Return is the same value in a bytes array.
"""
s = hexStr.strip().replace( "\n", " " )
s = ''.join( s.split(" ") )
bytes = []
for i in range( 0, len( s ), 2 ):
bytes.append( chr( int( s[i:i+2], 16 ) ) )
return ''.join( bytes )
#===========================================================================