diff --git a/Printer.md b/Printer.md new file mode 100644 index 0000000..4bc15ea --- /dev/null +++ b/Printer.md @@ -0,0 +1,28 @@ +# Password-Printer + +``printer.sh`` +This script prints out a random passoword on a thermal printer upon button press. + + +## Device + +We use a Card Start 8010 thermal printer. With the USB adaptor, you can simply send text via echo to the /dev/usb/lp1 device. It is printed if the line is full (24 characters) or when a "\r" sequence is sent. + +## Commands + +### Wanted Output: + +---------------------+ + | Dein Passwort: | + | 0123456789 | + +---------------------+ + +### Test Output: + echo -e "\r\r+---------------------+\r| Dein Passwort: |\r| 0123456789 |\r+---------------------+\r\r\r" > /dev/usb/lp1 + +### Final command: + + #!/bin/sh + + echo "\r\r+----------------------+| Dein Passwort lautet || " > /dev/usb/lp1 + pwgen -N1 10 > /dev/usb/lp1 + echo " |+----------------------+\r\r" > /dev/usb/lp1 diff --git a/printer.sh b/printer.sh new file mode 100755 index 0000000..e67553b --- /dev/null +++ b/printer.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +# This script prints a random password with 10 characters on a thermal printer. + +echo "\r\r+----------------------+| Dein Passwort lautet || " > /dev/usb/lp1 +pwgen -N1 10 > /dev/usb/lp1 +echo " |+----------------------+\r\r" > /dev/usb/lp1 diff --git a/video.mkv b/video.mkv new file mode 100644 index 0000000..5aa666b Binary files /dev/null and b/video.mkv differ diff --git a/videoplayer.py b/videoplayer.py new file mode 100755 index 0000000..d3de437 --- /dev/null +++ b/videoplayer.py @@ -0,0 +1,14 @@ +#!/usr/bin/python3 + +# Starts long video (24h) at random position + +import random +import os + +sec = str(random.randrange(0, 60)) +min = str(random.randrange(0, 60)) +hour = str(random.randrange(0,20)) + +start = "\"" + hour + ":" + min + ":" + sec + "\"" +print(start) +os.system("omxplayer \"video.mkv\" -b --loop --no-osd --pos "+ start)