ffmpeg -i pohokolius_-_tetrahedron.flac -filter_complex "[0:a]avectorscope=s=640x640:rate=25:zoom=1.5:draw=line" -y tetrahedron_phase.mp4
Generates a visual phase analysis video (Goniometer/Lissajous) from the audio stream. Vertical alignment indicates Mono compatibility; horizontal alignment indicates phase cancellation. The 'cloud' shape represents stereo width. Ideal for checking mastering results!
audio processing ffmpeg phase-analysis
ffmpeg -i pohokolius_-_tetrahedron.flac -filter_complex "pan=mono|c0=c0-c1" -y tetrahedron_side_signal.wav
Isolates the Side signal (Stereo Difference). Subtracts Right from Left. Used to audit exactly what 'space' and 'air' will be deleted when the track is played on mono systems. Ideal for checking mastering results!
audio processing ffmpeg side-signal
adb push ./local_file /sdcard/Download/
The only way to write to Android at full speed (20-40MB/s). Bypasses the MTP/FUSE bottleneck entirely.
android file adb
ffmpeg -i input.wav -af "pan=stereo|c0=c0|c1=-1*c1" phase_flip.wav
Inverts the phase of the Right channel. If the cancellation was caused by a simple polarity inversion, this restores the sound while keeping some stereo information.
audio processing ffmpeg phase-flip
ffmpeg -i input.wav -af "pan=stereo|c0=c0|c1=c0" vangogh.wav
The 'Van Gogh'. Discards the Right channel entirely and forces the Left channel to both speakers. Fixes many phase cancellation issues by killing stereo.
audio processing ffmpeg stereo-fix
ffmpeg -i input.wav -codec:a libmp3lame -q:a 0 output.mp3
Converts audio to MP3 using Variable Bitrate (VBR) set to V0 (highest VBR quality, efficient size).
audio conversion ffmpeg mp3
ffmpeg -i input.wav -codec:a libmp3lame -b:a 320k output.mp3
Converts audio to MP3 using Constant Bitrate (CBR) at 320kbps (highest standard quality).
audio conversion ffmpeg mp3
magick input.png -resize 1000x1000 -quality 90 output.jpeg
Resizes an image to fit within 1000x1000px (maintaining aspect ratio) and saves as 90% quality JPEG.
image processing imagemagick resize
magick input.png -define jpeg:extent=1.8MB output.jpeg
Converts an image to JPEG, automatically adjusting quality to ensure the file size is under the specified limit (e.g., 1.8MB).
image processing imagemagick size
magick cover.png \( -background none -size 200x200 logo.svg \) -gravity SouthEast -geometry +100+100 -composite output.png
Overlays a vector logo onto a base image. Resizes the logo cleanly to 200px and places it 100px from the bottom-right corner.
image processing imagemagick composite
metaflac --remove --block-type=PICTURE file.flac && metaflac --import-picture-from="cover.jpg" file.flac
Safely removes old artwork first, then embeds the new cover image in a second pass in a music file.
audio metadata cover-art
ffmpeg -i input.flac -af loudnorm=I=-12:TP=-2:LRA=7:print_format=summary -c:a flac -sample_fmt s32 -ar 48000 output.flac
The 'Streaming Safe' Master. Normalizes audio to -12 LUFS and -2.0 True Peak. Preserves 24-bit depth and 48kHz rate.
audio mastering loudness ffmpeg
etcupdate diff | less
Compares your current /etc configuration files against the stock defaults. Shows exactly what you have modified.
freebsd administration config diff
bastille cmd ALL ping -c 1 8.8.8.8
The 'Smoke Test': Verifies that your PF Firewall NAT is actually working by forcing all Jails to ping Google.
freebsd container bastille network
service pf reload
Reloads the PF firewall rules immediately (applies changes).
freebsd firewall pf reload
pfctl -nf /etc/pf.conf
Checks the PF configuration file for syntax errors WITHOUT loading it (Safe Mode).
freebsd firewall pf
fsck -t ufs -f -y /dev/da0p1
Forces a full consistency check and auto-repair on a UFS partition, even if marked 'clean'. Equivalent to 'e2fsck -f'.
freebsd disk ufs repair
tunefs -n enable /dev/da0p1
Enables 'Soft Updates'. Reorders disk writes to ensure filesystem structure remains consistent even if power fails.
freebsd disk ufs
tunefs -t enable /dev/da0p1
Enables TRIM support on a UFS partition. CRITICAL for SSD longevity and sustained write speeds.
freebsd disk ufs ssd
tunefs -j enable /dev/da0p1
Enables 'Soft Updates Journaling' (SU+J). Makes filesystem recovery near-instant after a power failure.
freebsd disk ufs
tunefs -p /dev/da0p1
Prints all current UFS tuning parameters (ACLs, Journal, Soft Updates, Trim, Owner).
freebsd disk ufs info
tunefs -m 0 /dev/da0p1
Reduces the reserved space (minfree) on a UFS partition to 0%, instantly reclaiming ~8% of disk capacity (useful for data/backup drives).
freebsd disk ufs optimization
fsck -t ufs -y /dev/da0p1
Runs a non-interactive (-y) consistency check and repair on a UFS partition.
freebsd disk ufs repair
e2fsck -f /dev/da0p1
Forces a filesystem consistency check and repair on Ext2, Ext3, or Ext4 partitions (Fixes 'dirty' bit).
freebsd disk ext-fs repair
tune2fs -L "NEW_LABEL" /dev/da0p1
Renames (relabels) an Ext2, Ext3, or Ext4 filesystem without reformatting.
freebsd linux disk ext-fs label
newfs -U -L "DATA-DISK" /dev/da0p1
Formats an existing partition as UFS with Soft Updates (fast) and labels it 'DATA-DISK'.
freebsd disk ufs format
sysupgrade -b /tmp/backup.tar.gz
Creates a backup archive of the current configuration and saves it to /tmp.
openwrt backup config
block info
Displays UUIDs, labels, filesystem types, and mount points for all attached block devices.
openwrt storage info
whereis -b ansible
Locates the binary executable for a specific program.
freebsd search
/usr/libexec/locate.updatedb
Manually updates the 'locate' database to index recent files.
freebsd administration file search
procstat -f $(pgrep nginx)
Lists all open files and file descriptors for a specific process (like lsof).
freebsd monitoring process file
pfctl -s info
Shows the current status of the PF firewall (uptime, stats, state table).
freebsd firewall pf info
service netif restart
Restarts the network interface subsystem. WARNING: Will disconnect SSH.
freebsd network dangerous
service -e
Lists all system services that are currently enabled.
freebsd administration service
sockstat -4l
Lists all IPv4 listening sockets and the processes/PIDs attached to them.
freebsd network monitoring socket
kldstat -v
Lists all loaded kernel modules and the specific kernel files they belong to.
freebsd kernel module info
pciconf -lv
Lists all PCI devices attached to the system showing driver names and vendor details.
freebsd hardware pci info
service powerd status
Checks if the power control daemon is running.
freebsd hardware power
sysctl dev.cpu.0.cx_usage
Displays usage statistics for CPU C-states (sleep modes).
freebsd hardware cpu power
sysctl dev.cpu.0.freq_levels
Lists all supported frequency steps and their power consumption.
freebsd hardware cpu frequency
sysctl dev.cpu.0.freq
Displays the current operating frequency (MHz) of the first CPU core.
freebsd hardware cpu frequency
sysctl dev.cpu | grep temperature
Displays the current temperature of all CPU cores.
freebsd hardware cpu temperature
top -P -d 1
Runs top in per-CPU mode (-P) with a 1-second refresh rate.
freebsd system monitoring top
bastille rdr target_jail tcp 8080 80
Forwards TCP port 8080 on the host to port 80 inside the target jail (requires PF).
freebsd container bastille network
bastille stop target_jail
Gracefully stops a specific jail.
freebsd container bastille
bastille cmd ALL echo 'Hello World'
Executes a single command across ALL running jails simultaneously.
freebsd container bastille
bastille console hlab-ansible-server
Logs directly into the shell of a specific running jail.
freebsd container bastille
bastille list
Displays a table of all Bastille jails, including their state (Up/Down) and IP addresses.
freebsd container bastille
pkg audit -F
Fetches the latest vulnerability database and audits all installed packages for known security issues.
freebsd security pkg audit
pkg info -as | sort -hk 2
Lists all installed packages sorted by their installed size (human-readable).
freebsd package-management pkg disk
pkg query -e '%a = 0' '%n-%v'
Lists 'leaf' packages (software you explicitly installed), excluding dependencies.
freebsd package-management pkg query
bectl create -r pre-update-backup
Creates a new ZFS Boot Environment recursively, allowing you to rollback the entire OS if an update fails.
freebsd zfs backup
bectl list
Lists all ZFS Boot Environments (BEs), showing which is active now and which will be active on the next reboot.
freebsd zfs boot
zpool scrub zroot
Initiates a data integrity check (scrub) on the main ZFS pool to verify checksums and repair corruption.
freebsd zfs maintenance
zpool status -v zroot
Checks the progress of a running ZFS scrub or displays detailed error logs for the pool.
freebsd zfs maintenance
zpool list -v
Shows the status and topology of ZFS pools, including individual read/write/checksum errors for specific drives.
freebsd zfs storage
zfs list -o space
Displays a detailed breakdown of ZFS disk usage, distinguishing between data, snapshots, and reserved space.
freebsd zfs storage
glabel status
Shows all available labels (UFS, GPT, Ext2fs) and which physical device they point to.
freebsd hardware storage label
geom disk list
Lists detailed physical attributes of all connected disks (mediasize, sector size, rotation rate, device names).
freebsd hardware storage info
echo '/dev/ext2fs/DATA_VAULT /mnt/ext_usb ext2fs rw,noauto,failok,noatime 0 0' >> /etc/fstab
Adds an fstab entry for an Ext4/Ext2 drive using the fast kernel driver.
freebsd disk fstab automation
tune2fs -L "DATA_VAULT" /dev/da0s1
Labels an existing Ext4 partition.
freebsd disk label
tune2fs -O ^has_journal /dev/da0s1
Disables the journal on an existing Ext4 partition to allow high-speed mounting on FreeBSD.
freebsd disk ext-fs optimization
mke2fs -t ext4 -O ^has_journal -L "DATA-DISK" /dev/da0p1
Formats as Ext4 but manually disables the journal. Functionally similar to Ext2 but retains Ext4 features.
freebsd disk format ext-fs
mke2fs -t ext2 -L "DATA-DISK" /dev/da0p1
Formats a drive as Ext2. Essential for high-speed writes on FreeBSD if you need Linux compatibility (No journaling).
freebsd linux disk format ext-fs
gpart destroy -F da0 && gpart create -s gpt da0 && gpart add -t linux-data -a 1m -l "DATA-DISK" da0
Wipes disk and creates a generic 'linux-data' partition. Useful if the drive must be shared with Linux systems.
freebsd disk partition linux cleanup
mount -o async,noatime /dev/ufs/DATA-DISK /media/DATA-DISK
Mounts a UFS drive in 'Turbo Mode' (Write Caching + No Access Time). Dangerously fast (130MB/s+) for backups.
freebsd disk ufs
tunefs -L "DATA-DISK" /dev/da0p1
Writes a label to an EXISTING UFS partition. Makes it appear permanently as /dev/ufs/DATA-DISK.
freebsd disk ufs label
gpart destroy -F da0 && gpart create -s gpt da0 && gpart add -t freebsd-ufs -l "DATA-DISK" -a 1m da0
Completely wipes disk da0, creates a fresh GPT scheme, and adds a 1MB-aligned UFS partition labeled DATA-DISK.
freebsd disk partition ufs cleanup
rsync -avhW --no-compress --info=progress2 /source/ /media/DATA-DISK/
(The 'Turbo' Rsync) Uses whole-file copy (-W) and disables compression to maximize throughput on local USB drives.
linux backup rsync
dd if=/dev/zero of=/media/DATA-DISK/speedtest.img bs=1M count=1000 status=progress
Writes a 1GB sequential test file to check the pure write speed of a drive, bypassing filesystem overhead.
linux disk benchmark
cmp ./Samsung_SSD_990_PRO_8B2QJXD7.iso /dev/sdb
Compares the contents of an ISO file against a physical disk to ensure the data was written accurately byte-for-byte.
linux disk integrity
sudo dd if=./Samsung_SSD_990_PRO_8B2QJXD7.iso of=/dev/sdb bs=4M status=progress
Writes an ISO file to a physical device with a 4MB block size and a real-time progress indicator.
linux disk management iso
: > /path/to/big.log
The fastest way to truncate a file to zero bytes. The colon ':' is the null command (does nothing), and the redirection operator opens the file and truncates it. Atomic and faster than 'echo'.
linux file cleanup
echo "${SRANDOM}"
Bash 5.1+ Only. Returns a cryptographically secure 32-bit random number from the kernel's entropy pool, unlike $RANDOM which is linear and predictable. No need to cat /dev/urandom anymore.
linux security random bash
shred -vzu -n 5 filename
Securely delete a file. Overwrites 5 times with random data, then zeros, then removes.
linux security cleanup
assoc .txt=txtfile
Fix file associations via command line. Links .txt extension back to text files.
windows file config extension
dism /online /export-driver /destination:C:\BackupDrivers
Export all installed 3rd-party drivers to a folder. Essential before reinstalling Windows.
windows backup drivers maintenance
netstat -ano | findstr LISTENING
List all active ports listening for connections, including the Process ID (PID).
windows network ports monitoring
taskkill /F /FI "STATUS eq NOT RESPONDING"
Force kill all applications that are currently frozen or 'Not Responding'.
windows process kill
wmic path softwarelicensingservice get OA3xOriginalProductKey
Retrieve the OEM product key embedded in the motherboard firmware (BIOS/UEFI).
windows license activation hardware
python3 -m http.server 8000
Instant Web Server. Serves current directory over HTTP. Useful for quick file transfers
web network server python
powercfg /batteryreport
Generates a detailed HTML report of battery health, cycles, and capacity history in user folder
windows hardware battery info
robocopy Source Dest /MIR /MT:8 /R:1 /W:1
Robocopy Mirror. Syncs Source to Dest. DELETES files in Dest not in Source. Multithreaded.
windows backup sync cli
netsh wlan show profile name="SSID" key=clear
Reveal the saved Wi-Fi password for a specific network in plain text.
windows network security password
cipher /W:C:
Wipe free space. Overwrites deleted data with 3 passes (0x00, 0xFF, Random). Does not touch existing files.
windows security disk cleanup
ipconfig /flushdns
Clears the DNS resolver cache, potentially resolving connectivity issues by forcing the system to retrieve fresh DNS information.
windows network dns
defrag /c /h /v /b /o
Defragments all volumes, optimizes boot files, includes TRIM for SSDs, and provides detailed output.
windows disk maintenance optimization
defrag /c /h /v /a
Analyzes fragmentation levels on all volumes (HDDs only) with detailed output, and can be compared using the GUI version in dfrgui
windows disk maintenance optimization
sfc /scannow
Scans and repairs corrupted or missing system files, ensuring system integrity and proper operation.
windows system maintenance repair
cleanmgr /sageset:1
cleanmgr /sagerun:1
Use /sageset:1 to configure and save specific cleanup options for Disk Cleanup, and /sagerun:1 to execute the cleanup based on those saved settings.
windows disk cleanup maintenance
chkdsk /f /r
Fixes errors on the disk and recovers readable information from bad sectors, improving overall disk integrity and performance. Usually, this is a very slow operation.
windows disk maintenance repair
chkdsk /scan
Scans the file system on the specified volume for errors without fixing them, allowing for a thorough examination of disk health.
windows disk maintenance repair
winget repair [package-name or package-ID]
Repairs the specified installed application using winget. It verifies and attempts to fix issues with applications managed by winget. You can specify the application by either its name or ID. This works only on supported installations and may not be available for all applications (winget will display a message if unavailable). Requires Windows 10 version 1809 (build 17763) or later.
windows package-management winget repair
winget upgrade --all
Upgrades all updatable packages to their latest versions using winget. This only applies to winget updatable packages and may not include all installations. Requires Windows 10 version 1809 (build 17763) or later.
windows package-management winget
winget list
Lists all installed packages on the system using winget. The list shows only winget affected and updatable programs. Requires Windows 10 version 1809 (build 17763) or later.
windows package-management winget
dnf --assumeno install package1
Runs a DNF transaction that shows what would be done but aborts instead of applying changes, letting you preview packages to be installed or removed without modifying the system.
linux package-management dnf debug fedora
apt autoremove --purge
Removes packages that were automatically installed to satisfy dependencies and are no longer required, and with --purge also removes their configuration files; run apt clean afterward to clear cached package archives.
linux package-management apt cleanup debian
apt -s install package1 package2
Performs a simulated install showing packages that would be installed or removed without changing the system
linux package-management apt debug debian
apt remove --purge package1
Removes the package and its installed files, and with --purge also removes system-wide configuration files from /etc and dpkg's info so the package is fully removed.
linux package-management apt cleanup debian
apt --no-install-recommends --no-install-suggests package1 package2
Installs specified packages using apt while suppressing recommended and suggested packages, ensuring only required dependencies are pulled for a minimal installation. To disable this behavior system-wide, add the lines
APT::Install-Recommends "false";
APT::Install-Suggests "false";
to /etc/apt/apt.conf (or drop files with those settings under /etc/apt/apt.conf.d/) so apt defaults to not installing recommends/suggests
linux package-management apt debian
find . -type f -wholename './.meta/artwork/*-release_cover_l.jpeg' -exec bash -c 'magick "$0" -write mpr:img +delete \
\( mpr:img -resize 1920x1920 -crop 1920x1920+0+0 -gravity center -extent 1920x1080 +repage -blur 0x187 -attenuate 10.0 +noise Uniform -modulate 100,75 -blur 0x7 \) \
\( mpr:img -resize 540x540 \) \
\( +clone -background black \) \
\( -clone 2,1 -background none -layers merge +repage \) \
-delete 1,2 \
-gravity center -extent 1920x1080 -compose over -composite -quality 98% -define jpeg:fancy-upsampling=off ".meta/artwork/$(basename ./*.flac ".flac")-video_cover_l.jpeg"' '{}' \;
Finds a source album cover and generates a 1920x1080 video background by layering a clean, resized version of the artwork in the center of the image over a heavily blurred, desaturated, and zoomed-in version of the same image.
image processing imagemagick
MP4Box -info $VIDEO.mp4 2>&1 | grep RFC6381 | awk '{print $4}' | paste -sd , -
Inspects an MP4 file to find all RFC 6381 codec identifiers and formats them into a single, comma-separated string suitable for the 'codecs' attribute in an HTML5 video tag.
video analysis metadata mp4box
find ./.artwork/jpeg/ -type f \( -name "*.jpeg" -o -name "*.jpg" ! -name "*_optimized.jpeg" \) -exec bash -c 'magick -strip -quality 88 -verbose -limit thread 0 "$0" sixel:- > "${0%.*}.six"' '{}' \;
Finds all JPEG images in a specific directory, skipping any that are already optimized, then converts each image into the SIXEL graphics format for terminal display, saving the result as a .six file.
image terminal sixel conversion
find . -type f -wholename '*.flac' -exec bash -c 'ffmpeg -hide_banner -loglevel error -nostats -y -i "$(eval "echo .meta/artwork/*video_cover_l.jpeg")" -i "${0}" -metadata title="$(metaflac --show-tag=TITLE "${0}" | cut -c7-)" -metadata artist="$(metaflac --show-tag=ARTIST "${0}" | cut -c8-)" -metadata album="$(metaflac --show-tag=ALBUM "${0}" | cut -c7-)" -metadata genre="$(metaflac --show-tag=GENRE "${0}" | cut -c7-)" -metadata encoded_by="FFmpeg" -q:v 8 -codec:v libvpx-vp9 -lossless 1 -preset slow -quality good -speed 0 -deadline best -codec:a libopus -b:a 160k -vbr on -compression_level 10 -pix_fmt yuv420p -threads 0 "./${0%.*}_vp9_opus_1080p.webm"' '{}' \;
Finds all FLAC files and converts each one into a WebM video that uses a static cover image for the video track, which is encoded losslessly with high-quality VP9 settings, while preserving all metadata
video ffmpeg cover-art
git ls-files . --exclude-standard --others
Shows a list of all untracked files that do not match any standard gitignore rules.
git version-control status untracked
git ls-files . --ignored --exclude-standard --others
Shows a list of all files in the current directory that are untracked and match a pattern in a standard gitignore file.
git version-control status ignored
Get-ChildItem -Path Cert:\CurrentUser\My | Select-Object - Property Subject, NotAfter
Displays the subject and expiration date for all certificates in the current user's personal certificate store.
windows powershell security certificates
git show b523b86 | grep -i 'JS'
Displays the full diff of a specific commit but filters the output to show only the lines containing a certain string.
git version-control search diff
git log -S "specific_variable_name"
Finds all commits where the number of occurrences of a specific string or code snippet changed (a "pickaxe" search).
git version-control search history
lsof -p 1234
Shows every file, network socket, and library being used by a process with a specific PID (e.g., 1234).
dnf provides /usr/bin/ssh
Identifies the software package that installed a given file (e.g., /usr/bin/ssh).
linux package-management dnf search
dig +trace google.com
Performs a DNS lookup by querying the root servers and following the entire delegation path down to the authoritative nameserver.
linux network dns debug
openssl dgst -sha256 myfile
Computes and displays the SHA256 hash of a file, useful for verifying file integrity without needing a separate sha256sum tool.
security file checksum openssl
truncate -s 5G large_dummy_file.img
Creates a sparse file of a specified size (e.g., 5 Gigabytes) almost instantly.
linux disk file
git bisect start BAD_COMMIT GOOD_COMMIT
Starts an interactive binary search between a known "good" and "bad" commit, allowing you to quickly pinpoint which change caused a regression.
git version-control debug
iostat -dx 2
Displays detailed, per-disk I/O statistics (reads/writes per second, utilization) every 2 seconds.
linux disk monitoring io
nmap -p 22 --open 192.168.1.0/24
Scans the entire 192.168.1.0/24 subnet and lists only the hosts that have the specified TCP port (e.g., 22 for SSH) open.
linux network security scan nmap
podman inspect bfd59994e8f2
Shows low-level information about a container, such as its state, configuration, and network settings, in JSON format.
linux container podman info
journalctl --unit=nginx.service --follow --output=json-pretty
Follows the logs for a specific systemd unit in real-time, formatting the output as human-readable JSON.
linux log systemd web
ss -tlpn 'sport = :8080'
Displays the process name and PID that is actively listening on a given TCP port (e.g., 8080).
php phpstan.phar --memory-limit=4096M analyse --level max '~/index.php'
Analyzes a specific PHP file for potential errors using the strictest rule set and a 4GB memory limit.
programming php analysis
ionice -c 3 -n 7 mistat.py generate-all
Executes the mistat.py script with minimal I/O priority to reduce disk usage and prevent overwhelming the disk with high-volume I/O operations.
linux system priority io
comm -23 mistat_v3.py mistat_v4.py
Compares two versions of a script and prints lines that are unique to the first version, showing what was removed or changed.
linux text compare comm
date -d '2025-06-13 08:22:00 UTC' +%s
Converts a specified UTC date and time into a UNIX timestamp (seconds since epoch)
linux system time conversion
find . -type f -wholename '*.flac' -exec bash -c 'DELAY_COMPENSATION=0.2; SMOOTHING_PX=2; FLAC_FILE="$0"; COVER_PATH=".meta/artwork/$(basename "${FLAC_FILE}" ".flac")-video_cover_l.jpeg"; BRIGHTNESS=$(magick "$COVER_PATH" -colorspace Gray -format "%[mean]" info:); VISUALISER_COLOR="white"; BRIGHTNESS_THRESHOLD=35000; if (( $(echo "$BRIGHTNESS > $BRIGHTNESS_THRESHOLD" | bc -l) )); then VISUALISER_COLOR="black"; fi; GEQ_FORMAT="r=r(X,Y):g=g(X,Y):b=b(X,Y):a=st(0,H/2*sin(X/W*PI));st(1,abs(Y-H/2));if(gt(ld(1),ld(0)),0,if(lt(ld(1),ld(0)-%s),alpha(X,Y),alpha(X,Y)*(ld(0)-ld(1))/%s))"; GEQ_FINAL=$(printf "$GEQ_FORMAT" "$SMOOTHING_PX" "$SMOOTHING_PX"); echo "Processing ${FLAC_FILE}. Cover brightness: $BRIGHTNESS. Using visualiser color: $VISUALISER_COLOR. Applying ${DELAY_COMPENSATION}s delay compensation. Applying ${SMOOTHING_PX}px edge smoothing."; ffmpeg -hide_banner -loglevel error -nostats -y -framerate 24 -i "$COVER_PATH" -i "$FLAC_FILE" -filter_complex "[0:v]scale=1920:1080,setsar=1[bg]; [1:a]asplit[a_out][a_viz]; [a_viz]asetpts=PTS-${DELAY_COMPENSATION}/TB[a_viz_shifted]; [a_viz_shifted]showwaves=s=1400x140:mode=cline:colors=${VISUALISER_COLOR}:draw=full:rate=24,format=rgba[waves_hr]; [waves_hr]scale=700:70:eval=init:flags=lanczos[waves]; [waves]geq='\''"$GEQ_FINAL"'\''[waves_faded]; [waves_faded]colorchannelmixer=aa=0.3[waves_transparent]; [bg][waves_transparent]overlay=(W-w)/2:910[outv]" -map "[outv]" -map "[a_out]" -metadata title="$(metaflac --show-tag=TITLE "${FLAC_FILE}" | cut -c7-)" -metadata artist="$(metaflac --show-tag=ARTIST "${FLAC_FILE}" | cut -c8-)" -metadata album="$(metaflac --show-tag=ALBUM "${FLAC_FILE}" | cut -c7-)" -metadata genre="$(metaflac --show-tag=GENRE "${FLAC_FILE}" | cut -c7-)" -metadata encoded_by="FFmpeg" -crf 45 -b:v 0 -codec:v libvpx-vp9 -cpu-used 0 -row-mt 1 -auto-alt-ref 1 -lag-in-frames 25 -g 250 -codec:a libopus -b:a 160k -vbr on -compression_level 10 -frame_duration 60 -application audio -pix_fmt yuv420p -threads 0 "./${FLAC_FILE%.*}_vp9_opus_visualiser_1080p.webm"' '{}' \;
This command automatically converts FLAC audio files into WebM videos. For each track, it uses the corresponding album art as a static background and overlays a custom audio visualiser.
This transparent visualiser is styled as a pill-shape with faded edges, and its color is intelligently set to black or white to contrast with the brightness of the artwork. To ensure the visuals align perfectly with the sound, a delay is applied to the visualiser's audio stream for precise synchronization. Finally, all original metadata (like title, artist, and album) is transferred from the FLAC file to the new WebM video.
video ffmpeg visualizer
cuebreakpoints "Pohokolius - The Best Of.cue" | shnsplit -o flac -f "Pohokolius - The Best Of.cue" -t "%n-%t" "Pohokolius - The Best Of.flac"
Splits a single FLAC audio file into individual FLAC track files based on track timings defined in a CUE sheet.
audio processing splitting cue
for f in *.wav; do ffmpeg -i "$f" -hide_banner -loglevel error -nostats -vn -c:a libopus -b:a 24k -compression_level 10 -application audio -map_metadata 0 -metadata composer="" -metadata ENCODED-BY="" -metadata comment="" -metadata COMM="" -metadata encoded_by="FFmpeg$(ffmpeg -version | head -n1 | awk '{print $3}')" "${f%.wav}.opus"; done
Converts all .wav files in the current directory to mono Opus audio files with a 24kbps bitrate, optimized for speech using the 'audio' application, preserving metadata and adding encoding information, ideal for podcast audio.
audio conversion ffmpeg podcast
for f in *.wav; do ffmpeg -i "$f" -hide_banner -loglevel error -nostats -ac 1 -c:a libmp3lame -q:a 8 -joint_stereo 1 -compression_level 9 -map_metadata 0 -metadata composer="" -metadata ENCODED-BY="" -metadata comment="" -metadata encoded_by="FFmpeg$(ffmpeg -version | head -n1 | awk '{print $3}')" -id3v2_version 3 "${f%.wav}.mp3"; done
Converts all .wav files in the current directory to mono MP3 files with a lower bitrate (variable, around 64-80kbps), optimized for speech, preserving metadata and adding encoding information, which is ideal for podcast audio.
audio conversion ffmpeg podcast
for f in *.flac; do ffmpeg -i "$f" -ab 320k -map_metadata 0 -id3v2_version 3 "${f%.flac}.mp3"; done
Iterates through all .flac files in the current directory, converts each to MP3 with a constant audio bitrate of 320kbps, preserves metadata, and sets the ID3v2 tag version to 3.
audio conversion ffmpeg mp3
find . -type f -perm -o+w -ls
Finds and displays detailed information about files within the current directory and its subdirectories that have world-writable permissions.
linux security file permissions
ip addr show | grep -Eo 'inet (addr:)?([0-9]{1,3}\.){3}[0-9]{1,3}' | grep -Eo '([0-9]{1,3}\.){3}[0-9]{1,3}'
Retrieves and prints the system's IPv4 address(es) by parsing the output of the `ip addr show` command.
linux network info ip
systemctl list-timers --all
Displays a comprehensive list of all systemd timers, including both active and inactive ones, along with their last and next execution times.
linux automation systemd
find . -type f -size +100M -print0 | xargs -0 ls -lh | sort -h
Locates all files exceeding 100 megabytes in the current directory and its subdirectories, then lists them with human-readable sizes, sorted from smallest to largest.
linux disk storage analysis
lsof -i TCP:80
Displays all processes that have open network connections or are listening on TCP port 80.
linux network monitoring ports
ps -eo pid,comm,%mem,%cpu --sort=-%mem | head
Shows a list of running processes, sorted in descending order based on memory consumption, also displaying CPU usage.
linux system monitoring process cpu
find . -type f -printf '%T+\t%p\n' | sort -n | head -n 1
Locates and prints the timestamp and name of the oldest file within the current directory and its subdirectories.
linux file search timestamp
journalctl --disk-usage
Displays the current amount of disk space being consumed by the systemd journal logs.
linux log systemd disk
ps aux | awk '{print $1, $2, $3, $4, $11}' | sort -k 4 -r | head -n 10
Lists the top 10 processes currently using the most memory, showing user, PID, %CPU, %MEM, and command.
linux system monitoring process memory
echo 'Secret' > ~/.secret_file; history -d $((HISTCMD-1))
Writes "Secret" to a file and immediately removes its record from the shell's history.
linux security history cleanup
find "${HOME}/cats" \( -name "*.png" -o -name "*.gif"\) -exec touch -t "$(date +%Y%m%d)0100" {} \;
Finds all PNG and GIF files within the specified directory and sets their modification time to 1:00 AM of the current day.
linux file metadata touch
for d in */; do XZ_OPT="-9e" tar -cvJf "${d%/}.tar.xz" "$d"; done
Creates a separate .tar.xz archive for each subdirectory within the current directory, using maximum compression (XZ level 9e). Includes verbose output.
linux archive backup tar batch
for f in *.mp3; do echo "$f: $(soxi -B "$f")"; done
Loops through all MP3 files in the current directory and displays their average bitrate using the soxi command.
audio analysis bitrate sox
find . -name "*.eno" -print0 | tar -czvf eno-backup-$(date '+%Y-%m-%d_%H%M%S').tar.gz --null -T -
Finds files with the ".eno" extension, and creates a compressed tar archive with a timestamped filename.
linux archive backup tar timestamp
ping google.com | awk '{ print strftime("[%Y-%m-%d %H:%M:%S]"), $0 }
Prepends a timestamp to each line of ping output using awk's strftime function.
linux network ping timestamp
ping google.com | ts '[%Y-%m-%d %H:%M:%S]'
Prepends a timestamp to each line of ping output, using the ts command from the moreutils package.
linux network ping timestamp
flatpak override --reset com.bitwig.BitwigStudio
Resets all overrides (such as permissions or configurations) for a specified Flatpak package to its default settings.
linux package-management flatpak config
flatpak override --show com.bitwig.BitwigStudio
Displays the current overrides (such as permissions or configurations) applied to a specified Flatpak package.
linux package-management flatpak config
xdg-settings get default-web-browser
Displays the currently set default web browser on the system.
linux desktop config
flatpak mask --remove com.bitwig.BitwigStudio
Re-enables updates and upgrades for a previously masked Flatpak package, allowing it to be updated again.
linux package-management flatpak config
flatpak mask
Lists all Flatpak packages that have been masked, preventing updates or installation.
linux package-management flatpak config
flatpak mask com.bitwig.BitwigStudio
Prevents the specified Flatpak package from being updated or installed by masking it.
linux package-management flatpak config
flatpak update --commit=d46e23d2d45efb8f9b5e38d60abbbeb17cce6ee3d8143918fa4d7f0708b4eee7 com.bitwig.BitwigStudio
Updates a package to a specific commit hash, useful for downgrading or pinning a package to a particular version.
linux package-management flatpak downgrade
flatpak remote-info --log flathub com.bitwig.BitwigStudio
Displays the installation log and metadata for the specified package from the remote repository (flathub).
linux package-management flatpak info
SELECT user,host FROM mysql.user;
Retrieves a list of users and their associated hosts from the MySQL or MariaDB mysql.user table.
database sql mysql info
SHOW GRANTS FOR 'ABC'@'%';
Shows the privileges granted to a specific user ('ABC'@'%') in MySQL or MariaDB.
database sql mysql security
find . -maxdepth 1 -type f -name "*.flac" -exec bash -c 'sha256sum "$1" | sed "s|./||" > "$1.sha256"' _ {} \;
Finds FLAC files in the current directory, generates a SHA256 checksum for each file, and saves the checksum to a separate .sha256 file, truncating the ./ from the file path.
audio checksum flac
Get-Process notepad* | Stop-Process -Force
Forcefully kills all running Notepad instances (e.g., notepad.exe, notepad.exe_1) using PowerShell's Stop-Process cmdlet.
windows powershell process kill
taskkill /F /IM ms-teams.exe
Forcefully kills the ms-teams.exe process (Microsoft Teams) using the /F flag to terminate it immediately.
windows process kill
tasklist | findstr /i "teams.exe"
Uses tasklist combined with findstr to check if teams.exe (Microsoft Teams) is currently running on the system.
windows process
systeminfo | find /i "original"
Uses systeminfo combined with find to filter and display the "Original Install Date" from the system information output.
windows system info date
(Get-Item "C:\Windows\system.ini").CreationTime
Fetches the creation date of the C:\Windows\system.ini file, which can be used as an indicator of the system installation date. Alternatively, you can use C:\Windows\inf\setupapi.dev.log or C:\Program Files\WindowsApps\ instead of C:\Windows\system.ini.
windows system info date
du -h
Calculates and displays the sizes of files and directories in a human-readable format (e.g., KB, MB, GB) in PowerShell
windows powershell disk storage
Get-ChildItem -File | ForEach-Object {
$hash = Get-FileHash $_.FullName -Algorithm SHA256
"$($hash.Hash) $($_.FullName)"
}
Computes the SHA256 hash for each file in a directory and outputs the hash alongside the file's full path.
windows powershell file hash
1..4 | ForEach-Object { -join ((65..90) + (97..122) + (48..57) | Get-Random -Count 10 | % {[char]$_}) }
Generates random 10-character alphanumeric strings in PowerShell
windows powershell random string
php -S 127.0.0.1:8080 -t .
Starts a PHP built-in server on 127.0.0.1 (localhost) at port 8080, serving files from the current directory (.).
web network server php http
for file in *.heic; do magic "$file" "${file%.heic}.jpeg"; done
Converts all .heic files in the current directory to .jpeg format using ImageMagick (magic). In ImageMagick v7 and later, the convert command is deprecated, so you should use magick instead.
image conversion imagemagick
git remote rename origin codeberg
Renames an existing Git remote repository, changing the name of the remote from origin to codeberg in the current repository configuration.
git version-control remote
git remote -v
Displays the URLs of remote repositories associated with the current Git project, showing both fetch and push URLs.
git version-control remote
git diff --staged
Displays the differences between the staged changes and the last committed version, showing what has been modified and prepared for the next commit.
git version-control diff
sox *.flac -n stat
Generates and displays detailed statistical information (such as duration, peak level, RMS, etc.) for each .flac file in the specified directory.
audio analysis statistics sox
ffmpeg -i INPUT.flac -af loudnorm=I=${TARGET_INTEGRATED_LOUDNESS}:TP=${TARGET_TRUE_PEAK}:LRA=${TARGET_LOUDNESS_RANGE}:measured_I=${MEASURED_INPUT_INTEGRATED_LOUDNESS}:measured_TP=${MEASURED_INPUT_TRUE_PEAK}:measured_LRA=${MEASURED_INPUT_LOUDNESS_RANGE}:measured_thresh=${MEASURED_INPUT_THRESHOLD}:offset=${TARGET_NORMALIZATION_OFFSET}:linear=true OUTPUT.flac
Normalizes the loudness of a .flac file to specified target values, using measured input loudness statistics to ensure consistent output volume.
audio processing normalization ffmpeg
ffmpeg -i *.flac -af loudnorm=print_format=summary -f null -
Analyzes the loudness of .flac files and prints the summary of integrated loudness, true peak, loudness range, and threshold.
audio analysis loudness ffmpeg
free -t -m
Shows memory usage in megabytes, including total, used, and free memory, with the -t flag for total memory.
linux system memory info
free -t | tail -n+2 | awk '{($2>0) ? p=$3/$2*100.0 : p=0.0; print "Used " $1 "\t" p "%"}'
Calculates and prints the used memory percentage for each category from the free command output.
linux system memory info
grep -E --color 'Mem|Cache|Swap' /proc/meminfo
Searches for and highlights lines containing "Mem", "Cache", or "Swap" in the /proc/meminfo file.
linux system memory info
dconf dump / >~/.config/dconf/user.conf
dconf load / <~/.config/dconf/user.conf
Backs up dconf settings to a file and restores them from the backup.
linux desktop gnome config backup
for f in *.flac; do sox -S "${f}" -r 44100 -b 16 "${f%.*}"_16bit_44100.flac; done
Resamples all FLAC files in the current directory to 16-bit depth and 44.1kHz sample rate.
audio conversion processing sox
for f in *; do ffmpeg -i "$f" -map 0 -map -0:s -codec copy "$f.mkv"; done
Removes all subtitle streams from video files in the current directory and saves them as MKV files.
video processing ffmpeg cleanup
find . -type d -name '*.jpeg' -exec rm -r {} +
Finds and deletes directories with names ending in '.jpeg' within the current directory and its subdirectories.
linux file cleanup
for f in *; do ffmpeg -i "$f" -f mp4 -c:v libx265 -preset ultrafast -crf 24 -acodec aac "${f%.*}"_x265.mp4; done
Reencodes all video files in the current directory to a more efficient MP4 format using H.265 for video and AAC for audio.
video conversion ffmpeg h265
gpgconf --list-dirs
Displays the directories used by GPG for configuration, keyring, and other data.
security encryption gpg info
gpg --list-keys
Displays all the GPG keys available in the keyring.
security encryption gpg info
gpgconf --kill gpg-agent
Terminates the GPG agent process to stop managing keys and cache.
security encryption gpg config
git commit --amend
Modifies the most recent Git commit, allowing changes to the commit message or content.
git version-control edit history
git config --global tag.gpgSign true
Configures Git to automatically GPG sign all tags globally.
git version-control config gpg
git config --global commit.gpgsign true
Sets Git to automatically GPG sign all commits globally.
git version-control config gpg
git config --global user.signingkey ABCBCA
Configures the specified GPG key (ABCBCA) as the global signing key for Git commits.
git version-control config gpg
git filter-repo --commit-callback '
commit.gpg_sign = True
' --force
Configures all Git commits to be GPG signed using git-filter-repo with a commit callback.
git version-control rewrite history
echo 'New Name <new@email.com> <old@email.com>' > ../mailmap
git filter-repo --mailmap ../mailmap --force
Uses git-filter-repo, an external tool, to update Git commit history by mapping old email addresses to new ones with a mailmap file.
git version-control rewrite history
git log --all --pretty=format:"%h - %an <%ae>"
Lists all Git commits with their abbreviated hash, author name, and email in a custom format.
git version-control log history
ledger reg Expenses -S amount
Displays expense transactions sorted by amount using the ledger-cli command-line accounting tool for Plain Text Accounting (PTA).
finance accounting cli ledger
ledger bal ^Expenses ^Income --invert
Shows the balances for accounts whose names start with "Expenses" and "Income", with inverted values, using the ledger-cli command-line accounting tool for Plain Text Accounting (PTA).
finance accounting cli ledger
ledger -M register Assets -X EUR -n --no-rounding
Displays asset transactions in EUR (specifying currency/commodity) without rounding, using the ledger-cli command-line accounting tool for Plain Text Accounting (PTA).
finance accounting cli ledger
ledger reg -b 09/01 -e 12/01 --subtotal
Displays a subtotal of transactions between the specified date range (MM/DD format, 09/01 to 12/01) using the ledger-cli command-line accounting tool for Plain Text Accounting (PTA).
finance accounting cli ledger
ledger bal Expenses -H --flat -S -T
Shows the expense account balances in a flat format without headers, sorting by date and excluding totals, using the ledger-cli command-line accounting tool for Plain Text Accounting (PTA).
finance accounting cli ledger
ledger register Expenses
Lists all transactions under the expense category, displaying detailed records with the ledger-cli command-line accounting tool for Plain Text Accounting (PTA).
finance accounting cli ledger
ledger balance Assets --collapse
Displays the balances of asset accounts, collapsing them into a summarized view using the ledger-cli command-line accounting tool for Plain Text Accounting (PTA).
finance accounting cli ledger
ledger balance income expenses --period "this month"
Shows the balance of income and expenses for the current month using the ledger-cli command, a command-line accounting tool for Plain Text Accounting (PTA).
finance accounting cli ledger
#!/bin/sh
# Simple logging script with date filtering, colorizing, and Todo.txt compatibility.
TIMESTAMP=$(date "+%Y-%m-%d [%H:%M:%S]")
LOG="${HOME}/.jnrl.log"
CONTEXT="${CONTEXT:-20}"
TODOTXT_TAG='+jnrl'
# Ensure the log file exists
touch "$LOG"
# Colorize timestamp matches in log output
grep_coloring() {
grep --color=always -P "(\[[0-9]{2}:[0-9]{2}:[0-9]{2}|\])" "$@"
}
# Handle date range filtering based on OS type (BSD vs GNU date)
if [ "$1" = "-d" ] && [ "$2" -ge 0 ] 2>/dev/null; then
DATE_RANGE=$(date --date="$2 day ago" "+%Y-%m-%d" 2>/dev/null || date -v "-$2d" "+%Y-%m-%d")
grep "$DATE_RANGE" "$LOG" | grep_coloring
elif [ -z "$*" ]; then
# Show last N lines if no arguments are provided
tail -n "$CONTEXT" "$LOG" | grep_coloring
else
# Log the message with timestamp and Todo.txt tag, escaping special characters
echo "${TIMESTAMP} - $(printf '%q' "$*") $TODOTXT_TAG" >> "$LOG"
fi
Logs messages with timestamps, allows date range searches, highlights timestamps, adds Todo.txt tags (+jrnl), and supports BSD/GNU date formats.
linux productivity log script
cat <<EOF
(*- { $@ }
//\
v_/_
EOF
Uses a here-document (cat <<EOF) to print a customizable ASCII art message, with $@ representing passed arguments, and outputs a simple "Tux say!" design.
linux text art
pwgen -Bnyc | head -c15
Uses pwgen to generate a secure, random password with no ambiguous characters, then limits the output to the first 15 characters.
security random password generator pwgen
shuf -n10 /usr/share/dict/words | tr -d '\n' | head -c15
Uses shuf to randomly select 10 dictionary words, removes newline characters with tr, and limits the output to the first 15 characters, creating a memorable password like "correct battery staple horse"
obligatory xkcd reference: 936 - https://xkcd.com/936
security random password generator diceware
openssl rand -base64 16
Uses openssl to generate 16 bytes of random data and encodes it in Base64 format, providing a random password.
security random password generator openssl
openssl rand -hex 15 | sha256sum | head -c15 | cut -b -15
Uses openssl to generate 15 bytes of random data in hexadecimal, hashes it with SHA-256, then truncates the output to the first 15 characters to create a random password.
security random password generator openssl
gpg --gen-random --armor 1 15 | head -c15
Uses gpg to generate 15 bytes of random data as a password, outputs it in ASCII armored format, and limits the output to 15 characters.
security random password generator gpg
#!/bin/bash
PODCAST_DOWNLOAD_DIR="${HOME}/Ресурси/Преузимања/Podcasts"
if [ -e "$PODCAST_DOWNLOAD_DIR" ] && [ ! -z "$(command -v ffmpeg)" ]; then
find "$PODCAST_DOWNLOAD_DIR" -type f -name '*.mp3' -execdir sh -c '
PODCAST_FILE="$1"
PODCAST_FILE_LENGHT_IN_SECONDS="1800"
if [[ ! $PODCAST_FILE =~ ^[0-9]{2}- ]]; then
random_filename_string=$(tr -dc "a-zA-Z0-9" < /dev/urandom | head -c 3)
ffmpeg -i "$PODCAST_FILE" -c:a libmp3lame -q:a 6 -f segment -segment_time ${PODCAST_FILE_LENGHT_IN_SECONDS} -map 0:a -map_metadata -1 "${random_filename_string}-%02d-${PODCAST_FILE##*/}" && rm "$PODCAST_FILE"
fi
' sh {} \;
fi
Verifies podcast directory and ffmpeg, slices long .mp3 files into 30-minute segments with random prefixes, renames them with 01-99 numbering, reduces file size, and removes originals
linux audio processing ffmpeg script automation
cd "${BACKUP_DESTINATION}" && export XZ_DEFAULTS="-9 -T 0" && tar cJf "${BACKUP_FILENAME}.tar.xz" "$TARGET_PATH" 2>/dev/null && tar -tf "${BACKUP_FILENAME}.tar.xz" 2>/dev/null && sha256sum "${BACKUP_FILENAME}.tar.xz" > "${BACKUP_FILENAME}.tar.xz.sha256" && chown -R ${OWNER_USERNAME}:${OWNER_USERNAME} "${BACKUP_DESTINATION}/${BACKUP_FILENAME}.tar.xz"
Performs a series of operations in sequence: navigates to the backup destination, sets compression options (XZ_DEFAULTS for max compression and multi-threading), creates a .tar.xz archive, verifies it, generates a SHA256 checksum, and sets ownership. Each step is dependent on the previous one (using &&), so if any operation fails, the process stops immediately.
linux backup archive script
if [ -z "$(pidof -x "$1")" ]; then "$1" & exit 0; else exit 1;fi
Checks if the process specified by the argument ($1) is running; if not, it starts the process in the background. Exits with 0 if successful, or 1 if the process is already running.
linux process management script
cat myfile.txt | tr -d '\n' | wc -c
Removes newlines from a file and counts the remaining characters using tr and wc -c
linux text statistics
GOGC=10 hugo server --environment development --watch --disableFastRender --templateMetrics --templateMetricsHints --buildFuture --buildDrafts
Starts the Hugo server in development mode with specific options like watching for changes and enabling future/draft builds
web development static-site-generator hugo
find . -type d -exec du -h --max-depth=1 {} + 2>/dev/null | sort -rh | head -n "10" | awk -v highlighter="\033[1;32m" -v reset="\033[0m" '{gsub(/[0-9,.]+[MGK]|^0[[:space:]]/, highlighter "&" reset); print}'
Finds and lists the top 10 largest directories, highlighting their sizes, sorted in descending order
linux disk storage analysis colored
find . -type f -exec du -h {} + 2>/dev/null | sort -rh | head -n "10" | awk -v highlighter="\033[1;36m" -v reset="\033[0m" '{gsub(/[0-9,.]+[MGK]|^0[[:space:]]/, highlighter "&" reset); print}'
Finds and lists the top 10 largest files, highlighting their sizes, sorted in descending order
linux disk storage analysis colored
find . -type f -name "*.txt" -exec wc -l {} +
Finds all .txt files and counts the number of lines in each using wc -l
linux text statistics file
cat /bin/ls | hexdump -C | less
Displays the binary content of the ls command using hexdump, piped through less for pagination.
linux binary analysis hexdump
SELECT random_article_id FROM random_articles WHERE date = DATE('now') LIMIT 1
Retrieves a random article ID from the random_articles table for the current date in sqlite.
database sql sqlite query
rsync -avz --delete --prune-empty-dirs \
--exclude='.ignore*' \
--exclude='*.db-wal' \
--exclude='*.db-shm' \
-e "ssh -p $SSH_PORT -C" \
"$LOCAL_FOLDER/" "$REMOTE_USER@$REMOTE_HOST:$REMOTE_FOLDER"
Syncs local files to a remote server via SSH, excluding specific files and deleting obsolete ones.
linux backup rsync sync remote ssh
podman exec -d "$client_name" /bin/sh -c "if which apk > /dev/null; then /usr/bin/node_exporter; elif which apt-get > /dev/null; then /usr/bin/prometheus-node-exporter; fi"
Starts the appropriate Node Exporter based on the package manager (apk or apt-get) inside a podman container.
linux container podman exporter
podman exec -d "$client_name" sh -c "/usr/sbin/sshd -D -e"
Runs the SSH daemon in the background inside a podman container, allowing remote connections.
linux container podman ssh service
podman exec "$client_name" sh -c "pkill sshd"
Kills the sshd process inside a running podman container to stop the SSH service.
linux container podman ssh service
podman exec "$client_name" sed -i '/^#\?PubkeyAuthentication /c\PubkeyAuthentication yes' /etc/ssh/sshd_config
Modifies the SSH configuration inside a podman container to enable public key authentication.
linux container podman ssh config
podman machine set my-machine --cpus 4 --memory 4096
Adjusts the CPU and memory resources for a specific podman machine (4 CPUs, 4GB memory).
linux container podman vm
podman machine init my-machine --cpus 2 --memory 2048
Creates a new podman machine with 2 CPUs and 2GB of memory.
linux container podman vm
podman container ls -a --filter name="$container" --format "{{.Names}}"
Displays the name of a specific container in podman using a custom filter and format.
linux container podman info
podman volume prune -f
Deletes all unused volumes in podman, freeing up disk space with forced confirmation.
linux container podman cleanup
podman auto-update
Updates all containers managed by podman to the latest available versions automatically.
linux container podman management
podman image prune -a -f
Deletes all unused images in podman, freeing up disk space with forced confirmation.
linux container podman cleanup
curl --silent -L "$download_url" -o "$filepath"
Downloads a file from a URL to a specified path, suppressing output and following redirects.
web network curl
git -C "~/my_project" log --pretty=format:'%H' --max-count 5
Displays the latest Git commit hashes from a specific project path, limiting the number of messages to a defined count.
git version-control log history
rsync -avz --delete --exclude='.ignore*' -e "ssh -p 2222 -C" /home/user/documents/ user@192.168.1.100:/backup/documents/
Syncs a local folder to a remote server using rsync over SSH, with compression and exclusions for files starting with .ignore.
linux backup rsync sync remote ssh
rsync -gloptruc --info=progress2 --human-readable --stats --delete-missing-args --delete --delete-excluded --ignore-errors --zc=zstd --exclude='*.log' --exclude='*.tmp' --include='*/' --include='*.jpg' --include='*.png' /home/user/Documents/ /mnt/backup/
Syncs files using rsync with detailed progress, compression, exclusion/inclusion rules, and deletion of missing or excluded files.
linux backup rsync sync
python -m http.server 8899 --bind 127.0.0.1
Starts a simple HTTP server on port 8899, binding it to the localhost IP (127.0.0.1).
web network server python http
git --no-pager show -s --format="%an <%ae>"
Displays the author's name and email address from the latest Git commit.
git version-control info
journalctl --unit clamav-clamonacc --since today
Displays ClamAV logs for the clamav-clamonacc service since the start of today.
linux security log antivirus
find . -type f -exec du -h {} + | sort -r -h | head -n 10
Finds and lists the top 10 largest files in the current directory, sorted by size.
linux disk storage analysis
cmark --to html --validate-utf8 --unsafe
Converts a Markdown file to HTML with UTF-8 validation and allows unsafe HTML elements.
text markdown conversion html
inxi -v 3 -F -B -z -c 7
Shows comprehensive system details, including hardware, boot, and network info, with formatted output and obfuscated sensitive data.
linux system hardware info
mpv --loop --audio-display=no
Loops the media playback in MPV while disabling the audio visualizations.
video mpv config
nano --autoindent --backup --boldtext --mouse --nonewlines --nowrap --nohelp --multibuffer --quickblank --smarthome --constantshow --linenumbers --tabstospaces -T 2 --indicator --backupdir="~/.cache" some_file_i_wanna_create.txt
Launches Nano with specific options like auto-indentation, line numbers, tab-to-space conversion, and backup configuration.
linux text nano config
w3m -no-cookie -no-graph -W
Starts the w3m browser without using cookies or displaying images, with text-only output.
web browser cli
elinks -anonymous 1 -no-home 1 -no-connect 1
Starts ELinks with anonymous browsing, no home directory usage, and no network connection.
web browser cli
curl -I -H "Accept-Encoding: gzip,deflate,br" | grep -i "content-encoding"
Sends an HTTP request and checks the Content-Encoding header to see if the response is compressed (gzip, deflate, or br).
netstat -tupan
Shows active network connections, listening ports, and associated processes with detailed information.
linux network monitoring ports
ps aux | sort -nr -k 4 | head -5
Lists the top 5 processes consuming the most memory, sorted in descending order.
linux system monitoring process memory
dumpe2fs -h /dev/root | grep -i created
Retrieves the installation date of the operating system by checking the filesystem creation time on /dev/root.
linux disk filesystem info
find -not -empty -type f -printf "%s\n" | sort -rn | uniq -d | xargs -I{} -n1 find -type f -size {}c -print0 | xargs -0 md5sum | sort | uniq -w32 --all-repeated=separate
Finds duplicate files faster by comparing file sizes first, then checksums, using multiple tools in combination.
linux file storage cleanup duplicates optimization
find . ! -empty -type f -exec md5sum {} + | sort | uniq -w32 -dD
Finds and lists duplicate files in the current directory by comparing their MD5 checksums.
linux file storage cleanup duplicates
echo 'BUS=="usb", OPTIONS+="ignore_device"' > /etc/udev/rules.d/971-usb-lockdown.rules
Creates a udev rule to ignore USB devices by adding a custom rule to the /etc/udev/rules.d/ directory.
linux security usb udev config
udevadm control --reload-rules && udevadm trigger
Reloads udev rules and triggers devices to apply the new rules.
linux hardware udev config reload
cryptsetup benchmark
Measures the performance of various encryption algorithms using cryptsetup.
linux security encryption benchmark
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 10 | head -n 4
Generates random alphanumeric usernames, each 10 characters long, using /dev/urandom.
linux security random generator
journalctl -b2
Displays system logs from the second-to-last boot using journalctl.
linux log systemd boot
for file in *; do zip -r ${file%.*}.zip $file; done
Recursively compresses each file in the current directory into its own ZIP archive.
linux archive compression zip batch
pactl set-sink-volume @DEFAULT_SINK@ +2%
Increases the volume of the default audio sink by 2% using pactl.
linux audio volume config pulseaudio
smartctl -l selftest /dev/sdX
Displays the results of previous SMART self-tests for a specified disk.
linux disk hardware health smart
smartctl -t short
Initiates a short self-test on a disk to check its health using SMART.
linux disk hardware health smart
smartctl -a /dev/sdX
Displays detailed SMART (Self-Monitoring, Analysis, and Reporting Technology) information for a specified disk.
linux disk hardware health smart
find $DIR_PATH -type f -exec chmod 644 {} \;
Recursively changes the permissions of all files within a specified path to 644.
linux file permissions chmod batch
find $DIR_PATH -type d -exec chmod 755 {} \;
Recursively changes the permissions of all directories within a specified path to 755.
linux file permissions chmod batch
for f in *.ass; do ffmpeg -i "$f" -c:s srt "${f%.*}".srt; done
Converts .ass subtitle files to .srt format using ffmpeg.
video subtitles conversion ffmpeg
for f in *.flac; do sox -S "${f}" -r 44100 -b 16 ./resampled/"${f%.*}"_16bit_44100.flac; done
Resamples .flac audio files to 16-bit, 44.1 kHz format and saves them to a new directory.
audio conversion processing sox
xsetroot -cursor_name left_ptr
Changes the cursor to the specified type (e.g., left_ptr) in the X server environment.
linux desktop x11 gui config
iw list
Displays detailed information about available wireless network interfaces on a system.
linux network wifi hardware info
for file in *.html; do printf "$file\t$(cat $file | wc -c | xargs printf "%'d\n")\t$(gzip -9c $file | wc -c | xargs printf "%'d\n")\t$(brotli -cZ $file | wc -c | xargs printf "%'d\n")\n"; done | tee
Prints the sizes of .html files, comparing uncompressed, gzipped, and brotli-compressed sizes in a tabular format.
linux file statistics compression benchmark
vboxsdl --startvm $VM_NAME
Starts a VirtualBox VM using the SDL (Simple DirectMedia Layer) interface for graphical display.
linux virtualization vbox vm
vboxmanage modifyvm Debian5 --nic1 bridged --cableconnected1 on --bridgeadapter1 eth0
Configures a bridged network adapter for a VirtualBox VM, connecting it to the host's eth0 interface.
linux virtualization vbox network
vboxmanage hostonlyif remove vboxnet0
Removes a host-only network interface (e.g., vboxnet0) from VirtualBox.
linux virtualization vbox network
vboxmanage storagectl $VM_NAME --name "IDE Controller" --add ide --controller PIIX4
Adds an IDE controller to a VirtualBox VM with the specified controller type (PIIX4).
vboxmanage modifyvm $VM_NAME --memory 1024 --vram 128 --accelerate2dvideo on --accelerate3d off --audio alsa --cpuexecutioncap 85 --ostype WindowsXP
Modifies the settings of a VirtualBox VM, including memory, video, audio, CPU, and OS type.
linux virtualization vbox vm config
vboxmanage createhd --filename $VM_HDD_PATH --size 35000 --variant fixed
Creates a new fixed-size virtual disk of 35 GB at the specified path for use in VirtualBox.
linux virtualization vbox disk
vboxmanage unregistervm $VM_PATH --delete
Unregisters and deletes a virtual machine's configuration from VirtualBox using the path to the VM configuration file.
linux virtualization vbox vm cleanup
vboxmanage registervm $VM_PATH
Registers an existing virtual machine in VirtualBox using the path to the VM configuration file.
linux virtualization vbox vm
vboxmanage createvm -name "Debian" -ostype "Debian" --register
Creates and registers a new virtual machine named "Debian" in VirtualBox with the specified OS type.
linux virtualization vbox vm
stat -c %a .bashrc
Displays the permissions of a file (in this case, .bashrc) in numeric format.
linux file permissions info
rfkill unblock all
Unblocks all wireless devices (Wi-Fi, Bluetooth, etc.) using the rfkill unblock all command to enable them for use.
linux network hardware wifi bluetooth
ffmpeg -i concat:"input1.mp4|input2.mp4" output.mp4
Combines multiple video files (input1.mp4 and input2.mp4) into a single file (output.mp4) using FFmpeg’s concat protocol.
video edit ffmpeg
/etc/init.d/alsa-utils reset 0
Resets the ALSA (Advanced Linux Sound Architecture) settings by running the alsa-utils reset 0 script, which can help resolve audio issues on Linux.
Note: init.d scripts are typically used in older init systems, but if your system is still using init.d to manage services, this command would be relevant.
linux audio hardware
systemctl set-default graphical.target
Configures the system to boot into graphical mode by setting the default target to graphical.target using systemctl in a systemd-based environment.
linux boot systemd config gui
flatpak remote-ls flathub | grep org.gtk.Gtk3theme
Searches and lists GTK3 themes available in the Flathub repository using flatpak remote-ls and filters results with grep for org.gtk.Gtk3theme.
linux package-management flatpak search theme
ausearch -c 'hl2_linux' --raw | audit2allow -M my-hl2linux
Uses ausearch to search for SELinux audit logs related to hl2_linux (Half-Life 2) and generates a custom policy module (my-hl2linux) with audit2allow to allow necessary actions.
linux security selinux policy generator
grub2-mkconfig -o /boot/grub2/grub.cfg
Creates or updates the GRUB2 configuration file (/boot/grub2/grub.cfg) on Fedora, CentOS, or RHEL systems based on the current system setup and available kernels.
linux boot grub config
sealert -a /var/log/audit/audit.log
Analyzes SELinux-related messages in the audit log (/var/log/audit/audit.log) using sealert to provide detailed explanations and troubleshooting advice.
linux security selinux audit log
setsebool -P selinuxuser_execheap 0
Disables the SELinux selinuxuser_execheap boolean, allowing user processes to execute code in writable memory regions. This is necessary for some applications, like Steam games, to function correctly, but it reduces overall system security.
linux security selinux config gaming
setsebool -P allow_execheap 0
Disables the SELinux allow_execheap boolean, allowing processes to execute code in writable memory regions. This is necessary for some applications, like Steam games, to function correctly, but it reduces overall system security.
linux security selinux config gaming
fixfiles onboot
Ensures SELinux file contexts are corrected during boot by running fixfiles onboot, typically used after system changes or restoring file systems.
linux security selinux repair boot
journalctl --vacuum-time=2weeks
Removes systemd journal logs older than 2 weeks using journalctl --vacuum-time=2weeks to free up disk space.
linux log cleanup systemd
dmesg | grep -i ahci
Filters and displays AHCI-related messages from the kernel log (dmesg), useful for troubleshooting or checking storage controller status.
linux hardware storage debug log
dd if=/dev/zero of=./largefile bs=7M count=256
Measures SSD write performance by creating a 1.8 GB file (largefile) using dd with a block size of 7MB, writing zeros to the disk.
linux disk benchmark ssd throughput
restorecon -r -v /
Recursively restores the correct SELinux security contexts for all files and directories under the root (/) directory, ensuring proper security labeling using restorecon -r -v.
linux security selinux repair
vnstat -u -i wlp6s0
Initializes or updates the vnStat database for the specified network interface (wlp6s0), enabling traffic monitoring.
linux network monitoring vnstat config
vnstat --iflist
Displays a list of network interfaces available for monitoring with vnstat on a Linux system.
linux network monitoring vnstat
package-cleanup --oldkernels --count=5
Removes all but the 5 most recent kernel versions using package-cleanup --oldkernels --count=5 to free up disk space.
linux package-management cleanup kernel
gsettings list-recursively | grep -i Epiphany
Displays all GNOME settings related to Epiphany (Web) by recursively querying gsettings and filtering results with grep.
linux desktop gnome config search
echo 'installonly_limit=4' > /etc/yum.conf
Sets the installonly_limit to 4 in /etc/yum.conf, restricting the number of kernel versions to keep on the system.
linux package-management yum config kernel
dnf remove $(dnf repoquery --installed --latest-limit=-2 -q)
Removes all but the latest installed 2 versions of packages using dnf repoquery to find older versions and dnf remove to uninstall them.
linux package-management dnf cleanup
echo "never" > /sys/kernel/mm/transparent_hugepage/defrag
Sets the transparent hugepage defragmentation behavior to "never" by writing never to /sys/kernel/mm/transparent_hugepage/defrag on Linux.
linux kernel memory hugepages config
authconfig --disablefingerprint --update
Disables fingerprint authentication by running authconfig --disablefingerprint and updates the system configuration.
linux security auth config
tracker status
Displays the current status of the Tracker daemon, which is used for indexing and searching files on GNOME-based systems.
linux desktop gnome search tracker
tracker daemon -t
Runs the Tracker daemon, typically used for indexing and searching on GNOME-based systems, in test mode (-t) for debugging and testing purposes.
linux desktop gnome search tracker
echo "blacklist firewire-core" >> /etc/modprobe.d/firewired.conf
Appends blacklist firewire-core to /etc/modprobe.d/firewired.conf on Linux, preventing the firewire-core module from loading.
linux kernel module config blacklist
SELECT * FROM categories ORDER BY name ASC;
Retrieves and displays all categories from the database, sorted by name in ascending order.
database sql query
dnf grouplist -v
Displays a verbose list of all available package groups in DNF, including both installed and available groups.
linux package-management dnf
qemu-img create -f qcow2 -o preallocation=off <disk-name> <disk-size>
Creates a new QCOW2 disk image with the specified disk name and size, disabling preallocation for faster creation.
linux virtualization kvm disk
virsh pool-destroy default
Destroys the default storage pool in virsh, effectively stopping it and removing its resources from active use.
linux virtualization libvirt storage
virsh pool-dumpxml default > pool.xml
Dumps the XML configuration of the default storage pool in virsh to a file (pool.xml).
pkcon refresh force -c -1
Forces a refresh of the PackageKit cache, bypassing any cached data, with -c -1 to use the default repo.
linux package-management packagekit
sed -i 's/^.*KeepCache=.*$/KeepCache=false/' /etc/PackageKit/PackageKit.conf
Modifies the PackageKit.conf file to set KeepCache=false, disabling the package cache for PackageKit.
linux package-management dnf cleanup
dnf clean all --releasever=F41
Clears all cached data for DNF, including metadata and packages, for the specified release version (F41).
gsettings set org.gnome.software download-updates false
Uses gsettings to disable automatic downloading of updates in GNOME Software by setting download-updates to false under the org.gnome.software schema.
linux desktop gnome config
chmod a+x ~/.local/share/gnome-boxes
Adds execute permissions to the ~/.local/share/gnome-boxes directory for all users.
linux file permissions chmod
gnome-extensions -e system-monitor
Enables the system-monitor extension in GNOME, adding system monitoring features to the GNOME Shell.
linux desktop gnome extension
dnf config-manager --set-disabled fedora-modular
Disables the fedora-modular repository in DNF, preventing it from being used during package operations.
linux package-management dnf config
dnf module reset $MODULE_NAME
Resets a specified DNF module ($MODULE_NAME), reverting it to its default stream and removing any custom settings.
linux package-management dnf module
dnf module list --enabled
Displays all currently enabled DNF modules, which are sets of packages grouped for easy management, often used for specific software streams or configurations.
linux package-management dnf module
dnf list installed *.i*86
Displays a list of all installed 32-bit packages (matching *.i*86 pattern) using DNF.
linux package-management dnf
perl -c somescript_or_module.pl
Verifies the syntax of the specified Perl script (somescript_or_module.pl) without executing it.
programming perl debug syntax
hwclock --hctosys
Sets the system time to the current hardware clock (real-time clock) time.
linux system time hardware
hwclock --systohc
Sets the hardware clock (real-time clock) to the current system time.
linux system time hardware
dnf install @container-tools -y
Installs the @container-tools group package using DNF, automatically agreeing to all prompts.
linux package-management dnf
rpm-ostree --idempotent install gnome-shell-extension-caffeine
Installs the gnome-shell-extension-caffeine package with idempotency to ensure the command can be safely re-run.
linux package-management rpm-ostree
clamav-update clamav clamd
Updates the ClamAV virus definitions by running the clamav-update command with ClamAV and ClamD services.
linux security antivirus clamav
dnf --setopt=strict=0 --setopt=install_weak_deps=False install nano
Installs the nano package while disabling strict mode and preventing the installation of weak dependencies.
linux package-management dnf
find ~/mail/example@domain.com/ -type d -name "cur" -print0 | xargs -0 -I {} find {} -type f -mtime +7 ! -ipath '*/.Archive/*' -print0 | xargs -0 rm -f
Finds and deletes mail messages older than 7 days in the cPanel/Dovecot mail directory (cur), while excluding messages in Archive folders.
web cpanel mail cleanup maintenance
find ~/logs ~/access-logs ~/tmp/{analog,awstats,webalizer,webalizerftp} -type f \( -name "*.log" -o -name "*.txt" -o -name "*.rs" -o -name "*90a3ac" \) -exec sed -i -E '/djura|dura|80a5ai3dd|pohokolius|--90a3ac/Id' {} +
Searches cPanel log files for specific keywords (e.g., "djura", "dura", etc.) and deletes any lines that contain them.
web cpanel log cleanup edit
find ~/logs ~/access-logs ~/tmp/{analog,awstats,webalizer,webalizerftp} -type f \( -name "*.log" -o -name "*.txt" -o -name "*.rs" -o -name "*90a3ac" \) -exec grep -H -E 'djura|dura|80a5ai3dd|pohokolius|--90a3ac' {} \;
Searches for specific keywords (e.g., "djura", "dura", etc.) in various cPanel log files and displays all matching entries.
web cpanel log search maintenance
find ~/logs ~/access-logs ~/tmp/{analog,awstats,webalizer,webalizerftp} ~/.trash -type f \( -name "*djura*" -o -name "*dura*" -o -name "*80a5ai3dd*" -o -name "*pohokolius*" -o -name "*90a3ac" \) -mtime 0 -exec rm -f {} \;
Searches and removes log files from specific directories in cPanel that contain certain keywords (e.g., "djura", "dura", etc.), limiting the search to files modified within the last 24 hours.
web cpanel log cleanup maintenance
sed -i.bak -e '/^#ControllerMode = dual/s/^#//; /^ControllerMode = le/!s/^ControllerMode = dual$/ControllerMode = le/' -e '/^#AutoEnable=true/s/^#//; /^AutoEnable=false/!s/^AutoEnable=true$/AutoEnable=false/' /etc/bluetooth/main.conf
Modifies the /etc/bluetooth/main.conf configuration file to disable Bluetooth power-saving settings that can lead to poor or intermittent communication with devices, particularly low-power ones.
linux hardware bluetooth config
find . -type f | sed -rn 's|.*/[^/]+\.([^/.]+)$|\1|p' | sort | uniq -c | sort -rn
Finds and displays the most common file extensions in the current directory and subdirectories, counting occurrences of each type and sorting them by frequency.
linux file statistics analysis
echo '<device screen="0" driver="dri2"><application name="Default"><option name="vblank_mode" value="0"/></application></device>' > ~/.drirc
Disables vertical synchronization (V-Sync) in GNOME by modifying the ~/.drirc file, preventing the GPU from waiting for the monitor's refresh rate, potentially improving frame rates in certain applications but possibly introducing screen tearing.
linux gpu config gnome
cat /sys/kernel/debug/dri/*/radeon_pm_info
Displays detailed power management statistics for AMD Radeon GPUs, showing information such as current performance states, clock speeds, and power usage for various components like the GPU, memory, and display.
linux hardware gpu amd monitoring
cat /sys/class/drm/card*/device/power_dpm_force_performance_level
Displays or modifies the DPM (Dynamic Power Management) performance level for AMD GPUs, which controls the power and performance state of the GPU. This setting can help optimize energy usage or force the GPU to operate at specific performance levels.
linux hardware gpu amd power
sysctl -w kernel.sysrq=1
Enables the SysRq key (kernel.sysrq = 1) in Linux, allowing you to use key combinations like REISUB for safely rebooting or recovering an unresponsive system without data loss. The REISUB sequence gracefully shuts down processes, syncs filesystems, and remounts them read-only before rebooting.
linux kernel security sysrq recovery
cat /dev/urandom > /dev/pcspkr
Sends random data from /dev/urandom to the PC speaker (/dev/pcspkr), generating continuous beeping or noise. This can be used for simple sound effects or to test the PC speaker functionality. Warning: This can produce loud and potentially high-pitched noise!
linux audio hardware test
pacat /dev/urandom
Plays continuous white noise by streaming random data from /dev/urandom through PulseAudio using pacat. This can be used for various purposes such as masking background noise or testing audio output. Warning: This can produce loud and potentially unpleasant noise.
linux audio test
passwd -dl root
The passwd -dl root command disables the root account by deleting its password (-d) and locking the account (-l). This prevents direct login as root via password-based authentication, protecting the system from unauthorized access. While the root account is locked for login, it remains active for system processes and can still be used for administrative tasks through sudo or other secure access methods like SSH with public key authentication.
linux security user administration
dd if=/dev/urandom of=/dev/null status=progress
Runs the dd command to read from /dev/urandom and discard the output, while showing a progress bar that updates in real-time. The status=progress option (available from GNU Coreutils 8.24 released in June 2015) provides a running status of how much data has been processed, useful for long-running data transfers.
linux disk benchmark throughput
sysctl kern.geom.debugflags=0x10
Sets kern.geom.debugflags to 0x10 in FreeBSD, allowing write access to the MBR (Master Boot Record), which is typically protected to prevent accidental modification. This is useful for tasks like modifying boot loaders or repairing MBR issues.
freebsd kernel disk mbr debug
echo -e "* hard nproc 2500\n@users hard nproc 3250\nroot hard nproc 3250\n* hard core 0\n* hard maxlogins 2" | sudo tee -a /etc/security/limits.conf
Adds custom resource limits to the /etc/security/limits.conf file, including process limits for users and root, disabling core dumps for all users, and restricting the maximum number of simultaneous logins per user to 2, ensuring better system resource management and security.
linux security resources config
ulimit -aH
Shows the hard resource limits for the current user, such as maximum file size, number of open files, and maximum memory usage, using the ulimit command with the -aH option.
linux system resources info
find . -type f \( -name "*.[Pp][Nn][Gg]" -o -name "*.[Jj][Pp]*[Gg]" -o -name "*.[Gg][Ii][Ff]" -o -name "*.[Ww][Ee][Bb][Pp]" \) -exec exiftool -overwrite_original -all= {} \;
This command searches for image files (*.png, *.jpg, *.jpeg, *.gif, *.webp) in the directory and its subdirectories and uses exiftool to strip all metadata from each file. The -overwrite_original flag ensures that the images are overwritten with metadata-free versions, which is useful for privacy, reducing file size, or preparing files for distribution.
linux image metadata privacy cleanup
find . -type f -iname '*' -exec exiftool -overwrite_original -all= {} \;
Finds all files in the current directory and subdirectories, and removes all metadata (such as EXIF, IPTC, XMP) from each file using exiftool, overwriting the originals.
linux image metadata privacy cleanup
find . -type f \( -name "*.[Pp][Nn][Gg]" -o -name "*.[Jj][Pp]*[Gg]" -o -name "*.[Gg][Ii][Ff]" -o -name "*.[Ww][Ee][Bb][Pp]" \) -exec exiv2 -da rm {} \;
Finds all image files (PNG, JPEG, GIF, WebP) in the current directory and subdirectories, and removes any EXIF metadata using exiv2, ensuring privacy by stripping image metadata.
linux image metadata privacy cleanup
find . -type f -iname '*' -exec exiv2 -da rm {} \;
Finds all files in the current directory and subdirectories and removes any EXIF metadata using exiv2, effectively stripping the metadata from images, PDFs, and other file types that support EXIF.
linux image metadata privacy cleanup
find . -name "*.[Jj][Pp]*[Gg]" -printf ' jpegoptim > %p\n' -exec jpegoptim -f --strip-none --overwrite --quiet {} \;
This command searches for JPEG files (*.jpg, *.jpeg, etc.) and uses jpegoptim to apply lossless optimization. The -f flag forces the optimization, --strip-none preserves all metadata, --overwrite replaces the original files with the optimized versions, and --quiet suppresses output for a smoother, silent operation.
linux image processing compression jpeg
find . -name "*.[Jj][Pp]*[Gg]" -printf ' jpegtran > %p\n' -exec jpegtran -optimize -copy all {} > {} \;
This command recursively searches for JPEG files (*.jpg, *.jpeg, etc.) and uses jpegtran with the -optimize option to apply lossless compression, reducing the file size without losing quality. The -copy all option ensures that all metadata (such as EXIF data) is preserved. The > operator overwrites the original files with the optimized versions.
linux image processing compression jpeg
find . -name "*.[Gg][Ii][Ff]" -printf ' gifsicle > %p\n' -exec gifsicle --batch --no-warnings --no-comments --optimize=3 {} \;
This command recursively searches for GIF files (*.gif or *.GIF) and uses gifsicle to apply advanced optimization (--optimize=3) while removing comments and warnings for a quieter process. The --batch flag ensures that all GIF files are processed in batch mode. This results in smaller, more efficient GIFs without losing quality.
linux image processing compression gif
find . -name "*.[Pp][Nn][Gg]" -printf ' pngcrush > %p\n' -exec pngcrush -ow -rem alla -reduce -brute -q -warn {} \;
This command searches for PNG files (*.png or *.PNG) in the current directory and subdirectories, and applies lossless compression using pngcrush with options to remove unnecessary chunks (-rem alla), optimize file size (-reduce), and apply brute-force optimization (-brute). The -ow option overwrites the original files, while -q suppresses unnecessary output, and -warn shows warnings if any issues arise during the process.
linux image processing compression png
find . -name "*.[Pp][Nn][Gg]" -printf ' optipng > %p\n' -exec optipng -preserve -clobber -nc -nb -o7 -zm1-9 -quiet {} \;
This command recursively locates all PNG files (*.png or *.PNG) and uses optipng to apply maximum optimization (-o7), varying compression levels (-zm1-9), and other options like preserving metadata (-preserve) and avoiding overwriting existing files (-nc). The -quiet option suppresses unnecessary output during optimization.
linux image processing compression png
find . -name "*.[Pp][Nn][Gg]" -printf ' oxipng > %p\n' -exec oxipng -ao max -Z -q {} \;
This command recursively searches for PNG files (*.png or *.PNG) and uses oxipng to apply maximum compression (-ao max), lossless optimization (-Z), and quiet mode (-q) to reduce file sizes without losing image quality.
linux image processing compression png
flatpak uninstall --unused
Uninstalls Flatpak applications and runtimes that are no longer needed, freeing up disk space by removing dependencies that are no longer required by any installed applications.
linux package-management flatpak cleanup
flatpak uninstall --delete-data org.gnome.TextEditor
Uninstalls the GNOME Text Editor (org.gnome.TextEditor) Flatpak application and deletes its associated data, freeing up space and ensuring no leftover configuration or cache files remain.
linux package-management flatpak cleanup
qemu-img convert -f vdi -O qcow2 [VBOX-IMAGE.vdi] [KVM-IMAGE.qcow2]
Uses qemu-img to convert a VirtualBox disk image ([VBOX-IMAGE.vdi]) into the KVM-compatible QCOW2 format ([KVM-IMAGE.qcow2]), enabling the image to be used with KVM/QEMU virtual machines.
linux virtualization kvm disk conversion
VBoxManage modifyhd [VDI] --resize [megabytes]
Resizes an existing VirtualBox disk image ([VDI]) to a new size, specified in megabytes, using the --resize option.
linux virtualization vbox disk resize
VBoxManage clonehd [old-VDI] [new-VDI] --variant Fixed
Clones an existing VirtualBox disk image ([old-VDI]) to a new one ([new-VDI]) with a fixed size using the --variant Fixed option, meaning the new disk will have a set size rather than dynamically expanding.
linux virtualization vbox disk clone
VBoxManage clonehd [old-VDI] [new-VDI] --variant Standard
Clones an existing VirtualBox disk image ([old-VDI]) to a new one ([new-VDI]) using the --variant Standard option, creating an exact copy of the original virtual hard disk.
linux virtualization vbox disk clone
avahi-browse -alr
Uses avahi-browse to list all available services (both local and remote) on the local network, including their types and instance names, in real-time.
linux network discovery mdns
firewall-cmd --add-service=http --permanent
Adds the HTTP service (port 80) to the allowed services in the firewall permanently using firewall-cmd, ensuring that the rule persists after a reboot.
linux network firewall security http
firewall-cmd --add-service=http
Adds the HTTP service (port 80) to the list of allowed services in the firewall using firewall-cmd, enabling inbound HTTP traffic.
linux network firewall security http
echo -e '[device]\nwifi.scan-rand-mac-address=yes\n\n[connection]\nwifi.cloned-mac-address=random\nethernet.cloned-mac-address=random\nconnection.stable-id=${CONNECTION}/${BOOT}' > /etc/NetworkManager/conf.d/00-macrandomize.conf
Configures NetworkManager to randomize the MAC address for Wi-Fi scans, cloned MAC addresses for connections, and assigns a stable ID for network connections on boot, helping improve privacy and prevent tracking.
linux network privacy security mac-spoofing
echo 'none' > /sys/class/leds/ath9k_htc-phy0/trigger
Disables the LED trigger for Atheros-based wireless devices (e.g. using ath9k_htc driver) by setting the trigger to 'none'. This can prevent network performance issues caused by excessive power draw from the LED. Used this on TP-Link TL-WN721N WiFi dongle
openwrt hardware led power atheros
logread -t | grep -iE '(warn|crit|err)'
Uses logread to scan OpenWRT kernel logs, filtering for and displaying lines containing warnings (warn), errors (err), or critical (crit) messages to quickly identify potential issues.
openwrt administration log monitoring
cat /sys/kernel/debug/iee*/phy*/airtime_flags
Displays the airtime flags (airtime_flags) for WLAN interfaces on Atheros-based devices in OpenWRT, useful for monitoring and managing airtime scheduling and prioritization for wireless clients.
openwrt network wifi airtime atheros
cat /sys/kernel/debug/iee*/phy*/netdev:wlan*/stations/*/aql
Displays the Active Queue Length (AQL) setting for individual WLAN stations on ath79-based devices in OpenWRT, which is useful for monitoring and tuning wireless traffic management per station.
openwrt network wifi queue monitoring
cat /sys/kernel/debug/iee*/phy*/aql_enable
Displays the current status of AQL (Active Queue Length) enable setting on ath79-based devices in OpenWRT, useful for tuning network performance and managing queue lengths for wireless traffic.
openwrt network wifi queue atheros
cat /sys/kernel/debug/iee*/phy*/netdev:wlan*/stations/*/peer_ps_state
Displays the power save state (peer_ps_state) for WLAN stations connected to ath79-based devices in OpenWRT, providing insight into the power management status of wireless clients.
openwrt network wifi power atheros
cat /sys/kernel/debug/iee*/phy*/netdev:*/aqm
Displays the AQMs (Active Queue Management) settings for network devices under the /sys/kernel/debug/iee*/phy*/netdev:*/aqm path in OpenWRT, useful for network performance tuning and debugging.
openwrt network wifi queue optimization
find /sys/kernel/debug/iee*/phy* -name aqm
Searches for AQMs (aqm) configuration files in the OpenWRT /sys/kernel/debug/iee*/phy* path, which relate to Active Queue Management settings for network devices.
openwrt network wifi queue optimization
grep -iE '(BEAMFORME|ANTENNA)' /var/run/hostapd*.conf
Searches for BEAMFORME and ANTENNA settings in the hostapd configuration files on OpenWRT. In some cases, you can expect output such as beamforming capabilities (SU-BEAMFORMER, MU-BEAMFORMER), antenna patterns, and OFDMA settings like he_su_beamformer and he_mu_beamformer.
openwrt network wifi config
nmap -p0-65535 127.0.0.1 -T5
Uses nmap to scan all ports (0-65535) on the local machine (127.0.0.1) with aggressive timing (-T5) for faster results.
linux network security scan nmap
netstat -lntu
Uses netstat to show all listening TCP, UDP, and UNIX domain sockets, along with their state and associated ports.
linux network monitoring ports
ss -lntu
Uses the ss tool to show all listening TCP, UDP, and UNIX domain sockets, providing detailed information about their states and ports.
linux network monitoring ports socket
hdsentinel -solid | awk '{print "[\t" $3 "% \t] "$5}'
Uses hdsentinel to retrieve SSD health and usage information, then formats the output to show the health percentage and corresponding attribute name.
linux disk monitoring health ssd
dd if=/dev/zero of=/dev/sdX bs=512 status=progress
Writes zeros to every 512-byte block on the specified disk (/dev/sdX), effectively wiping all data, including the partition table and file system
linux disk management cleanup dangerous
dd if=/dev/zero of=/dev/sdX bs=512 count=1 status=progress
Writes zeros to the first 512-byte block of the specified disk (/dev/sdX), which can erase the partition table and boot sector.
Warning: This command will destroy the partition table and potentially make the disk unbootable. Use with extreme caution and double-check the target disk (/dev/sdX).
linux disk management cleanup dangerous
fstrim -v /
Performs a manual trim operation on the root filesystem, freeing unused blocks on SSDs to improve performance, with verbose output.
Warning: Be cautious when running fstrim on the root filesystem, as incorrect use or trimming certain filesystems can potentially lead to data loss in some configurations.
linux disk maintenance ssd
grep . /sys/block/sd?/queue/scheduler
Searches and outputs the I/O scheduler settings for all block devices (e.g., /dev/sda, /dev/sdb) by reading their respective /queue/scheduler files.
linux disk config scheduler
for f in /sys/block/sd?/queue/scheduler; do printf "$f is "; cat $f; done
Iterates over all block devices (e.g., /dev/sda, /dev/sdb) and prints the current I/O scheduler used for each device.
linux disk config scheduler
grep . /sys/block/sd?/queue/rotational
Displays whether each block device (/dev/sda, /dev/sdb, etc.) is rotational (HDD) or non-rotational (SSD) by checking the /queue/rotational property.
linux disk hardware info
for f in /sys/block/sd?/queue/rotational; do printf "$f is "; cat $f; done
Checks and displays whether each block device (e.g., /dev/sda, /dev/sdb) is rotational (HDD) or non-rotational (SSD) by reading from /sys/block/*/queue/rotational.
linux disk hardware info
dmesg | grep -i 'ata link up'
Searches the system log for messages related to ATA link status, specifically looking for "ATA link up" events.
linux disk hardware log search
seq 3 | xargs -P0 -n1 md5sum /dev/zero
Runs a parallel MD5 hash calculation on /dev/zero three times, stressing the CPU with multiple concurrent processes using xargs -P0.
linux cpu stress-test
yes > /dev/null &
Stresses the CPU by running the yes command in the background, which continuously outputs "y" to /dev/null without consuming disk space.
linux cpu stress-test
dd if=/dev/urandom | bzip2 -9 >> /dev/null
Tests CPU performance by compressing random data from /dev/urandom using the bzip2 compression algorithm at maximum level (-9), discarding the output.
linux cpu benchmark stress-test
dd if=/dev/zero of=/dev/null
Measures the raw disk write speed by writing zeros to /dev/null, effectively testing the system’s I/O throughput.
linux disk benchmark throughput
watch -n 2 cpupower monitor
Displays real-time CPU power and frequency data, updating every 2 seconds using cpupower monitor.
linux hardware cpu monitoring
perf stat -a sleep 2
Gathers and displays performance statistics (e.g., CPU usage, cache hits) for the entire system while the system is idle for 2 seconds.
linux hardware cpu benchmark monitoring
@reboot echo -n $USER_DEFINED > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
Sets the up_threshold for the CPU's ondemand governor to a user-defined value on system startup.
linux hardware cpu power cron automation
crontab -e -u pretzel
Opens the crontab file for the user pretzel, allowing you to schedule tasks for that user.
linux automation cron
echo SUBSYSTEM=="module", ACTION=="add", KERNEL=="acpi_cpufreq", RUN+=" /bin/sh -c ' echo -n $USER_LIMIT > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold ' " > /etc/udev/rules.d/50-scaling-governor.rules
Creates a udev rule that automatically sets the up_threshold for the CPU's ondemand governor when the acpi_cpufreq module is loaded.
linux hardware cpu power udev automation
echo -n $USER_LIMIT > '/sys/devices/system/cpu/cpufreq/ondemand/up_threshold'
Sets the up_threshold value for the CPU's ondemand governor to control when to increase CPU frequency based on load.
linux hardware cpu power
cpupower -c $CPU_CORES frequency-set -g performance
Sets the specified CPU cores (defined by $CPU_CORES) to performance mode for maximum frequency.
linux hardware cpu performance config
cpupower frequency-set -g performance
Configures the CPU to run at its maximum frequency for optimal performance.
linux hardware cpu performance config
cat /sys/devices/system/cpu/cpufreq/boost
Displays whether CPU frequency boosting is enabled or disabled on the system.
linux hardware cpu power config
lscpu
Provides a summary of the system's CPU architecture, including core count, threads, and architecture type.
linux hardware cpu info
cat /proc/cpuinfo
Shows detailed information about the system's CPU, including model, cores, and clock speed.
linux hardware cpu info
glxinfo | grep memory
Extracts and shows memory-related details (e.g., video memory) for the GPU from the glxinfo output.
linux hardware gpu memory info
lspci -vvv | grep modules
Shows the kernel modules associated with PCI devices on the system.
linux hardware kernel drivers info
lsusb -vs 006:001
Displays verbose details about the USB device located at 006:001.
linux hardware usb info verbose
lspci -vs 0a:00.0
Displays verbose information about the PCI device located at 0a:00.0.
linux hardware pci info verbose
lspci | grep VGA
Shows information about the VGA (graphics) device(s) on the system.
linux hardware gpu info
find ~/logs/{daily,monthly,weekly} -type f \( -name "*.log" -o -name "*.txt" \) | xargs sed -i -E '/monday\|tuesday/Id'
Searches log and text files in daily, monthly, and weekly directories, and deletes lines containing 'monday' or 'tuesday', case-insensitively.
linux log cleanup sed edit find
find . -type f -size +50000k -exec cp -nv {} ./ \;
Finds files larger than 50MB and copies them to the current directory, showing verbose output.
linux file search size copy find
find . -type f -name "*.log" -mtime +10 | xargs grep -iEn "(Error 403|Error 404)"
Finds .log files modified more than 10 days ago and searches for "Error 403" or "Error 404" within them.
linux log search find grep maintenance
find . -maxdepth 1 -type f -name "*apache*" -mtime +10 -exec echo {} \;
Finds and lists files in the current directory containing "apache" in the name, modified more than 10 days ago.
linux file search find timestamp
find . -name "*.pdf" -type f -print0 | xargs -0 /bin/rm -f
Finds all .pdf files and deletes them forcefully, using xargs to handle filenames with special characters.
linux file search cleanup find xargs
find . -name "*.pdf" -type f -delete
Finds and deletes all .pdf files in the current directory and its subdirectories.
linux file search cleanup find
find . -iname "*.jpeg" -execdir mv -i '{}' cover.jpeg \;
Finds all .jpeg files (case-insensitive) and renames each to cover.jpeg in its respective directory, with confirmation.
linux file search management find
find . -name "*.pdf" -exec cp {} ~/Documents \;
Searches for all .pdf files in the current directory and subdirectories, then copies them to ~/Documents.
linux file search management copy find
sed -i 's/^.*NAutoVTs=.*$/NAutoVTs=2/' /usr/lib/systemd/logind.conf
Changes the value of "NAutoVTs" to 2 in /usr/lib/systemd/logind.conf file, modifying it in place.
linux config systemd sed edit
sed -i 's/^String=.*$/New String = 22/g'
Replaces lines starting with "String=" with "New String = 22" in a file, modifying it in place.
linux text edit sed
dmidecode | awk '/(\t)+Size/{$1=""; print $0 }'
Filters the output of dmidecode to show memory size details, removing the first field from matching lines.
linux hardware memory info awk
awk '/(\t)+Size/{$1=""; print $0 }'
Finds lines with "Size" preceded by tabs, removes the first field, and prints the rest.
linux text processing awk
grep -R 'search-string' ~/Some/Path/
Searches for 'search-string' in all files under the specified directory and its subdirectories.
linux text search grep
grep -i -B 3 -A 5 'something something'
Finds 'something something' and shows 3 lines before and 5 lines after each match, case-insensitively.
linux text search grep
grep -iE '(Word1|Word2|Word3)'
Searches for any of the specified words (Word1, Word2, or Word3) in a case-insensitive manner.
linux text search grep
awk -v SEPARATOR="," '{print $1 " " SEPARATOR " " $2 " " SEPARATOR " " $3}'
Adds the specified separator (a comma) between the printed fields ($1, $2, and $3) in the output.
linux text processing awk