Live data from Hacker News

Curl.io – Share files from your terminal or ssh

curl.io

61–68 of 68 posts

Re: Curl.io – Share files from your terminal or ssh

#61
post #54

Earlier quoted context omitted.

Ah, a candidate for the useless use of cat award. The first command can be given more easily as: nc -l -p 9999 (which also mirrors the logic of the second, modulo nc's idiosyncratic argument syntax)

The cat version much more clearly represents the flow of data. We read left to right, it makes no sense to me to have data flow written right to left (and only for input files, while output files read left to right). When building commands up from basics, it makes much more sense to start with cat. I will typically cat the file to see it's contents, then modify the command with a pipe to another program, and make kee…

No, it makes much more sense to start with the command that is to process the file. Most commands take a command line argument to specify which file to process. This mirrors the redirection syntax perfectly:

You say:

  grep haystack needle.txt
or:

  grep haystack 
whereas this is more convoluted:

  cat needle.txt | grep haystack
As a bonus the syntax looks the same for output redirection:

  sort  outfile.txt
whereas this is not as readable:

  cat infile.txt | sort > outfile.txt
What "makes sense" to you doesn't always to other people. In this case it's trivial, but it's a nightmare to debug larger scripts when there are lots of unnecessary redirections and if statements.

Shell scripts may be one-offs, but they tend to linger. It's not unwise to spend a few extra moments to make them readable and follow best practice. It is code after all.

(Also; a bit silly with the personal attacks.)

Re: Curl.io – Share files from your terminal or ssh

#62
post #41

While I'm doing command line file sharing, why not just directly transfer a file to my peer with netcat? Server: $ cat hugefile.ext | nc -l -p 9999 Client: $ nc server.ip 9999 > hugefile.ext We tend to forget how the network is built, and how easy it is to use it with the right tools.

How do you identify a particular file ?

Also, HTTP is more accessible than raw TCP (you can use it from the browser)

Re: Curl.io – Share files from your terminal or ssh

#63
post #57

Hello everyone, Thanks for all these feedbacks! I have considered most of them. Well, as I can see the most of you are worried about the security, that I understand. So I've just added little help with a GPG encryption right from your terminal before sending the file. I think this is the most important things I can make right now, while I do not plan to install SSL certificate given that I don't make money with this…

why not startssl? you will get the SSL certificate for free

Re: Curl.io – Share files from your terminal or ssh

#67

Yikes, this should really be accessible only via HTTPS. Copying commands from untrusted websites (or insecure connections) and pasting them into your terminal is not a good idea: http://thejh.net/misc/website-terminal-copy-paste

Don't know about you, but an SSL certificate does nothing to increase my level of trust of a website.

While active attacks are still possible, TLS prevents passive attacks (eg: eavesdropping).
Post reply on HN