Skip to content

Instantly share code, notes, and snippets.

@davidlc9113
Last active December 14, 2018 06:35
Show Gist options
  • Select an option

  • Save davidlc9113/5d1f59dc09d87894d5e9ad74e3f2c4e7 to your computer and use it in GitHub Desktop.

Select an option

Save davidlc9113/5d1f59dc09d87894d5e9ad74e3f2c4e7 to your computer and use it in GitHub Desktop.

Revisions

  1. davidlc9113 revised this gist Dec 14, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion googleauth.py
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    #!/usr/bin/env python3

    """
    Install dependecies from https://gist.github.com/dlc9113/eb2b7410b105858bbbed8d80d9a5217d
    Install dependencies from https://gist.github.com/dlc9113/eb2b7410b105858bbbed8d80d9a5217d
    # Output the code
    $ googleauth your_secret_key
  2. davidlc9113 revised this gist Dec 14, 2018. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions googleauth.py
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,8 @@
    #!/usr/bin/env python3

    """
    Install dependecies from https://gist.github.com/dlc9113/eb2b7410b105858bbbed8d80d9a5217d
    # Output the code
    $ googleauth your_secret_key
  3. davidlc9113 revised this gist Dec 14, 2018. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion googleauth.py
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,10 @@
    #!/usr/bin/env python3

    """
    # Ouput and copy the code
    # Output the code
    $ googleauth your_secret_key
    # (Mac only) Copy the code
    $ googleauth your_secret_key | pbcopy
    """

  4. davidlc9113 created this gist Dec 14, 2018.
    10 changes: 10 additions & 0 deletions googleauth.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    #!/usr/bin/env python3

    """
    # Ouput and copy the code
    $ googleauth your_secret_key | pbcopy
    """

    import pyotp, sys
    secret_code = sys.argv[-1]
    print(pyotp.TOTP(secret_code).now())