This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/zsh | |
| # using this in my .zshrc file of the truenas_scale admin as an aliased command | |
| qvm() { | |
| local DISKS=() | |
| local ISO="" | |
| local BRIDGE="" | |
| local VNC_DISP="2" | |
| local VNC_BIND="0.0.0.0" | |
| local MEM="1024" | |
| local CPUS="1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # mover: bidirectional sync + retention-mode move/trim. | |
| # - Sync: --sync [--exclude PATTERN ...] [--authoritative-delete src|dst] [--authoritative-grace-sec SEC] | |
| # - Retain mode: --move --move-path P [--retain-pct N] [--retain-min-bytes BYTES] | |
| # [--ensure-dst-superset] [--max-trim-bytes BYTES] | |
| # Common safety: --min-age-sec SEC, --skip-open (auto: fuser→lsof→/proc), MergerFS branch awareness. | |
| # Locking: per pair/direction/global via --lock-scope, lock files in --lock-dir (default /var/lock/mover) | |
| set -euo pipefail | |
| export LC_ALL=C |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -Eeuo pipefail | |
| # omv-auto-import-mounts (safe XML edition) | |
| # Detect mounted filesystems and add missing <mntent> entries to OMV's config.xml. | |
| # Writes to a temp copy, validates XML, then atomically replaces the real file. | |
| # Default: DRY-RUN (prints). Use --apply to write, --deploy to refresh OMV. | |
| OMV_XML="/etc/openmediavault/config.xml" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # Endless SATA/UASP stability soak with fio + SMART (robust shutdown) | |
| # DESTROYS DATA on the target device. Use a WHOLE device (e.g. /dev/sdb, not /dev/sdb1). | |
| # Usage: sudo ./fio_stability_loop.sh /dev/sdX | |
| set -euo pipefail | |
| #====================== configuration ====================== | |
| DEVICE="${1:-}" # REQUIRED whole block device | |
| SEQ_DURATION=300 # 5m seq read/write | |
| RAND_DURATION=300 # 5m 4k 70/30 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import json | |
| import requests | |
| import concurrent.futures | |
| import os | |
| import time | |
| from tqdm import tqdm | |
| from deep_translator import GoogleTranslator | |
| def load_json_file(file_path): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| # This will extract an mbox in seperate eml files from google takeout (manually unzip it first) | |
| # Will try to create a folder structure based on the labels | |
| # Emails will be formatted like this: | |
| # 221104_110405_sender@mail.com_subject_in_45_chars.eml | |
| # e.g. ./Inbox/2022/10/Special/221104_110405_sender@mail.com_subject_in_45_chars.eml | |
| # | |
| # Should work for all languages, but has been tested on German with a 14 GB large mbox file (with 169039 messages) | |
| # Result: 169039 messages processed, 167591 messages saved |