{"id":21130776,"url":"https://github.com/jawaracloud/bash-collections","last_synced_at":"2026-04-20T05:02:00.733Z","repository":{"id":194272423,"uuid":"690470130","full_name":"jawaracloud/bash-collections","owner":"jawaracloud","description":"This repository contains a collection of Bash scripts for various purposes. Feel free to explore and use these scripts as needed.","archived":false,"fork":false,"pushed_at":"2025-12-14T22:06:05.000Z","size":52,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-17T10:54:05.572Z","etag":null,"topics":["bash","bash-script","linux","security","shell","terminal"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jawaracloud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-09-12T08:59:07.000Z","updated_at":"2025-12-14T22:06:09.000Z","dependencies_parsed_at":"2024-12-06T16:28:59.517Z","dependency_job_id":"daf52f27-4c23-4037-a169-9e2bdf2d072c","html_url":"https://github.com/jawaracloud/bash-collections","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"65f5f87e691fdc50c9100db96a4eaa7dc63990d4"},"previous_names":["mrofisr/bash-collections"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jawaracloud/bash-collections","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jawaracloud%2Fbash-collections","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jawaracloud%2Fbash-collections/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jawaracloud%2Fbash-collections/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jawaracloud%2Fbash-collections/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jawaracloud","download_url":"https://codeload.github.com/jawaracloud/bash-collections/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jawaracloud%2Fbash-collections/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32033717,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T00:18:06.643Z","status":"online","status_checked_at":"2026-04-20T02:00:06.527Z","response_time":94,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","bash-script","linux","security","shell","terminal"],"created_at":"2024-11-20T05:38:50.787Z","updated_at":"2026-04-20T05:02:00.723Z","avatar_url":"https://github.com/jawaracloud.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bash Collections\n\nThis repository contains a curated collection of specialized Bash scripts designed for DevOps, cloud infrastructure, and system administration workflows.\n\nThese tools are built to run natively on Unix-like operating systems, leveraging standard CLI utilities to automate routine tasks securely and efficiently.\n\n---\n\n## Tutorials (Getting Started)\n\nIf you are new to this repository, here is how you can start using these scripts immediately.\n\n### Executing a Script\n1. Navigate to the specific directory of the script you want to use.\n2. Read the accompanying `README.md` in that directory to understand its specific requirements and parameters.\n3. Make the script executable:\n   ```bash\n   chmod +x \u003cscript-name\u003e.sh\n   ```\n4. Run the script:\n   ```bash\n   ./\u003cscript-name\u003e.sh\n   ```\n\nEach script is heavily commented and acts autonomously, handling its own errors and output logging.\n\n---\n\n## How-To Guides (Task-Oriented)\n\nThe scripts are organized into specific use cases. Depending on your current task, navigate to the relevant directory:\n\n### Securing \u0026 Monitoring Systems\n*   **06-basic-ufw-rules/** - Configure and enforce basic UFW firewall rules.\n*   **07-simple-ssh-monitor/** - Monitor SSH logs to detect brute-force attempts and blacklist IPs.\n*   **08-certificate-expiration-monitor/** - Monitor SSL certificate expiration dates and trigger alerts.\n*   **17-nginx-log-analyzer/** - Parse and analyze Nginx access logs for traffic anomalies.\n*   **18-disk-space-alert/** - Setup threshold-based alerts for disk usage exhaustion.\n\n### Managing Cloud \u0026 Infrastructure\n*   **09-sync-ecr-between-account-or-profile/** - Synchronize AWS ECR repositories across different AWS accounts.\n*   **11-cleanup-aws/** - Execute a destructive cleanup of unused AWS resources.\n*   **12-aws-s3-backup/** - Push local backups to AWS S3 using AES-256 encryption.\n*   **20-aws-cost-monitor/** - Fetch and monitor daily unblended AWS costs via the CLI.\n\n### Orchestrating Kubernetes\n*   **10-export-kube-yaml-manifest/** - Export active Kubernetes cluster resources into local YAML manifests.\n*   **14-k8s-pod-restart/** - Gracefully restart pod workloads using label selectors.\n*   **22-k8s-namespace-cleaner/** - Clean up stale resources (failed pods, old ReplicaSets) inside specific namespaces.\n\n### Handling Containers \u0026 Docker\n*   **05-install-docker-ubuntu/** - Fully automate the installation of Docker on an Ubuntu host.\n*   **13-docker-logs-rotate/** - Rotate and truncate Docker container logs automatically to save disk space.\n*   **19-docker-image-cleanup/** - Prune and automate the cleanup of dangling Docker images and volumes.\n*   **25-docker-compose-healthcheck/** - Monitor Docker Compose services dynamically based on timeout configurations.\n\n### Database Administration\n*   **15-postgres-backup/** - Generate compressed and automated backups of PostgreSQL databases.\n*   **24-database-connection-tester/** - Rapidly test TCP/authentication connectivity against Postgres, MySQL, Redis, and MongoDB.\n\n### Networking Utilities\n*   **02-find-subdomains/** - Discover subdomains publicly indexed via the crt.sh certificate transparency logs.\n*   **03-socat/** - Manage complex network routing and port forwarding using Socat.\n*   **04-network-namespace/** - Isolate and manage Linux network namespaces.\n*   **21-logs-shipper/** - Ship local logs to remote servers securely via SCP.\n\n### Working with Files \u0026 Git\n*   **01-rename-file-with-same-patern/** - Apply pattern-matching logic to bulk rename specific files.\n*   **23-git-repo-syncer/** - Batch synchronize tracking branches across multiple git repositories simultaneously.\n\n### The 100 Obscure Scripts Collection\nFrom `26-empty-trash` through `125-run-until-fail`, this repository also includes 100 highly specialized, single-file bash scripts for nuanced edge cases (e.g., fast sub-netping, native stopwatch loops, isolated random password generators).\nPlease refer to the specific script foldering from `26` to `125` for highly atomic utility commands.\n\n---\n\n## Reference\n\nEvery script within this repository adheres to a strict design pattern to ensure predictability:\n\n*   **Self-Contained:** Scripts do not rely on complex external dependencies outside of standard POSIX tools (`jq`, `curl`, `awk`, `sed`) or the specific cloud CLI they interact with (`aws`, `kubectl`, `docker`).\n*   **Configuration via Variables:** Core parameters (like thresholds, target namespaces, or AWS regions) are defined clearly as variables at the top of the script files.\n*   **Error Handling:** Implementation of `set -eo pipefail` is standard to prevent cascading failures during execution.\n\n---\n\n## Explanation (Design Principles)\n\nThis collection was built on the philosophy that complex infrastructure automation does not always require high-overhead orchestration tools. Often, a well-written, natively executed Bash script provides the fastest resolution to an outage or a repetitive task. \n\nBy utilizing the native UNIX capabilities (e.g., pipelines, text processing, network sockets), these scripts aim to reduce cognitive load for operators while providing maximum cross-system compatibility.\n\n### Contribution\n\nTo contribute to this collection:\n1. Ensure your script follows the single-responsibility principle.\n2. Provide a dedicated directory prefixed chronologically (e.g., `126-new-script/`).\n3. Include a detailed `README.md` following the Diataxis framework within the folder.\n4. Submit a Pull Request.\n\nContributions expanding on native operations or covering new infrastructure tools are highly welcome.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjawaracloud%2Fbash-collections","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjawaracloud%2Fbash-collections","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjawaracloud%2Fbash-collections/lists"}