Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

27 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧰 bash-kit

bash-kit is a lightweight, modular toolkit of Bash utilities β€” easily installable via a single command.


πŸš€ Quick Install

curl -sL https://github.com/ahur-system/bash-kit/raw/main/bkit.sh | sudo bash -s @ install

This will list available tools.

Or install directly:

curl -sL https://github.com/ahur-system/bash-kit/raw/main/bkit.sh | sudo bash -s @ install proxy_watcher

πŸ”§ Available Tools

Tool Description Version
proxy_watcher Continuously fetches and maintains a list of working free proxies v0.1.0
cryptshare Encrypts and decrypts files using OpenSSL (symmetric) v0.0.1
dirstat Analyzes directory and filesystem usage with optional recursive tree view -

🧩 Usage Examples

# List all available tools
curl -sL https://github.com/ahur-system/bash-kit/raw/main/bkit.sh | sudo bash -s @ list

# Install bkit locally for easier use
sudo bash -c "$(curl -sL https://github.com/ahur-system/bash-kit/raw/main/bkit.sh)" @ install bkit

# Then use locally:
bkit list
bkit install proxy_watcher
bkit uninstall proxy_watcher

# Or use directly without installing:
curl -sL https://github.com/ahur-system/bash-kit/raw/main/bkit.sh | sudo bash -s @ install proxy_watcher

# Check running service
sudo systemctl status proxy_watcher

πŸ“ Directory Structure

bash-kit/
β”œβ”€β”€ bkit.sh              # Universal installer/manager
└── tools/
    β”œβ”€β”€ proxy_watcher/
    β”‚   β”œβ”€β”€ proxy_watcher.sh      # Main script
    β”‚   β”œβ”€β”€ README.md             # Tool documentation
    β”‚   └── systemd/
    β”‚       β”œβ”€β”€ proxy-watcher.service
    β”‚       └── README.md
    β”œβ”€β”€ cryptshare/
    β”‚   β”œβ”€β”€ cryptshare.sh          # Main script
    β”‚   └── README.md              # Tool documentation
    └── dirstat/
        β”œβ”€β”€ dirstat.sh            # Main script
        └── README.md             # Tool documentation

πŸ› οΈ Tool Details

proxy_watcher v0.1.0

Continuously fetches and maintains a list of working free proxies with enhanced management capabilities.

Features:

  • Multi-source proxy fetching from 4+ public lists
  • Real-time health monitoring with configurable timeouts
  • Smart caching with healthy.txt and timestamped bad.txt
  • Randomized testing to avoid detection patterns
  • Concurrent checks for faster validation
  • NEW: Proxy setting/unsetting for session or system-wide use
  • NEW: Enhanced IP validation (IPv4/IPv6, octet range checking)
  • NEW: File locking to prevent race conditions
  • NEW: Safe .bashrc modification with backup creation
  • NEW: Dependency checking and signal handling
  • NEW: User-writable data directory (no root required)
  • NEW: Comprehensive logging with timestamps
  • NEW: GNOME proxy support for desktop browsers (Firefox, Chrome)
  • NEW: Smart desktop environment detection with server compatibility
  • NEW: Status command for proxy configuration and connectivity
  • NEW: Version command and proper versioning

Files created:

  • Data: $HOME/.local/share/bash-kit/proxy_watcher/ directory
    • healthy.txt β†’ always-up-to-date working proxies
    • bad.txt β†’ failed proxies with timestamps
    • all.txt β†’ latest fetched raw proxy list
    • *.lock β†’ file locks for concurrent access
  • Backup: $HOME/.bashrc.proxy_watcher.backup (when using --system)

Usage:

# Install and auto-start as systemd service
curl -sL https://github.com/ahur-system/bash-kit/raw/main/bkit.sh | sudo bash -s @ install proxy_watcher

# Basic proxy operations
proxy_watcher healthy    # List working proxies
proxy_watcher bad        # List failed proxies
proxy_watcher all        # List all discovered proxies

# Set/unset proxies (works with shell + GNOME system proxy)
eval "$(proxy_watcher set)"           # Set for current session
proxy_watcher set --system          # Set system-wide
proxy_watcher unset                  # Remove from session (immediate)
proxy_watcher unset --system         # Remove system-wide

# Status and version
proxy_watcher status     # Show proxy configuration and connectivity
proxy_watcher version    # Show version info
proxy_watcher help       # Show usage

# Manual IP checking (use reliable services)
curl https://api.ipify.org        # βœ… Reliable (script default)
curl https://icanhazip.com       # βœ… Reliable
# curl https://ipinfo.io/ip       # ❌ Unreliable (don't use)

# Check service status
sudo systemctl status proxy_watcher

dirstat

Analyzes directory and filesystem usage with optional recursive tree view for quick disk space analysis.

Features:

  • Shows filesystem total, used, and available space
  • Calculates directory usage as percentage of filesystem
  • Recursive tree view of subdirectories sorted by size
  • Human-readable size formatting (B/K/M/G/T)
  • Handles paths with spaces gracefully
  • Uses only standard Linux utilities
  • Visual tree structure with emojis

Usage:

# Install dirstat
curl -sL https://github.com/ahur-system/bash-kit/raw/main/bkit.sh | sudo bash -s @ install dirstat

# Basic directory analysis
dirstat /home

# Recursive tree view
dirstat -r /var/log

# Current directory
dirstat

# Show help
dirstat --help

πŸͺ„ Philosophy

  • Minimal β€” Pure Bash + curl, no external dependencies
  • Modular β€” Each tool is standalone and independent
  • Self-contained β€” Clean installation and uninstallation
  • Universal β€” Works on any Linux system with Bash

πŸ“‹ Requirements

  • Bash 4.0+
  • curl
  • Standard GNU utilities (awk, grep, sort, etc.)

πŸ—‚οΈ Installation Location

Installation Location

Tools are installed to:

  • Tool files: /usr/local/bash-kit/tools/<tool>/
  • Executables: /usr/local/bin/<tool> (symlinked)
  • Additional files: systemd services, documentation, etc.

Made with ❀️ for sysadmins who love simple, effective tools.

About

🧰 A lightweight, modular toolkit of Bash utilities β€” easily installable via a single command

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages