SD Card Backup and Restore
馃拪 Quick Pill: SD Card Backup and Restore 鈩癸笍Info Use case: Backup Raspberry Pi SD cards, bootable USB drives, or any block device with compression. 馃攧 Backup SD Card Create a compressed backup of your SD card: ...
馃拪 Quick Pill: SD Card Backup and Restore 鈩癸笍Info Use case: Backup Raspberry Pi SD cards, bootable USB drives, or any block device with compression. 馃攧 Backup SD Card Create a compressed backup of your SD card: ...
馃拪 Quick Pill: Windows System Repair 鈩癸笍Info Use case: Fix corrupted Windows system files, repair Windows Update issues, resolve DLL errors, and restore system health. 馃敡 Automated Repair Script Save this as windows_repair.bat and run as Administrator: ...
馃拪 Quick Pill: LUKS Encrypted Container 鈩癸笍Info Use case: Create encrypted file containers for secure backup storage, sensitive documents, or portable encrypted volumes. Works like a virtual encrypted disk. 馃攼 Quick Setup (5 minutes) 1. Install Required Tools sudo apt install cryptsetup 2. Create Encrypted Container # Create a 10GB empty file (fast allocation) fallocate -l 10G BackupCrypt.img # Initialize LUKS encryption (you'll set a password) sudo cryptsetup luksFormat BackupCrypt.img # Open the encrypted container sudo cryptsetup open BackupCrypt.img backup_crypt # Create filesystem inside sudo mkfs.ext4 /dev/mapper/backup_crypt # Mount it sudo mkdir -p /mnt/encrypted sudo mount /dev/mapper/backup_crypt /mnt/encrypted # Set permissions (optional - for your user) sudo chown $USER:$USER /mnt/encrypted 3. Use Your Encrypted Storage # Copy files cp -r ~/Documents/sensitive/ /mnt/encrypted/ # Work with files normally echo "Secret data" > /mnt/encrypted/secret.txt 4. Close Encrypted Container # Unmount sudo umount /mnt/encrypted # Close LUKS container sudo cryptsetup close backup_crypt 鉁匰uccess Done! Your data is now encrypted. Without the password, the file looks like random data. 馃攧 Daily Usage Open and Mount # Open with password prompt sudo cryptsetup open BackupCrypt.img backup_crypt # Mount sudo mount /dev/mapper/backup_crypt /mnt/encrypted Close and Lock # Always unmount first sudo umount /mnt/encrypted # Then close sudo cryptsetup close backup_crypt 馃搵 Command Reference Create Container Command Purpose Notes fallocate -l SIZE file.img Create empty file (fast) Sizes: 1G, 10G, 100G, etc. dd if=/dev/zero of=file.img bs=1M count=10240 Create file (slower, more secure) Overwrites with zeros cryptsetup luksFormat file.img Initialize LUKS encryption Sets password Open/Close Command Purpose cryptsetup open file.img name Open encrypted container cryptsetup close name Close encrypted container cryptsetup status name Check if container is open Filesystem Command Purpose mkfs.ext4 /dev/mapper/name Create ext4 filesystem mkfs.xfs /dev/mapper/name Create XFS filesystem mkfs.btrfs /dev/mapper/name Create Btrfs filesystem 馃挕 Pro Tips Create container with dd (more secure, slower) Use dd instead of fallocate for better security - overwrites the file with zeros: ...
馃拪 Quick Pill: Batch Image Optimization 鈩癸笍Info Use case: Optimize hundreds of JPEG images for websites, reduce storage space, speed up page loading, or prepare photos for sharing. 馃殌 Quick Setup Install Required Tools # Ubuntu/Debian sudo apt install jpegoptim optipng # Fedora/RHEL sudo dnf install jpegoptim optipng # macOS (with Homebrew) brew install jpegoptim optipng 馃摳 Basic Image Optimization Optimize All JPEGs in Folder Save as optimize_images.sh: ...
馃拪 Quick Pill: QEMU/VirtualBox Disk Resize 鈩癸笍Info Use case: Expand virtual machine disk when running out of space. Works with QEMU raw images, VirtualBox VDI/VHD, and similar formats. 馃殌 Complete Resize Process 鈿狅笍Warning 鈿狅笍 Critical: Always backup your VM disk before resizing! Step-by-Step Guide # 1. Shutdown your VM first! # 2. Resize the disk image file qemu-img resize -f raw Ubuntu.vhd 200G # 3. Load NBD kernel module sudo modprobe nbd # 4. Connect disk as network block device sudo qemu-nbd --connect=/dev/nbd0 -f raw Ubuntu.vhd # 5. Expand the partition sudo parted /dev/nbd0 Inside parted: ...
馃拪 Quick Pill: Encrypted LVM Disk Resize 鈩癸笍Info Use case: Expand encrypted Ubuntu/Debian VMs that use LUKS encryption + LVM. Common in full-disk encryption setups. 馃攼 Complete Resize Process (Encrypted + LVM) 鈿狅笍Warning 鈿狅笍 Critical: ...