You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Hari Sekhon ef1ddd8cfb updated git.sh 8 months ago
..
Makefile updated URLS 2 years ago
README.md
aliases.sh updated aliases.sh 8 months ago
ansible.sh updated ansible.sh 1 year ago
argocd.sh updated URLS 2 years ago
aws-cloudshell.sh updated URLS 2 years ago
aws.sh updated aws.sh 1 year ago
azure.sh disabled shellcheck SC1091 1 year ago
bash_it.sh updated URLS 2 years ago
circleci.sh disabled shellcheck SC1091 1 year ago
colors.sh updated URLS 2 years ago
custom.sh updated custom.sh 1 year ago
direnv.sh updated direnv.sh 1 year ago
docker.sh disabled shellcheck SC1091 1 year ago
env.sh updated env.sh 8 months ago
functions.sh updated functions.sh 1 year ago
gcp.sh updated gcp.sh 1 year ago
git.sh updated git.sh 8 months ago
golang.sh updated golang.sh 1 year ago
gpg-agent.sh disabled shellcheck SC1091 1 year ago
grype.sh updated grype.sh 1 year ago
hadoop.sh disabled shellcheck SC1091 1 year ago
java.sh updated java.sh 1 year ago
jenkins.sh updated URLS 2 years ago
k3d.sh added k3d.sh 1 year ago
kafka.sh updated kafka.sh 1 year ago
kubernetes.sh added whenpodup function 8 months ago
linux.sh disabled shellcheck SC1091 1 year ago
lolcat.sh updated URLS 2 years ago
mac.sh updated mac.sh 8 months ago
mercurial.sh updated mercurial.sh 2 years ago
mp3.sh updated URLS 2 years ago
mysql.sh disabled shellcheck SC1091 1 year ago
network.sh updated network.sh 1 year ago
nodejs.sh updated nodejs.sh 1 year ago
os_detection.sh updated os_detection.sh 2 years ago
paths.sh updated paths.sh 8 months ago
perl.sh updated perl.sh 8 months ago
postgres.sh disabled shellcheck SC1091 1 year ago
prompt.sh updated prompt.sh 1 year ago
python.sh updated python.sh 1 year ago
rancid.sh updated URLS 2 years ago
ruby.sh updated ruby.sh 1 year ago
screen.sh updated screen.sh 2 years ago
skaffold.sh updated skaffold.sh 1 year ago
spinner.sh updated URLS 2 years ago
spotify.sh updated spotify.sh 1 year ago
ssh-agent.sh disabled shellcheck SC1091 1 year ago
ssh.sh updated ssh.sh 2 years ago
svn.sh disabled shellcheck SC1091 1 year ago
teamcity.sh updated URLS 2 years ago
terraform.sh updated terraform.sh 1 year ago
title.sh updated URLS 2 years ago
travis_ci.sh updated travis_ci.sh 1 year ago
trivy.sh updated trivy.sh 1 year ago
vagrant.sh updated vagrant.sh 8 months ago
vim.sh disabled shellcheck SC1091 1 year ago
virtualbox.sh updated URLS 2 years ago
vnc.sh Merge branch 'master' of github.com:HariSekhon/DevOps-Bash-tools 1 year ago
welcome.sh updated URLS 2 years ago
when.sh updated when.sh 8 months ago
z_final.sh updated z_final.sh 8 months ago

README.md

Advanced Bashrc Code - Interactive Functions, Aliases and Shell Customizations

Advanced bashrc code I've been using for ~15 years, I've ported nearly 5000 lines to this public repo so far.

All *.sh files in this directory are automatically sourced by .bashrc at the top level which is itself designed to be sourced in your $HOME/.bashrc.

To disable any these source files, simply rename them to not match the *.sh glob, eg. => *.sh.disabled.

  • aliases.sh - general aliases
  • functions.sh - general functions eg. pass which prompts for a password which is saved to an environment variable and auto-populated in various top-level API querying scripts built on curl_auth.sh
  • env.sh - general environment variables and var/unvar functions for setting environment variables for the current and all new shell sessions
  • paths.sh - deduplicated adding to $PATH for lots of common places (eg. /usr/sbin, /usr/local/bin, ~/bin) and commands to clearly print one path per line for Bash $PATH, Perl @INC and Python sys.path. Also contains technology specific paths when there is no <technology>.sh file. All other includes use add_PATH() function defined here.
  • <technology>.sh - aliases, functions and environment variables to make interactive day-to-day use of a specific technologies easier
    • Cloud / Containerization / Virtualization:
      • aws.sh - AWS functions:
        • aws_env - populates credentials from ~/.aws/credentials / ~/.boto section given as an argument to $AWS_ACCESS_KEY and $AWS_SECRET_KEY environment variables and sets $AWS_PROFILE to the profile name (defaults to the 'default' profile and creds if no argument is specified)
        • aws_envs - prints the available envs configured in the aws credentials file and stars the one currently in use
        • awk_token - generates a 24-hour MFA session token, exports it as $AWS_SESSION_TOKEN for use with AWS CLI, and saves it to ~/.aws/token for loading to other shells that call aws_env
      • docker.sh - Docker convenient aliases and functions like clearing old containers and dangling image layers to clean up space
      • kubernetes.sh - Kubernetes aliases and functions, managing contexts and namespaces even for periodically regenerated .kube/config with refreshed embedded certificates, switching between open source Kubernetes and Redhat OpenShift kubectl and oc commands, automating getting authentication token and Kubernetes API endpoints
      • vagrant.sh - Vagrant aliases and functions
    • Automation / Distributed Systems:
      • ansible.sh - Ansible aliases and environment variables
      • kafka.sh - Kafka environment variables for Kerberos security and CLI appropriate heap size (avoids heap allocation failures on VMs that otherwise default to using larger server configured heap size), avoiding need for common broker and zookeeper arguments when using kafka_wrappers/ scripts by setting your Kafka broker and zookeeper addresses once instead of in every command
    • Coding:
      • git.sh - Git aliases and functions
      • mercurial.sh - Mercurial aliases and functions
      • svn.sh - Svn aliases and functions
      • java.sh - Java detection and setting of $JAVA_HOME for Linux and Mac environments
    • OS:
      • apple.sh - Apple Mac OS X / macOS specific tricks
      • linux.sh - Linux specific miscellaneous bits like X.org
      • network.sh - network aliases and functions
      • ssh.sh - SSH convenience functions and key management
      • ssh-agent.sh / gpg-agent.sh - auto-starts SSH and GPG agents if not already running, stores and auto-sources their details for new shells to automatically use them
      • title.sh - auto-title tricks for Screen and Terminals

More script related functions can be found in the lib/ directory at the top level.