Giter Site home page Giter Site logo

deruina / bash_scripts Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 535 KB

Quick Scripts Overview: A playground of bash scripts for image management, trivia gaming, data backup, and log analysis, crafted out of curiosity and love for experimentation.

Shell 100.00%
automation backup bash bash-script linux trivia

bash_scripts's Introduction

bash_scripts

This repository contains a collection of bash scripts for various tasks such as downloading images, playing a trivia game, backing up data, and analyzing web server logs. Each script is designed to perform a specific function and can be run independently or together depending on the needs of the user.

Scripts Included

1. analyze_logfile.sh

An analysis script for Apache web server log files. It extracts and reports various statistics such as successful requests, requests for .zip files, IP addresses, and the most requested URL from Firefox browsers.

Usage: ./analyze_logfile.sh <path_to_logfile> Permissions: chmod +x analyze_logfile.sh

2. backup_script.sh

A backup script that creates compressed archives of specified directories and also backs up a database using a separate script (backup_db.sh which is a replica for mysqldump). The script logs errors and exits with a specific exit code indicating the type of failure.

Usage: ./backup_script.sh Permissions: chmod +x backup_script.sh

backup

3. trivia.sh

A trivia game script that fetches questions from the Open Trivia Database API and presents them to the user. The user can answer questions and earn points based on the difficulty of the question.

Usage: ./trivia.sh Permissions: chmod +x trivia.sh

trivia trivia

4. image_thumbnail.sh

This script attempts to download images from a specified API endpoint and creates thumbnails for each downloaded image. It stops after 10 unsuccessful attempts to download an image.

Usage: ./image_thumbnail.sh Permissions: chmod +x image_thumbnail.sh

Prerequisites

  • Bash: Ensure that you have Bash installed on your system to execute these scripts.
  • jq: The trivia.sh script uses jq to parse JSON responses from the API. Make sure jq is installed.
  • dialog: The trivia.sh script uses dialog for creating menus and message boxes. Install dialog if you plan to use this script.
  • tar: The backup_script.sh script uses tar to create archives. Ensure tar is available on your system.
  • bzip2: The backup_script.sh script uses bzip2 to compress files. Make sure bzip2 is installed.
  • grep: The analyze_logfile.sh script uses grep to analyze log files. Confirm that grep is installed.

Usage

To use any of the scripts, navigate to the directory containing the script and execute it with the appropriate permissions. For example: chmod +x image_thumbnail.sh

bash_scripts's People

Contributors

deruina avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.