diff options
| author | 2025-11-30 14:32:51 -0500 | |
|---|---|---|
| committer | 2025-11-30 14:32:51 -0500 | |
| commit | c8412bbedae0fce38db96833732e8ce904721e4c (patch) | |
| tree | 4611046186c714513d042966ce97825df0fecf9e /scripts | |
| parent | 0d6d13425015d78606232874498327cabcb0e4e2 (diff) | |
| download | camu-c8412bbedae0fce38db96833732e8ce904721e4c.tar.gz camu-c8412bbedae0fce38db96833732e8ce904721e4c.tar.bz2 camu-c8412bbedae0fce38db96833732e8ce904721e4c.zip | |
Build cleanup and fixes from sink testing
Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/cmv_add.sh | 2 | ||||
| -rwxr-xr-x | scripts/encode_ip.py | 38 | ||||
| -rwxr-xr-x | scripts/run_server.sh | 1 | ||||
| -rwxr-xr-x | scripts/run_valgrind.sh | 4 |
4 files changed, 42 insertions, 3 deletions
diff --git a/scripts/cmv_add.sh b/scripts/cmv_add.sh index 92de535..4572b51 100755 --- a/scripts/cmv_add.sh +++ b/scripts/cmv_add.sh @@ -12,4 +12,4 @@ do fi CMD="$CMD""$EXP\n" done -echo -e "$CMD""X" | socat - UNIX-CONNECT:/tmp/camu_control_sock +echo -e "$CMD""X" | socat - UNIX-CONNECT:/tmp/camu_control diff --git a/scripts/encode_ip.py b/scripts/encode_ip.py new file mode 100755 index 0000000..9f24fd6 --- /dev/null +++ b/scripts/encode_ip.py @@ -0,0 +1,38 @@ +#! /usr/bin/env python3 + +import sys + +arg = sys.argv[1] + +# Invalid characters on Windows: \/:*?"<>| + +#edge_chars = ['¥','£','€','¢'] +#chars = ['¡', '"', '#', '$', '%', '&', "'", '(', ')', ',', '.', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '—', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', ']', '^', '_', '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '}', '~'] +#chars.extend(edge_chars) +#shift_up = '+' +#shift_down = '-' +# +#c_struct = 'static char addr_char_map[] = { ' +#for i in range(0, 87): +# c_struct += f'[\'{chars[i] if chars[i] != '\'' else '\\\''}\'] = {str(i)}' +# if i != 86: +# c_struct += ', ' +#c_struct += ' };' +# +#s = '' +#for n in arg.split('.'): +# i = int(n, 10) +# if i >= 174: +# i -= 174 +# s += shift_down +# if i >= 87: +# i -= 87 +# else: +# s += shift_up +# s += chars[i] + +s = '' +for n in arg.split('.'): + s += '%02x' % int(n, 10) + +print(s) diff --git a/scripts/run_server.sh b/scripts/run_server.sh index 22945ed..f3c520b 100755 --- a/scripts/run_server.sh +++ b/scripts/run_server.sh @@ -1,5 +1,6 @@ #! /usr/bin/env sh source ../scripts/python_env +export CMSRV_IP=$(<../scripts/host_ip) # screen will use $SHELL. screen -c ../scripts/screenrc #valgrind --leak-check=no --show-error-list=yes --log-file=./server-valgrind.log ./src/fruits/cmsrv/cmsrv $@ diff --git a/scripts/run_valgrind.sh b/scripts/run_valgrind.sh index c49d561..7982184 100755 --- a/scripts/run_valgrind.sh +++ b/scripts/run_valgrind.sh @@ -1,6 +1,6 @@ #! /usr/bin/env sh source ../scripts/python_env #valgrind --leak-check=full --show-leak-kinds=definite ./src/fruits/cmv/cmv "$@" -valgrind --leak-check=full --show-leak-kinds=all ./src/fruits/cmv/cmv "$@" -#valgrind --leak-check=no --show-error-list=yes ./src/fruits/cmv/cmv "$@" +#valgrind --leak-check=full --show-leak-kinds=all ./src/fruits/cmv/cmv "$@" +valgrind --leak-check=no --show-error-list=yes ./src/fruits/cmv/cmv "$@" #valgrind --tool=callgrind ./src/fruits/cmv/cmv "$@" |