WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: inxi.tcz : suggestion to add a depend  (Read 2664 times)

Offline Rantanplan

  • Newbie
  • *
  • Posts: 47
inxi.tcz : suggestion to add a depend
« on: May 19, 2023, 08:15:19 AM »
Hi and hello,

inxi provides up-to-date weather data.
To return the information successfully, wget must be installed.
Also, I suggest that wget.tcz be declared as a dependency of inxi.tcz

What do you think about it?
Best regards.

============= in french =================
Bonjour,

inxi permet d'obtenir des données météorologiques actualisées.
Pour retourner les informations avec succès, wget doit être installé.
Aussi, je suggère que wget.tcz soit déclarée comme une dépendance de inxi.tcz

Qu'en pensez-vous ?
Amitiés.


Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14621
Re: inxi.tcz : suggestion to add a depend
« Reply #1 on: May 19, 2023, 08:25:21 AM »
The busybox version of wget exists in the tinycore base - does inxi require the full version of wget?

Offline Rantanplan

  • Newbie
  • *
  • Posts: 47
Re: inxi.tcz : suggestion to add a depend
« Reply #2 on: May 19, 2023, 08:41:13 AM »
Hi Juanito,

I don't know.

I'll try tomorrow morning and will say you.

Thanks.

Offline Rantanplan

  • Newbie
  • *
  • Posts: 47
Re: inxi.tcz : suggestion to add a depend
« Reply #3 on: May 19, 2023, 09:27:44 AM »
@Juanito,

I just tried without loading wget.tcz and the feedback is:
Code: [Select]
wget: error getting response: Connection reset by peer
Weather:
  Message: No weather data found. Internet connection working?

And after loading wget.tcz, I get :
Code: [Select]
Weather:
  Report: temperature: 16.22 C (61 F) conditions: overcast clouds wind: from
    NNE at 6.1 m/s (22 km/h, 14 mph). Gusting to 6.1 m/s (22 km/h, 14 mph)
    cloud cover: 90% humidity: 74% pressure: 1018 mb (34 in)
  Locale: Langres, FR current time: ven. 19 mai 2023 18:23:00
    observation time: N/A Source: OpenWeatherMap.org

I conclude that the full version of wget is needed.

Many thanks.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14621
Re: inxi.tcz : suggestion to add a depend
« Reply #4 on: May 19, 2023, 10:02:20 AM »
Try busybox wget with the ca-certificates extension.

Offline Rantanplan

  • Newbie
  • *
  • Posts: 47
Re: inxi.tcz : suggestion to add a depend
« Reply #5 on: May 21, 2023, 09:30:41 AM »
Hi @Juanito,

Great idea, my dear. :)

After loading ca-certificates.tcz, I get the meteo data ("i feel so good..." by James Brown)  8) :
Code: [Select]
tc@box:~$ inxi -xxxW London,Europa
Weather:
  Report: temperature: 17.79 C (64 F) conditions: overcast clouds wind: from
    NE at 3.6 m/s (13 km/h, 8 mph) cloud cover: 100% humidity: 58%
    pressure: 1019 mb (34 in)
  Locale: London, Europa current time: dim. 21 mai 2023 18:17:43
    observation time: N/A Source: OpenWeatherMap.org

So, can you add "ca-certificates.tcz" in the "inxi.tcz.dep" file ?

Thank you for your help and guidance.

"Hasta la vista, baby !" in Terminator  :)

Best for you

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14621
Re: inxi.tcz : suggestion to add a depend
« Reply #6 on: May 22, 2023, 01:22:21 AM »
So, can you add "ca-certificates.tcz" in the "inxi.tcz.dep" file ?

That would be up to the maintainer of the inxi extension - I would recommend having ca-certificates as an optional dependency.

Offline Rantanplan

  • Newbie
  • *
  • Posts: 47
Re: inxi.tcz : suggestion to add a depend
« Reply #7 on: May 22, 2023, 02:23:31 AM »
Thank you so much Juanito.

