Skip to content

Instantly share code, notes, and snippets.

View Guiorgy's full-sized avatar

Guiorgy Guiorgy

  • Ecopre
  • Georgia
View GitHub Profile
@Guiorgy
Guiorgy / zstd-fs-bench.sh
Last active March 27, 2026 11:11
Benchmark zstd compression on a filesystem
#!/bin/sh
# Example usage: ./zstd-fs-bench.sh ~/ 1 6 128 2
# Use the home directory (~/) as the sample for the benchmark
# Benchmark compression levels from 1 to 6 (inclusive)
# Use 128 KB block (default on ZFS)
# Use 2 GB of the sample data at most (since the data is first copied to memory, avoid filling it up)
SAMPLE="${1}"
START="${2:-1}"
@Guiorgy
Guiorgy / start.bat
Created March 17, 2026 11:55
A Windows batch file to start the local NanoKVM-USB service
@echo off
:: Download the latest NanoKVM-USB browser archive from https://github.com/sipeed/NanoKVM-USB/releases
:: Extract it into the service subdirectory
:: Download the latest Python Embeddable Package from https://www.python.org/downloads/
:: Extract it into the runtime subdirectory
cd /d "%~dp0"
@Guiorgy
Guiorgy / cs11rawstr.py
Last active April 6, 2026 15:48
Emulates C# 11 style raw string literal interpretation in Python
# Copyright (c) 2026 Guiorgy
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
from typing import Final, Iterable, Tuple, List
def cs11rawstr(rawstr: str) -> str:
@Guiorgy
Guiorgy / tempmon.sh
Created February 11, 2026 14:10
A simple shell script to monitor the temperatures in Linux
#!/usr/bin/env bash
# ============================================================================= #
# Copyright © 2026 Guiorgy #
# #
# This program is free software: you can redistribute it and/or modify it under #
# the terms of the GNU General Public License as published by the Free Software #
# Foundation, either version 3 of the License, or (at your option) any later #
# version. #
# #
@Guiorgy
Guiorgy / [email protected]
Last active January 30, 2026 17:46
Systemd service to periodically update tealdeer (tldr) cache
[Unit]
Description=Update tealdeer (tldr) cache for %i
ConditionACPower=true
After=network.target network-online.target systemd-networkd.service
[Service]
Type=oneshot
User=%i
ExecStart=/usr/bin/tldr --update
@Guiorgy
Guiorgy / Dockerfile.builder
Created December 25, 2025 17:20
Build NUT using Docker
FROM gcc:latest
# ============================================================================= #
# Copyright © 2025 Guiorgy #
# #
# This program is free software: you can redistribute it and/or modify it under #
# the terms of the GNU General Public License as published by the Free Software #
# Foundation, either version 3 of the License, or (at your option) any later #
# version. #
# #
@Guiorgy
Guiorgy / bash-completion.sh
Last active December 31, 2025 14:09
A wrapper around Systemd journalctl to print logs for the last n invocations of a unit
# ============================================================================= #
# Copyright © 2025 Guiorgy #
# #
# This program is free software: you can redistribute it and/or modify it under #
# the terms of the GNU General Public License as published by the Free Software #
# Foundation, either version 3 of the License, or (at your option) any later #
# version. #
# #
# This program is distributed in the hope that it will be useful, but WITHOUT #
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
@Guiorgy
Guiorgy / flac2opus.sh
Created December 20, 2025 15:38
Reencode all FLAC audio files in a source directory into OPUS and output them into a destination directory
#!/usr/bin/env bash
# ============================================================================= #
# Copyright © 2025 Guiorgy #
# #
# This program is free software: you can redistribute it and/or modify it under #
# the terms of the GNU General Public License as published by the Free Software #
# Foundation, either version 3 of the License, or (at your option) any later #
# version. #
# #
@Guiorgy
Guiorgy / build.sh
Created December 9, 2025 16:22
Build Microsoft Edit while including the current datetime in the about dialog as the build
#!/usr/bin/env bash
# ============================================================================= #
# Copyright © 2025 Guiorgy #
# #
# This program is free software: you can redistribute it and/or modify it under #
# the terms of the GNU General Public License as published by the Free Software #
# Foundation, either version 3 of the License, or (at your option) any later #
# version. #
# #
@Guiorgy
Guiorgy / enable-ssh.sh
Last active December 20, 2025 15:38
Generates a modified Finnix ISO file with a default root password and SSH enabled for use on headless systems
#!/usr/bin/env bash
# ============================================================================= #
# Copyright © 2025 Guiorgy #
# #
# This program is free software: you can redistribute it and/or modify it under #
# the terms of the GNU General Public License as published by the Free Software #
# Foundation, either version 3 of the License, or (at your option) any later #
# version. #
# #