Skip to content

feat: expand LinuxScripts into a complete Linux utility toolkit - #2

Closed
ashishsinghbora wants to merge 39 commits into
mainfrom
feat/linux-toolkit
Closed

ashishsinghbora wants to merge 39 commits into
mainfrom
feat/linux-toolkit

Conversation

@ashishsinghbora

Copy link
Copy Markdown
Owner

Summary

This pull request expands LinuxScripts from an initial loose collection of 5 scripts into a professional, modular, reliable, and beginner-friendly Linux utility toolkit. All legacy root-level scripts have been migrated into structured categories under scripts/, 34 new standalone utilities have been implemented, a unified interactive CLI dashboard (bin/linux-toolbox) has been introduced, and an automated regression validation harness with GitHub Actions CI has been added.

What changed

1. System (scripts/system/)

  • system-info.sh: Reorganized with robust multi-distro identification and hostname fallback.
  • system-health.sh: Real-time health metrics including CPU, RAM, root disk, load average, and active systemd triage.
  • kernel-info.sh: Kernel release, architecture, and loaded kernel modules.
  • boot-info.sh: Boot times and systemd startup performance breakdown.
  • failed-services.sh: Lists all currently degraded or failed systemd services.

2. Storage (scripts/storage/)

  • disk-usage.sh: Human-readable mounted filesystem utilization.
  • find-large-files.sh: Finds largest files exceeding size thresholds with configurable directory and count.
  • directory-size.sh: Computes disk usage of specific directories.
  • inode-usage.sh: Tracks filesystem inode utilization and alerts on >90% exhaustion.
  • mount-info.sh: Detailed mount points, options, and block device details via findmnt.
  • filesystem-info.sh: Reports filesystem types, mount options, and UUIDs.
  • disk-health.sh: SMART disk diagnostics via smartctl with permission and status reporting.

3. Networking (scripts/network/)

  • network-info.sh: Network interfaces, IP addresses, default routing, and active DNS servers.
  • ping-test.sh: ICMP reachability and latency checks with configurable counts.
  • dns-test.sh: DNS resolution validation with dig or nslookup.
  • port-check.sh: TCP port availability check with /dev/tcp or nc fallback.
  • route-info.sh: Kernel IP routing tables and gateway inspection.
  • internet-test.sh: WAN connectivity verification via HTTP/HTTPS endpoints.
  • listening-ports.sh: Inspects open listening sockets via ss and netstat.
  • network-diagnostics.sh: Comprehensive automated network triage suite.

4. Process (scripts/process/)

  • process-info.sh: Top CPU and memory consuming processes.
  • kill-process.sh: Safe process termination with search filtering, custom signal options, and confirmation prompts.

5. Packages (scripts/packages/)

  • update-system.sh: Cross-distro system updates with dry-run support (-n).
  • install-package.sh: Safe package installation with user confirmation across supported managers.
  • remove-package.sh: Safe package removal with user confirmation across supported managers.
  • search-package.sh: Queries package repositories for keywords.
  • package-info.sh: Package version, status, and dependency inspection.
  • package-manager-info.sh: Detects active system package manager and version.

6. Hardware (scripts/hardware/)

  • hardware-summary.sh: Aggregates CPU, GPU, memory, block, and USB information.
  • cpu-info.sh: Detailed CPU architecture, model, cores, and frequencies.
  • gpu-info.sh: PCI graphics adapters and OpenGL renderers.
  • memory-info.sh: Human-readable memory statistics and /proc/meminfo metrics.
  • usb-devices.sh: Lists USB devices via lsusb or sysfs fallback.
  • pci-devices.sh: Lists PCI devices via lspci.
  • battery-info.sh: Power supply and battery capacity/status reporting.

7. SSH (scripts/ssh/)

  • ssh-key-setup.sh: Generates secure Ed25519/RSA key pairs with overwrite protection.
  • ssh-config-check.sh: Validates client SSH configuration syntax.
  • ssh-host-info.sh: Queries remote host fingerprints using ssh-keyscan.
  • ssh-hardening-check.sh: Strictly read-only audit of sshd_config against best-practice security baselines.

8. Developer Tools (scripts/developer/)

  • dev-environment-info.sh: Scans for compilers, runtimes (Python, Node, Go, Rust, Java), and container engines.
  • git-info.sh: Displays Git version, user config, and current repository status.
  • docker-info.sh: Docker daemon, container, and image status reporting.
  • python-info.sh: Python 3 runtime, active virtualenv, and installed pip packages.
  • node-info.sh: Node.js, npm version, and global package modules.
  • command-exists.sh: Fast path resolution and command presence checker.

