$ show xykt/HardwareQuality
This repository contains a comprehensive hardware diagnostic and benchmarking tool implemented as a single bash script (hardware.sh). The tool collects detailed system information including OS, virtualization, motherboard, CPU, GPU, memory, and storage devices. It runs performance benchmarks using sysbench, fio, and Geekbench5 to evaluate hardware quality, presenting results in a formatted terminal interface with optional JSON output for further analysis. The script features robust dependency handling, automatic installation of missing tools, and cross-platform support for numerous Linux distributions. It demonstrates strong bash scripting practices with sophisticated progress bars, intelligent fallback mechanisms for network services, and modular design for gathering diverse system metrics.
The LLM identified 3 files worth highlighting for reuse:
The IP detection functions (get_ipv4, get_ipv6) and hiding functions (hide_ipv4, hide_ipv6) implement a robust pattern for obtaining public IP addresses with multiple fallback services, timeout handling, and error checking. This isolated component demonstrates non-obvious skill in network resilience design and could be easily extracted for use in other scripts requiring external IP detection.
The progress bar implementation (show_progress_bar, show_progress_bar_) creates a sophisticated visual indicator using Unicode block characters with dynamic length adjustment, custom status message display, and special handling for upload progress. This component demonstrates advanced bash scripting techniques for terminal UI and could be reused in other CLI tools requiring progress visualization.
The byte formatting functions (fmt_bytes, fmt_rw) provide portable, human-readable formatting of byte values with automatic unit selection (B, KB, MB, etc.). They use numfmt when available with an awk fallback, demonstrating consideration for cross-environment compatibility. These self-contained utility functions solve a common formatting problem and could be easily extracted to other projects.