Add ip-part module and example IP Art file. - annna - Annna the nice friendly b… | |
git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws6… | |
Log | |
Files | |
Refs | |
Tags | |
README | |
--- | |
commit d01040bed8eecd7ac7dcf63424a6c6292807ca33 | |
parent 817893d1bd92be465e2b5fad76172a22e7cb8957 | |
Author: Annna Robert-Houdin <[email protected]> | |
Date: Sun, 3 Jan 2021 00:45:09 +0100 | |
Add ip-part module and example IP Art file. | |
Diffstat: | |
A modules/ip-art/display-file.sh | 28 ++++++++++++++++++++++++++++ | |
A modules/ip-art/ip-art-addresses.awk | 35 +++++++++++++++++++++++++++++… | |
A modules/ip-art/ip-art.ipart | 11 +++++++++++ | |
3 files changed, 74 insertions(+), 0 deletions(-) | |
--- | |
diff --git a/modules/ip-art/display-file.sh b/modules/ip-art/display-file.sh | |
@@ -0,0 +1,28 @@ | |
+#!/bin/sh | |
+ | |
+# TODO: Use network namespaces for concurrent execution. | |
+ | |
+if [ $# -lt 1 ]; | |
+then | |
+ printf "usage: %s file.ipart\n" "$(basename "$0")" >&2 | |
+ exit 1 | |
+fi | |
+ | |
+ipartfile="$1" | |
+ | |
+# bitreich.org | |
+ipv6prefix="2a01:4f8:1c17:4885:0" | |
+ipv6if="eth0" | |
+ | |
+requestip="2a01:4f8:1c17:4885::1337" | |
+requestport="80" | |
+requeststr="GET /dickbutt HTTP/1.0\r\n\r\n" | |
+ | |
+./ip-art-addresses.awk "${ipv6prefix}" "${ipartfile}" \ | |
+| while read -r line; | |
+do | |
+ sudo /br/bin/show-ip-pixels.sh "$ipv6if" "$line" "$requestip" \ | |
+ "$requestport" "$requeststr" | |
+ sleep 0.1 | |
+done | |
+ | |
diff --git a/modules/ip-art/ip-art-addresses.awk b/modules/ip-art/ip-art-addres… | |
@@ -0,0 +1,35 @@ | |
+#!/usr/bin/awk -f | |
+# | |
+# Original source by josuah. Thanks! | |
+# | |
+ | |
+# usage: IP-prefix pixelfile | |
+ | |
+BEGIN { | |
+ prefix = ARGV[1] | |
+ | |
+ for (i = 1; i < ARGC; i++) | |
+ ARGV[i] = ARGV[i + 1] | |
+ ARGC-- | |
+ | |
+ pix_on = "7" | |
+ pix_off = "1" | |
+} | |
+ | |
+function pixel(pix) { | |
+ pix = (pix == " " ? pix_off : pix_on ) | |
+ return pix | |
+# return substr(pix, 1 + int(rand() * 2), 1) | |
+} | |
+ | |
+{ | |
+ #$0 = ":" $0 | |
+ for (i = 0; length($0) > 0; i++) { | |
+ pix = pixel(substr($0, 1, 1)) | |
+ row = row ((i % 4 == 0) ? ":" : "") pix | |
+ $0 = substr($0, 2) | |
+ } | |
+ print prefix row | |
+ row = "" | |
+} | |
+ | |
diff --git a/modules/ip-art/ip-art.ipart b/modules/ip-art/ip-art.ipart | |
@@ -0,0 +1,11 @@ | |
+ II IIIII | |
+ II II II | |
+ II IIIII | |
+ II II | |
+ II II | |
+ | |
+ II IIIIIIII | |
+I II IIIII | |
+I IIIII II | |
+IIIIIII II | |
+I II II II |