Skip to content

Instantly share code, notes, and snippets.

@mrwhale
Created November 15, 2016 22:10
Show Gist options
  • Select an option

  • Save mrwhale/c2c19acfb1a9edaef5e79f31eec2a2b6 to your computer and use it in GitHub Desktop.

Select an option

Save mrwhale/c2c19acfb1a9edaef5e79f31eec2a2b6 to your computer and use it in GitHub Desktop.
onetimesecret bash alias
#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