{"id":50320198,"url":"https://github.com/jchurrocarvalho/utilx","last_synced_at":"2026-05-29T03:03:52.845Z","repository":{"id":314197715,"uuid":"507706639","full_name":"jchurrocarvalho/utilx","owner":"jchurrocarvalho","description":"Utility linux tools and scripts usefull to manage linux boxes and executing commands. Started to be a practise bash scripts. Scripts to agile day by day tasks for users.","archived":false,"fork":false,"pushed_at":"2026-03-02T11:22:01.000Z","size":271,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-02T15:13:40.310Z","etag":null,"topics":["bash","linux","script","userscript","utilities"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jchurrocarvalho.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2022-06-26T23:24:54.000Z","updated_at":"2026-03-02T11:22:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"d865832e-7270-404a-9dba-02da32623a8a","html_url":"https://github.com/jchurrocarvalho/utilx","commit_stats":null,"previous_names":["jchurrocarvalho/utilix","jchurrocarvalho/utilx"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/jchurrocarvalho/utilx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchurrocarvalho%2Futilx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchurrocarvalho%2Futilx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchurrocarvalho%2Futilx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchurrocarvalho%2Futilx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jchurrocarvalho","download_url":"https://codeload.github.com/jchurrocarvalho/utilx/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchurrocarvalho%2Futilx/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33634615,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"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","linux","script","userscript","utilities"],"created_at":"2026-05-29T03:03:48.186Z","updated_at":"2026-05-29T03:03:52.832Z","avatar_url":"https://github.com/jchurrocarvalho.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# utilx\n\nLinux tools and scripts usefull to manage boxes and executing commands. Started to be a practise bash scripts. Scripts to agile day by day tasks for users.\n(Scripts submitted to SAST tools)\n\n# Files\n\n## Apache\n\n- Scripts to get active connections.\n- Check running web servers.\n\n## Certificates and Private / Public Keys\n\nSeveral scripts (cert-*.sh) made to:\n\n- Create and manage keystores.\n- Import certificates and keys to keystores.\n- Keystore migration between JCEKS, JKS, PKCS11, PKCS12 formats.\n- Create PFX files from certificates and keys.\n- Convert PEM to DER.\n- Extract certificates and keys fom PFX file.\n- Extract certificates and keys from P7B2.\n\nSome filenames end with \"-rsa\" to indicate that keys are created or exported using rsa encryption.\nIn future releases will be added equivalent to use elliptic curve (EC).\n\n## git\n\n- git-pull-p.sh: Execute git pull from any other directory / folder.\n- git-pull-r.sh: Execute git pull recursively for directores containing git repositories.\n- git-set-env-nopass.sh: When you execute git pull in a repo protected by a secret and you do not want to stop for secret, skipping in these cases.\n\n## postgres\n\nScripts for:\n\n- Database creation.\n- Maintenance, Analysis and Index.\n- Backup and Restore.\n\nIn order to allow executing the same postgres commands in a machine with different postgres versions, the scripts has a \"-v-\" in the name and one of the arguments is the version. The scripts assume that postgres is installed from official repo.\n\n## Remote command execution\n\n- rcmd.sh\n- rcmd-bulk.sh\n\nThese scripts execute remote command in a remote Unix / Linux machine using ssh. The script rcmd-bulk.sh use the command in a bulk mode through the machines listed in a input file supplied as an argument.\nThe first argument is always the user for execution in the remote machine, the second is the host or input file with hosts list, and at the end is the command to execute.\n\n## scp execution in bulk mode (run in several machines)\n\n- scp-bulk.sh\n- scp-bulk-r.sh\n\nThese are the same. The difference is only related to copy the files recursively. The syntax is the one as scp command. Two files were created only for simplicity.\n\nThe parameters once more are:\n\n- User in the remote machine to login.\n- Input filename for hosts list.\n- Destination path in the remote machine.\n- Sources files or path in the local machine to copy.\n\nNote: Opposite to standard in the Unix / Linux machines copy / move or similar commands related, where the destination is the last path as argument, here destination and source are switched in the position. This was made to permit and simplify the way user fill the source files and paths to copy.\n\n## ssh id copy for several machines\n\n### ssh-copy-id-bulk.sh\n\nUsing a hosts input file as used in rcmd and scp scripts, copy ssh key to remote machines for ssh remote login.\n\n## ACL management\n\nThere are several scripts, setacl*.sh, to manage the acl for files and paths. These scripts in the beginning were created for security and access concerns, because all the time **SECURITY** was the main objective. Meanwhile readling a lot of information and manuals about acl in Linux, I concluded that there are many information out there that can lead to erroneous results. So many tests were made that led to these scripts and bypass one issue that for me, setfacl command is missing, and this is not having an option to distinguish object types like directory or file.\n\nScripts filename format:\n\n- setacls*.sh. Scripts to set acl for several users and groups acl for a path or file.\n- setacl-def*.sh. Manage default acl for several paths.\n- setacl-u*.sh. Set acl for user for several paths.\n- setacl-g*.sh. Set acl for group for several paths.\n- setacl-m*.sh. Set acl mask for several paths.\n\nThe scripts also as an parameter to indicate if mask should be recalculated or not. In bulk mode, executing setfacl commands in a sequence, can be useful to speed up. Beside, in some situations, can be useful to set the mask based on user / owner permissions and not based in group mask which is the default behaviour for setfacl / acl in Linux.\nThe goal is to apply same user permissions as the owner, and group permissions as owner group. The exception are:\n\n- setacl-u-r-dirsonly.sh\n- setacl-u-r-filesonly.sh\n- setacl-g-r-dirsonly.sh\n- setacl-g-r-filesonly.sh\n\nThe above scripts execute setfacl for user (-u-) or group (-g-) applying only for directories or files giving as parameter the permissions to apply. For directories \"setfacl -R ...\" with X (uppercase x - executable definition for dirs) bit in the acl permissions parameter could be one way of doing the job, but depending what is pretended to do, could be risky such as applying write permissions on directories but not on files or vice-versa.\n\n- setacl-remove-all.sh. Remove all acl definitions, including default acl, from path or paths.\n\nRead recomendation: \"https://documentation.suse.com/sles/15-SP7/html/SLES-all/cha-security-acls.html\"\n\n## Others\n\n### find-useful-queries.sh\n\nScript to check permissions in a several ways. This begin to be a first approach to find unnecessary permissions or security holes.\n\n- Permissions for others.\n- Write group permission where user does not have that permission.\n- Execute group permission where user does not have that permission.\n\nMore scripts related to security can be find in admx (https://github.com/jchurrocarvalho/admx) project\n\n# Format for input of hosts list\n(used also in https://github.com/jchurrocarvalho/admx project)\n\nThis format is now used in scripts for remote commands execution such as rcmd-bulk.sh and scp-bulk*.sh.\n\nThe format of the files used as input for such commands are simple as text files with 3 simples rules:\n\n- Prefix \"P\" to indicate the port. Any number after \"P\" until \"H\" or another char (not number) will be assumed as the port where ssh is listening.\n- Prefix \"H\". After it is a string until end of line or until space char to indicate the host.\n- If prefix \"P\" is not present in the line, the ssh default port is assumed (22).\n\nI know this is a very basic \"format\", but it was useful to rapidly build a way for automatization of several maintenance tasks as security updates, certificates updates, log monitoring, etc …\nSo think this as a starting point. In the **TODO** list is included in future release, to adopt a json format somehow standard for hosts list.\n\nProducts to see:\n\n- glpi\n- wazuh\n- otrs\n- Other CMDB tool, or asset manager\n\n# TODO\n(For now ...)\n\n- Introduce the json format for reading host list.\n- Add elliptic curve (EC) for key creation.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjchurrocarvalho%2Futilx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjchurrocarvalho%2Futilx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjchurrocarvalho%2Futilx/lists"}