Easier Commands
Use local file for authentication
Encrypting Files
So you’ve learnt how to use shunt.io but are you having trouble remembering the correct parameters to use? if so bash functions are your friend.
Lets say you want to make it quicker to upload a file. Open your .bashrc file which can be found in your home directory.
1 |
$ nano .bashrc |
Scroll to the end and add
1 2 3 |
shunt() { if [ $# -eq 0 ]; then echo "No arguments specified. Usage: PATH_TO_FILE"; return 1; fi curl --progress-bar -u user:pass -F "file=@$1" "https://shunt.io" | tee /dev/null } |
save & exit
Execute the following to reload .bashrc
1 |
$ source .bashrc |
To upload a file now all you need to do is
1 2 3 |
$ shunt /path/file.name ######################################################################## 100.0% Upload successful |
easy peasy!
Edit it to suit you needs i.e if you don’t want the progress bar to show. You can create similar functions for list, share and delete. I use function names slist, sshare and sdelete for this.
Use local file for authentication
Another way of parsing your login info is by storing your credentials in a local file.
In your home directory create a file called .netrc
1 |
$ nano .netrc |
and add the following
1 2 3 |
machine shunt.io login YourUsername password YourPassword |
save & exit
Now when you need to upload a file you will use the -n switch which uses the authentication credentials from your .netrc file i.e
1 |
$ curl -n -F 'file=@/path/file.name' https://shunt.io |
or use it as part of a bash function as described above.
Encrypting files
I recommend encrypting your files before uploading to shunt here is an example of how to do this
First install the gpg package (do a web search for your os on how to do this)
Next run
1 2 3 4 |
$ gpg -c "/path/file.name" && curl -u user:pass -F "file=@/path/file.name.gpg" https://shunt.io Enter passphrase: Repeat passphrase: Uploaded successful |