9. Maintenance (scripts/maintenance/)

  • cleanup-cache.sh: Cleans user and temporary caches safely with user confirmation.
  • backup.sh: Creates compressed .tar.gz archives of directories with timestamps.
  • extract.sh: Universal archive extraction supporting .tar, .zip, .gz, .bz2, .xz, and .7z.
  • file-organizer.sh: Categorizes loose files by extension into clean folders, with dry-run support.
  • log-inspect.sh: Inspects and filters system and application logs with tail/grep controls.

10. Interactive Dashboard (bin/linux-toolbox)

  • Keyboard-friendly terminal UI categorized into 9 domains.
  • Resolves paths relative to repository root independent of working directory.
  • Passes user arguments safely to target scripts without unsafe eval.

11. Testing & Quality Assurance (tests/, .github/)

  • tests/test_all.sh: Automated test runner verifying bash syntax, executable bits, and --help responses across all 39 scripts.
  • .github/workflows/shellcheck.yml: GitHub Actions workflow running automated ShellCheck and the test suite.

12. Documentation

  • Comprehensive README.md with complete reference table, quick start, and safety philosophy.
  • Community guidelines in CONTRIBUTING.md, security disclosure policy in SECURITY.md, and LICENSE (MIT).

Testing

  • Syntax validation: Verified bash -n on all 39 scripts and bin/linux-toolbox (0 errors).
  • Test suite: Ran bash tests/test_all.sh across all scripts (50/50 test assertions passed).
  • Smoke tests: Tested individual scripts on live Linux environment including hardware summary, process inspection, file organizer, and toolbox menu.
  • Path validation: All README command examples and file paths verified against actual repository tree.

Safety

  • All inspection and diagnostics scripts are strictly read-only.
  • Destructive operations (kill-process.sh, cleanup-cache.sh, remove-package.sh, install-package.sh) prompt for confirmation before modifying the system.
  • ssh-hardening-check.sh is strictly read-only and never alters or overwrites SSH configurations.
  • Scripts use strict variable quoting to avoid word splitting and path traversal issues.

Compatibility

Supported distributions and package managers tested:

  • Arch Linux (pacman)
  • Debian / Ubuntu / Linux Mint (apt)
  • Fedora / RHEL (dnf)
  • openSUSE (zypper)

Files

  • bin/: CLI dashboard
  • scripts/: Modular scripts categorized by domain
  • tests/: Automated test suite
  • .github/workflows/: CI testing pipeline
  • Root documents: README.md, LICENSE, CONTRIBUTING.md, SECURITY.md

Validation

Final local validation result:

  • Syntax errors: 0
  • Failing tests: 0 (100% passed)
  • Uncommitted files: 0
  • Clean git diff: Yes

@ashishsinghbora

Copy link
Copy Markdown
Owner Author

Maintainer Review & Verification Summary

1. What was implemented

  • Reorganization: Moved legacy root scripts into clean, category-based subdirectories (scripts/{system,storage,network,process,packages,hardware,ssh,developer,maintenance}/).
  • New Utilities: Added 34 new production-ready utilities covering deep system triage, filesystem and SMART storage health, end-to-end network diagnostics, cross-distro package management, hardware profiling, SSH key management and hardening audits, developer runtimes, and system maintenance.
  • Interactive Toolbox: Implemented bin/linux-toolbox providing an intuitive terminal menu for running any script without modifying the current working directory.
  • Test Suite & CI: Developed tests/test_all.sh for automated syntax checks, permission enforcement, and help flag validation. Added GitHub Actions CI workflow (.github/workflows/shellcheck.yml).
  • Documentation & Standards: Updated README.md with complete reference tables, added CONTRIBUTING.md, SECURITY.md, and LICENSE. All scripts follow set -euo pipefail and clean error handling.

2. What was tested

  • Syntax verification: bash -n executed across every .sh script and bin/linux-toolbox (0 syntax errors).
  • Automated test suite: bash tests/test_all.sh executed against all scripts (50/50 tests passed).
  • Execution & Smoke tests: Tested --help flags, safe non-destructive read operations, dry-run flags (-n), and interactive menus.
  • Git integrity: Verified git diff --check and git status (clean tree, no uncommitted changes, no secrets or accidental files).

3. Final test result

  • Syntax: 0 errors
  • Test Suite: 50/50 passed (100% success rate)
  • Branch status: Pushed to feat/linux-toolkit with 39 atomic, logical commits.

4. Known limitations

  • Systemd-dependent tools (boot-info.sh, failed-services.sh) gracefully report when running on non-systemd init systems (SysVinit, OpenRC).
  • Elevated inspection features (e.g. SMART diagnostics on certain drives or system package operations) require sudo permissions when run.

@ashishsinghbora

Copy link
Copy Markdown
Owner Author

All feature components from this umbrella pull request have been individually reviewed, verified, and merged into main across PRs #3 through #27. Closing this umbrella PR as fully integrated.

@ashishsinghbora
ashishsinghbora deleted the feat/linux-toolkit branch September 24, 2026 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant