Merge branch 'develop' of https://kitsunehosting.net/gitea/Kenwood/lewis-crawler into develop
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,5 +1,7 @@
|
|||||||
# Python
|
# Python
|
||||||
__pycache__
|
__pycache__
|
||||||
|
Pipfile
|
||||||
|
Pipfile.lock
|
||||||
|
|
||||||
# CAD
|
# CAD
|
||||||
*.stl
|
*.stl
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
from PIL import Image
|
||||||
|
import base64
|
||||||
|
|
||||||
|
im = Image.open('still.jpg')
|
||||||
|
|
||||||
|
# using Image.ADAPTIVE to avoid dithering
|
||||||
|
for i in range(8, 0, -1):
|
||||||
|
out = im.convert('P', palette=Image.ADAPTIVE, colors=i)
|
||||||
|
|
||||||
|
out.save(f'out_{i}_bits.png')
|
||||||
|
|
||||||
|
with open(f'out_{i}_bits.png', 'rb') as image_file:
|
||||||
|
encoded_string = base64.a85encode(image_file.read())
|
||||||
|
|
||||||
|
with open(f'out_{i}_bits.txt', 'w') as f:
|
||||||
|
f.write(encoded_string.decode('UTF-8'))
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
M,6r;%14!\!!!!.8Ou6I!!!)I!!!&X#Qk&,!4s2MScA`m!)Q?g7AGd(zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz!.5pZZiC(+%V8a6Akbu".KBGK#QOi)zdSl>0!!-\'6pXdsSF+-I!<<*"_P$QtD$r"izzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz!!!"D(e?.W!V_LqE<#t=!(fUS7'8jaJc
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
15
crawler_software/raspberry_pi/tests/otp/otp_test.py
Normal file
15
crawler_software/raspberry_pi/tests/otp/otp_test.py
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
import time, pyotp
|
||||||
|
|
||||||
|
totp = pyotp.TOTP(pyotp.random_base32(), interval=45)
|
||||||
|
|
||||||
|
code = totp.now()
|
||||||
|
|
||||||
|
for i in range(0,60):
|
||||||
|
|
||||||
|
if totp.verify(code):
|
||||||
|
print(f'{code} verified fine at t+{i}')
|
||||||
|
else:
|
||||||
|
print(f'{code} expired at t+{i}')
|
||||||
|
break
|
||||||
|
|
||||||
|
time.sleep(1)
|
||||||
Reference in New Issue
Block a user