Skip to content

Instantly share code, notes, and snippets.

@dzogrim
dzogrim / fedora42-live-fwupd-tty.ks
Last active November 12, 2025 16:04
Kickstart Fedora 42 x86_64 minimal TTY Live hybrid ISO for firmware on/offline updates (fwupd)
# SPDX-License-Identifier: MIT
#version=DEVEL
# Fedora 42 x86_64 minimal TTY Live hybrid ISO for firmware on/offline updates (fwupd)
#
# Purpose (what this ISO is for)
# - Text-only (TTY) Fedora 42 Live ISO to run firmware updates with fwupd.
# - Works online (LVFS over HTTPS) or offline using a restored cache.
# - Boots on UEFI and BIOS/legacy.
# - No GUI (nmcli only). Wi-Fi supported.
# - Persistence supported via an ext4 partition labeled 'overlay' on the USB stick.
@dzogrim
dzogrim / bash_rc_reseync_v3.sh
Created October 17, 2025 14:43
Compare local config files/folders against two Dropbox references and show concise diffs/missing files
#!/usr/bin/env bash
# SPDX-License-Identifier: MIT
# SPDX-FileCopyrightText: 2025 dzogrim
# SPDX-FileContributor: dzogrim <[email protected]>
# ==============================================================================
# Compare local config files/folders against two Dropbox references
# ("work" and "personal") and show concise diffs/missing files.
# ==============================================================================
# How it works
# • The REFSETS array lists triplets: "current|ref_work|ref_personal".
@dzogrim
dzogrim / tailscale-prune-devices.sh
Created October 14, 2025 09:31
Lists tailnet devices, skips keyExpiryDisabled, flags expired or inactive (lastSeen <= now-<days>, default 120), prints name/lastSeen/expires, deletes each via DELETE /api/v2/device/{id} (interactive or --force), portable across macOS BSD date and Linux GNU date with a double-guard against expiry-disabled
#!/usr/bin/env bash
set -Eeuo pipefail
# tailscale-prune-devices.sh description:
# • Fetches all devices from your tailnet via GET /api/v2/tailnet/{tailnet}/devices.
# • Filters out devices with `keyExpiryDisabled=true`.
# • Flags devices whose key has expired (expires <= now)
# or that have been inactive since a cutoff (lastSeen <= now-<days>; default 120).
# • Shows name, lastSeen, and expires for each candidate.
# • Deletes each candidate via DELETE /api/v2/device/{id}:
@dzogrim
dzogrim / reset_spotlight_position.sh
Last active July 24, 2025 12:40
Set new Spotlight window position to the computed coordinates and size
#!/usr/bin/env bash
# SPDX-License-Identifier: MIT
# SPDX-FileCopyrightText: 2015-2025 dzogrim
# SPDX-FileContributor: dzogrim <[email protected]>
# -----------------------------------------------------------------------------
# reset_spotlight_position.sh
# -----------------------------------------------------------------------------
# Description:
# Re-centers the macOS Spotlight search bar on the main screen.
# Optionally disables onboarding/suggestions and resets corrupted positioning.
@dzogrim
dzogrim / set-python-123.sh
Created July 19, 2025 15:02
This script configures system-wide defaults for Python and related tools installed via MacPorts
#!/usr/bin/env bash
# ------------------------------------------------------------------------------
# Script : set-python-123.sh
# Author : Sébastien L.
#
# Description :
# This script configures system-wide defaults for Python and related tools
# installed via MacPorts. It uses `port select --set` to point commands like
# `python`, `pip`, `cython`, `ansible`, etc. to a specific installed version.
#
@dzogrim
dzogrim / bash_rc_reseync_v2.sh
Created July 19, 2025 14:20
Compare les fichiers de configuration bash locaux avec des références sauvegardées sur Dropbox
#!/usr/bin/env bash
# ------------------------------------------------------------------------------
# Compare les fichiers de configuration bash (~/.bashrc.d) locaux avec des
# références sauvegardées sur Dropbox, selon l'environnement détecté (pro ou perso).
#
# Ce script est utile pour détecter les différences ou les oublis dans les fichiers
# de configuration shell synchronisés entre plusieurs machines.
#
# Dépendances : jq, diff, Dropbox installé et configuré avec fichier info.json
@dzogrim
dzogrim / brew-update.sh
Last active July 23, 2025 15:15
This script automates Homebrew maintenance on macOS
#!/usr/bin/env bash
# SPDX-License-Identifier: MIT
# SPDX-FileCopyrightText: 2019–2025 dzogrim <[email protected]>
#
# ------------------------------------------------------------------------------
# brew-update.sh — Homebrew Maintenance Tool for macOS
#
# This script automates Homebrew maintenance on macOS:
# - Updates the package index (brew update)
# - Lists and upgrades outdated packages (brew upgrade)
@dzogrim
dzogrim / certs_validity.sh
Created July 19, 2025 13:07
checks the expiration dates of TLS certificates
#!/usr/bin/env bash
# SPDX-License-Identifier: MIT
# SPDX-FileCopyrightText: 2015-2025 dzogrim
# SPDX-FileContributor: Sébastien L. <[email protected]>
# -----------------------------------------------------------------------------
# File: certs_validity.sh
# Description:
# This script checks the expiration dates of TLS certificates
# for common services (IMAP, SMTP, HTTPS) on a list of domains.
# It performs DNS resolution and TLS negotiation using OpenSSL.
@dzogrim
dzogrim / refresh_system.sh
Last active October 18, 2025 07:32
Provides an interactive system maintenance menu for macOS using 'dialog'
#!/usr/bin/env bash
# SPDX-License-Identifier: MIT
# SPDX-FileCopyrightText: 2015-2025 dzogrim
# SPDX-FileContributor: dzogrim <[email protected]>
# -----------------------------------------------------------------------------
# refresh_system.sh — macOS Maintenance Toolkit
#
# A modular Bash script to run daily/weekly maintenance on macOS systems.
# Uses either 'dialog' or 'gum' as an interactive frontend with fallback.
# Tasks include:
@dzogrim
dzogrim / git_refresh.sh
Last active July 7, 2025 16:19
This script scans and maintains Git repositories under a given base directory
#!/usr/bin/env bash
# SPDX-License-Identifier: MIT
# SPDX-FileCopyrightText: 2025 Sébastien L.
#
# Description:
# This script scans and maintains Git repositories under a base directory.
# Features:
# - Silent by default, verbose with '-v' or '--verbose'.
# - Dynamic discovery with '--discover'.
# - Force 'yes' with '--force', skip all prompts with '--skip'.