Skip to content

Instantly share code, notes, and snippets.

@alexdelorenzo
alexdelorenzo / to_opml.sh
Last active November 2, 2022 03:21
Generate an OPML file from Airsonic podcast subscriptions https://alexdelorenzo.dev/notes/airsonic-opml
#!/usr/bin/env bash
# License: GPLv3
export SCRIPT="${1:-airsonic.script}"
export TITLE="Airsonic Podcasts"
export SQL_REGEX="'https?://[^ ,]+','[^']*"
export TABLE="podcast_channel"
export DELIM=','
export TAG_FMT="<outline type='rss' xmlUrl='%s' text='%s' />"
@alexdelorenzo
alexdelorenzo / get-cflags.sh
Last active February 11, 2023 01:32
Get native CFLAGS for your host device. This will list the flags that are enabled on your hardware that are not enabled on the parent arch. https://alexdelorenzo.dev/notes/cflags
#!/usr/bin/env bash
# See: https://alexdelorenzo.dev/notes/cflags
# Requires `strs` package for Python: https://github.com/alexdelorenzo/strs/
# License: AGPLv3
export detectedArch="$(gcc -march=native -Q --help=target | grep march | str col 1 | str nth 0)"
export arch="${1:-$detectedArch}"
get-diff() {
diff \
@alexdelorenzo
alexdelorenzo / install_ff.sh
Last active April 10, 2022 02:28
Install Firefox with Global Menu patches on Ubuntu derived Linux distributions. https://alexdelorenzo.dev/notes/firefox-global-menu
#!/usr/bin/env bash
# Copyright 2022 Alex DeLorenzo. Licensed under the AGPLv3.
#
# This script requires Bash, byobu, curl, and pup. You can find the latter here:
# https://github.com/ericchiang/pup
# For more information, see https://alexdelorenzo.dev/notes/firefox-global-menu
#
# Usage:
# $ ./install_ff.sh amd64
readonly ARCH="${1:-amd64}"
@eNV25
eNV25 / hp-bios-update.md
Last active October 13, 2025 07:50
Instructions to Update the BIOS/UEFI for an HP Laptop on Linux

Instructions to Update the BIOS/UEFI for an HP Laptop on Linux

To update the BIOS/UEFI firmware requires HP-specific files in the EFI System Partition, also referred to as ESP.

On a Linux system, the ESP is typically mounted on /boot/efi or /efi. Whithin you should also find a EFI directory, e.g. /boot/efi/EFI or /efi/EFI. This article assumes that the ESP is mounted on /efi and that the /efi/EFI directory exists. You can replace that with the mount point your system uses.

The HP-specific files are located in /efi/EFI/HP or /efi/EFI/Hewlet-Packard. These files typically come preinstalled in HP Windows PCs. If you have these files you could skip Install HP-specific files.

@alexdelorenzo
alexdelorenzo / pyclean.py
Last active February 4, 2022 06:09
Clean up Python caches and packaging artifacts. See https://alexdelorenzo.dev/notes/pyclean
#!/usr/bin/env python3
## Author: Alex DeLorenzo
## Homepage: alexdelorenzo.dev
## License: GPLv3
from __future__ import annotations
from typing import Final, AsyncIterable
from shutil import rmtree
from sys import argv
from asyncio import (
gather, to_thread, run, Task,
@orhun
orhun / arch_linux_installation.md
Last active October 17, 2025 03:34
Notes on my Arch Linux installation: UEFI/Secure Boot + systemd-boot, LUKS-encrypted root (XFS), LUKS-encrypted swap (with hibernate & unlocked via TPM)
@b0gdanw
b0gdanw / DisableBigSur.sh
Last active September 23, 2025 05:44
Disable Big Sur services
#!/bin/zsh
#Credit: Original idea and script disable.sh by pwnsdx https://gist.github.com/pwnsdx/d87b034c4c0210b988040ad2f85a68d3
#Disabling unwanted services on macOS 11 Big Sur (11) and macOS Monterey (12)
#Disabling SIP is required ("csrutil disable" from Terminal in Recovery)
#Modifications are written in /private/var/db/com.apple.xpc.launchd/ disabled.plist and disabled.501.plist
# user
TODISABLE=()
#!/usr/bin/env bash
export SCRIPT="${1:-airsonic.script}"
export TITLE="Airsonic Podcasts"
export SQL_REGEX="'https?://[^ ,]+','[^']*"
export TABLE="podcast_channel"
export NAME_SEP="','" QUOTE="'"
export FIRST=0 SECOND=1 JOBS=4
@sts10
sts10 / rust-command-line-utilities.markdown
Last active October 30, 2025 03:46
A curated list of command-line utilities written in Rust

A curated list of command-line utilities written in Rust

Note: I have moved this list to a proper repository. I'll leave this gist up, but it won't be updated. To submit an idea, open a PR on the repo.

Note that I have not tried all of these personally, and cannot and do not vouch for all of the tools listed here. In most cases, the descriptions here are copied directly from their code repos. Some may have been abandoned. Investigate before installing/using.

The ones I use regularly include: bat, dust, fd, fend, hyperfine, miniserve, ripgrep, just, cargo-audit and cargo-wipe.

  • atuin: "Magical shell history"
  • bandwhich: Terminal bandwidth utilization tool
@alexdelorenzo
alexdelorenzo / find-mirrors.sh
Last active September 12, 2022 10:11
Find Ubuntu repository mirrors for ARM (armhf & arm64), RISC-V (riscv64), PPC (ppc64el), IBM Z (s390x), and more. For more information and documentation, see: https://alexdelorenzo.dev/notes/ubuntu-mirrors
#!/usr/bin/env bash
# Requires: Bash, GNU grep and parallel, htmlq, and httpie or xh.
# Usage:
# ./find-mirrors.sh ARCH DISTRO REPOSITORY PROTOCOL JOBS
# Example:
# ./find-mirrors.sh armhf focal main https 6
#
# Copyright 2022 Alex DeLorenzo. Licensed under the GPLv3.
#
export ARCH="${1:-${ARCH:-amd64}}"