{"id":20880118,"url":"https://github.com/michprac/bash_learning","last_synced_at":"2026-04-29T03:31:50.434Z","repository":{"id":220173390,"uuid":"749996441","full_name":"Michprac/BASH_learning","owner":"Michprac","description":"BASH scripts, learning repositorium","archived":false,"fork":false,"pushed_at":"2024-02-11T21:51:23.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-31T21:13:43.919Z","etag":null,"topics":["bash","scripting"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"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/Michprac.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}},"created_at":"2024-01-29T19:44:01.000Z","updated_at":"2024-02-10T15:29:53.000Z","dependencies_parsed_at":"2024-11-18T07:29:40.129Z","dependency_job_id":null,"html_url":"https://github.com/Michprac/BASH_learning","commit_stats":null,"previous_names":["michprac/bash_learning"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Michprac/BASH_learning","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Michprac%2FBASH_learning","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Michprac%2FBASH_learning/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Michprac%2FBASH_learning/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Michprac%2FBASH_learning/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Michprac","download_url":"https://codeload.github.com/Michprac/BASH_learning/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Michprac%2FBASH_learning/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32409084,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T02:37:21.628Z","status":"ssl_error","status_checked_at":"2026-04-29T02:36:50.947Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","scripting"],"created_at":"2024-11-18T07:19:05.541Z","updated_at":"2026-04-29T03:31:50.404Z","avatar_url":"https://github.com/Michprac.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BASH learning\n\nIn this repositorium, I'm trying to learn something about bash scripting.\n\n## Script add-local-user.sh\n\n- *Input:* You have no need to put any arguments, just call this script in your terminal.\n- *Functionality:* This script is based on entering different parameteres (like USERNAME, PASSWORD and REAL NAME) by user to the terminal, using ``read -p`` command. Also there is some checking conditions, for example for if the user has superuser previleges.\n- *Output:* In the output, user get displaying username, password and host.\n\n## Script add-new-local-user.sh\n\nThis script is developing of the previous, but the goal remains the same, which is creating an account on the local system.\n- *Input:*  You have to put at least one argument, which is USER_NAME and optionally supply some comments, for example real name of the user.\n- *Functionality:* Compared to the previous script, here user data is taken as an argument. The password is generating automatically, using the hashed current date in \"seconds + nanoseconds\".\n- *Output:* In the output, user get displaying username, password and host, like in the previous script one.\n\n## Script add-newer-local-user.sh\n\nThis script is modification of the previous for creating a new account, but with some modifications, which is adding some STD IN/OUT/ERR commands\n- *Input:*  As it was in previous script, you have to put at least one argument (USER_NAME and optionally comments)\n- *Functionality:* A special features were added to this script, like redirecting some messages to the STDERR (Standard error) using command ``1\u003e\u00262``.\n- *Output:* In the output, user get only username, password and host. Everything else is hiden by sending to the /dev/null using ``\u0026\u003e /dev/null`` after ``echo`` or other commends, for example ``useradd``.\n\n## Script disable-local-user.sh\n\nIn this script one new command was used, which is called ``getopts``. This command is useful, when user want to realize some scenarios with different flags. For example ``command -l -s`` ( in this case it's better to use ``getopts`` function neither writing a huge piece of code using case-statement).\n\n- *Input:* User should choose any option from the list ( -d for deleting, -r for removing home directory, -a for archiving)\n- *Functionality:* The script is based on two main commands, that is ``getopts`` and ``for loop``. The first one is used for option processing and the second one for arguments processing, namely usernames.\n- *Output:* In the output user can get archives of the users' accounts or deleted/disabled account. Also every step of the perfoming is  displayed in the terminal.\n\n## Script show-attackers.sh\n\nIn this script some string editing commands where introduced like ``awk``, ``sort`` and ``uniq``.\n\n- *Input:* User should provide a file with some log information like failed attempts with IP addresses.\n- *Functionality:* This script counts how many failed attempts occured for different IP addresses. If this number is greter then defined variable LIMIT, then in the output user get csv format information.\n- *Output:* User can get csv type of displaying information about failed login attempts. The view of the display is like count,IP,Location.\n\n## Script show-attackers.sh\n\nThis script can help user to run multiple commands on many servers automatically. Prerequistes: user should have a file (Or use a default ``/vagrant/servers``} for listing all servers' names\n\n- *Input:* User should provide a file with the names of the servers, any command for executing and additionally choose some option lik ``-v`` (displaying the name of procesing server)\n- *Functionality:* The script is based on for loop, run through all supplied server names and perform different scenario according to the user choice\n- *Output:* User can get some information displayed and the results of executing commands on other servers\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichprac%2Fbash_learning","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichprac%2Fbash_learning","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichprac%2Fbash_learning/lists"}