Skip to content

Instantly share code, notes, and snippets.

View kekneus373's full-sized avatar

kekneus373

View GitHub Profile
@kekneus373
kekneus373 / use-tmux.md
Created January 13, 2026 17:22
tmux and never lose SSH again

To use tmux for a persistent Midnight Commander session that survives SSH disconnections:

Starting a persistent session

  1. SSH into your server and start tmux:
    ssh your-server
    tmux new -s mc
@kekneus373
kekneus373 / zfs-vs-ext4-single-drive.md
Created January 13, 2026 17:21
ZFS vs Ext4 Single-drive Pool

For a single-drive pool, both ZFS and ext4 are viable options, but they serve different purposes:

ZFS advantages on a single disk:

  • Data integrity: Detects corruption through checksumming (though it can't auto-repair without redundancy)[1][8]
  • Snapshots and compression: Built-in features that ext4 lacks[1][4]
  • Future flexibility: Easy to convert to a mirrored pool later by adding another drive[1]
  • Self-healing with copies=2: You can set ZFS to store multiple copies of data on the same disk, enabling some corruption recovery[1]

ext4 advantages:

  • Lower overhead: Less resource-intensive (RAM, CPU) than ZFS[3][4]
@kekneus373
kekneus373 / recurscively-find-n-remove-files.md
Created January 12, 2026 21:24
Recursively find and remove files by extension in Linux

To find and remove files by extension in a directory and its subdirectories on Linux, you can use the command: find /path/to/dir -name "*.extension" -type f -delete, replacing /path/to/dir with your directory path and *.extension with the specific file extension you want to delete. For example, to remove all .txt files, use find /path/to/dir -name "*.txt" -type f -delete.

@kekneus373
kekneus373 / fix-cannot-set-ext2-attr-samba.md
Created January 12, 2026 15:24
[FIX][SMB] Permission denied when setting ext2 attributes

The error you're seeing is related to extended attributes (ext2/ext3/ext4 filesystem attributes) that can't be transferred over Samba to your destination. This is a common issue when syncing between Linux systems via Samba shares.

To resolve this, you have a few options:

In your sync/backup tool:

  • Disable the option to copy extended attributes or file metadata
  • If using FreeFileSync, uncheck options related to copying file permissions or attributes

In smb.conf on the server: Add or modify these settings in your share configuration:

@kekneus373
kekneus373 / fix-acpi-resource-conflict.md
Created January 12, 2026 15:22
[FIX] ACPI resource conflict during boot

ACPI Resource Conflict

The message "ACPI: OSL: Resource conflict; ACPI support missing from driver?" indicates a conflict between system resources claimed by the ACPI (Advanced Configuration and Power Interface) subsystem and those accessed by a legacy driver, such as hardware monitoring drivers like nct6775 or it87 This typically occurs when an ACPI OperationRegion (OpRegion) and a driver's I/O port range overlap, leading to potential instability or erratic system behavior

The root cause is often a misconfiguration or outdated firmware, particularly in the BIOS, where ACPI settings may not properly coordinate with hardware drivers While the warning suggests that the driver may lack ACPI support, the issue is frequently resolved by adjusting kernel parameters rather than modifying the driver itself

A common solution is to use the kernel parameter acpi_enforce_resources=no, which disables ACPI's enforcement of resource reservations, allowing legacy drivers to access conflict

@kekneus373
kekneus373 / add-2-cron-reboot.md
Created January 12, 2026 15:20
[Cron] Run command at reboot

Cron reboot

To schedule a task to run automatically at system boot using cron, use the @reboot directive in the crontab file. This directive ensures the specified command or script executes once immediately after the system restarts To configure it, open the crontab editor with crontab -e, then add a line using the syntax @reboot [full path to command or script] For example, to run a script located at /root/backup.sh, add @reboot /root/backup.sh to the crontab It is essential to use the full path to the command or script, as the cron environment may not include standard paths like /usr/sbin

The @reboot directive can also be used with commands that require a delay after boot, such as @reboot sleep 300 && date >> ~/date.txt, which waits 300 seconds before executing the date command This is useful for ensuring system services are fully initialized before running dependent tasks. The cron daemon automatically detects changes to the crontab file after saving, so no manual restart

@kekneus373
kekneus373 / 7z.md
Created January 12, 2026 15:19
[7-Zip] Work with .7z from Terminal on Linux

To create a 7z archive in the Linux terminal, you can use the following command:

7z a archive.7z files_to_archive

Replace archive.7z with the desired name for your archive, and files_to_archive with the files you want to include in the archive.

If you want to specify additional options, such as compression level or password protection, you can use the following format:

7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on archive.7z files_to_archive
@kekneus373
kekneus373 / readme-burn-cue-cd-da.md
Created January 12, 2026 15:17
[CDDA] Audio CD Splitting and Burning Guide (FLAC+CUE sources)

Audio CD Splitting and Burning Guide

Steps

  1. Convert FLAC to WAV

    ffmpeg -i cd.flac cd.wav
  2. Copy and modify CUE file

@kekneus373
kekneus373 / dates-bash.md
Created January 12, 2026 15:16
[bash] Efficiently gather dates for logging activity in scripts

You can use the date command to include the current date and time in your echo statements. Here are a few common examples:

1. Basic timestamp (date and time):

echo "Converted: $filename$output at $(date)"

2. Custom format (e.g., YYYY-MM-DD HH:MM:SS):

echo "Converted: $filename$output at $(date +'%Y-%m-%d %H:%M:%S')"
@kekneus373
kekneus373 / no-matching-swap-initramfs.md
Created January 12, 2026 15:14
Fix initramfs no matching swap device is available

Initramfs Swap Device Error

The "no matching swap device is available" warning during update-initramfs indicates that the system's initramfs configuration references a swap partition UUID that is no longer present or valid, often due to changes like partition resizing, disk replacement, or switching from a swap partition to a swap file This typically occurs when the RESUME variable in /etc/initramfs-tools/conf.d/resume points to a UUID that no longer corresponds to an active swap device

To resolve this issue, first identify the current UUID of the active swap device using the blkid command and locate the line containing TYPE="swap" Then, update the /etc/initramfs-tools/conf.d/resume file to reflect the correct UUID If the swap configuration has changed significantly—such as switching from a partition to a file or using encrypted swap—it may be necessary to set RESUME=none instead of a UUID, especially if hibernation is not used Alternatively, if the RESUME va