Offline h2

  • Newbie
  • *
  • Posts: 15
    • smxi.org
Re: inxi.tcz : suggestion to add a depend
« Reply #8 on: July 14, 2023, 07:00:06 PM »
I just got back on these forums after some issues.

Generally, if there's an issue with inxi or packaging, it should go to me.

I just did a new inxi, but I'll add the ca-certificates to the build script.

However, with this said, be very careful with any use of weather feature, if you automated it you'll get banned from using it ever again instantly. The weather APIs used have changed a lot over the years, and every year gets worse, so I've had to massively restrict use of the feature, and it's likely to go away one day because another api is lost now almost every year.

Basically due to way too many years of constant abuse of the weather feature, there is now a zero tolerance policy and I don't remove bans or blocks manually anymore, I decided that the only way it stays is if I don't have to spend anymore time than absolutely necessary on it.

Note you can use some fine cli weather tools like witrr I think it's called, not sure if that's available in tce, but the basic idea is, if you didn't type in the weather request and hi t enter, you'll get banned pretty quick, and if you use it too much (the amount varies but is getting less and less by the year sadly).

I never really noticed ca-certificates issues because I always installed those so I could wget pinxi for testing on tc, or to grab the files I need from server, so I never thought about it being non installed.
« Last Edit: July 14, 2023, 07:10:14 PM by h2 »

aus9

  • Guest
Re: inxi.tcz : suggestion to add a depend
« Reply #9 on: July 14, 2023, 07:04:42 PM »
Hi h2

I love your extension.

Do you have a Raspberry Pi by any chance?

Offline h2

  • Newbie
  • *
  • Posts: 15
    • smxi.org
Re: inxi.tcz : suggestion to add a depend
« Reply #10 on: July 14, 2023, 07:08:29 PM »
hi aus9, no I don't have a pi, over the years I've had remote access to them now and then, and I have had other people test on it, but I haven't had consistent pi access now for at least a year.

I've also had some pinebook testers, and in the past, I've had other pi testers, like orange pi, and others, but lately ARM SOC board testing has fallen off a cliff, basically if I didn't do it directly it hasn't happened, and I in general can't work on ARM SOCs without having direct access to them because it's too complicated to emulate them with debuggers.

There was a period where manjaro arm guys did a lot, but that seems to have faded away as manjaro morphed away from that group of people about a year or two ago.

I think almost all the real pi support came because a guy gave me ssh access for a long time, maybe a year, so I could actually get all the stuff working, then a few people over past year have helped with debuggers and testing, and one guy about 6-8 months ago helped me again with ssh access to some pi os stuff, and craigevil got a pi4 laptop device, and we got some of the harder pi 4 stuff working, like bluetooth deteciton in particular, but that's been about it. The good part is you only need to access one board per release type since they are all identical specs, so it only takes one person basically.
« Last Edit: July 14, 2023, 07:20:14 PM by h2 »

Offline Rantanplan

  • Newbie
  • *
  • Posts: 47
Re: inxi.tcz : suggestion to add a depend
« Reply #11 on: July 15, 2023, 02:25:03 AM »
Bonjour @h2,

Merci pour votre retour.

Effectivement, j'ai essayé wttr et créé un script pour obtenir la météo.

Salutations.

===================in english with a online translator==============

Hello @h2,

Thanks for your feedback.

Indeed, I tried wttr and created a script to get the weather.

Best regards.

