set_time-and_date ungoogled

Forum › Forums › antiX-development › Development › set_time-and_date ungoogled

  • This topic has 41 replies, 9 voices, and was last updated Sep 29-6:00 pm by Brian Masinick.
Viewing 15 posts - 16 through 30 (of 42 total)
  • Author
    Posts
  • #186152
    Brian Masinick
    Moderator

      Fixed version at git already.
      Please fetch the updated script

      Done; looking good @Robin!

      Also, the README.md provides a lot more information
      about the fetch-time-antiX tool.

      Testers, if there is still any detail that you want
      @Robin to address or document, please speak up.

      Good progress has been made in a short amount of time;
      nice work!

      --
      Brian Masinick
      Alternate "Search B":
      This search page

      #186175
      blur13
      Member

        Forgive my ignorance, but what is the advantage of using this script over simply installing eg chronyd and having the system automatically update the time, or using sudo chronyd -q to update the time at the users discretion?

        I realise I’m missing something here and that this script probably does something more.

        #186179
        Brian Masinick
        Moderator

          Forgive my ignorance, but what is the advantage of using this script over simply installing eg chronyd and having the system automatically update the time, or using sudo chronyd -q to update the time at the users discretion?

          I realise I’m missing something here and that this script probably does something more.

          I typically have ntpsec running but if something gets out of whack this tool has been helpful too.

          --
          Brian Masinick
          Alternate "Search B":
          This search page

          #186184
          Robin
          Member

            what is the advantage of using this script over simply installing eg chronyd and having the system automatically update the time, or using sudo chronyd -q to update the time at the users discretion?

            Simplicity. antiX is mean and lean, so are its inhouse tools. The script doesn’t need all the additional packages chrony requests to be installed as dependencies.

            Pre-Depends: init-system-helpers (>= 1.54~)
            Depends: adduser, iproute2, tzdata, ucf, libc6 (>= 2.29), libcap2 (>= 1:2.10), libedit2 (>= 2.11-20080614-0), libgnutls30 (>= 3.7.0), libnettle8, libseccomp2 (>= 2.4.3-1~)

            The script merely connects the one of the configured servers directly and returns the corrected time. User has full control over what servers are connected, and what data is sent. Actually the script doesn’t send anything but a time stamp to the server, and reads nothing but two values (fields, containing two time stamps) from the returned answer. Most likely chrony does not send something else, but who can tell for sure when looking at the sheer line count of their source code?

            For comparison: Source code line count
            Chrony: 77048 lines (without all the dependencies already)
            fetch-time-antiX: 244 lines

            The 244 lines are understandable easily (well commented, at least I do hope I succeeded in doing so), mostly to everybody who wants to check out.

            And then, it is merely meant as an ungoogled replacement to the currently still applied method used by set_time-and_date.sh in antiX Control Centre asking a google server for the current time, which was unfortunately used until now. As simple and straightforward as the former googled method also was, not expecting the user to install a fully featured NTP daemon.

            Windows is like a submarine. Open a window and serious problems will start.

            #186185
            Robin
            Member

              Script has been updated at git, now featuring gettext translations for all of its messages, which are already at transifex. Also the nasty warnings about experimental::switch have been silenced. Hopefully this silencing will in future perl versions no longer be needed.

              Windows is like a submarine. Open a window and serious problems will start.

              #186187
              Brian Masinick
              Moderator

                @Robin now that you mention it, I had been using ntpsec because when I looked at Chrony it was too cumbersome. I got away from ntpd either because it too was getting old and crumbly or it was introducing systemD stuff that I didn’t want. While I’m not as concerned about Google as some people are, I’m happy not to access any extraneous servers; an NTP daemon service ought to be just that, so I believe in what you’re doing. The lean nature of your approach and the rapid development and improvements speak for themselves.

                --
                Brian Masinick
                Alternate "Search B":
                This search page

                #186189
                Brian Masinick
                Moderator

                  @Robin, I’m sorry, I found another typo; not sure if it got introduced or I just
                  missed it. The spelling should be automatically on the fetch line.

                  Other than these little details, this is really shaping up very nicely!

                  --
                  Brian Masinick
                  Alternate "Search B":
                  This search page

                  #186201
                  Robin
                  Member

                    automatically

                    Sorry, Brian, this was too late for hitting the resource push to transifex yesterday. Now it’ll be fixed by entering it into en_GB and en_US translation at transifex. Many thanks for spotting the typo!

                    Windows is like a submarine. Open a window and serious problems will start.

                    #186202
                    Robin
                    Member

                      Hi @PPC

                      The script states, you have started on it at Jul 31st, 2019. Do you happen to know, what version number you had assigned, so we can add these (meanwhile incremented) numbers to the scriptfile now, in order to keep the added gettext translation files at transifex in sync with the respective script file?

                      better, GUI way to set time zones … I tried one such GUI a couple of years ago

                      Feel free to give it another try. Seems there is no way to convince the dpkg-reconfigure tzdata CLI to accept mouse input like other CLI tools we know. Not even when running in urxvt, which made some other CLI tools like htop work fine by mouse and even mouse wheel. No chance wiht this one, I’ve tried to modify the call, all in vain. So cresting and mastering a simple GUI frontend without bells and whistles, unlike the bolide frontends in DEs; that indeed would be a nice to have for people afraid of using the keyboard or consider this “that much eighties”.

                      Windows is like a submarine. Open a window and serious problems will start.

                      #186217
                      Brian Masinick
                      Moderator

                        automatically

                        Sorry, Brian, this was too late for hitting the resource push to transifex yesterday. Now it’ll be fixed by entering it into en_GB and en_US translation at transifex. Many thanks for spotting the typo!

                        Quite alright @Robin, especially since I’m not positive of whether that was a spelling regression or if I managed to miss it earlier. In any case it’s a minor thing. When I tried that build from yesterday I tried it on different hardware, so I also had to get the openntpd package; the documentation on the dialogue mentioning this was correct, and I made an honest attempt to check spelling on everything there; hope I didn’t miss anything else; hopefully there are a few other people with sharper eyes to help out both of us in this regard.

                        Nevertheless @Robin, this has been a great effort that was started, extended, and in almost final condition within what, two days? So if a few more tweaks are needed, I still think it’s quite good. Hopefully other participants will focus on the things that matter to them so that if there is anything else, it’ll be caught well before we ship antiX 25. Once again I thank you for an excellent idea and a very good implementation!

                        --
                        Brian Masinick
                        Alternate "Search B":
                        This search page

                        #186226
                        marcelocripe
                        Member

                          Thank you very much, Robin.
                          I’ve finished the “pt_BR” translation of the “fetch-time-antix” program.
                          I still have 937 entries to translate in the “antix23-desktop-files” program and 35 entries to translate in the “antix23-desktop-files-extra” program.
                          I expect that I won’t be able to finish the “antix23-desktop-files” and “antix23-desktop-files-extra” resources until next weekend.
                          Where is the new “set time-and-date” program? I want to look at the running program to adjust each of the sentences in the “pt_BR” translation.

                          #186229
                          PPC
                          Member

                            Where is the new “set time-and-date” program? I want to look at the running program to adjust each of the sentences in the “pt_BR” translation.

                            http://www.antixforum.com/forums/topic/set_time-and_date-ungoogled/#post-186045

                            #186241
                            PPC
                            Member

                              Feel free to give it another try.

                              Now I have AI to help me. Check this out and tell me if you like it:

                              #!/bin/bash
                              #Get the full list of timezones:
                              cd /usr/share/zoneinfo/posix && find * -type f -or -type l | sort > /tmp/time_Zones.txt
                              
                              # Specify the path to the text file
                              TEXT_FILE="/tmp/time_Zones.txt"
                              
                              # Check if the file exists
                              if [[ ! -f "$TEXT_FILE" ]]; then
                                  yad --title="Error" --text="File not found: $TEXT_FILE" --button="OK:0"
                                  exit 1
                              fi
                              
                              # Read the file and display its lines in a selection window
                              newtz=$(yad --title="Select a Time Zone" --icon=calendar --center\
                                  --width=400 \
                                  --height=300 \
                                  --list \
                                  --column="Time zones:" \
                                  --no-markup \
                                  --button="OK:0" \
                                  --button="Cancel:1" \
                                  < "$TEXT_FILE")
                              
                              # Check if something was selected
                              if [[ $? -eq 0 && -n "$newtz" ]]; then
                              	newtz="${newtz%|}" #REMOVE TRAILING "|"
                                  	echo "You selected: $newtz"
                              
                              	#Change the timezone:
                               	sudo rm -rf /etc/localtime
                              	sudo ln -s /usr/share/zoneinfo/$newtz /etc/localtime
                              
                              fi

                              P.

                              #186246
                              marcelocripe
                              Member

                                PPC, what is on the page http://www.antixforum.com/forums/topic/set_time-and_date-ungoogled/#post-186045 is “fetch-time-antix” and not “set time-and-date”.

                                Download at https://gitlab.com/Robin-antiX/fetch-time-antix

                                #186248
                                blur13
                                Member

                                  Robin, thanks for the explanation. It makes sense.

                                  One advantage of chronyd -q is “when run in this mode, chronyd will set the system clock once and exit.”, ie there is no daemon perpetually running, wasting system resources and connecting to time servers. But it is one more package that needs to be installed and the script you (and others?) have developed circumvents that.

                                  Brian, you are probably using ntpsec because ntpd is deprecated because of security vulnerabilities. When I was comparing chrony and ntpsec, chrony turned out to be much lighter in system resource usage. It is also the ntp daemon used by the MX linux project.

                                Viewing 15 posts - 16 through 30 (of 42 total)
                                • You must be logged in to reply to this topic.