Skip to content

Instantly share code, notes, and snippets.

@marduk191
Last active March 17, 2016 17:48
Show Gist options
  • Save marduk191/0604901fbcb56b44413f to your computer and use it in GitHub Desktop.
Save marduk191/0604901fbcb56b44413f to your computer and use it in GitHub Desktop.
A small shellscript for pasting to hastebin from the command line
Hastebin CLI
#Add to ~/.bashrc
haste() { a=$(cat); curl -X POST -s -d "$a" http://hastebin.com/documents | awk -F '"' '{print "http://hastebin.com/"$4}'; }
alias copy="xclip -selection c"
##Usage:
#Open terminal
#Type "cat <filename> | hastebin | copy
#"echo this is my text | hastebin | copy
##For RAW
#"echo "this is my text" | hastebin --raw | copy"
#"hastebin file --raw |copy"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment