Skip to content

Instantly share code, notes, and snippets.

@h0bbyte
h0bbyte / gist:23ea74cf379cd56fc505cba88aefb32b
Created July 10, 2022 10:40
enable 2fa on google without phone number, worked from linux
found solution in https://superuser.com/questions/1658659/how-to-set-up-google-2fa-with-third-party-otp-app#comment2541369_1658664
rust-u2f fail with some errors, found and use concise/v2f.py;
clone https://github.com/concise/v2f.py.git and follow instruction to start;
go to accounts.google.com, select "enable 2-step verification", select "show more options -> Security key";
answer "yes" in v2f console when browser query auth by usb-token and return to google window in 3 sec.;
if all done, you see query to name your key; then page with enabled 2fa with your "Security key (Default)";
download and save "Backup Codes";
if needed, enable TOTP.
you can remove v2f key from google.
@h0bbyte
h0bbyte / gist:5add065a5631f4ad93f4e2827d91228e
Last active March 29, 2020 14:19
Erai-raws get all 1080p .torrent links to transmission-daemon
curl -s https://erai-raws.info/anime-list/koisuru-asteroid/ | \
xmllint --html --xpath "//div[contains(@class,'release-links')]/table[.//td[@class='dl-label']/i[contains(text(),'1080p')]]//span[contains(@class, 'dl-link')]/a[contains(@href, '.torrent')]/@href" 2>/dev/null - | \
cut -d= -f2 | sed -e 's/"//g' | \
while read url; \
do transmission-remote "127.0.0.1:port" --auth "username:passw" -a "${url}" --download-dir "/media/NBox/Torrents/Anime/[Erai-raws] Koisuru Asteroid [1080p][Multiple Subtitle]"; \
done
@h0bbyte
h0bbyte / mh_z19.py
Last active August 27, 2018 15:16 — forked from UedaTakeyuki/mh_z19.py
MH-Z19 CO2 Sensor reading.
# http://eleparts.co.kr/data/design/product_file/SENSOR/gas/MH-Z19_CO2%20Manual%20V2.pdf
# http://qiita.com/UedaTakeyuki/items/c5226960a7328155635f
import serial
import time
def mh_z19():
ser = serial.Serial('/dev/ttyAMA0',
baudrate=9600,
bytesize=serial.EIGHTBITS,
parity=serial.PARITY_NONE,