Live data from Hacker News

Don't Copy-Paste from Website to Terminal

thejh.net

241–250 of 272 posts

Re: Don't Copy-Paste from Website to Terminal

#241
post #222

Earlier quoted context omitted.

Know better... in order to do what? They also provide an APT repository, which you can choose to use instead of the curl command. The curl command exists solely for convenience, because it autodetects your OS, distro version, and automatically registers the right APT repository for you if you're on Debian. As I've mentioned here ( https://news.ycombinator.com/item?id=5508680 ), people often freak out at curl commands…

Allow me to show you a viable proposal for an alternative: http://manpages.ubuntu.com/manpages/precise/man8/apturl.8.ht...

As I've mentioned in https://news.ycombinator.com/item?id=5508680, for any alternative to be viable it must "work on all major platforms". APT is only used in Debian derivatives. How do you want to handle OS X users?

Re: Don't Copy-Paste from Website to Terminal

#242

Earlier quoted context omitted.

There are legit criticisms against the copy-paste-curl-command style of installations. But on the other hand, I've yet to see a critic proposing a viable alternative. With viable I mean that said proposal must: 1. Work on all major platforms. 2. Be easy for the developer to create. 3. Be easy for the user to execute, with as few steps as possible. There are those who advocate that the developer should create a platfo…

The most viable alternative is "apt-get" which provides simple downloads from a central package repository with signature checking. I believe pip and cpan are comparable. In this case I'm picking on homebrew, and the quoted curl command is the command to install that very package tool. The brew package manager does some lightweight checksum verification on subsequent downloads.

And apt-get directly violates point 1, "must work on all major platforms". APT is not widely used on e.g. OS X, Red Hat derivates, etc.

Re: Don't Copy-Paste from Website to Terminal

#245

ok, honestly, where is the ability to disable clipboard manipulation or similar techniques? Browsers need to do this. I have NEVER seen value if a website's ability to modify my clipboard.

That's a different issue from the one here, actually. View the source. No JS in the page at all; just an invisible span in the middle of the code to be copy-pasted.

Re: Don't Copy-Paste from Website to Terminal

#246

Earlier quoted context omitted.

The most viable alternative is "apt-get" which provides simple downloads from a central package repository with signature checking. I believe pip and cpan are comparable. In this case I'm picking on homebrew, and the quoted curl command is the command to install that very package tool. The brew package manager does some lightweight checksum verification on subsequent downloads.

And apt-get directly violates point 1, "must work on all major platforms". APT is not widely used on e.g. OS X, Red Hat derivates, etc.

I look forward to you boiling the ocean. (Sadly, the only reason I know about this Homebrew stuff at all is that the APT-based Fink, for MacOS, is not very popular.)

Re: Don't Copy-Paste from Website to Terminal

#247
post #233

Earlier quoted context omitted.

Code is reusable data, and regardless of language is much more useful than an arbitrary data format. There was an attempt to port homebrew to linux, but it didn't go far. dotCloud has just open-sourced Docker[1], an attempt at solving the deployment issue. [1] http://docker.io

> There was an attempt to port homebrew to linux, but it didn't go far. Linux already has more package managers than you can shake a stick at. To gain traction on linux, homebrew would have to offer useful features that other package managers don't have. Even then, people are more likely to copy the features into an existing linux package manager. I don't think people tend to shop around when it comes to package mana…

I don't know why anyone would want Homebrew on Linux anyway. The whole point of it is that OS X is a mostly-serviceable UNIX without a decent package manager. So if you have a handful of UNIX packages you just want a lightweight way to install them using the system headers where applicable.

But if you need to install tons of stuff the cracks start to show, because you have no conflict resolution or sophisticated versioning. Linux leans heavily on its package managers, so I just don't see what Homebrew has to offer.

Re: Don't Copy-Paste from Website to Terminal

#248
post #227

Earlier quoted context omitted.

>If I select some text and copy it, I am taking a very explicit action. I am giving the computer a very explicit instruction. There is no room for interpretation. It must not disobey me! From the point of view of the browser, it very explicitly does what you told it to, without interpretation, obediently. The problem is that yours and the browser's opinions differ on what you intended to do.

Then it needs to adjust its worldview to match mine. It showed me some text, I selected the text it showed me. If its simple layout engine thinks I saw some text that was rendered hundreds of pixels outside the viewable area, that is its bug, not mine.

It's infeasible for the browser to know "what you see" in the general case. What if the text was in position, but very small and almost the same color as the background? Does the browser need to know if you're red-green colour blind? If you're farsighted?

Re: Don't Copy-Paste from Website to Terminal

#249

Earlier quoted context omitted.

Wget does not validate certificates by default because there's no CA bundle provided with wget. It does check for /etc/ssl/cert.pem, but it doesn't provide one. So you have to provide one or set up /etc/ssl/certs/ as OpenSSL libraries expect. Curl does provide a CA bundle (/usr/share/curl/ca-bundle.crt) and by default libcurl validates certs against it.

cURL doesn't provide a CA bundle any more [1], it's the job of your OS to provide this. As I understand it, all tools that provide SSL support will fail safe if there are no root CAs on your system. [1] http://curl.haxx.se/docs/sslcerts.html

Though, to be fair:

    $ pacman -Qi ca-certificates | grep 'Required By'
    Required By    : ca-certificates-java  curl  glib-networking  neon  qca  qt4
Note that curl is on that list but wget isn't.

Re: Don't Copy-Paste from Website to Terminal

#250
post #179

Good terminal emulators (xterm, urxvt, iTerm2, etc.) have support for "bracketed paste mode" which can be used to fix this problem in zsh: https://github.com/robbyrussell/oh-my-zsh/pull/1698 (original code: http://www.zsh.org/mla/users/2011/msg00367.html ) It's probably easy to write a similar fix for bash.

I initially thought it'd work, but actually, this protection can be circumvented. See the updated version of http://thejh.net/misc/website-terminal-copy-paste.
Post reply on HN