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
@davelevine
davelevine / how-to-cache-b2-content-with-cloudflare.md
Last active April 22, 2025 03:48
How to Properly Cache Content Hosted on Backblaze B2 with Cloudflare

How to Properly Cache Content Hosted on Backblaze B2

Summary

Because I use Cloudflare to manage my domains and Backblaze for backups, it only made sense to take advantage of their Bandwidth Alliance for creating my own CDN. This has been incredibly helpful for image hosting for this knowledge base, however, I recently noticed that caching wasn't working as it should.

The Problem

The overall problem started when I was adding a parking page for a domain I recently purchased. The background image was hosted on B2 and the image was supposed to be cached by Cloudflare. However, each time the page loaded, it would pull the image from the origin instead of the cache. I checked this on my knowledge base and found it was doing the same thing.

@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
@juanje
juanje / description.md
Last active April 2, 2025 13:44
Connect services with docker-compose at multirepo project

Connect services with docker-compose at multirepo project

Sometimes you have a project with different services (or microservices) and each one of them has its own repository. At those cases, tests the whole project (and its interactions) can be challenging.

With Docker and Docker Compose you can run easily each service from its repo, but for making them to see each other you (usually) need to manually create a network with Docker, assume so facts (as directories names) or do some crazy network configurations.

TL;DR

You have the final configuration here.

@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 August 5, 2024 23:37
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
{
@rdyv
rdyv / print-memory.go
Created May 22, 2019 20:54
Go print current memory
package main
import (
"runtime"
"fmt"
"time"
)
func main() {
// Print our starting memory usage (should be around 0mb)