From 167507256199addeccca2f8a2acc385a0caee677 Mon Sep 17 00:00:00 2001 From: Jeffrey Paul Date: Fri, 4 Oct 2019 05:26:45 -0700 Subject: [PATCH] random stuff --- bin/nue3.docker | 2 +- bin/unlock-las1 | 2 +- bin/unlock-syncpi-alpha | 2 +- bin/unlock-syncpi-bravo | 2 +- misc/tg.py | 16 ++++++++++++++++ misc/tg2.py | 20 ++++++++++++++++++++ 6 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 misc/tg.py create mode 100644 misc/tg2.py diff --git a/bin/nue3.docker b/bin/nue3.docker index 992fe10..8e52316 100755 --- a/bin/nue3.docker +++ b/bin/nue3.docker @@ -6,7 +6,7 @@ fi DOCKER_HOST=unix://$HOME/tmp/docker.sock if ! docker ps 2>&1 >/dev/null ; then - rm $HOME/tmp/docker.sock + /bin/rm $HOME/tmp/docker.sock ssh -nNT -L $HOME/tmp/docker.sock:/var/run/docker.sock root@nue3.eeqj.de fi diff --git a/bin/unlock-las1 b/bin/unlock-las1 index 803212d..7b24bf0 100755 --- a/bin/unlock-las1 +++ b/bin/unlock-las1 @@ -7,4 +7,4 @@ if [[ ! -e "$KEYFILE" ]]; then exit 1 fi -gpg -d "$KEYFILE" | ssh root@las1.tor "bash /root/unlock_disks" +gpg -d "$KEYFILE" | ssh root@las1.local "bash /root/unlock_disks" diff --git a/bin/unlock-syncpi-alpha b/bin/unlock-syncpi-alpha index 783a097..276de66 100755 --- a/bin/unlock-syncpi-alpha +++ b/bin/unlock-syncpi-alpha @@ -7,4 +7,4 @@ if [[ ! -e "$KEYFILE" ]]; then exit 1 fi -gpg -d "$KEYFILE" | ssh root@syncpi-las1-alpha.tor "bash /root/unlock_disks" +gpg -d "$KEYFILE" | ssh root@syncpi-las1-alpha.local "bash /root/unlock_disks" diff --git a/bin/unlock-syncpi-bravo b/bin/unlock-syncpi-bravo index 5f3928d..ea4c71d 100755 --- a/bin/unlock-syncpi-bravo +++ b/bin/unlock-syncpi-bravo @@ -7,4 +7,4 @@ if [[ ! -e "$KEYFILE" ]]; then exit 1 fi -gpg -d "$KEYFILE" | ssh root@syncpi-las1-bravo.tor "bash /root/unlock_disks" +gpg -d "$KEYFILE" | ssh root@syncpi-las1-bravo.local "bash /root/unlock_disks" diff --git a/misc/tg.py b/misc/tg.py new file mode 100644 index 0000000..e21ecb0 --- /dev/null +++ b/misc/tg.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python3 +import time +import termgraphics + +#g = termgraphics.TermGraphics(mode = termgraphics.MODE_EASCII) +g = termgraphics.TermGraphics() + +g.clear() + +for x in range(g.shape[0]): + y = int(0.5 * g.shape[1] * ((2*x/g.shape[0]-1)**3 + 1)) + g.point((x,y)) + + g.draw() + time.sleep(0.1) + diff --git a/misc/tg2.py b/misc/tg2.py new file mode 100644 index 0000000..076456c --- /dev/null +++ b/misc/tg2.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python3 + +import termgraphics +from PIL import Image, ImageOps +import requests +from io import BytesIO +import time + +g = termgraphics.TermGraphics() + +def get_image(url = 'https://devblogs.nvidia.com/parallelforall/wp-content/uploads/2016/07/cute.jpg'): + response = requests.get(url) + img = Image.open(BytesIO(response.content)) + return img + +if __name__ == "__main__": + img = get_image().resize((200//2,150//4), Image.NEAREST) + #print(img) + g.image(list(img.getdata()), img.width, img.height, (0, 0), image_type = termgraphics.IMAGE_RGB_2X4) +