Skip to content

Instantly share code, notes, and snippets.

View mara004's full-sized avatar

mara004

View GitHub Profile
@mara004
mara004 / yt_revanced.md
Last active June 13, 2025 22:20
On Procuring YouTube ReVanced

In the course of this process, you will download several apps from external sources. To be on the safe side, you'll want to check each APK with https://www.virustotal.com/ before installation. You are also encouraged to use Firefox with uBlockOrigin and the Badware Risks filter list enabled, as a precaution against scamming sites.

  1. Install ReVanced Manager from https://github.com/ReVanced/revanced-manager/releases/latest or https://revanced.app/download
  2. Open ReVanced Manager (grant permission to install apps when asked for). Tap Patches -> Select an app. Look for YouTube and the Suggested: version. It should be in the 3rd line. (Do not use the 1st line, that's your installed version of YouTube.)
  3. Go to https://www.apkmirror.com/ and search for YouTube $VERSION, where $VERSION is the suggested version you have determined in (2). (Alternatively, tap on the Suggested: ... field to do a browser search that may lead you to the apkmirror site in question.) Once you've found the right APK, downlo
@mara004
mara004 / phone_oss.md
Last active June 21, 2025 02:05
Open-source software for mobile phones
  • F-Droid
  • Firefox (with uBlockOrigin and Dark Reader)
  • Thunderbird (K9 Mail), (FreeMail)
  • VLC, KeePassDX, KDE Connect
  • NewPipe, LibreTube, YTDLnis, Seal
  • Signal, Wire
  • Termux
  • AdAway
  • Magisk/Zygisk, TWRP +? Zygisk Assistant or similar
  • LineageOS
@mara004
mara004 / run_with_args.py
Last active May 3, 2025 21:37
Wrap a python module's CLI entrypoint with argfiles support
#! /usr/bin/env python3
# SPDX-FileCopyrightText: 2025 mara004 <[email protected]>
# SPDX-License-Identifier: BSD-2-Clause
import sys
import shlex
from pathlib import Path
from importlib import import_module
from importlib.metadata import entry_points
@mara004
mara004 / SOFTWARE_TODO.txt
Last active June 12, 2025 02:11
My software tasks
pypdfium2
- matrix render helper & CLI
- CLI: input mode selection, ability to render multiple files at once
- think about mutex sharing, and plugging in a mutex into the autoclose machinery
- native sourcebuild script (-> implicit fallback on setup) WIP
- download the pdfium version in autorelease record by default, not latest
ghostscript:
- handle formats
@mara004
mara004 / ghostscript_ffi.py
Last active April 14, 2025 01:06
PDF rendering with Ghostscript, revisited (ABI bindings, in-memory approach)
# Four lines intentionally left blank
# SPDX-FileCopyrightText: 2025 geisserml <[email protected]>
# SPDX-License-Identifier: MPL-2.0 OR GPL-3.0-or-later
# Note that Ghostscript is AGPL-licensed, so this code is altogether affected by copyleft
# Written with Ghostscript 9.56.1 on Fedora.
@mara004
mara004 / dvd_rip.sh
Last active March 24, 2025 22:28
DVD ripping
# see also https://wiki.ubuntuusers.de/DVDs_manuell_rippen/#Komplette-Spur-rippen
lsdvd /dev/sr0 # to show available tracks and their length
mplayer dvd://n -dvd-device /dev/sr0 # to preview a track -- where n is the track number (1-based)
mplayer dvd://n -dvd-device /dev/sr0 -v -dumpstream -dumpfile filename.vob # to rip track
@mara004
mara004 / interesting_windows.md
Last active December 27, 2024 23:32
Interesting Windows(-only) software
@mara004
mara004 / labelling.py
Last active January 9, 2025 23:09
Enumerate data using letters rather than numbers
# SPDX-FileCopyrightText: 2024 geisserml <[email protected]>
# SPDX-License-Identifier: MPL-2.0
from string import ascii_uppercase as ALPHABET
N_CHARS, ORD_A = len(ALPHABET), ord("A") # 26, 65
def idx_to_label(i):
count, remainder = divmod(i, N_CHARS)
char = ALPHABET[remainder] # chr(remainder + ORD_A)
@mara004
mara004 / deferred_imports.py
Last active April 12, 2025 00:49
Various attempts at deferred ("lazy") imports. None of these seems particularly satisfying, though. Missing PEP 690...
# SPDX-FileCopyrightText: 2024 geisserml <[email protected]>
# SPDX-License-Identifier: Apache-2.0 OR BSD-3-Clause OR MPL-2.0
import sys
import importlib.util
def v1_deferred_import(modpath):
# FIXME If modpath points to a submodule (e.g. PIL.Image), the parent module will be loaded immediately when this function is called. What's more, non-deferred imports of the submodule will break. This seems to be a nasty limitation of the importlib APIs used here.
@mara004
mara004 / ghostscript_shell.py
Last active April 2, 2025 00:41
PDF rendering with Ghostscript (via subprocess)
# SPDX-FileCopyrightText: 2024 geisserml <[email protected]>
# SPDX-FileCopyrightText: 2024 James R. Barlow <[email protected]>
# SPDX-License-Identifier: MPL-2.0
# Initial code derived from ocrmypdf/_exec/ghostscript.py
# Note that Ghostscript is AGPL-licensed. However, we are calling it via subprocess here, so not sure whether copyleft would actually apply.
# See also https://www.gnu.org/licenses/gpl-faq.en.html#MereAggregation
import io
import os