Skip to content

Instantly share code, notes, and snippets.

View 1oh1's full-sized avatar
🧟

Vinayak 1oh1

🧟
View GitHub Profile
@1oh1
1oh1 / optiplex-3060-enable-pcie3.md
Last active December 28, 2024 15:59
Dell OptiPlex 3060 - Enable NVMe Gen 3 speeds (Enable PCIe 3.0)

Enable PCIe 3.0 speeds for NVMe SSDs on Dell OptiPlex 3060

Out of the box, any M.2 NVMe SSDs connected to the Dell OptiPlex 3060 runs at PCIe Gen 2.0 speeds (Max 5 GT/s; 2 GB/s) so the speed tests look like this:

screen1

However, after this BIOS mod, the SSD can reach PCIe Gen 3.0 speeds (Max 8 GT/s; 3.9 GB/s) so the speed tests look like this:

screen2

@1oh1
1oh1 / act-fibernet-login-logout.md
Last active June 21, 2021 20:39
Login and Logout of ACT Fibernet captive portal using Python

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 June 20, 2021 05:36
Using PRAW with 2FA

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 March 23, 2015 18:32
Block GIFs from auto looping on Imgur. Press B to toggle.
// ==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==