Skip to content

Instantly share code, notes, and snippets.

View WillPresley's full-sized avatar
🏠
Working from home

Will Presley WillPresley

🏠
Working from home
View GitHub Profile
@janderudder
janderudder / wsl-disk-space.md
Last active April 30, 2025 13:55
Reclaim WSL's virtual disk unused space

Reclaim WSL's unused virtual disk space

Compact a WSL distro's virtual disk to reclaim unused storage space.

WSL's virtual disk grows when needed but doesn't shrink by itself. Here is how to reclaim the unused space. This can sometimes free hundreds of GBs for use on Windows.

Trim the WSL partition

@Gyarbij
Gyarbij / rclone.service.md
Last active May 8, 2025 07:14
Steps and example RClone systemd with mounted Google Drive or OneDrive for use with Plex en Jellyfin and other similar use-cases. Replace 'nano' with vi or your editor of choice if not on distro with nano included or because you like misery... your kinks are yours :)

CHANGE LEGEND: (you MUST replace these in the service file)

  • USERNAME = your actual username e.g. gyarbij
  • I recommend changing rclone.service to the name of eache drive if you have multiple mount points.
  • If you already have rclone mounts check Step #2 then skip to Step #4 and place your mount point at #MOUNT

Steps for RClone systemd to autostart on boot

  1. Install fusermount (if not already installed)
@dvaupel
dvaupel / svt-av1_encoding_guide.md
Last active April 24, 2025 21:27
SVT-AV1 Encoding Guide

SVT-AV1 Encoding Guide

Open source encoders

  • AOMEnc[^4]. Developed by AOM, reference encoder with most features and highest quality.
  • SVT-AV1. Developed by Intel, production ready encoder with high performance and optimized for parallelism.
  • Rav1e. Developed by Mozilla/Xiph, used by Vimeo[^1].

Since all these tools are stil being actively developed, you should always use the newest versions and compile the standalone encoders yourself if necessary.

@Zekfad
Zekfad / Admiral-AntiAdblock-Killer.user.js
Last active March 2, 2025 20:17 — forked from peruihkxt/Admiral-AntiAdblock-Killer.user.js
Kills the Admiral anti adblock nonsense. Just click on the *Raw* button to install the script into Tampermonkey.
// ==UserScript==
// @name Admiral AntiAdblock Killer
// @version 0.3
// @description Admiral AntiAdblock Killer
// @author Zekfad
// @match https://*/*
// @match http://*/*
// @grant none
// @updateURL https://gist.github.com/Zekfad/ed4f846bd51c8aff41f2cdaad24b21dd/raw/Admiral-AntiAdblock-Killer.user.js
// ==/UserScript==
@lrvick
lrvick / github-troll.md
Last active April 1, 2025 08:14
Trolling Github's DMCA repo with their own security flaws.
#!/bin/bash
###
### my-script — does one thing well
###
### Usage:
### my-script <input> <output>
###
### Options:
### <input> Input file to read.
### <output> Output file to write. Use '-' for stdout.
@nokidding
nokidding / updateNpm.bat
Created March 31, 2020 13:08
Windows batch file which updates npm for nvm-windows
rem see https://github.com/coreybutler/nvm-windows/issues/300
@echo off
SETLOCAL EnableDelayedExpansion
if [%1] == [] (
echo Pass in the version you would like to install, or "latest" to install the latest npm version.
) else (
set wanted_version=%1
// create a bookmark and use this code as the URL, you can now toggle the css on/off
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3
javascript: (function() {
var elements = document.body.getElementsByTagName('*');
var items = [];
for (var i = 0; i < elements.length; i++) {
if (elements[i].innerHTML.indexOf('* { background:#000!important;color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }') != -1) {
items.push(elements[i]);
}
}
@plembo
plembo / you-need-spice-vdagent.md
Last active January 27, 2025 00:55
You need spice-vdagent

You need spice-vdagent

Debian or Kali Linux installed to as KVM (libvirtd) guests do not automatically have qemu-guest-agent or spice-vdagent installed. This will prevent seamless movement of the mouse cursor between the guest and host desktop in Virtual Machine Manager (requiring the use of a Ctrl-Alt to release the cursor from the guest window).

To cure this, install both qemu-guest-agent and spice-vdagent on each guest and reboot (the guests).

$ sudo apt install qemu-guest-agent
$ sudo apt install spice-vdagent
@ChrisHardie
ChrisHardie / multisite_attachment_url.php
Created March 18, 2019 01:27
Example WordPress plugin to help simplify attachment URLs on multisite sites with mapped domains
<?php
/**
* Plugin Name: Multisite Domain Mapping Attachment URL Fixes
* Description: Update attachment URLs to use mapped domain and remove mention of "sites" path.
* Author: Chris Hardie
*
* Rewrite attachment URLs (and related srcset URLs) to the non-multisite, mapped domain version if a domain is mapped
* Requires that the related nginx config that maps the non-multisite URL to the multisite URL be in place
**/
add_filter( 'wp_get_attachment_url', 'jch_attachment_url_with_domain_mapping' );