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
## encrypt text with SSH key | |
# Notes: | |
# It's not as straightforward as someone would think! | |
# Need to convert the keys to an openssl known format (PEM) first. | |
# Also, SSH keys aren't meant to encrypt content larger than 200bytes | |
# Sources: | |
# https://superuser.com/questions/576506/how-to-use-ssh-rsa-public-key-to-encrypt-a-text | |
# https://serverfault.com/questions/706336/how-to-get-a-pem-file-from-ssh-key-pair | |
# https://superuser.com/questions/1679344/for-valid-pem-i-get-unable-to-load-private-key-by-openssh |
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
git branch -r | cut -d '/' -f 2- | grep -v '\->' | sort -u | while read branch; do [[ "$(git --no-pager log -n 1 --format='%ae' "origin/$branch" 2>/dev/null)" == "$(git config user.email)" ]] && echo $branch; done |
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
# ... | |
[alias] | |
# ... | |
echo-remote-proto-and-host = "!f(){ REMOTE=origin; git remote -v | grep $REMOTE | head -n1 | sed -E \"s/^$REMOTE\\t+([a-z]+):\\/\\/([^\\/]+).*/protocol=\\1\\nhost=\\2/\";};f" | |
clear-credentials = "!f(){ git echo-remote-proto-and-host | git credential-osxkeychain erase ;};f" | |
get-credentials = "!f(){ git echo-remote-proto-and-host | git credential-osxkeychain get ;};f" | |
update-password = "!f(){ (git echo-remote-proto-and-host; git get-credentials) | sed \"s/password=.*/password=$1/\" | git credential-osxkeychain store ;};f" | |
# Usage: | |
#. Copy your new password in clipboard |
OlderNewer