Skip to content

Instantly share code, notes, and snippets.

@langheran
Created May 13, 2024 22:51
Show Gist options
  • Save langheran/a0acbb89e8f2ad0af7cdae7375264ede to your computer and use it in GitHub Desktop.
Save langheran/a0acbb89e8f2ad0af7cdae7375264ede to your computer and use it in GitHub Desktop.
C:\Users\NisimHurst\NDS\scripts\totp.py
python totp.py
# %%
#
import pyotp
import time
import pyperclip
import os
from dotenv import (
load_dotenv,
find_dotenv
)
DOTENV = os.environ.get('DOTENV', find_dotenv())
load_dotenv(DOTENV, override=True)
XIGNUX_OTP = os.environ.get('XIGNUX_OTP')
totp = pyotp.TOTP(XIGNUX_OTP)
code = totp.now()
pyperclip.copy(code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment