Command Crate

Subscribe via RSS
Latest command

ffmpeg -nostats -i pohokolius_-_odlazak_remastered.flac -af astats=metadata=0 -f null - 2>&1 | grep "Bit depth"

This commands exposes effective depth of an audio file. Example: if it comes back as something like 16/24/24/24, the source was 16-bit content in a 24-bit wrapper.

audio analysis ffmpeg depth #db5562aa

grep -E '^he_' /var/run/hostapd-phy*.conf | grep -v mu_edca

Dumps the active 802.11ax operating parameters minus the MU-EDCA defaults. Shows he_oper_chwidth (0=20/40, 1=80, 2=160), spatial reuse control, BSS color, TWT requirement and beamforming roles in one view.

openwrt network wifi hostapd 80211ax #4ef9f1b4

iw phy1 info | grep -A 10 'valid interface combinations'

Reports the maximum number of AP interfaces the radio hardware supports.

openwrt network wifi vap limits #accefec2

iw dev phy1-ap0 station dump | grep -c Station

Counts currently associated wireless clients on an interface. Useful for checking whether a txpower reduction dropped edge clients, when run repeatedly over time.

openwrt network wifi clients monitoring #d387475c

iw dev phy1-ap0 station dump | grep -E 'Station|signal:|tx bitrate|rx bitrate'

Shows per-client uplink signal and negotiated rates. Only measures what the AP receives, so it cannot be used to evaluate AP transmit power changes. Clients must be passing traffic or rates read low.

openwrt network wifi clients signal #ce61024a

iw dev phy1-ap0 survey dump | grep -A7 'in use'

Reports noise floor plus channel active/busy time for the operating channel. Divide busy by active for airtime utilization; under ~20 percent is healthy, over ~50 percent means real contention.

openwrt network wifi airtime congestion #1d3baaed

iwinfo phy1-ap0 info | grep -E 'Channel|Tx-Power'

Shows the channel, center channel, HT mode and post-regdb-clamp Tx-Power actually in effect on a wireless interface.

openwrt network wifi channel txpower #d01f75af

magick pokloni-website-card_1200x600.png -resize "1200x630^" -gravity center -extent 1200x630 pokloni-website-card_1200x600_fixed.png

Resizes an image to fill a 1200x630 canvas, centering the content and cropping any overflow.

imagemagick image crop resize center #585a4713

find . -maxdepth 1 -mindepth 1 -type d -exec rm -rf '{}' \;

Deletes all directories within the current folder while preserving the files in the root. Uses -maxdepth 1 to prevent recursion into sub-subdirectories.

find filesystem cleanup deletion shell #587781de

python3 -c "import re,sys,pathlib;p=re.compile(r'[\U0001f300-\U0001f9ff\U00002702-\U000027b0\U0000fe00-\U0000fe0f\U0000200b-\U0000200f\U0000200d]');[print(f'{f}:{i+1}: {l.rstrip()[:80]}') for f in pathlib.Path(sys.argv[1]).rglob('*') if f.suffix in ('.html','.md','.txt') for i,l in enumerate(f.read_text('utf-8').splitlines()) if p.search(l)]" ./

Scans all .html, .md, and .txt files recursively for emoji and zero-width characters (ZWJ, variation selectors, invisible formatters). Prints filename:line:preview for each hit. Safe for multilingual content (Cyrillic, CJK etc.), only targets Unicode emoji and control ranges.

python unicode emoji scanner security privacy #1300b16f

pkg info -r ImageMagick7

Lists all installed packages that depend on a given package.

freebsd package-management pkg dependencies #932068d2

gzip --best -k file.svg && mv file.svg.gz file.svgz

Compresses an SVG file into the SVGZ format. The -k flag preserves the original.

image svg compression gzip #4270d0cb

dnf repoquery --installed --whatrequires ImageMagick7

Lists all installed packages that depend on a given package. Answers: 'what would break if I removed this?'

dnf rpm fedora dependencies packages #67744b45

magick main_screen.png -background none -size 20x1 xc:none results.png +append kalkulator-prostih-brojeva-app-pregled.png

Horizontally appends images with a transparent spacer between them. Creates a 20x1 transparent canvas as a gap, then uses +append to stitch all images side by side into a single output file.

imagemagick magick append composite #f7191e8d

