Added project files
This commit is contained in:
parent
836741a933
commit
42e86a0897
28
Printer.md
Normal file
28
Printer.md
Normal 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
7
printer.sh
Executable 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
|
14
videoplayer.py
Executable file
14
videoplayer.py
Executable 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)
|
Loading…
Reference in New Issue
Block a user