Code: [Select]
# permet d'obtenir la meteo sous forme d'image au format .png
# necessite un parametre : le lieu
clear
if [ $# -eq 0 ]
then echo "
+--------------------------------------------+
:  Il faut indiquer une localite.            :
:  Pour un nom compose, utilisez le signe +  :
:  entre chaque terme.                       :
:                                            :
:  Le programme va s'arreter.                :
+--------------------------------------------+
" && exit
fi
wget fr.wttr.in/$1.png
imlib2_view -s 1,1.125 $1.png
mv $1.png `date +%Y%m%d%H%M%S`_$1.png

Offline gadget42

  • Hero Member
  • *****
  • Posts: 668
Re: inxi.tcz : suggestion to add a depend
« Reply #12 on: July 15, 2023, 05:06:58 AM »
it was fun to review the information at:
https://github.com/chubin/wttr.in

thanks for the reminder!
The fluctuation theorem has long been known for a sudden switch of the Hamiltonian of a classical system Z54 . For a quantum system with a Hamiltonian changing from... https://forum.tinycorelinux.net/index.php/topic,25972.msg166580.html#msg166580

Offline h2

  • Newbie
  • *
  • Posts: 15
    • smxi.org
Re: inxi.tcz : suggestion to add a depend
« Reply #13 on: July 15, 2023, 12:00:13 PM »
The best way to think of the inxi weather feature is this: you are a sys admin, you want to check the weather at a remote server, so you do. One time. Then maybe at another remote system. That's really who it is made for, the fact of people instantly starting to abuse it massively by setting up rapid repeat cycles of requests by running inxi on an automated timer like a desktop widget caught me completely off guard when I first realized it was happening.

That's also a silly thing to do, because executing inxi takes a LOT of resources, on an old pentium MMX 200mhz laptop, it takes something like 12 seconds just to compile inxi's Perl to run it, then more seconds to actually execute the data operation requested. You can see how long it takes your system to parse inxi to run it by roughly the time it takes between you hitting enter and the time the first output appears on screen, -s or -M are both very fast to run internally so give a good idea of compilation time vs execution time since almost all the required time was compilation.

For example:
Code: [Select]
inxi -M;
Machine:
  Type: Desktop System: Gigabyte product: X470 AORUS ULTRA GAMING v: N/A
    serial: <superuser required>
  Mobo: Gigabyte model: X470 AORUS ULTRA GAMING-CF
    serial: <superuser required> BIOS: American Megatrends LLC. v: F62d
    date: 10/13/2021

real 0m0.194s
user 0m0.153s
sys 0m0.040s

In this case, almost no time is used to generate the data itself, so the user/sys time are probably fairly indicative of the compile time for the Perl, yielding 0.04 seconds to actually get the data,r oughly, maybe 0.06, hard to say. This would probably be spiking at least one and maybe more cores close to 100% as well. inxi prioritizes speed over system resource use since the idea is someone is running it for a reason, to get data, so it doesn't matter how many resources it uses while it's compiling and running. In fact, I'm now dropping more and more data straight into RAM as quicikly as possible, because accessing that is far faster than reading it from the system again, or generating that data repeatedly internally.

The way to think of how not to use inxi weather is if you want to see the weather on your desktop as a widget, then you want a plugin, something like wttr.

In all cases, you do NOT want to run whatever is supplying you with weather more than every 30-60 minutes for the very simple reason that weather APIs do not update their weather data that often, so that's just a total waste of requests, which is one reason the weather apis are starting to slash access numbers per allowed time period, and/or remove access completely as they are bought out and integrated into things like apple or commercial weather entities. I don't know how wttr does it, it looks like it's similar to what inxi does, send the request to the server which then returns the data, so I don't know how the wttr people do it, I guess the code might show it.
« Last Edit: July 15, 2023, 12:10:15 PM by h2 »

Offline Rantanplan

  • Newbie
  • *
  • Posts: 47
Re: inxi.tcz : suggestion to add a depend
« Reply #14 on: July 16, 2023, 09:33:36 AM »
Hi h2,

merci pour votre commentaire et votre analyse très intéressante.
J'ai besoin de la météo de manière très ponctuelle et pour quelques lieux (maximum 4).
Oui, l'abus de certains amènent les propriétaires à gérer drastiquement les accès.

Sincères saluations.

--------------------------english translation--------------------
Hi h2,

thank you for your comment and your very interesting analysis.
I need the weather forecast very punctually and for a few locations (maximum 4).
Yes, the abuse of some leads owners to drastically manage access.
Best regards