This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Inspired by https://developer.hashicorp.com/vault/docs/commands/token-helper#example-token-helper | |
| # Install via | |
| # echo 'token_helper = "/absolute/path/to/vault_token_helper.sh"' >> "$HOME/vaulttest" | |
| function write_error(){ >&2 echo "$@"; } | |
| # Customize the hash key for tokens. Currently, we remove the strings | |
| # 'https://', '.', and ':' from the passed Vault address |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for tuples in gc,'git checkout' gm,'git merge' grb,'git rebase' | |
| echo $tuples | read -d , abb cmd | |
| function _abbr_git_default_branch_$abb --inherit-variable cmd | |
| if git rev-parse --verify main &> /dev/null | |
| echo $cmd main | |
| else | |
| echo $cmd master | |
| end | |
| end | |
| abbr --add $abb'm' --function _abbr_git_default_branch_$abb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # This hooks script syncs task warrior to the configured task server. | |
| # The on-exit event is triggered once, after all processing is complete. | |
| # Make sure hooks are enabled | |
| check_for_internet() { | |
| # check for internet connectivity | |
| nc -z 8.8.8.8 53 >/dev/null 2>&1 | |
| if [ $? != 0 ]; then |