Added project files

This commit is contained in:
Sebastian 2022-02-03 22:52:44 +01:00
parent 836741a933
commit 42e86a0897
4 changed files with 49 additions and 0 deletions

28
Printer.md Normal file
View File

@ -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

7
printer.sh Executable file
View File

@ -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

BIN
video.mkv Normal file

Binary file not shown.

14
videoplayer.py Executable file
View File

@ -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)