Skip to content

Instantly share code, notes, and snippets.

Avatar
🧟

Vinayak 1oh1

🧟
View GitHub Profile
@1oh1
1oh1 / act-fibernet-login-logout.md
Last active Jun 21, 2021
Login and Logout of ACT Fibernet captive portal using Python
View act-fibernet-login-logout.md

Login and Logout of ACT Fibernet captive portal using Python

Save the following as act.py and replace ACT_ACCOUNT_ID with your ACT account ID and ACT_PASSWORD with your ACT captive portal password (not your Wi-Fi router password unless they're the same).

Change ACT_SELFCARE_URL to the correct captive portal link as well (use https://selfcare.actcorp.in/web/blr/home/-/act/ if you're unsure).

Install requests with pip install requests if you don't have it already.

Run the script with python act.py

@1oh1
1oh1 / praw-2fa.md
Last active Jun 20, 2021
Using PRAW with 2FA
View praw-2fa.md

Using PRAW with 2FA

If like me, you got a prawcore.exceptions.OAuthException: invalid_grant error processing request error out of the blue for your reddit bot that had been running without an issue for years on AWS Lambda, then maybe like me you also enabled 2FA on your Reddit account recently and failed to realize that the change would affect your reddit bot too since it authenticates to Reddit using your credentials.

To the best of my knowledge, reddit doesn't have 'App Passwords' like Google does so you'll have to find a way to supply the OTP code every time you authenticate to Reddit using PRAW.

Thanks to this pull request, prawcore can now accept 2FA codes for ScriptAuthorizer via a callback function.

To get the OTP code, you can use [pyotp](https://pypi.org/project/pyot

@1oh1
1oh1 / prevent-gif-looping.user.js
Created Mar 23, 2015
Block GIFs from auto looping on Imgur. Press B to toggle.
View prevent-gif-looping.user.js
// ==UserScript==
// @id imgur.com@scriptish
// @name prevent-gif-looping
// @version 1.1
// @namespace imgur.com
// @author Vinayak
// @description Block GIFs from looping on Imgur
// @include http*://imgur.com/*
// @run-at document-end
// ==/UserScript==