{"id":21047071,"url":"https://github.com/thecalcaholic/bash-utils","last_synced_at":"2025-05-15T19:31:38.943Z","repository":{"id":79248785,"uuid":"174544352","full_name":"theCalcaholic/bash-utils","owner":"theCalcaholic","description":"Various shell script utilities I've come to write over the years to make life easier","archived":false,"fork":false,"pushed_at":"2023-08-10T13:35:22.000Z","size":111,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-03T13:38:31.221Z","etag":null,"topics":["bash","csv","dyndns","gcp","gsutil","inotify","iperf3","keepass-mounter","nautilus","networking","pulseaudio","security","utility"],"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/theCalcaholic.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}},"created_at":"2019-03-08T13:41:31.000Z","updated_at":"2025-03-05T17:14:42.000Z","dependencies_parsed_at":"2024-11-19T14:51:46.691Z","dependency_job_id":null,"html_url":"https://github.com/theCalcaholic/bash-utils","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theCalcaholic%2Fbash-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theCalcaholic%2Fbash-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theCalcaholic%2Fbash-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theCalcaholic%2Fbash-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theCalcaholic","download_url":"https://codeload.github.com/theCalcaholic/bash-utils/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254407377,"owners_count":22066228,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","csv","dyndns","gcp","gsutil","inotify","iperf3","keepass-mounter","nautilus","networking","pulseaudio","security","utility"],"created_at":"2024-11-19T14:35:21.416Z","updated_at":"2025-05-15T19:31:38.925Z","avatar_url":"https://github.com/theCalcaholic.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# BASH UTILS\n\n*A random collection of scripts I have written over the years*\n\n## Installation\n\nSimply clone this repository or download the scripts you need from this repository's \n[releases](https://github.com/theCalcaholic/bash-utils/releases).\n\nDon't forget to set executable permissions (`chmod +x`). :)\n\nIf you cloned it, you can add the following line to your ~/.bashrc:\n\n```sh\n. /path/to/cloned/repo/bash_aliases\n. /path/to/cloned/repo/bash_aliases_auto\n```\n\nThat will give you bash aliases for all the scripts in the repo.\n\n## Scripts\n\n- [anonymize-columns.sh](#anonymize-columnssh)\n- [apt-install-temp.sh](#apt-install-tempsh)\n- [bundle-script.sh](#bundle-scriptsh)\n- [check-cert.sh](#check-certsh)\n- [collect-bucket-permissions.sh](#collect-bucket-permissionssh)\n- [collect-service-account-keys.sh](#collect-service-account-keyssh)\n- [delete-bridge.sh](#delete-bridgesh)\n- [du-tool.sh](#du-toolsh)\n- [dyndns-update.sh](#dyndns-updatesh)\n- [exec-on-change.sh](#exec-on-changesh)\n- [fp-nvim-launcher.sh](#fp-nvim-launchersh)\n- [gcp-list-projects-in-folder.sh](#gcp-list-projects-in-foldersh)\n- [gcp-update-project-ssh-key-in-folder.sh](#gcp-update-project-ssh-key-in-foldersh)\n- [gcp-update-project-ssh-key.sh](#gcp-update-project-ssh-keysh)\n- [generate-bash-aliases.sh](#generate-bash-aliasessh)\n- [generate-readme.sh](#generate-readmesh)\n- [git-replace-author.sh](#git-replace-authorsh)\n- [gs-touch.sh](#gs-touchsh)\n- [iperf-log.sh](#iperf-logsh)\n- [keepass-mounter.sh](#keepass-mountersh)\n- [keepassxc-open-all-urls.sh](#keepassxc-open-all-urlssh)\n- [lower-vpn-priority.sh](#lower-vpn-prioritysh)\n- [prime-render-offload.sh](#prime-render-offloadsh)\n- [reload_touchpad_driver_lenovo.sh](#reload_touchpad_driver_lenovosh)\n- [setup-secure-dump.sh](#setup-secure-dumpsh)\n- [show-gcs-bucket-modification-times.sh](#show-gcs-bucket-modification-timessh)\n- [start-when-available.sh](#start-when-availablesh)\n- [toggle-ssh-jumpserver.sh](#toggle-ssh-jumpserversh)\n- [treediff.sh](#treediffsh)\n- [virtual-mic.sh](#virtual-micsh)\n- [whats-my-ip.sh](#whats-my-ipsh)\n---\n### anonymize-columns.sh\n\n```yaml\nReplaces specific columns in a csv table with generic data in the same format\nby mapping '0-9' -\u003e '0', 'a-z' -\u003e 'a' and 'A-Z' -\u003e 'A'\n\nUSAGE:\n  anonymize-columns [OPTIONS] columns file\ncolumns:\n  A comma separated list of column ids to anonymize\n  file:\n  The csv file to anonymize\n\n  Options:\n    -d, --delimiter \u003cdelimiter\u003e Delimiter to split table by\n    -s, --skip-header Ignore (Don't change) first row table\n```\n\n### apt-install-temp.sh\n\n```yaml\nInstall apt packages and marks them as automatically installed (to allow easy removal via apt autoremove)\n\nUSAGE:\n  apt-install-temp.sh package [package [...]]\n```\n\n### bundle-script.sh\n\n```yaml\nBundles a script with it's dependencies (meant to be used for scripts from https://github.com/theCalcaholic/bash-utils)\n\nUSAGE:\n  bundle-script.sh [OPTIONS] input output [dependency [dependency [...]]]\n\n  input      path to the original script\n  output     path to save the bundled script at.\n  dependency path to a dependency to bundle\n\n  Options:\n    --check, -c If provided, the bundled script will be called with the given arguments to\n                check if it works (i.e. returns with exit code 0).\n    --gzip, -z  Use additional gzip compression for bundled scripts\n    --exit, -e  The expected exit code if the script is working (requires --check)\n```\n\n### check-cert.sh\n\n```yaml\nGet openssl information on x509_cert_file\n\nUSAGE:\n  check-cert.sh x509_cert_file\n```\n\n### collect-bucket-permissions.sh\n\n```yaml\n\u003cNo description found\u003e\n\nUSAGE:\n  USAGE:\n  collect-bucket-permissions [OPTIONS]\n\n  Options:\n      -p, --project project_id Use the specified project instead of your gcloud default\n      -o, --output format Change output format. Can be one of 'yaml', 'spaced', 'spaced-40', 'spaced-80' and 'spaced-120'\n      --sa-project For service accounts also print the project which contains it (given the permissions)\n\nNote: You need to be logged into gcloud (gcloud auth login) when executing this command!\n```\n\n### collect-service-account-keys.sh\n\n```yaml\n\u003cNo description found\u003e\n\nUSAGE:\n  USAGE:\n  collect-service-account-keys [OPTIONS]\n\n  Options:\n      -p, --project project_id Use the specified project instead of your gcloud default\n\nNote: You need to be logged into gcloud (gcloud auth login) when executing this command!\n```\n\n### delete-bridge.sh\n\n```yaml\nDeletes given bridge\n\nUSAGE:\n  delete-bridge.sh bridge-id\n```\n\n### du-tool.sh\n\n```yaml\nLists sorted, human-readable sizes of subdirectories\n\nUSAGE:\n  du-tool.sh [PATH] \n    PATH             The path to analyze\n```\n\n### dyndns-update.sh\n\n```yaml\nChecks for each configured dynDNS domain if it is pointing at the current ip and otherwise calls an http endpoint for updating it.\n\nUSAGE:\n  dydns-update.sh\n  (Configuration inside the script)\n```\n\n### exec-on-change.sh\n\n```yaml\nExecute CMD whenever a file within DIR has been changed.\n\nUSAGE:\n  exec-on-change.sh directory command [OPTIONS]\n  directory: Path to watch for changes\n  command: Command to execute\n\n  OPTIONS:\n    --help, -h: Show this message\n```\n\n### fp-nvim-launcher.sh\n\n```yaml\nScript to rund the flatpak version of nvim and give it arbitrary permissions for the target (file or directory) path\n\nUSAGE:\n  fp-nvim-launcher.sh target-path\n```\n\n### gcp-list-projects-in-folder.sh\n\n```yaml\nLists all projects contained in a GCP folder or its subfolders\n\nUSAGE:\n  gcp-list-projects-in-folder.sh folder_id\n\n  folder_id: The id of the root folder that should be searched\n```\n\n### gcp-update-project-ssh-key-in-folder.sh\n\n```yaml\n\u003cNo description found\u003e\n\nUSAGE:\n  gcp-update-project-ssh-key-in-folder.sh [OPTIONS] command folder user ssh-public-key\n\n  command         'add' if the user/public key should be added to projects where it doesn't exist yet\n                  or 'replace' if existing ssh-public-keys for the user should be replaced\n  folder          The id of the gcp folder which contains all projects that the ssh public key should\n                  be rolled out to\n  user            The ssh user\n  ssh-public-key  The ssh public key\n\n  Options:\n    --blacklist \"project1 [project2 [...]]\" A space separated list of project ids to not rollout any ssh public keys to\n    --non-interactive Ask for confirmation before making any changes (disabling is potentially dangerous!)\n\n```\n\n### gcp-update-project-ssh-key.sh\n\n```yaml\nReplaces or updates the ssh key for a specific user in the metadata of a Google Project\n\nUSAGE:\n  gcp-update-project-ssh-key.sh [OPTIONS] command project-id user ssh-public-key\n\n  command             The command to perform. One of add (adds the key if there wasn't any\n                      configured for the given user yet), replace (replaces any old key of the user)\n  project-id          The project containing the metadata to edit\n  user                The ssh user name of the user of which to replace the public key\n  ssh-public-key      The public key to replace the old one with\n\n  Options:\n    --non-interactive Don't ask for confirmation before making any changes (potentially dangerous!)\n    --help            Show this help message\n```\n\n### generate-bash-aliases.sh\n\n```yaml\n\u003cNo description found\u003e\n\nUSAGE:\n  generate-bash-aliases.sh \u003e bashrc\n\n  Options:\n    --output, -o path File to write to\n```\n\n### generate-readme.sh\n\n```yaml\n\u003cNo description found\u003e\n\nUSAGE:\n  generate-readme.sh\n```\n\n### git-replace-author.sh\n\n```yaml\n\u003cNo description found\u003e\n\nUSAGE:\n  git-replace-author.sh [OPTIONS] old-email new-name new-email\n\n  old-email: The email of the author to replace\n  new-name: The new author's name\n  new-email: The new author's email\n\n  Options:\n    -f, --force Overwrite the backup from a previous run\n    -h, --help  Show this help message\n```\n\n### gs-touch.sh\n\n```yaml\nMove file in GCS bucket in order to trigger events (e.g. for cloud functions)\n\nUSAGE:\n  gs-touch.sh file-uri\n\n  file-uri gs uri for file, e.g. gs://my-storage-bucket/foo.bar\n```\n\n### iperf-log.sh\n\n```yaml\nChecks the download and upload rates against a given target (where an iperf daemon needs to be running) and prints it in a parseable format together with the current gateway mac address (to allow filtering for networks)\n\nUSAGE:\n  iperf-log.sh target username rsa-public-key-path\n\n    target: The target IP to test up-/download rates against (requires iperf to be running on the target host)\n    username: The username to use for authentication at the target host\n    rsa-public-key-path: The path to the public key that will be used for encrypting the iperf credentials\n\n    If the file $HOME/iperf_pw exists, it will be expected to contain a valid iperf password for the target host. Otherwise, the script will ask for the password interactively.\n```\n\n### keepass-mounter.sh\n\n```yaml\nScript to mount a network (e.g. sshfs/davfs) directory and subsequently start keepass with a vault in said directory\n\nRequires \n  - the flatpak version of KeepassXC to be installed (or whatever version is passed via the -c argument)\n  - an fstab entry for the desired mount point (using davfs2)\n\nUSAGE:\n  keepass-mounter.sh mount-point db-file [OPTIONS]\n\n  mount-point The directory to mount the remote storage into\n  db-file     The path to your keepass vault (relative to the mount point)\n\n  Options:\n      -b, --backup  A path for storing a database backup\n      -c, --command The command for executing keepass (defaults to the flatpak version of keepass).\n                    '--DB_PATH--' will be replaced with the path to the password database.\n      -h, --help    Show this help message\n\nExample:\n  keepass-mounter.sh /media/myUser/keepass myvault.kdbx -b ~/keepass-backups\n```\n\n### keepassxc-open-all-urls.sh\n\n```yaml\nInteractively open the urls for all passwords within a keepass database file (requires keepassxc.cli)\n\nUSAGE:\n  keepassxc-open-all-urls.sh [OPTIONS] keepass-db\n\n    keepass-db The path to the keepass database that should be parsed\n\n    Options:\n      -b, --browser \u003cbrowser-command\u003e   The command to launch your browser. Will be called as such: '\u003ccommand\u003e %url%'\n      -c, --cli \u003ckeepassxc.cli-command\u003e The command to execute keepassxc.cli. Not required if it can be found in your system PATH\n      -g, --group \u003cgroup-path\u003e          Only show password entries for the given group\n      -y, --noninteractive              Open all urls without waiting for user interaction\n      -h, --help                        Show this message\n```\n\n### lower-vpn-priority.sh\n\n```yaml\nLowers your VPNs default route priority to 101\n\nUSAGE:\n  lower-vpn-priority.sh [OPTIONS]\n\n  Options:\n    -p, --priority \u003cvalue\u003e Sets the new route priority to the given value (default: 101)\n\n  Must be executed as root\n```\n\n### prime-render-offload.sh\n\n```yaml\nDESCRIPTION: Executes command with required environment variables to enable NVIDIA prime offload rendering.\nUSAGE:\n  prime_render_offload.sh command [args]\n```\n\n### reload_touchpad_driver_lenovo.sh\n\n```yaml\nUsage: reload_touchpad_driver_lenovo.sh\n\n  Must be executed as root\n```\n\n### setup-secure-dump.sh\n\n```yaml\n\u003cNo description found\u003e\n\nUSAGE:\n  USAGE:\n  setup-secure-dump [OPTIONS]\n\n  Options:\n      -m, --mount mountpoint    The directory to mount the container to \n                                (must be empty or nonexistent)\n      -c, --container container The location where the container image should be created\n                                (must not exist if -d was not given)\n      -d, --delete              Remove an existing container\n      -s, --size                The size of the container (e.g. '1G', '500MB')\n      -h, --help                Print this help message\n```\n\n### show-gcs-bucket-modification-times.sh\n\n```yaml\nShows you the modification times for all buckets in your google project (based on file modification times or as a fallback bucket metadata).\n\nUSAGE:\n  show_bucket_access [OPTIONS]\n\nOptions:\n    -f, --fetch   Fetch bucket details before printing update times. If not specified, the details\n                  need to be present in the given path (see --dir)\n    -p, --project Fetch buckets from given project\n    -d, --dir     Specifies the working directory (where the bucket info files will be downloaded\n                  to/are expected to be). Default is '.'\n```\n\n### start-when-available.sh\n\n```yaml\nStart given command as soon as a url can be reached\n\nUSAGE:\n  Usage: start-when-available [OPTIONS][--delay time] [--batch] [--help|-h] url cmd\n\n  url\n    The url that needs to be available before executing the command\n  command\n    The command to be executed\n\n  Options:\n    -d, --delay time A minimum delay (in seconds) after which the command can be executed\n    -b, --batch      Use batch mode for executing the command (can help with system resource \n                     consumption)\n```\n\n### toggle-ssh-jumpserver.sh\n\n```yaml\n\u003cNo description found\u003e\n\nUSAGE:\n  toggle-ssh-jumpserver.sh command user jump-server-name\n\n  command\n    'enable' if the jump server should be enabled, else 'disable'\n  user\n    The user whose ssh config should be edited\n  jump-server\n    The name of the jump server to use. Needs to correspond to an entry in the user's ssh config\n```\n\n### treediff.sh\n\n```yaml\nCompare two directory trees\n\nUSAGE:\n  treediff.sh directory-1 directory-2\n```\n\n### virtual-mic.sh\n\n```yaml\nSets up a virtual mic and output to allow e.g. sharing your system sound to a video call (using pulseaudio volume control)\nUSAGE:\n  virtual-mic.sh\n```\n\n### whats-my-ip.sh\n\n```yaml\nPrints your public IP (by querying opendns or, as fallback, google's dns server)\nUSAGE:\n  whats-my-ip.sh\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecalcaholic%2Fbash-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthecalcaholic%2Fbash-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecalcaholic%2Fbash-utils/lists"}