Created
November 15, 2016 22:10
-
-
Save mrwhale/c2c19acfb1a9edaef5e79f31eec2a2b6 to your computer and use it in GitHub Desktop.
onetimesecret bash alias
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
| #Add the following to your bashrc or similar to quickly create secrets without leaving your terminal! | |
| #This also prints the secret link back to you, so you can copy and paste elsewhere | |
| #eg | |
| #george@george-LT:~$ onetimesecret Thisissupersecret | |
| #https://onetimesecret.com/secret/kvq9927e3ylltd83u679vlyfr942vjg | |
| onetimesecret() { | |
| if [ $# -eq 0 ]; then echo "No secret specified";return 1; fi | |
| secret=$(curl -s -F "secret=$1" https://onetimesecret.com/api/v1/share | cut -d '"' -f12) | |
| echo https://onetimesecret.com/secret/$secret | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment