Skip to content

Instantly share code, notes, and snippets.

View 1oh1's full-sized avatar

Vinayak 1oh1

View GitHub Profile
1oh1 /
Last active May 12, 2024 04:55
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:


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:


1oh1 /
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 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 if you're unsure).

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

Run the script with python

1oh1 /
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](

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
// @name prevent-gif-looping
// @version 1.1
// @namespace
// @author Vinayak
// @description Block GIFs from looping on Imgur
// @include http*://*
// @run-at document-end
// ==/UserScript==