Skip to content

sundanc/auto_scripts

Repository files navigation


Automation Scripts Operations Specialist

Author GitHub Status

⭐ Please star if you find this useful ⭐
📋 Original content - Attribution required if used or modified 📋

Buy Me a Coffee

Auto-Scripts Collection

A collection of useful automation scripts for system administration, development, and DevOps tasks.

IT Arsenal Command Center

The IT Arsenal is a unified command center that brings all scripts together into a cohesive toolkit. This central interface makes it easy to access all scripts in one place, with consistent logging, configuration, and execution handling. Check my blog post

This blog post covers:

  • Installation and setup
  • Detailed usage instructions for all tool categories
  • Advanced features and integrations
  • Creating your own arsenal-compatible scripts
  • Troubleshooting common issues
  • Best practices for IT automation

Whether you're new to the toolkit or looking to master advanced features, this comprehensive guide will help you leverage the full power of the IT Arsenal.

To launch the arsenal:

chmod +x arsenal.sh
./arsenal.sh

The arsenal provides:

  • Menu-driven access to all tools
  • Unified logging system
  • Centralized configuration
  • Error handling and notifications
  • Easy script execution

What's New: Enhanced Reliability Features

System Compatibility Checker

IT Arsenal now includes a robust compatibility checker that verifies if your system meets the requirements to run each script. This helps prevent issues before they occur by checking:

  • Required dependencies and tools
  • Operating system compatibility
  • User privilege requirements
  • Version requirements for critical tools

How to use:

  1. Automated checks - Every script is checked before execution
  2. System-wide scan - From the main menu, select option 9 to check compatibility of all scripts
  3. Direct usage - Run ./lib/compatibility_checker.sh script_name.sh to check a specific script

Key Benefits:

  • Prevents script failures due to missing dependencies
  • Provides customized installation commands for your specific OS
  • Alerts you to permission requirements before execution
  • Saves time by identifying issues proactively

Advanced Script Debugging

The new script debugging tool (system/script_debug.sh) offers comprehensive script analysis:

# Debug a specific script
./system/script_debug.sh -s system/vm.sh

# Check all scripts in a category
./system/script_debug.sh -c system

# Full system analysis
./system/script_debug.sh -a

Debugging Capabilities:

  • Syntax validation without execution
  • Dependency verification
  • Static code analysis
  • Best practices checks
  • Execution recommendations
  • Code quality suggestions

Seamless Integration with IT Arsenal

When a script fails, the arsenal now offers to run a detailed compatibility check to help diagnose and resolve issues. This provides:

  • Immediate feedback on what went wrong
  • Clear steps to resolve dependencies
  • Installation guidance specific to your OS
  • User-friendly explanations of complex requirements

Comprehensive Tutorial

We've created a detailed tutorial to help you get the most out of the IT Arsenal:

How to Use IT Arsenal: Your One-Stop IT Automation Solution

Directory Structure

  • system/ - Scripts for system administration tasks
  • development/ - Scripts for development workflows and tools
  • devops/ - Scripts for deployment and CI/CD automation
  • database/ - Scripts for database management and maintenance
  • lib/ - Shared libraries and utilities
    • common.sh - Core functions used across all scripts
    • compatibility_checker.sh - NEW! Script compatibility verification
  • config/ - Configuration files
  • logs/ - Log files generated by the arsenal and scripts
  • docs/ - Documentation and tutorials
  • templates/ - Starter templates for creating new scripts
  • plugins/ - Extensibility system for custom functionality
  • tests/ - Unit and integration tests for critical functions

Available Scripts

System Administration

Script Description
vm.sh Enhanced VM detection script that checks for hypervisors, virtual hardware signatures, network adapters and container environments.
uptime.sh Displays system uptime and boot time in a human-readable format.
updateupgrade.sh Simple apt package update and upgrade script with colored output.
syshealth.sh Advanced system health monitoring with adaptive thresholds based on historical data. Includes CPU, memory, disk usage and load average tracking.
sys_monitor.sh Simple system monitoring script that logs system statistics every 5 seconds.
health_check.sh Service health check that verifies if nginx is running and starts it if needed.
disk_usage.sh Monitors disk usage and alerts when partitions exceed the defined threshold (85%).
connectivity_check.sh Checks network connectivity to a specified host and logs the result.
security_audit.sh Comprehensive security audit tool that scans for common vulnerabilities and configuration issues.
network_diagnostics.sh Advanced network troubleshooting tool that performs comprehensive diagnostics including interface information, DNS resolution, connectivity tests, gateway testing, route analysis, speed testing, and hardware checks.
log_analyzer.sh Powerful log analysis tool that identifies error patterns, authentication failures, service restarts, and resource issues in system logs with detailed reporting.
system_benchmark.sh Complete system performance benchmark tool measuring CPU, memory, disk, and network performance with detailed metrics and reports.
script_debug.sh NEW! Advanced script diagnostics tool for analyzing dependencies, compatibility, and potential problems in any script.

Development Tools

Script Description
git_branch_management.sh Interactive git branch management tool for creating, deleting, and merging branches. Includes safety checks and confirmation prompts.
autogit.sh Streamlines the git workflow by automating add, commit, and push operations with interactive prompts.
create_env.sh Creates and activates a Python virtual environment for development projects.

DevOps & Deployment

Script Description
ci_cd_auto.sh Comprehensive CI/CD automation system with branch management, testing, code quality checks, and deployment capabilities.
deploy.sh Deploys an application from a git repository to a target server with options for branch selection and service restart.
backup.sh Simple file backup script that creates timestamped backup directories.

Database Management

Script Description
database_backup.sh MySQL database backup utility that creates timestamped SQL dumps.
autodb.sh Advanced database maintenance script with backup, optimization, connection monitoring, and performance reporting features.

Library Functions

The lib/common.sh provides shared functionality for all scripts, including:

  • Configuration management
  • Logging functions
  • System monitoring utilities
  • File management helpers
  • User interaction tools
  • Network utilities

The new lib/compatibility_checker.sh provides:

  • Dependency verification
  • OS compatibility checks
  • User privilege validation
  • Installation recommendations

To use these functions in your own scripts:

source "$(dirname "$0")/../lib/common.sh"
source "$(dirname "$0")/../lib/compatibility_checker.sh"

Usage

Most scripts can be executed directly after making them executable:

chmod +x script_name.sh
./script_name.sh

However, it's recommended to use the IT Arsenal command center to execute scripts for consistent logging, error handling, and compatibility verification.

Contributing

Feel free to contribute to this collection by adding new scripts or improving existing ones. Please follow these guidelines:

  • Add clear comments to your script
  • Include error handling where appropriate
  • Use consistent formatting
  • Document any dependencies or prerequisites
  • Add compatibility information for the compatibility checker

License

These scripts are provided as-is under the MIT license. Use at your own risk.

About

A unified automation command center for system administration, development, and DevOps tasks.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages