Live data from Hacker News

`curl wttr.in`: Weather in your terminal

github.com

131–140 of 147 posts

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

#131
post #112

Earlier quoted context omitted.

Than you need a webcam out there, with a thermometer in the field of view. I live in a big city, it could be raining frogs in one part and a happy sunny day in the other and the best thing any weather report could say to me is 'expect rain'. And if I need to go it doesn't even matter what the report says or if I have/have not an umbrella with me. Honestly for the last decade even if I look at the weather report I loo…

> I live in a big city, it could be raining frogs in one part and a happy sunny day in the other and the best thing any weather report could say to me is 'expect rain'. Just in case you haven't seen it: some services provide conditions and forecasts for particular locations with better resolution than ‘the city’, and can show the projected movement of rainclouds. (You'll have to research the services for your country…

Well, I have such service, though it's a map with the current rainfall data.

Still, after I wrote the previous comment the rain has come. And in 15 minutes there was no rain and the sun shone brightly and in another 30 minutes even puddles all dried up. So the practical usability of such service is quite limited.

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

#133
post #122
post #70

Earlier quoted context omitted.

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 ofte…

Windows executables can be signed, and Homebrew formulae are theoretically reviewed and check a hash when they download binaries. With curl | bash, maybe the download fails partway through, or a hacker has replaced the executable on the server or the URL in the copy/paste instructions with a homograph spoof, or the site serves malware when it detects a curl agent.

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

#134
post #112

Earlier quoted context omitted.

> I live in a big city, it could be raining frogs in one part and a happy sunny day in the other and the best thing any weather report could say to me is 'expect rain'. Just in case you haven't seen it: some services provide conditions and forecasts for particular locations with better resolution than ‘the city’, and can show the projected movement of rainclouds. (You'll have to research the services for your country…

Well, I have such service, though it's a map with the current rainfall data. Still, after I wrote the previous comment the rain has come. And in 15 minutes there was no rain and the sun shone brightly and in another 30 minutes even puddles all dried up. So the practical usability of such service is quite limited.

I occasionally amuse myself by gawking at the formations of rainclouds in my vicinity, which included stuff from thunderclouds thousands of kilometers across, to jagged clouds bringing alternate rain and sunshine, to again a massive cloud covering this whole region except a circle right around my house. So I definitely can recommend finding such a service with cloud movement and with projection of it into the future—if only for the curiosity value.

The one I use is https://yandex.ru/pogoda/maps/nowcast — but I'm not sure if it works in English, and these days perhaps one will prefer not to use Yandex anyway.

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

#135

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…

> Better not render any graphics! Unironically a good idea. Graphics have always been a mistake - most engineers would agree that if we stuck with very basic output, our software would be in a much better place than today (and more usable, too!)

I don't understand this, how would you create a program to help explore (for example) a 2D coordinate space without any visual aids?

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

#136

Earlier quoted context omitted.

> Better not render any graphics! Unironically a good idea. Graphics have always been a mistake - most engineers would agree that if we stuck with very basic output, our software would be in a much better place than today (and more usable, too!)

I don't understand this, how would you create a program to help explore (for example) a 2D coordinate space without any visual aids?

    Jameson street: (10,220)->(4,110)
    Queens lane: (10,220)->(1,55)
    ...
    ...
    You are at: (15,220)
    Turn left at the next intersection.

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

#137
post #70

Earlier quoted context omitted.

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.

i'd imagine the download would have to finish first, before the piping into bash finishes and then bash interprets the finished script.

I find it hard to believe you could interpret a partial script on the fly as more comes in via stdin.

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

#138
post #137

Earlier quoted context omitted.

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.

i'd imagine the download would have to finish first, before the piping into bash finishes and then bash interprets the finished script. I find it hard to believe you could interpret a partial script on the fly as more comes in via stdin.

No, that's exactly how it works. Why would you write such a thing when you're clearly just guessing?

A shell script is interpreted one line at the time.

Very simple proof:

    $ while true; do printf 'date\n' && sleep 5; done | sh
    Mon 16 May 2022 07:19:21 AM CEST
    Mon 16 May 2022 07:19:26 AM CEST
    Mon 16 May 2022 07:19:31 AM CEST
In either case, if the network connection is interrupted, the download is finished. How would sh know it's not the whole script as the author intended it? Remember that in a pipeline the receiving end only sees the pipe, and won't know about the exit status of the process upstream (which may for all we know be zero anyway).

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

#140

Earlier quoted context omitted.

> Better not render any graphics! Unironically a good idea. Graphics have always been a mistake - most engineers would agree that if we stuck with very basic output, our software would be in a much better place than today (and more usable, too!)

I don't understand this, how would you create a program to help explore (for example) a 2D coordinate space without any visual aids?

West of House

You are standing in an open field west of a white house, with a boarded front door.

There is a small mailbox here.

Post reply on HN