Skip to content

Instantly share code, notes, and snippets.

@FoxxMD
FoxxMD / list
Created April 22, 2025 14:53 — forked from wndhydrnt/list
Run several commands in parallel, prefix the stdout of each stdout with its source and fail the script if one of the commands exits with a code != 0
foo
bar
baz
@FoxxMD
FoxxMD / README.md
Last active February 24, 2025 17:55
Blocking Docker container Egress to LAN

Hardens Docker networking between Stacks and LAN

Blocking Egress to LAN

Achieves:

  • Allow LAN -> Docker container communication
  • (Optional) Allow Docker -> LAN DNS
  • Block egress from Docker container to LAN destination (when established solely by container)
@FoxxMD
FoxxMD / convert.js
Last active January 20, 2025 20:16
convert acc-adts (audio/x-hx-aac-adts) audio to plain AAC with ffmpeg
const fs = require('fs');
const path = require('path');
const {execSync} = require('child_process');
const files = fs.readdirSync('.');
for(const f of files) {
const info = path.parse(f);
if(info.ext !== '.aac') {
console.log(`Skipping non AAC file ${f}`);
@FoxxMD
FoxxMD / getTotalTorrentsSize.js
Last active January 31, 2025 07:27
Qbittorrent get total size, downloaded, uploaded, and overall ratio (WebUI only)
// Tested on qBittorrent 4.6.1
//
// 1. open qbittorent web interface
// 1a. (optionally) filter to just the torrents that should be totalled
// 1b. MAY need to ensure any/all columns to be totalled are enabled -> Size, Downloaded, Uploaded
// 2. open developer tools
// 3. copy and paste the *entirety* of the below code into the developer tools console and hit enter
//
// Will print totals in MiB/GiB/TiB for:
// * Size + Min/Max/Avg
@FoxxMD
FoxxMD / podman.md
Created September 13, 2023 18:24
podman usage

UID/GID on container build

https://www.redhat.com/sysadmin/rootless-podman

Under Allocating additional UIDs/GIDs:

  • make sure you have newuidmap and newgidmap installed and have allocated ids for your normal user

for UID 2119470584, GID 2042662593 (try increasing the number of subordinate IDs in /etc/subuid and /etc/subgid

@FoxxMD
FoxxMD / README.md
Last active August 28, 2023 15:40
convert javascript import file endings/extensions using codeshift (relative and/or absolute)

Overview

Convert endings/extensions of your imports in your Typescript/Javascript files using jscodeshift

When migrating to/from TS/JS projects, changing tsconfig module/moduleResolution, or migrating from commonjs to ESM you may find you need to convert all, or some, of your imports to use a specific ending.

This transform module automates the process and provides granularity in how and which types of imports are converted.

Features:

@FoxxMD
FoxxMD / .scrobbler.json
Created March 9, 2023 19:16 — forked from ericboehs/.scrobbler.json
Scrobble iTunes/Apple Music to Last.fm
{
"lastfm": {
"username": "ericboehs",
"password": "secret",
"api_key": "abc123",
"api_secret": "xyz890"
}
}
@FoxxMD
FoxxMD / printer.md
Created September 15, 2022 20:12
3d printer investigation
@FoxxMD
FoxxMD / file-with-symbols.test.yaml
Created July 14, 2022 14:53
gist fetch example
value: symbols test
@FoxxMD
FoxxMD / flow.yaml
Last active March 1, 2022 14:54
flow control for context-mod
# your configs will continue to work with 'checks' at top-level
# -- CM will automatically wrap them in a dummy run
#
# use 'runs' at top-level to configure your own runs.
# You CANNOT have a top-level 'checks' and 'runs'
runs:
- name: flairAndCategory
# Runs inherit the same filters as checks/rules/actions
# If these filters fail the Run is skipped and CM processes the next run in order