Closed ofrei closed 3 years ago
it's on a ticket now, right?
I'm using QR codes to copy short messages, as a workaround - works fine at least for Windows TSD machines. This is strictly for non-sensitive data. I don't think this is a security breach - but any use of the scripts below is fully at your individual responsibility.
On TSD:
pip install --user --index-url=https://pypi.tsd.usit.no/simple pyperclip
pip install --user --index-url=https://pypi.tsd.usit.no/simple pyqrcode
pip install --user --index-url=https://pypi.tsd.usit.no/simple pypng
python C:\users\p33-ofrei\Desktop\make_qrcode.py
On your local machine:
parse_qrcode.py
(see below for the actual script)python parse_qrcode.py
# make_qrcode.py file
import pyqrcode, matplotlib.pyplot as plt, matplotlib.image as mpimg
import zlib, base64, pyperclip, time, os
if __name__ == "__main__":
b0 = None
fname = os.path.join(os.environ['USERPROFILE'], 'Desktop', 'qrcode.png')
print('Results will be saved to {}'.format(fname))
while True:
try:
b = pyperclip.paste()
if (b0 is not None) and (b == b0): time.sleep(0.1); continue
b0=b; print(b)
b = zlib.compress(b.encode())
b = base64.b64encode(b).decode()
pyqrcode.create(b, error='L').png(fname)
except:
print('Error. Message size {}, allowed 2953'.format(len(b)))
# parse_qrcode.py file
import os, zxing, base64, zlib, pyperclip, time
if __name__ == "__main__":
while True:
try:
os.system('xclip -selection clipboard -t image/png -o > /tmp/qrcode.png')
b = zxing.BarCodeReader().decode("/tmp/qrcode.png").parsed;
b = base64.b64decode(b.encode()); #print(len(b))
b = zlib.decompress(b).decode(); #print(len(b))
pyperclip.copy(b); print(b);
except:
time.sleep(1); print('.')
It would be great for p33 users to copy-paste short text messages out from TSD. Today we do exactly the same by taking screenshots. This makes day-to-day life on TSD a lot harder than it should be.
One use case is debugging error messages, and re-tying them to google.com or stackoverflow.