Skip to content

Instantly share code, notes, and snippets.

View darthShadow's full-sized avatar
💭
I may be slow to respond.

Anagh Kumar Baranwal darthShadow

💭
I may be slow to respond.
  • Lavelle Networks
  • Bangalore, India
  • 16:58 (UTC +05:30)
View GitHub Profile
@darthShadow
darthShadow / AuthyToOtherAuthenticator.md
Created September 15, 2022 06:21 — forked from gboudreau/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Generating Authy passwords on other authenticators


There is an increasing count of applications which use Authy for two-factor authentication. However many users who aren't using Authy, have their own authenticator setup up already and do not wish to use two applications for generating passwords.

Since I use 1Password for all of my password storing/generating needs, I was looking for a solution to use Authy passwords on that. I couldn't find any completely working solutions, however I stumbled upon a gist by Brian Hartvigsen. His post had a neat code with it to generate QR codes for you to use on your favorite authenticator.

His method is to extract the secret keys using Authy's Google Chrome app via Developer Tools. If this was not possible, I guess people would be reverse engineering the Android app or something like that. But when I tried that code, nothing appeared on the screen. My guess is that Brian used the

@darthShadow
darthShadow / macOS-IPv6-Tunnel-DNS-HOWTO.md
Created December 7, 2020 13:54 — forked from smammy/macOS-IPv6-Tunnel-DNS-HOWTO.md
How to convince macOS to do IPv6 DNS lookups when your only IPv6 address is via a VPN or tunnel of some sort

This was a huge hassle to figure out, so I wrote up a little guide in hopes that others would find it helpful:

How to convince macOS to do IPv6 DNS lookups when your only IPv6 address is via a VPN or tunnel of some sort

The Problem

macOS's domain name resolver will only return IPv6 addresses (from AAAA records) when it thinks that you have a valid routable IPv6 address. For physical interfaces like Ethernet or Wi-Fi it's enough to set or be assigned an IPv6 address, but for tunnels (such as those using utun interfaces) there are some extra annoying steps that need to be taken to convince the system that yes, you indeed have an IPv6 address, and yes, you'd like to get IPv6 addresses back for DNS lookups.

I use wg-quick to establish a WireGuard tunnel between my laptop and a Linode virtual server. WireGuard uses a utun user-space tunnel device to make the connection. Here's how that device gets configured:

@darthShadow
darthShadow / Steps to Obtain Client Secret.md
Last active October 11, 2021 19:28
Mega Account Creator. Handles registration using megareg. Handles verification using Google Client API.
  1. Use this wizard to create or select a project in the Google Developers Console and automatically turn on the API. Click Continue, then Go to credentials.
  2. On the Add credentials to your project page, click the Cancel button.
  3. At the top of the page, select the OAuth consent screen tab. Select an Email address, enter a Product name (Mega Account Creator) if not already set, and click the Save button.
  4. Select the Credentials tab, click the Create credentials button and select OAuth client ID.
  5. Select the application type Other, enter the name "Mega Account Creator", and click the Create button.
  6. Click OK to dismiss the resulting dialog.
  7. Click the Download JSON button to the right of the client ID.
  8. Move this file to your working directory and rename it client_secret.json.
# Author : Anagh Kumar Baranwal
# Question : http://www.practicepython.org/exercise/2014/03/05/05-list-overlap.html
a = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]
b = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
intersection_set = sorted([num for num in a if num not in b] + [num for num in b if num not in a])
print(intersection_set)
# Author : Anagh Kumar Baranwal
# Question : http://www.practicepython.org/exercise/2014/04/02/09-guessing-game-one.html
import random
rand_num = random.randint(1,9)
count = 0
while(1):
choice = input("Please enter the number OR 'exit' to exit : ")
if(choice == "exit"):
print("You guessed "+str(count)+" times")
break
# Author : Anagh Kumar Baranwal
# Question : http://www.practicepython.org/exercise/2014/03/19/07-list-comprehensions.html
a = [1,4,9,16,25,36,49,64,81,100]
even_elements = [a[i] for i in range(0,len(a),2)]
print(even_elements)