awk -F'[<>]' '/<loc>/ {print $3}' sitemap.xml

Extracts raw URLs from a standard XML sitemap with awk. Matches and captures text strictly between <loc> tags.

awk sitemap xml extract url #751461d8

sed -n 's/.*<loc>\(.*\)<\/loc>.*/\1/p' sitemap.xml

Extracts raw URLs from a standard XML sitemap. Matches and captures text strictly between <loc> tags, replacing the entire line with the URL. Works on FreeBSD/BSD sed.

sed sitemap xml extract url freebsd #5883ea00

top -o res

Sorts FreeBSD process list by resident set size (RSS, physical RAM). Essential for ignoring misleading virtual memory ('SIZE') stats, which often show terabytes of reserved address space for electron/Go apps. 'RES' reveals the actual physical memory cost.

freebsd top memory ram monitoring #72f05a09

magick gshock-gw-m5610u-1b.png -fill "#fbfbfe" -opaque "#e6f1f5" -fill "#1c1b22" -opaque "#203a43" gshock-gw-m5610u-1b_darkgrey.png

Swaps specific hex colors 1:1 on the image. Replaces Light (#e6f1f5) with off-white (#fbfbfe) and dark (#203a43) with dark-grey (#1c1b22). Uses sequential fill/opaque operations.

imagemagick hex color #aeca042e

printf 'dev.hwpstate_intel.0.epp=100\ndev.hwpstate_intel.1.epp=100\ndev.hwpstate_intel.2.epp=100\ndev.hwpstate_intel.3.epp=100\n' | sudo tee -a /etc/sysctl.conf && sudo sysrc powerd_enable='NO'

Appends Intel HWP powersave settings to sysctl.conf (making them permanent) and disables the obsolete 'powerd' service in rc.conf. Useful for libreboot systems.

freebsd cpu power save persist #33cc2d6f

sysctl dev.cpu.0.freq_levels

Checks available CPU frequency steps. If output is single-level (e.g., '2700/-1') on Libreboot/modern Intel, ACPI tables are missing. Discard 'powerd' and rely on 'hwpstate_intel' (Hardware P-States) for frequency scaling.

freebsd cpu libreboot p-state quirk #10f29d1a

sysctl dev.hwpstate_intel.0.epp=100

Sets Intel Speed Shift (HWP) to 'Powersave' (Energy Performance Preference = 100) on CPU core 0 (first). Use '50' for Balanced or '0' for Performance. Required on modern Intels where 'powerd' has no effect.

freebsd cpu power save hwp #fc8608e6

sysctl dev.cpu.0.freq dev.cpu.0.freq_levels dev.cpu.0.cx_supported dev.cpu.0.cx_lowest

Displays current CPU frequency, available scaling levels, and supported C-states (sleep modes). Essential for verifying if FreeBSD is correctly entering low-power idle states.

freebsd cpu power diagnosis c-states #aefcf205

dd if=Fedora-Workstation-Live.iso of=/dev/da0 bs=1m conv=sync status=progress

Writes a bootable ISO to a USB drive on FreeBSD. Uses '/dev/da0' (FreeBSD USB device identifier) and 'bs=1m' (BSD syntax). 'conv=sync' pads the final block to prevent data corruption.

freebsd disk management iso usb #786f4091

magick input.xcf -flatten -resize 3000x3000 -strip -quality 92 output.jpg

Directly converts a GIMP XCF project file to JPEG without opening GIMP. '-flatten' merges all layers onto a white background (crucial for XCF), '-resize' sets the dimensions, and '-strip' removes all metadata/EXIF for a clean, smaller file.

image imagemagick conversion gimp #dd3305c7

magick rss-icon.png -quality 75 -define webp:method=6 -define webp:pass=10 rss-icon.webp

Converts PNG to WebP with 'Max Effort' settings. Method 6 enables the most computationally expensive compression algorithms, and pass 10 iteratively optimizes the quantization. Uses standard YUV 4:2:0 chroma subsampling for minimum file size.

image conversion imagemagick webp optimization #058e5be9

magick -background none -density 648 favicon.svg rss-icon.png

Crisp SVG to PNG conversion. The density must be calculated: (TargetWidth / SourceWidth) * 72. Example: 144 / 16 = 9. 9 * 72 = 648. This forces 1:1 rendering without blurring.

image processing imagemagick svg conversion math #5a8ffb93

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 #fd578b64

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 audio channel 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 #c4e0fda5

adb push ./local_file /sdcard/Download/

The only way to write to Android at full speed (20-40MB/s). Helps with MTP/FUSE bottleneck.

android file adb #2d643b07

ffmpeg -i input.wav -af "pan=stereo|c0=c0|c1=-1*c1" phase_flip.wav

Inverts the phase of the right audio 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 #56d730e3

ffmpeg -i input.wav -af "pan=stereo|c0=c0|c1=c0" vangogh.wav

Discards the right audio channel entirely and forces the left channel to both speakers. Fixes some phase cancellation issues by killing stereo.

audio processing ffmpeg stereo-fix #0c0ad238

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 #ffdf967b

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 #19e9aa58

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 #7c180293

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 #2aaa32e0

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 #cef56735

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 #2ae7c5d2

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 #3c226b9e

etcupdate diff | less

Compares your current /etc configuration files against the stock defaults. Shows exactly what you have modified.

freebsd administration config diff #99a9f859

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 #034ef592

service pf reload

Reloads the PF firewall rules immediately (applies changes).

freebsd firewall pf reload #81b8cd89

pfctl -nf /etc/pf.conf

Checks the PF configuration file for syntax errors WITHOUT loading it (Safe Mode).

freebsd firewall pf #7ea2f113

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 #d8dccf97

tunefs -n enable /dev/da0p1

Enables 'Soft Updates'. Reorders disk writes to ensure filesystem structure remains consistent even if power fails.

freebsd disk ufs #a5c27884

tunefs -t enable /dev/da0p1

Enables TRIM support on a UFS partition. CRITICAL for SSD longevity and sustained write speeds.

freebsd disk ufs ssd #83392725

tunefs -j enable /dev/da0p1

Enables 'Soft Updates Journaling' (SU+J). Makes filesystem recovery near-instant after a power failure.

freebsd disk ufs #2444fe34

tunefs -p /dev/da0p1

Prints all current UFS tuning parameters (ACLs, Journal, Soft Updates, Trim, Owner).

freebsd disk ufs info #32b054ed

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 #5184d49e

fsck -t ufs -y /dev/da0p1

Runs a non-interactive (-y) consistency check and repair on a UFS partition.

freebsd disk ufs repair #44261dc5

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 #b785d2e3

tune2fs -L "NEW_LABEL" /dev/da0p1

Renames (relabels) an Ext2, Ext3, or Ext4 filesystem without reformatting.

freebsd linux disk ext-fs label #6c3b9096

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 #55cb93da

sysupgrade -b /tmp/backup.tar.gz

Creates a backup archive of the current configuration and saves it to /tmp.

openwrt backup config #07ab2ed7

block info

Displays UUIDs, labels, filesystem types, and mount points for all attached block devices. Requires block-mount package.

openwrt storage info #f4f80145

whereis -b ansible

Locates the binary executable for a specific program.

freebsd search #48da274c

/usr/libexec/locate.updatedb

Manually updates the 'locate' database to index recent files.

freebsd administration file search #bc880462

procstat -f $(pgrep nginx)

Lists all open files and file descriptors for a specific process (like lsof).

freebsd monitoring process file #64b650a1

pfctl -s info

Shows the current status of the PF firewall (uptime, stats, state table).

freebsd firewall pf info #e46a7b4c

service netif restart

Restarts the network interface subsystem. WARNING: Will disconnect SSH.

freebsd network #6ea8e2c4

service -e

Lists all system services that are currently enabled.

freebsd administration service #f96445e9

sockstat -4l

Lists all IPv4 listening sockets and the processes/PIDs attached to them.

freebsd network monitoring socket #35f44bb4

kldstat -v

Lists all loaded kernel modules and the specific kernel files they belong to.

freebsd kernel module info #f4ceb9bd

pciconf -lv

Lists all PCI devices attached to the system showing driver names and vendor details.

freebsd hardware pci info #19812c54

service powerd status

Checks if the power control daemon is running.

freebsd hardware power #26c91018

sysctl dev.cpu.0.cx_usage

Displays usage statistics for CPU C-states (sleep modes).

freebsd hardware cpu power #777d31ca

sysctl dev.cpu.0.freq_levels

Lists all supported frequency steps and their power consumption.

freebsd hardware cpu frequency #8624fe3f

sysctl dev.cpu.0.freq

Displays the current operating frequency (MHz) of the first CPU core.

freebsd hardware cpu frequency #a3b6fc3d

sysctl dev.cpu | grep temperature

Displays the current temperature of all CPU cores.

freebsd hardware cpu temperature #1a9a4fdf

top -P -d 1

Runs top in per-CPU mode (-P) with a 1-second refresh rate.

freebsd system monitoring top #6443f347

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 #df0a6bad

bastille stop target_jail

Gracefully stops a specific jail.

freebsd container bastille #6990d4a2

bastille cmd ALL echo 'Hello World'

Executes a single command across ALL running jails simultaneously.

freebsd container bastille #fed7584e

bastille console hlab-ansible-server

Logs directly into the shell of a specific running jail.

freebsd container bastille #ddee83dc

bastille list

Displays a table of all Bastille jails, including their state (up/down) and IP addresses.

freebsd container bastille #3994ef33

pkg audit -F

Fetches the latest vulnerability database and audits all installed packages for known security issues.

freebsd security pkg audit #676ddc4d

pkg info -as | sort -hk 2

Lists all installed packages sorted by their installed size (human-readable).

freebsd package-management pkg disk #ba4ddd6d

pkg query -e '%a = 0' '%n-%v'

Lists 'leaf' packages (software you explicitly installed), excluding dependencies.

freebsd package-management pkg query #200fdb9e

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 #1ebc3101

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 #34c61f08

zpool scrub zroot

Initiates a data integrity check (scrub) on the main ZFS pool to verify checksums and repair corruption.

freebsd zfs maintenance #538b159f

zpool status -v zroot

Checks the progress of a running ZFS scrub or displays detailed error logs for the pool.

freebsd zfs maintenance #950905d1

zpool list -v

Shows the status and topology of ZFS pools, including individual read/write/checksum errors for specific drives.

freebsd zfs storage #a815b80d

zfs list -o space

Displays a detailed breakdown of ZFS disk usage, distinguishing between data, snapshots, and reserved space.

freebsd zfs storage #e25c4580

glabel status

Shows all available labels (UFS, GPT, Ext2fs) and which physical device they point to.

freebsd hardware storage label #d60e314d

geom disk list

Lists detailed physical attributes of all connected disks (mediasize, sector size, rotation rate, device names).

freebsd hardware storage info #c1d77e7d

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 #e1fc9d3e

tune2fs -L "DATA_VAULT" /dev/da0s1

Labels an existing Ext4 partition.

freebsd disk label #365eb0e9

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 #daa1e152

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 #faa7341c

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 #f7c5baa4

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 #0d4a6ff9

mount -o async,noatime /dev/ufs/DATA-DISK /media/DATA-DISK

Mounts a UFS drive in 'Turbo Mode' (Write Caching + No Access Time). Fast for backups (130MB/s+).

freebsd disk ufs #8b265011

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 #b3382f9d

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 #5516d74d

rsync -avhW --no-compress --info=progress2 /source/ /media/DATA-DISK/

('Turbo' Rsync) Uses whole-file copy (-W) and disables compression to maximize throughput on local USB drives.

linux backup rsync #0ae184fe

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 #5fdf3a7c

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 #b8c77ddb

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 #8f2dd499

: > /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 #56075049

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 #8fa6f582

shred -vzu -n 5 filename

Securely delete a file. Overwrites 5 times with random data, then zeros, then removes.

linux security cleanup #1f0bdad3

assoc .txt=txtfile

Fix file associations via command line. Links .txt extension back to text files.

windows file config extension #ca3a6b9e

dism /online /export-driver /destination:C:\BackupDrivers

Export all installed 3rd-party drivers to a folder. Essential before reinstalling Windows.

windows backup drivers maintenance #3225dd8e

netstat -ano | findstr LISTENING

List all active ports listening for connections, including the Process ID (PID).

windows network ports monitoring #4073e021

taskkill /F /FI "STATUS eq NOT RESPONDING"

Force kill all applications that are currently frozen or 'Not Responding'.

windows process kill #25495be8

wmic path softwarelicensingservice get OA3xOriginalProductKey

Retrieve the OEM product key embedded in the motherboard firmware (BIOS/UEFI).

windows license activation hardware #3a83907e

python3 -m http.server 8000

Instant Web Server. Serves current directory over HTTP. Useful for quick file transfers

web network server python #f9a49be4

powercfg /batteryreport

Generates a detailed HTML report of battery health, cycles, and capacity history in user folder

windows hardware battery info #577c0a33

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 #6d507a1e

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 #12feb7dd

cipher /W:C:

Wipe free space. Overwrites deleted data with 3 passes (0x00, 0xFF, random). Does not touch existing files.

windows security disk cleanup #0910a9fc

ipconfig /flushdns

Clears the DNS resolver cache, potentially resolving connectivity issues by forcing the system to retrieve fresh DNS information.

windows network dns #72401fba

defrag /c /h /v /b /o

Defragments all volumes, optimizes boot files, includes TRIM for SSDs, and provides detailed output.

windows disk maintenance optimization #5e73aecb

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 #0575ab98

sfc /scannow

Scans and repairs corrupted or missing system files, ensuring system integrity and proper operation.

windows system maintenance repair #9ced4f21

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 #dd578e08

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 #dfc75931

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 #43baa433

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 #249565f7

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 #88adc0de

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 #39e2859f

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 #9cf90e63

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 #b870b61f

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 #068f5b38

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 #4b5290de

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 #230caea8

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 #0289ac53

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 #de6643e6

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 #76ed8822

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 #fceb487c

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 #18183192

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 #ef7f6ba5

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 #b91a2d71

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 #ba18f9d6

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 #f2f4997e

lsof -p 1234

Shows every file, network socket, and library being used by a process with a specific PID (e.g., 1234).

linux file pid #e4306de7

dnf provides /usr/bin/ssh

Identifies the software package that installed a given file (e.g., /usr/bin/ssh).

linux package-management dnf search #ecf46fe4

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 #8abbdc5c

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 #c1157455

truncate -s 5G large_dummy_file.img

Creates a sparse file of a specified size (e.g., 5 Gigabytes) almost instantly.

linux disk file #bbf87ef2

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 #4f1460f0

iostat -dx 2

Displays detailed, per-disk I/O statistics (reads/writes per second, utilization) every 2 seconds.

linux disk monitoring io #a94b5abb

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 #1630de16

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 #fb390052

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 #f5262f9e

ss -tlpn 'sport = :8080'

Displays the process name and PID that is actively listening on a given TCP port (e.g., 8080).

linux log process #8a7a70b1

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 #cec958de

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 #3ab9e235

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 #c6141c1f

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 #52af1648

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 #11533904

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 #90e9552e

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 #33b68196

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 #005330c5

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 #24c44878

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 #de2b750e

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 #513732e1

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 #faddec68

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 #a9bd0ab0

lsof -i TCP:80

Displays all processes that have open network connections or are listening on TCP port 80.

linux network monitoring ports #45ebc44f

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 #0e74848b

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 #ae679600

journalctl --disk-usage

Displays the current amount of disk space being consumed by the systemd journal logs.

linux log systemd disk #5803a89d

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 #56d3502a

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 #4036017f

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 #73c9d24f

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 #855940c3

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 #d6964a75

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 #864289db

ping google.com | awk '{ print strftime("[%Y-%m-%d %H:%M:%S]"), $0; fflush() }'

Prepends a live timestamp to each line of ping output. Requires GNU awk (strftime is a gawk extension, not in BSD awk). fflush() forces line-by-line output instead of buffered bursts.

linux network ping timestamp gawk #d5123b0c

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 #d56b2414

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 #9d209bd2

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 #0abbb5de

xdg-settings get default-web-browser

Displays the currently set default web browser on the system.

linux desktop config #eb901226

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 #d6d38092

flatpak mask

Lists all Flatpak packages that have been masked, preventing updates or installation.

linux package-management flatpak config #3a07480f

flatpak mask com.bitwig.BitwigStudio

Prevents the specified Flatpak package from being updated or installed by masking it.

linux package-management flatpak config #dbfd8508

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 #bc50e6da

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 #6476c619

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 #4e918add

SHOW GRANTS FOR 'ABC'@'%';

Shows the privileges granted to a specific user ('ABC'@'%') in MySQL or MariaDB.

database sql mysql security #b7edb07a

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 #ab9a1dd1

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 #869810e1

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 #91a376bc

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 #2263659e

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 #c39f66c9

(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 #abff6d5b

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 #804f02e7

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 #ff627679

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 #0c721f0e

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 #8cc767d4

for file in *.heic; do magick "$file" "${file%.heic}.jpeg"; done

Converts all .heic files in the current directory to .jpeg format using ImageMagick (magick). In ImageMagick v7 and later, the convert command is deprecated, so you should use magick instead.

image conversion imagemagick #78ba5d2a

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 #b77d00bc

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 #2b9a2345

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 #e4b564d6

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 #fb12b283

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 #d5e79080

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 #58650a05

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 #bb679148

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 #64c4e5bb

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 #97716081

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 #80641246

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 #f96bbf77

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 #291b609d

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 #511cf19b

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 #0640a2ab

gpgconf --list-dirs

Displays the directories used by GPG for configuration, keyring, and other data.

security encryption gpg info #d9a04b75

gpg --list-keys

Displays all the GPG keys available in the keyring.

security encryption gpg info #bdc71a7e

gpgconf --kill gpg-agent

Terminates the GPG agent process to stop managing keys and cache.

security encryption gpg config #5b6a0369

git commit --amend

Modifies the most recent Git commit, allowing changes to the commit message or content.

git version-control edit history #d294e89d

git config --global tag.gpgSign true

Configures Git to automatically GPG sign all tags globally.

git version-control config gpg #2eb4b732

git config --global commit.gpgsign true

Sets Git to automatically GPG sign all commits globally.

git version-control config gpg #22775cb0

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 #fab057a7

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 #eff40ec1

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 #ec8df150

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 #77c153ac

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 #2629c423

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 #e7fa4396

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 #a55441d9

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 #d4638dd8

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 #64a9e7a8

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 #f51813af

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 #7281cc73

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 #0d63c106

#!/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 #16471a62

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 #720cbb79

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 #96fe95bd

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 #d8d9bebc

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 #0764e884

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 #703dfd6c

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 #4714d654

#!/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_LENGTH_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_LENGTH_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 #007a5d3e

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 #85de0cc0

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 #dc362978

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 #559d3ff3

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 #94bcd918

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 #9731ed33

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 #6542fe54

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 #8147515b

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 #440dbc05

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 #6f55f474

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 #9fba5d26

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 #4cbf088c

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 #90c10830

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 #26347444

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 #a909adb3

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 #8995e8ec

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 #bf389a71

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 #752ba600

podman volume prune -f

Deletes all unused volumes in podman, freeing up disk space with forced confirmation.

linux container podman cleanup #7597156a

podman auto-update

Updates all containers managed by podman to the latest available versions automatically.

linux container podman management #b8e66a35

podman image prune -a -f

Deletes all unused images in podman, freeing up disk space with forced confirmation.

linux container podman cleanup #06543e43

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 #0bd4e5ae

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 #61bce1e4

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 #5ce8548c

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 #2417a5d7

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 #eb5539d9

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 #fade4090

journalctl --unit clamav-clamonacc --since today

Displays ClamAV logs for the clamav-clamonacc service since the start of today.

linux security log antivirus #ca722d4c

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 #e5decad7

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 #6c80b905

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 #c3718a31

mpv --loop --audio-display=no

Loops the media playback in MPV while disabling the audio visualizations.

video mpv config #f683743a

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 #9f1c795f

w3m -no-cookie -no-graph -W

Starts the w3m browser without using cookies or displaying images, with text-only output.

web browser cli #2d2d8d76

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 #a13c0fa6

curl -Is -H "Accept-Encoding: gzip,deflate,br" https://durad.xyz | 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).

web encoding cli #aa75a560

netstat -tupan

Shows active network connections, listening ports, and associated processes with detailed information.

linux network monitoring ports #03a739fe

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 #7bf5b7b7

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 #d30bebb8

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 #7d817a01

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 #40420838

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 #676c3dbc

udevadm control --reload-rules && udevadm trigger

Reloads udev rules and triggers devices to apply the new rules.

linux hardware udev config reload #24aecd49

cryptsetup benchmark

Measures the performance of various encryption algorithms using cryptsetup.

linux security encryption benchmark #ad881c3d

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 #e2cfb4bb

journalctl -b2

Displays system logs from the second-to-last boot using journalctl.

linux log systemd boot #b6cab7b7

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 #10fd0a1c

pactl set-sink-volume @DEFAULT_SINK@ +2%

Increases the volume of the default audio sink by 2% using pactl.

linux audio volume config pulseaudio #dd6dc0a7

smartctl -l selftest /dev/sdX

Displays the results of previous SMART self-tests for a specified disk.

linux disk hardware health smart #3c6f66f5

smartctl -t short /dev/sdX

Initiates a short self-test on a specified disk to check its health using SMART.

linux disk hardware health smart #5ccbc271

smartctl -a /dev/sdX

Displays detailed SMART (Self-Monitoring, Analysis, and Reporting Technology) information for a specified disk.

linux disk hardware health smart #984628d2

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 #a93425b5

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 #1bd34101

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 #f8f2af06

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 #0fffc18d

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 #14d45d47

iw list

Displays detailed information about available wireless network interfaces on a system.

linux network wifi hardware info #efe115dd

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 #064d15ac

vboxsdl --startvm $VM_NAME

Starts a VirtualBox VM using the SDL (Simple DirectMedia Layer) interface for graphical display.

linux virtualization vbox vm #b7f296f0

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 #950b30ab

vboxmanage hostonlyif remove vboxnet0

Removes a host-only network interface (e.g., vboxnet0) from VirtualBox.

linux virtualization vbox network #3f2db2d9

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).

linux virtualization vbox vm config #c72346c7

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 #107cb8ab

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 #3491ee57

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 #d6abb1c7

vboxmanage registervm $VM_PATH

Registers an existing virtual machine in VirtualBox using the path to the VM configuration file.

linux virtualization vbox vm #010b6a98

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 #09715500

stat -c %a .bashrc

Displays the permissions of a file (in this case, .bashrc) in numeric format.

linux file permissions info #5de2c17f

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 #2c7853a9

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 #2e4bfc2c

/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 #72964742

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 #6cbcbf92

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 #8ec1df61

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 #1aea1ee1

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 #0bf189f3

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 #9d3a1d26

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 programs, like Steam games, to function correctly, but it reduces overall system security.

linux security selinux config gaming #65fff7b6

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 programs, like Steam games, to function correctly, but it reduces overall system security.

linux security selinux config gaming #4f58ae78

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 #863419eb

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 #2dcc4c07

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 #d00f906e

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 #15e85633

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 #7d33602b

vnstat -u -i wlp6s0

Initializes or updates the vnStat database for the specified network interface (wlp6s0), enabling traffic monitoring.

linux network monitoring vnstat config #997cb813

vnstat --iflist

Displays a list of network interfaces available for monitoring with vnstat on a Linux system.

linux network monitoring vnstat #e4324874

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 #3b8a08c1

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 #848a3539

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 #cf0d6d2d

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 #cda45356

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 #029e6c6a

authconfig --disablefingerprint --update

Disables fingerprint authentication by running authconfig --disablefingerprint and updates the system configuration.

linux security auth config #f800028a

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 #08f629b9

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 #18138ea0

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 #4d8cf164

SELECT * FROM categories ORDER BY name ASC;

Retrieves and displays all categories from the database, sorted by name in ascending order.

database sql query #879a7ab4

dnf grouplist -v

Displays a verbose list of all available package groups in DNF, including both installed and available groups.

linux package-management dnf #39dcc695

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 #f3066c8d

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 #99fdc264

virsh pool-dumpxml default > pool.xml

Dumps the XML configuration of the default storage pool in virsh to a file (pool.xml).

linux virtualization libvirt storage #609ec6cd

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 #2a5c4283

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 #2b590b05

dnf clean all --releasever=F41

Clears all cached data for DNF, including metadata and packages, for the specified release version (F41).

linux package-management dnf cleanup #c20fcbb7

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 #5c9282c2

chmod a+x ~/.local/share/gnome-boxes

Adds execute permissions to the ~/.local/share/gnome-boxes directory for all users.

linux file permissions chmod #1232dedb

gnome-extensions -e system-monitor

Enables the system-monitor extension in GNOME, adding system monitoring features to the GNOME Shell.

linux desktop gnome extension #b45785a0

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 #094b12e3

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 #cb42aa5f

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 #6c1382f7

dnf list installed *.i*86

Displays a list of all installed 32-bit packages (matching *.i*86 pattern) using DNF.

linux package-management dnf #76a70c3f

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 #e5d892ff

hwclock --hctosys

Sets the system time to the current hardware clock (real-time clock) time.

linux system time hardware #89028088

hwclock --systohc

Sets the hardware clock (real-time clock) to the current system time.

linux system time hardware #66766685

dnf install @container-tools -y

Installs the @container-tools group package using DNF, automatically agreeing to all prompts.

linux package-management dnf #0bc50f54

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 #5f51af9d

freshclam

Updates the ClamAV virus definitions by running the update command.

linux security antivirus clamav #b6193180

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 #9096cfdc

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 #0afd83dc

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 #b32555c2

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 #a3f14d36

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 #330e47d0

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 #20f672c5

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 #a8dc18d7

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 #a443542f

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 #3195e985

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 #b381dab6

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 #85913104

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 #23908e71

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 #be6154e2

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 #356c441f

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 #f78e87d5

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 #851f73eb

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 #d48e8964

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 #099b1039

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 #22cf338a

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 #4b64993b

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 #ce659245

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 #6fcd43df

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 #c8b98053

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 #7b0bd46f

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.

linux image processing compression gif #38d38e5d

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 #6fa9ae65

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 #dbdc4041

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 #162b5ea4

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 #5401656c

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 #af32efbf

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 #5bd8e417

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 #5642c9b5

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 #1a114b1b

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 #9edbcf30

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 #65970b37

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 #fe55dac4

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 #79dd18df

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 #68cc78a8

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 #b9054245

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 #7656952f

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 #00bea06c

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 #eb435235

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 #7d0c5755

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 #f8341911

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 #1224c259

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 #4bdabbdf

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 #f4139ae9

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 #b42e16b7

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 #a351d919

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 #ba0e6757

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 #5abfefdb

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 #dbec0deb

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 #e4cdeeb4

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 #2bc6083d

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 #1688d948

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 #5db0ce2f

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 #015b7ac9

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 #a1a612df

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 #2bee77b1

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 #811ad63f

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 #13f6459a

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 #ff7d4e6f

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 #5029fb0f

watch -n 2 cpupower monitor

Displays real-time CPU power and frequency data, updating every 2 seconds using cpupower monitor.

linux hardware cpu monitoring #6f270ed4

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 #c247e862

@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 #6ad7ca89

crontab -e -u pretzel

Opens the crontab file for the user pretzel, allowing you to schedule tasks for that user.

linux automation cron #e8537b37

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 #5d591f31

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 #d94598ad

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 #4ea54773

cpupower frequency-set -g performance

Configures the CPU to run at its maximum frequency for optimal performance.

linux hardware cpu performance config #1599faa9

cat /sys/devices/system/cpu/cpufreq/boost

Displays whether CPU frequency boosting is enabled or disabled on the system.

linux hardware cpu power config #0e7fc83a

lscpu

Provides a summary of the system's CPU architecture, including core count, threads, and architecture type.

linux hardware cpu info #64d35d42

cat /proc/cpuinfo

Shows detailed information about the system's CPU, including model, cores, and clock speed.

linux hardware cpu info #851d022d

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 #a94ef2f7

lspci -vvv | grep modules

Shows the kernel modules associated with PCI devices on the system.

linux hardware kernel drivers info #aec60dd8

lsusb -vs 006:001

Displays verbose details about the USB device located at 006:001.

linux hardware usb info verbose #31899f08

lspci -vs 0a:00.0

Displays verbose information about the PCI device located at 0a:00.0.

linux hardware pci info verbose #54a9e63e

lspci | grep VGA

Shows information about the VGA (graphics) device(s) on the system.

linux hardware gpu info #d185b5f4

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 #bb90a72e

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 #ee1bca85

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 #ad632d46

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 #597fa243

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 #46728432

find . -name "*.pdf" -type f -delete

Finds and deletes all .pdf files in the current directory and its subdirectories.

linux file search cleanup find #a97fc556

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 #93c4a104

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 #8ddc5df8

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 #4d8ec548

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 #9bccf2a7

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 #90103a95

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 #abb4eefe

grep -R 'search-string' ~/Some/Path/

Searches for 'search-string' in all files under the specified directory and its subdirectories.

linux text search grep #1b3a0e6e

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 #348ae116

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 #23ff8949

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 #f655da20


↑↑