ad-ldap-tool.sh - Search Microsoft Active Directory using ldapsearch
apt-update-security-packages.sh - Update Apt packages for security updates
aws-adfs-profile-login - Login to AWS with aws-adfs, using AWS profiles
aws-assume-admin-role - Assume an admin role and execute arbitrary commands
aws-assume-role - A wrapper to make it easier to assume AWS roles
The following is specifically written to return an exit code, without exiting the current shell session. This way this will work when sourced into a script, without exiting the parent script.
aws-cli-cache-auth-keys.sh - Extract the auth keys from a cached AWS CLI authentication json file
aws-create-update-secret - Create or update an AWS Secrets Manager secret
This script is only used the first time we create a secret. It's part of a bootstrap process, or when a new application is added.
aws-ec2-describe-sec-group-rules.sh - Print a TSV of AWS EC2 security group rules
aws-ec2-get-instance-id.sh - Get the Instance ID of running AWS EC2 instances
aws-ec2-get-ip.sh - Get the IPs of running AWS EC2 instances
aws-ec2-get-network-interface-public-ips.sh - Get the public IP of AWS EC2 network interfaces
aws-ec2-get-running-instances.sh - Get the Instance ID, key name, group ID, and public IP of running AWS EC2 instances
aws-ec2-get-security-groups.sh - Get AWS EC2 security groups
aws-ec2-get-sg-ids.sh - Get AWS EC2 instance security group IDs
aws-ecr-create-repository - Create an AWS ECR repository
aws-ecr-docker-login - Perform a Docker login to an AWS ECR repository
aws-ecr-docker-pull - Pull a Docker image from an AWS ECR registry
aws-ecr-docker-push - Push a Docker container to an AWS ECR registry
aws-ecs-utils.sh - Wrapper for simpler operations on AWS ECS
aws-rds-get-ip.sh - Get AWS RDS IP addresses for running instances
aws-s3-get-buckets.sh - Get AWS S3 bucket names
aws-select-credentials - Use 'dialog' to select cached AWS credentials and export it into your current shell
Assuming this script is in your PATH, simply run: $
aws-select-credentials
or: $ . aws-select-credentials
aws-select-profile - Use 'dialog' to select an AWS profile and export it into your current shell.
Assuming this script is in your PATH, simply run: $
aws-select-profile
or: $ . aws-select-profile
bitbucket-list-all-repos.py - Return a CSV file of Bitbucket repositories
bitbucket-list-all-repos.sh - Return a JSON document of available Bitbucket repositories for a specific $BITBUCKET_TEAM
bitbucket-list-repo-commits.py - Return a CSV of Bitbucket repositories
bitbucket-manage.py - A management CLI tool for Bitbucket repositories
bluetooth-reset.sh - Linux bluetooth needs a kick in the pants every time I connect my headset -(
bluez-set-a2dp.sh - Try to force-enable A2DP mode for Bluetooth devices
butler-jenkins-export-import.sh - Use Butlet to export and import jobs and credentials for Jenkins servers
cgrep - Wrapper for grep with color mode forced-on
circleci-manage.py - A management CLI for CircleCI operations the official CLI doesn't support
cpufreq-set-all - Set CPU frequency
csv_row_template_output.py - Generate a set of files based on a Python template and CSV file
dar-backup.sh - generate a full and/or incremental backup using dar
date-seconds-portable.sh - A portable implementation of 'date' output, given SECONDS
d-aws - Run AWS CLI from Docker
d-java - Run Java from Docker
d-nr-cli - Run the NewRelic CLI from Docker
NOTE: I don't know who wrote this?? It was probably downloaded from the internet?
- Peter
docker-detach-sshd.sh - Run a detached Docker container with an entrypoint to run an sshd daemon
Before running this script, create an ssh key on the local host: ssh-keygen -t ed25519 -N ''
Set PUBKEY to the public key file created. Then run the sshd container below.
This will volume-map the host's docker.sock, make a persistent Terraform plugin cache, a persistent volume for miscellaneous uses, the SSH public key created above (so we can login with it), maps in the entrypoint to set up and start sshd, and exports the sshd port to the local host.
docker-login-list-registries - List Docker CLI config's registries
docker-registry-list-repositories - List Docker CLI config's repositories
docker-run-1password - Run 1Password CLI using Docker
docker-run-gcloud - Run GCloud CLI from Docker
docker-run-op - Run 1Password's 'op' CLI tool with Docker
docker-sshd-entrypoint.sh - Install and run sshd in a Docker container
download-aws-secret-env.sh v0.2 v0.2 - Download AWS Secrets Manager secrets, store in a file, and execute a program
download-tls-cert.sh - Download TLS certificate from a host/port
d-terraform - Run Terraform CLI from Docker
envsubst.sh - POSIX-compatible version of envsubst
Feed it text on standard input, and it prints the text to standard output, replacing ${FOO} or $FOO in the text with the value of the variable.
This is very slow, but it's about as fast as I can get it using just POSIX shell stuff (sed/awk would be faster). Use GNU envsubst for speed.
Since this is a shell script, it conflates shell variables with environment variables. You can load this script into your shell and it will use those variables specific to your shell session: cat Sample.txt | . ./envsubst.sh
Or you can call this script as an external executable and it will use only exported variables: cat Sample.txt | ./envsubst.sh
extract-script-comments.sh - Generate a TSV of any shebang-interpreted scripts and their commented descriptions
flatpak-run-firefox - Run Firefox using Flatpak
flatpak-run-slack - Run Slack using Flatpak
flatpak-run-thunderbird - Run Thunderbird using Flatpak
flatpak-run-zoom - Run Zoom using Flatpak
gcp-list-service-account-keys.sh - List GCP service account keys
gen-piiaa-list.sh - Generate list of scripts and descriptions for PIIAA
git-askpass-netrc.sh - Use .netrc with Git Askpass
This is mostly unnecessary right now. It was written with the idea that maybe one could use a fake username and then substitute it later with a new username and a specific personal access token.
I think the solution is to turn this into a 'credential helper' which can take different arguments and actually return both a username and password.
git-clean.sh - Interactively remove unchecked-in Git working directory files
git-cleanup-local-stale.sh - Remove any stale local and remote Git branches from local repository
git-clean-workdir.sh - Clean up temporary files in a Git working directory
git-commit-file.sh - automation for committing files to git
git-find-ignored.sh - Show all the files in the current Git repo that are being ignored by .gitignore
git-fix-commit-author.sh - Rewrite Git history to correct the wrong commit author details
git-grep-entire-repo-history.sh - Grep the entire history of a Git repository
git-http-check-origin-exists.sh - In case you want to use 'curl' to see if an HTTP(s) Git repo actually exists or not
github-get-pr - Get a pull request branch from GitHub
github-get-restapi.sh - Curl the GitHub API
github-get-team-members.sh - Use get-github-restapi.sh to get GitHub team members list
github-get-team.sh - Use get-github-restapi.sh to get GitHub teams list
github-list-users.py - List GitHub users using 'github' Python library
github-set-commit-build-status.sh - Set commit build status for a GitHub commit
git-lfs-compare.sh - Compare the files in a Git repository with the files in Git LFS
git-list-branch-by-date.sh - List Git branches by date of last commit
git-list-repo-files.sh - List all files checked into a git repository
git-list-untracked-ignored.sh - List untracked and ignored files in a Git repository
git-list-untracked.sh - List untracked files in a Git repository
git-permanently-remove-file-from-repo.sh - Rewrite history to permanently remove a file from a Git repository
git-push-force-all.sh - Force-push a Git repository (with tags)
git-show-commit-authors.sh - List all of the commit authors in a Git repository
git-show-mainline-branch.sh - Attempt to show mainline branch of a Git repository
git-squash-current-branch.sh - Squash your current branch's commits, based on MAINBRANCH
gw - A Terminal User Interface wrapper to make Git worktrees easier to manage
helm-list-fast.sh - Much faster version of 'helm list'
This script exists because 'helm list' will query the Kubernetes API server in such a way that secrets take a looooong time to come back. To avoid that wait, here I just grab the secrets list with kubectl, and then parallelize grabbing individual last release files to determine their last updated date. This is about 6x faster than 'helm list' (on my cluster).
Requires:
- kubectl, base64, gzip, jq, xargs, column
TODO:
- add columns 'STATUS', 'CHART', 'APP VERSION'
- support single-namespace operation
jenkins-add-credential.sh - Adds a credential to Jenkins credential store via REST API
Example:
$ JENKINS_SERVER_URL=https://foo.com/
./add-jenkins-credential.sh easi-github-token
jenkinsctl - a command-line wrapper around building and running a Jenkins instance
jenkins-curl-wrapper.sh - Loads Jenkins authentication information and runs curl, passing in command-line arguments.
Re-use this to call curl on Jenkins servers. By default gets and inserts a CSRF crumb in header. Pass in '-XGET' or '-XPOST' followed by the rest of your arguments, depending on the API calls you're making.
et -Eeuo pipefail
jenkins-generate-user-token.sh - Generates a Jenkins user token
jenkins-groovy-remote.sh - Run a Groovy file on a Jenkins server (via the API)
jenkins-run-groovy-remote.sh - Takes a groovy file, replaces some variables, and executes it on a remote Jenkins instance.
Sample groovy file: print "ls -la".execute().getText()
jenkins-run-job-with-parameter-defaults.py - Run a Jenkins job with parameters
jenkins-trigger-paramaterized-build.py - Run a Jenkins parameterized build
k8s-copy-secret-across-namespace.sh - Copy a Kubernetes secret into a new namespace
k8s-curl.sh - Curl the K8s API, from within a K8s pod
k8s-deployment-restart.sh - Restart a K8s deployment
k8s-diagnose-site.sh - Attempt to diagnose a web site in K8s
k8s-diff-secrets.sh - Diff Kubernetes secrets
This script gives you multiple ways to diff the secrets (names and/or values) of Kubernetes secrets.
To optimize for speed, secret values are not retrieved for diff if a secret does not exist in a namespace. Secret retrieval is parallelized with xargs.
k8s-find-all-resources.sh - Find all Kubernetes resources
k8s-get-events-notnormal.sh - Get all Kubernetes events not of type 'Normal'
k8s-get-pod-logs.sh - Save any Crashing, Error, or Failed pods' logs to a file
k8s-get-pods-running.sh - Get running K8s pods
k8s-get-secrets-opaque.sh - Get any 'Opaque' type k8s secrets
k8s-get-secret-values.sh - Output kubernetes secret keys and values in plaintext
k8s-run-shell.sh - Start a K8s pod and open an interactive shell, then destroy it on exit
Installs some basic packages and drop user into command prompt in a screen session. On exit, pod is deleted.
All arguments are passed to 'kubectl run' before the command arguments, so you can pass things like the k8s namespace.
kd - A Terminal User Interface wrapper for Kubernetes commands
kd is a wrapper around common kubernetes commands to simplify running various k8s tasks without needing to remember commands or rely on bash-completion. It supplies a text UI (optionally using the 'dialog' tool) for prompts.
Run 'kd' and select a command, or select DEFAULT to always use the defaults.
list-dupe-files.sh - Find and list duplicate files
Pass this script one or more files or directories, and it will print out the files that are duplicates. Uses md5sum for comparison.
load-vim-plugins.sh - Load VIM plugins
make-readme.sh - Generates a README.md based on the comment descriptions after a shebang in a script
move-files-to-folders-by-ext.sh - Move all the files in a directory into folders named by extension
notes.sh - shell script to manage hierarchy of note files
python-stdin-to-json.py - Dump standard input stream as a JSON-formatted output
random-dict-password.sh - Generate a random password from dictionary words
random-password.sh - Generate a random password
remote-gpg - Run gpg operations on a remote host
original author: Dustin J. Mitchell dustin@cs.uchicago.edu
reset-ntp.sh - Update the time on a box using ntp
setup-hibernate-ubuntu.sh - Set up hibernation mode in Ubuntu
ssh - ssh wrapper to override TERM setting so that ssh will send the one we want remotely
ssh-config-hosts.sh - Recursively find any 'Host ' lines in local ssh configs
Usage: ssh-config-hosts [FILE]
ssh-mass-run-script.sh - send a script to a lot of hosts and then execute it on them
Note: this script does not fail on error, in order to work on as many hosts as possible.
strip-terminal-colors - does what it says on the tin
terraform-extract-backend.pl - extract backend configuration from terraform module
Options: -o FORMAT Output format (flat, json)
terraform-find-missing-vars.pl - Find missing variable definitions in a Terraform module
terraform-split-parts.pl - extract blocks from terraform configs and put them into separate files
ubuntu-18.04-setup-dnsmasq.sh - Set up DNSMASQ on Ubuntu 18.04
ubuntu-list-pkgs-by-date.sh - Self explanatory
uniqunsort - Remove duplicated lines from stdin, print to stdout
urlencode.sh - Print a string URL-encoded
venv-app-manager.sh - Manages a set of Python venv applications for you
Sometimes you may want to install a bunch of Python applications, but your system wants you to use a venv (virtual environment) to install Python packages. This script helps you:
- Create a venv for each app you want to install
- Run pip for you
- Run extra commands you can configure per-application
- Add each venv bin/ directory to the end of your PATH so you can execute the installed apps easily
So this is basically a very crappy, small application manager for Python. (sigh.... not another one............ !!!)