Live data from Hacker News

`curl wttr.in`: Weather in your terminal

github.com

121–130 of 147 posts

Re: `curl wttr.in`: Weather in your terminal

#121
post #87

Earlier quoted context omitted.

Engineers are not UX designers, so their opinion on UX has little value imo.

Engineers can't be users?

once you become an engineer you cant unsee it very easily, your user vision is now tainted by a higher understanding of problems, rather than feeling frustrated at {FOO = FAIL} bugs and submitting a complaint comment.

Re: `curl wttr.in`: Weather in your terminal

#122
post #70

Earlier quoted context omitted.

This is true of anything that ever renders to your terminal. I'm not sure this class of issue is worth worrying about, generally. Sure, these are neat and scary examples. Have you seen some of the recent GPU driver ACEs? Better not render any graphics! A generalization of this is "receiving information from third parties can lead to security issues" which is of course true. Untrusted inputs are always untrusted. Pipi…

Completely agree, but also I remember that 'piping curl into bash' was always one of the biggest no-no's. I held onto this for so long, but then realized every time I run 'npm i' arbitrary commands can also run, and now it seems wild that I ever cared about curl | bash on websites that I trust

Coming from a Windows world, I've never worried about the `curl | bash` thing. If I would trust an opaque Windows executable from a site, why would I not trust an equally opaque `curl | bash`?

I've even seen people concerned about installing Homebrew that way. It is probably one of the most confusing concerns regarding `curl | bash` given that the it's a package manager designed to run arbitrary Ruby code and is often pulling down precompiled applications.

Re: `curl wttr.in`: Weather in your terminal

#123
post #72

Earlier quoted context omitted.

Curl isn't the problem they're describing. The remote can assume you're running it in a terminal (especially since the user agent string indicates you're using curl) and can send malicious escape sequences in the body, which will be interpreted by your terminal emulator in most cases. This is true of any program that prints output directly from a remote host / untrusted source. In the event your terminal emulator has…

is there way to “sanitize” the curl output such that escaping is disabled? another commenter mentioned the threats of graphics, but this seems more concerning, esp. in an elevated shell. maybe pipe curl to a text file and inspect before running?

Don't use a terminal emulator, or yes redirect to a file. But that means you'll need to know what the escapes do, and they look cryptic to the layperson. Also, inspect with an editor that replaces non-printing with some other character (like vim, unlike cat) otherwise it's just as bad as letting curl output.

And even then, this is probably not a threat you need to worry about.

Re: `curl wttr.in`: Weather in your terminal

#124
post #12

Earlier quoted context omitted.

That would be cool, but how would you condense the information enough that it's both useful and doesn't take up 2/3 of a line?

I might be a heathen, but my PS1 is as long as it wants to be, and ends with \n$

That's a great old-school idea. I used to run it that way but forgot.

I have also started adding a time stamp to the second, so that when I run long commands and come back later in a tmux session I can see when it finished.

Re: `curl wttr.in`: Weather in your terminal

#126
post #104

Earlier quoted context omitted.

Yes, and I use terminal emulators too, but I look at it the same way I look at browsers. Sure, there is a lot of useful stuff being made with heavy Javascript dependencies, weird Web frameworks, etc., but this doesn't mean that the technology is good in itself.

a terminal is the bare minimum you get when installing an OS (think Arch). is what gives you the power and speed to shape your workflow exactly the way you want it. running shell inside Emacs is not a bad idea, but you don’t get emacs when you install a new OS. you get a terminal that then lets you install emacs. at that point, you might as will just use the terminal.

I don't get what that has to do with my point. Arch leans into terminal enthusiasm, so it is natural that by default all they offer is a tty to install the distribution. But as most other distributions prove, this is not necessary.

Re: `curl wttr.in`: Weather in your terminal

#127
post #70

Earlier quoted context omitted.

This is true of anything that ever renders to your terminal. I'm not sure this class of issue is worth worrying about, generally. Sure, these are neat and scary examples. Have you seen some of the recent GPU driver ACEs? Better not render any graphics! A generalization of this is "receiving information from third parties can lead to security issues" which is of course true. Untrusted inputs are always untrusted. Pipi…

Completely agree, but also I remember that 'piping curl into bash' was always one of the biggest no-no's. I held onto this for so long, but then realized every time I run 'npm i' arbitrary commands can also run, and now it seems wild that I ever cared about curl | bash on websites that I trust

Part of the reason is that your connection could be interrupted … and then now what? Hope you like sifting through the script’s entirety and manually checking how much it’s done so far.

Re: `curl wttr.in`: Weather in your terminal

#128
post #42

In the USA, I like the National Weather Service direct APIs. I wish I could get more granular forecast data, both in time and space, but they forecast dewpoint/humidity, which is really nice.

dewpoint is underrated

https://www.weather.gov/arx/why_dewpoint_vs_humidity

> less than or equal to 55: dry and comfortable

> between 55 and 65: becoming "sticky" with muggy evenings

> greater than or equal to 65: lots of moisture in the air, becoming oppressive

Re: `curl wttr.in`: Weather in your terminal

#129

If only there's a $PS1 version

i know you’re referring to the shell prompt, but it reminded me that PowerShell file extension is also *.ps1 (which I find strange as I’m not used to seeing numbers in file extensions). didn’t this really come up when MS was designing PowerShell?

i think they count the namespace pollution as free advertising

Re: `curl wttr.in`: Weather in your terminal

#130
My little custom command (HN formatting break it all so need to be nicely formatted again).

alias weather=weather function weather() { if [ $# -le 2 ]; then Command="wttr.in/$1" if [ $# -eq 2 ]; then Command="$Command,$2" fi fi Command="curl ${Command// /%20}" eval $Command }

Post reply on HN