Skip to content

Instantly share code, notes, and snippets.

@vikas17a
Last active August 29, 2015 14:23
Show Gist options
  • Save vikas17a/94542c65c9ab1f973386 to your computer and use it in GitHub Desktop.
Save vikas17a/94542c65c9ab1f973386 to your computer and use it in GitHub Desktop.

Setting up hastebin server

  • Set up and start redis server
  • Enter following command in clone
git clone https://github.com/seejohnrun/haste-server.git && cd haste-server/
cat config.js #setup configuration of hastebin server port and redis server port
npm install
npm start &> /dev/null/ &

User this server IP and Port in following steps to setup command line code paste to haste-server

Usage Web based

  • Open url IP:PORT
  • Do whatever you want to do

Usage command line

  • install gem haste
gem install haste
  • add alias to ~/.bash_profile
alias work_haste "HASTE_SERVER=http://<IP:PORT> haste"
  • use following commands in command line
source ~/.bash_profile
cat something | work_haste
  • another way without installing gem is
haste() { a=$(cat); curl -X POST -s -d "$a" http://<IP:PORT>/documents | awk -F '"' '{print "http:/<IP:PORT>/"$4}'; }
cat something | haste
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment