Skip to content

Instantly share code, notes, and snippets.

View Makeshift's full-sized avatar

Connor Bell Makeshift

View GitHub Profile
/*
This helper script bridges compatibility between the Greasemonkey 4 APIs and
existing/legacy APIs. Say for example your user script includes
// @grant GM_getValue
And you'd like to be compatible with both Greasemonkey 4 and Greasemonkey 4
(and for that matter all versions of Violentmonkey, Tampermonkey, and any other
user script engine). Add:
@Makeshift
Makeshift / open_with_wsl_vscode.reg
Last active December 30, 2020 22:27
A reg file that modifies the "Open with Code" context menu to instead open with WSL VSCode
Windows Registry Editor Version 5.00
; The content of the hex below is as follows:
; C:\Windows\System32\wsl.exe bash -c "p='%V';p=\${p/W:/\\\\\\\\wsl$\\\\Ubuntu};echo Opening \$p ...;code \$(wslpath \$p)"
; %V contains the directory you right clicked in/on. This command uses wslpath to convert the Windows dir to a WSL dir, then
; uses 'code <dir>' to open it (assuming you have the remote VSCode command installed)
; The other bits relating to W: are specific to my needs, as I have \\wsl$\Ubuntu\ mounted as W:
; If you do the same, you will be able to 'Open with Code' on a WSL network mount
; Otherwise, it will still work as intended on Windows filepaths.
@Makeshift
Makeshift / gist:8275d95217a6337915c07790b113c3ad
Created March 11, 2021 12:03
Using Sodastream canisters without a Sodastream
canister - some proprietary bullshit |
<- p-bullshit adapter | m22 female -> https://www.co2supermarket.co.uk/sodastream-cylinder-valve-adapter-advanced-p171.html
<- m22 male | 1/4" female -> https://www.ebay.co.uk/itm/KARCHER-type-M22-male-Screw-Thread-22mm-to-1-4-female-Screw-Coupling-connector/122618528328
<- 1/4" male | 5/16" male -> https://www.ebay.co.uk/itm/Brass-Bsp-Threads-Male-To-Male-Adapter-Adaptors-Connecting-Reducer-Nipple-Hex/132588029117
<- 5/16" female - line assembly -> https://www.amazon.co.uk/PERA-Ball-Assembly-Disconnect-Brewing/dp/B079LX9575
@Makeshift
Makeshift / tutorial.md
Last active November 2, 2025 06:34
Tutorial for automatically syncing an Obsidian vault with Git on an Android device

How to sync Obsidian with Git on Android

Limitations

  • If Termux is closed in the background by Android, the cron service will stop updating your repository and you must open Termux again. Refer to instructions for your device model to disable the killing of certain background applications.
  • This may negatively affect your devices battery life. I'm not entirely sure yet.

Setup

@Makeshift
Makeshift / docker-compose.yml
Created November 8, 2021 14:41
Marauder without Marauder
version: '3.4'
services:
nzbhydra:
image: linuxserver/nzbhydra2
restart: unless-stopped
network_mode: "host"
volumes:
- ./runtime_conf/nzbhydra:/config
environment:
- TZ=Etc/UTC
@Makeshift
Makeshift / docker-compose.override.yml
Created November 8, 2021 18:26
Marauder - Extra Sonarr/Radarr
radarr4k:
image: makeshift27015/radarr
restart: unless-stopped
depends_on:
- rclone
volumes:
- /etc/localtime:/etc/localtime:ro
- ./runtime_conf/radarr4k:/config
- ./shared/:/shared:rshared
environment:
// ==UserScript==
// @name Manual Import Select All
// @match https://sonarr.makeshift.ninja/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
var SelectionManager = {};
@Makeshift
Makeshift / get-docker-stats.sh
Last active December 19, 2025 16:15
Docker stats in CSV with separated values in bytes
#!/bin/bash
function cleanLine() {
local line key field
line="$1"
key="$2"
field="$3"
echo "$line" | jq -r "$key" | tr -d 'BbIi' | awk "{print toupper(\$$field)}" | numfmt --from=auto
}
@Makeshift
Makeshift / tar.reg
Created September 2, 2022 11:59
Right-click tar options for Windows 10
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\SystemFileAssociations\.gz]
[HKEY_CLASSES_ROOT\SystemFileAssociations\.gz\shell]
[HKEY_CLASSES_ROOT\SystemFileAssociations\.gz\shell\extract]
@="Extract archive..."
[HKEY_CLASSES_ROOT\SystemFileAssociations\.gz\shell\extract\command]
@Makeshift
Makeshift / my-target-arch.md
Created April 1, 2023 23:40
What's MYTARGETARCH and why are you using it?

You might see this style of multi-arch binary management in a few Dockerfiles that I maintain:

ARG TARGETARCH
ARG MYTARGETARCH="${TARGETARCH:-amd64}"

ARG MICROMAMBA_amd64_URL="https://micro.mamba.pm/api/micromamba/linux-64/latest"
ARG MICROMAMBA_arm64_URL="https://micro.mamba.pm/api/micromamba/linux-aarch64/latest"

RUN MICROMAMBA_URL_STR="MICROMAMBA_${MYTARGETARCH}_URL" && MICROMAMBA_URL="${!MICROMAMBA_URL_STR}" \