Transfer.sh – File sharing from the command line
transfer.sh
transfer.sh
During Hacktoberfest I also started my own, written in Go, so I could have my friends can use it without installing a Python ecosystem [8].
[1]: https://github.com/nils-werner/zget
[2]: https://github.com/cowbell/sharedrop
[3]: https://github.com/webtorrent/instant.io
[4]: https://github.com/kern/filepizza
[5]: https://github.com/warner/magic-wormhole
[6]: https://github.com/zerotier/toss
FF Send files last for 24 hours, and you can configure the number of downloads allowed from 1 to 20. The maximum filesize is around 2 GiB. The reason I wrote ffsend is that the official site loads the entire file into memory in order to en/decrypt it, but my script is able to stream the en/decryption and thus significantly reduce memory usage.
As it stands they will be abused for copyright infringement and the rights holders will not only ask for the files to be taken down, but for them to preemptively prevent those same files from being uploaded again. A huge rabbit hole full of bullshit.
If I'm not confusing matters, in the past people might have sent files to each other by dropping stuff off in an ftp directory, or they might have used DirectConnect to host files up, or even Windows file sharing / samba.
If it were designed to be used within a local network on the other hand between untrusted users, it might make more sense but I think there would then also be simpler ways to go about that?
woof: http://www.home.unix-ag.org/simon/woof.html
1. Allows directory upload/download (tar/gzip/bzip2 compressed)
2. Local file server (doesn't go over the internet)
3. Allows upload form (-U option)
4. Allows file to be served <count> number of times (-c option)
python3 -m http.server
or python2 -m SimpleHTTPServer tar -cf - ./files.txt ./orDir/ | ssh host "(cd /dest/dir; tar -xf -)"
Given that ssh it so ubiquitous I think this will always be my go to. scp file.txt user@host:/dest/dir/rsync -zvh file.txt user@host:/dest/dir/
So many ways to do this :)
rsync -n -avh --progress source destination:~/asdf/ for a dry run followed by ctrl-p, ctrl-a, alt-f, alt-d, alt-d to remove the -n flag and then execute that for the real thing.
Occasionally though, I'll also use sftp if I'm just pulling one thing - perhaps even after sshing to the remote machine.
For all of these, SSH keys should be set up (and desktop logins secured) to make life easier.
As for Android, adb push and adb pull -a seems to work better than mtp:// or AirDroid in my experience.
rsync source destination will plonk the entire source directory and put it inside destination as a neat bundle.
rsync source/ destination will take the contents of source (but not the directory source itself) and plonk it in destination
I found the info page a little dry but it does describe it succintly:
rsync -av /src/foo /dest
rsync -av /src/foo/ /dest/foo
For some reason though, my head freaks out when it sees "foo" and "bar", but all they're saying is that it does the same thing.If in doubt though, just chuck everything into the destination ~/temp/ or ~/asdf/ and sort it out later.
To be honest though, most of the time I just use fish shell's autosuggestions to guide me along.
-h for human-readable numbers -a for archive mode -v and --progress for verbose info -z for compression during transfer
Add a -n for a dry run if required.
https://linux.die.net/man/1/rsync
One of the people who came up with it - Andrew Tridgell - was more or less "responsible" for Linux and BitKeeper parting ways, which in turn ultimately lead to the creation of Git. I think it's a fascinating story. Excellent tools.
The progress / speed display is the main thing that keeps me coming back to rsync even though other tools might manage the same job - not seeing the progress of a copy is what had me searching for that solution in the very first place.
--info=progress2
You can use it since rsync version 3.1.0.
@{cd fromdir && tar cp .} | @{cd todir && tar xT}
You should use '&&' instead of ';' on the host side. That way you don't accidentally dump your transfer contents into a wrong directory if the existing host dir doesn't exist.
e.g.: tar cf - stuff | ssh host "(cd /dest/dir && tar xf -)"
tar -C /dest/dir -xf - tar cf - src/ | ssh $host "tar -C /dest/dir -xf -"No encryption necessary No integrity checks No resume support Just plain and as fast it could get..
I need to try the netcat version but I'm hoping someone could show me a concurrent version of it that is mad fast.
< /path/to/source ncat remote-host 8001
On your destination machine: ncat -l 8001 > /path/to/dest
Though in most situations with files of reasonable size, you're probably going to be better off running through `gzip -c`.:-D
> tar -cf - ./files.txt ./orDir/ | ssh host "(cd /dest/dir; tar -xf -)"
:-O
On the receiving end:
nc -vll 0.0.0.0 12345 | pv | tar xv
On the sending end: tar cv files... | pv | nc -N "destination IP" 12345
pv is a nice tool that just reports on the rate and number of bytes moving through the pipe, optional if you don't have it. Throw in gpg --symmetric + gpg --decrypt for good measure if you want to encrypt it on the wire with a password.Didn't know about nc or rysnc at the time. Good to see those other solutions, and good that there are many ways to do it, with different pros and cons.
(The site still exists, but they never replied to my e-mail to their signup address, so I can't say for sure if they're still live or not.)
I wish transfer.sh good luck, and will bookmark them for now as "the new chunk.io".
EDIT: note, as not all comments comparing this to SSH seem to have picked it up - this is a service where you can upload a file, get a link and e-mail the link to someone. You don't need to have any special software (such as sshd) running on the download side.
Looks neat.
> This library includes the URL of a public rendezvous server run by the author. Application developers can use this one, or they can run their own (see the https://github.com/warner/magic-wormhole-mailbox-server repository)
> For now, bulk data is sent through a “Transit” object, which does not use the Rendezvous Server. Instead, it tries to establish a direct TCP connection from sender to recipient (or vice versa). If that fails, both sides connect to a “Transit Relay”, a very simple Server that just glues two TCP sockets together when asked.
If I understand the docs correctly, it always uses a centralized server to establish the transfer. Once the transfer is established, it'll attempt to transfer the files directly, if possible, but if not, it'll fall back to using a relay.
And so many people are trapped behind NAT these days, I don't know that the need for this will be all that unusual.
It's amazing to see the language embraced that much for server side apps.
What are the benefits of one over another?
Something like grokking this concept for once and all :D
If you use dynamically linked binaries, you rely on the system to have the version of the library you need, and hope that your reliance on those libraries does not break other applications which may rely on different versions of those libs.
Static == everything you need bundled up Dynamic == relies on libraries present on the host to provide aspects of functionality
Of course, even static binaries rely on some basic level of compatibility; typically system-level things that don't change much.
Dynamically-linked binaries have the potential to create a massive dependency graph that can hard or even impossible (for a given o/s installation) to traverse.
* single binary that you can scp (or use transfer.sh haha) into the production machine and run; no runtime environments, package installation etc.
* two different applications can depend on different versions of a library without any intermediate package manager or virtual environment
* guaranteed execution: related to the first point, but I see enough merit in this to make it a separate point
Cons:
* If there's a security issue in a commonly used library (database/sql, for example), you'll need to patch every application that uses it. With dynamic dependencies, you just patch the library.
pip install magic-wormhole
wormhole send foo.tar.gz
Bonus: the files are e2e encrypted.Still, transfer.sh is hard to beat for flexibility. Magic-wormhole requires that users install something.
Then when I browse my email months later, I can't use the links :(
I wish tools such as this one would automatically incorporate the downloaded files into my email history somehow.
A reliable UDP with a rendezvous server would allow for much more scalable P2P transfer. Unfortunately, I haven't found one implemented like this...
...although on second thought, and with some bad math, if you know the file name, and you can manage 750+ tries a second, you could brute it prior to the 14 day expiration.
$ udp-sender --min-receivers 1 --full-duplex --pipe 'tar czvf - theDirectory'
on the sender and $ udp-receiver --pipe 'tar xzp'
and at least on my home network it's 11x faster than tar|nc. There are some caveats[1] about udp not working well everywhere, and you may have to open ports 9000 and 9001 and of course it's not encrypted at all, but for copying large ISO's and such when you can't find your usb stick it's great. Just remember to compare checksums afterwards.[0] http://www.spikelab.org/blog/transfer-largedata-scp-tarssh-t...
[1] https://superuser.com/questions/692294/why-is-udcast-is-many...
Preferably a cryptographic hash... UDP is known for not being reliable at all, and that's partly why it's so fast --- the sender doesn't care whether the packets reached the receiver, it just sends as fast as it can.
Oh, they should use SHA anyway because why not, but CRC is only vulnerable to deliberate manipulation or exceedingly abstruse bit-flips.
When the failure mode is lost packets, it's perfectly fine.
The power of UDP allows the sender to have more control on things like how often transmissions are are acknowledged (tcp window size), or how to handle delays or errors. There are also some advantages because middle boxes who try to be smart and "make TCP" better for you can't really muck with the UDP packets all that much because the applications own protocol of how to handle UDP packets will not likely be know. This is why QUIC is such a big deal -- as a lot of the type of things a middle box might want to -- and do on TCP today -- muck around with are encrypted.
So I would not say that UDP is fast because it is not reliable, it is fast because it can allow a programmer to exploit the network in a more efficient way than TCP can for a specific type of data being transferred. There are many reliable UDP based protocols that achieve faster speeds than TCP in different situations.