Skip to content

Instantly share code, notes, and snippets.

@compleatang
Last active August 29, 2015 14:15
Show Gist options
  • Save compleatang/87603d14f00b2f35c8b8 to your computer and use it in GitHub Desktop.
Save compleatang/87603d14f00b2f35c8b8 to your computer and use it in GitHub Desktop.
# Aliases
alias efa='ipfs_add'
alias efb='ipfs_view'
alias efg='ipfs_get'
alias efs='ipfs_get_save'
# alias gss='git status -s'
# compdef _git gss=git-status
# Add a file to IPFS cache
function ipfs_add()
{
echo "https://ipfs.erisbootstrap.sexy/ipfs/$(curl --ssl-reqd -ksiX POST -d @$1 https://ipfs.erisbootstrap.sexy/ipfs/ | grep Ipfs-Hash | awk '{print $2}')"
}
function ipfs_view()
{
echo "https://ipfs.erisbootstrap.sexy/ipfs/$1"
}
function ipfs_get()
{
curl --ssl-reqd -ks https://ipfs.erisbootstrap.sexy/ipfs/$1
}
function ipfs_get_save()
{
curl --ssl-reqd -ks https://ipfs.erisbootstrap.sexy/ipfs/$1 > $2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment