Skip to content

Instantly share code, notes, and snippets.

View Rican7's full-sized avatar
😮
My dotfiles just keep getting better... and its been OVER 10 YEARS NOW! ⌚😮🤯

Trevor N. Suarez Rican7

😮
My dotfiles just keep getting better... and its been OVER 10 YEARS NOW! ⌚😮🤯
View GitHub Profile
@Rican7
Rican7 / KeepAwake.ps1
Last active January 25, 2021 10:50 — forked from jamesfreeman959/keepawake.ps1
KeepAwake - Keep Windows "awake" - A PowerShell script to keep Windows awake and make think the user is active on the keyboard
# KeepAwake - Keep Windows "awake"
#
# Useful for keeping awake during the running long/maintenance processes without
# having to change power or screen-saver options.
#
# See https://gist.github.com/jamesfreeman959/231b068c3d1ed6557675f21c0e346a9c
Write-Host @"
KeepAwake running...
@Rican7
Rican7 / internetarchive-download.md
Created October 29, 2020 01:58
Download multi-file items from the Internet Archive (archive.org)

Internet Archive (archive.org) multi-file item downloading

Finding an item to download

  1. Find an item that you'd like to download (for example: https://archive.org/details/SuperNintendoUSACollectionByGhostware)
  2. Grab its "identifier" (you can see it in the HTML of the page, but otherwise just use the last part of the URL for a "details" page)

Downloading the files

At this point, you could just download the files by clicking on them on the HTML page, but that's slow and concurrent-download-limited... Sooo...

@Rican7
Rican7 / windows-volume-clone.bat
Last active March 15, 2024 00:12
Windows built-in volume "clone"
robocopy <source> <destination> /E /COPYALL /DCOPY:DATE /SL /SJ /ZB /V
@deanbot
deanbot / keepawake.ps1
Last active July 19, 2022 16:03 — forked from jamesfreeman959/keepawake.ps1
PowerShell script to keep a Windows PC awake
# PowerShell script to keep a Windows PC awake
Write-Host "Keeping PC awake... (send Ctrl+C to quit)"
while (1) {
$wsh = New-Object -ComObject WScript.Shell
$wsh.SendKeys('+{F15}')
Start-Sleep -seconds 59
}
@Rican7
Rican7 / instagram-download-all-post-media.js
Last active November 7, 2019 00:01
Download all media of an Instagram post in new tabs (windows). (NOTE: Only works on direct post page links, not "lightboxed" posts from profile pages)
(function (scope) {
/* NOTE: Comments are all in "block" form for easier bookmark one-lining */
let download = async function (url) {
const filename = (new URL(url)).pathname.split("/").pop();
const fetched = await fetch(url);
const tempElement = document.createElement("a");
tempElement.target = "_blank";
@Rican7
Rican7 / instagram-open-all-post-media.js
Last active November 7, 2019 00:00
Open all media of an Instagram post in new tabs (windows). (NOTE: Only works on direct post page links, not "lightboxed" posts from profile pages)
(function (scope) {
/* NOTE: Comments are all in "block" form for easier bookmark one-lining */
/* Public pages will hold their entry data here */
let entries = scope._sharedData.entry_data.PostPage;
/* If the data doesn't exist there... */
if (entries[0].graphql === undefined) {
/* Logged in pages will have the data stored in a different location */
entries = Object.values(scope.__additionalData).map(x => x.data);
@karanlyons
karanlyons / ZoomDaemon.yara
Last active July 12, 2021 14:07
Fixes for Zoom, RingCentral, Zhumu (and additional white labels) RCE vulnerabilities
private rule Macho
{
meta:
description = "private rule to match Mach-O binaries (copied from Apple's XProtect)"
condition:
uint32(0) == 0xfeedface or uint32(0) == 0xcefaedfe or uint32(0) == 0xfeedfacf or uint32(0) == 0xcffaedfe or uint32(0) == 0xcafebabe or uint32(0) == 0xbebafeca
}
rule ZoomDaemon
{
@jamesfreeman959
jamesfreeman959 / keepawake.ps1
Last active May 16, 2024 23:31
A very simple PowerShell script to keep a Windows PC awake and make lync think the user is active on the keyboard
# Useful references:
#
# https://superuser.com/questions/992511/emulate-a-keyboard-button-via-the-command-line
# https://ss64.com/vb/sendkeys.html
# https://social.technet.microsoft.com/Forums/windowsserver/en-US/96b339e2-e9da-4802-a66d-be619aeb21ac/execute-function-one-time-in-every-10-mins-in-windows-powershell?forum=winserverpowershell
# https://learn-powershell.net/2013/02/08/powershell-and-events-object-events/
#
# Future enhancements - use events rather than an infinite loop
$wsh = New-Object -ComObject WScript.Shell
while (1) {
@Rican7
Rican7 / Enable Import Photos and Videos.bat
Created October 16, 2017 17:13
Enable the old style (Win 7) "Import pictures and videos" AutoPlay option for Windows 10
cd "C:\Program Files (x86)\Windows Photo Viewer"
regsvr32 PhotoAcq.dll
regsvr32 PhotoViewer.dll
@romainl
romainl / colorscheme-override.md
Last active April 27, 2024 15:36
The right way to override any highlighting if you don't want to edit the colorscheme file directly

The right way to override any highlighting if you don't want to edit the colorscheme file directly

Generalities first

Suppose you have weird taste and you absolutely want:

  • your visual selection to always have a green background and black foreground,
  • your active statusline to always have a white background and red foreground,
  • your very own deep blue background.