[HN Gopher] RunAsDate - Run a program with the specified date/ti...
       ___________________________________________________________________
        
       RunAsDate - Run a program with the specified date/time (2019)
        
       Author : thunderbong
       Score  : 102 points
       Date   : 2021-08-08 14:06 UTC (8 hours ago)
        
 (HTM) web link (www.nirsoft.net)
 (TXT) w3m dump (www.nirsoft.net)
        
       | msaharia wrote:
       | What a blast from the past! I used runasdate to run a Neural
       | Network software using time-lagged RNNs beyond the trial period.
       | In my defense, I was a poor undergrad and couldn't afford the
       | license fee of the software (Circa 2010).
        
       | weinzierl wrote:
       | NirSoft looks legit with a real person (Nir Sofer) behind it. It
       | also is around for a long time. Moreover people in this and other
       | threads seem to trust NirSoft tools, so I assume they are safe to
       | use. It's a pity that whenever I tried they got quarantined by
       | enterprise end point security (aka virus scanner).
       | 
       | EDIT: I just sent NirSoft's GDIView, which is the tool I tried to
       | use in the past, to virustotal and it sadly gets flagged by two
       | vendors. Now that's only two out of about 70. Unfortunately in
       | large organizations we have no choice, if it gets detected it
       | cannot be used.
        
         | mysterydip wrote:
         | Most likely flagged as a generic malware from heuristics
         | because of the API calls their tools use.
        
       | rasz wrote:
       | 2007
        
       | vxNsr wrote:
       | Aside from the trial thing, what's the use case for this?
        
         | biryani_chicken wrote:
         | Games that use the system clock to timegate stuff. Nier
         | Replicant, for example, uses the system clock for its gardening
         | minigame. You have to wait 24 real hours for your plants to
         | grow, or change the date in your system.
        
         | FPGAhacker wrote:
         | Among other things, I assume for testing your code with date
         | handling edge cases like leap years, leap seconds, 2038, etc.
        
       | aaaaaaaaaaab wrote:
       | Hmm, I wonder if there's a way to do this for a whole Docker
       | container?
        
         | CyberShadow wrote:
         | Time namespacing would achieve this, had it not omitted the
         | real-time clock:
         | 
         | > Note that time namespaces do not virtualize the
         | CLOCK_REALTIME clock. Virtualization of this clock was avoided
         | for reasons of complexity and overhead within the kernel.
        
       | gizmo686 wrote:
       | Related question, does anyone know of a tool to change the time
       | speed of a program. Something like "make the program think an
       | hour passed every minute"?
        
       | janci wrote:
       | I started Firefox with it set to 2000 and all webpages now have
       | blinking and scrolling text!
        
         | sombremesa wrote:
         | Those are the Google "warning" banners trying to switch you to
         | Chrome. I get them even in 2021!
        
       | 1f60c wrote:
       | When would this be useful?
        
         | fiftyacorn wrote:
         | Financial quarter ends or year ends
        
         | boba10 wrote:
         | We have program registered till date. The software company went
         | bust. You run the software with correct time and it runs.
        
         | 0xEFF wrote:
         | Unit testing.
        
           | pletnes wrote:
           | Or better, integration test where multiple executables are
           | involved, making regular in-process mocking unusable.
        
         | ghoward wrote:
         | Testing.
         | 
         | Maybe a bug only appears around midnight, or near Easter. This
         | makes that easier to reproduce.
        
           | myself248 wrote:
           | Gimme gimme gimme? ;)
        
             | ghoward wrote:
             | Yep! You got my reference.
             | 
             | For all others, see [1] and [2] .
             | 
             | [1]: https://unix.stackexchange.com/questions/405783/why-
             | does-man...
             | 
             | [2]: https://news.ycombinator.com/item?id=15747313
        
         | kburman wrote:
         | Run some trail software forever.
        
           | ape4 wrote:
           | But not all, the author says: I get many email messages that
           | say something like "I tried to extend the trial period of xyz
           | software with RunAsDate and it didn't work". Running a
           | software with different date/time can be used for many
           | legitimate purposes and for these purposes RunAsDate was
           | created. I have never said implicitly or explicitly that
           | RunAsDate can be used for extending the trial period of a
           | software. For some shareware programs, RunAsDate might really
           | work, but many shareware creators are smart enough to detect
           | that the date/time was modified and when they detect the time
           | change, they end the trial period immediately. Please don't
           | bother yourself to send me a question about extending the
           | trial period of a software, because these kind of messages
           | are simply deleted without answering.
        
         | janci wrote:
         | I would need RunAsTimezone
        
           | kelnos wrote:
           | On Linux (well, glibc, not sure about other libc
           | implementations) you can just set the `TZ` environment
           | variable before running the app. I wonder if Windows has
           | something similar.
        
           | [deleted]
        
         | OJFord wrote:
         | Fixing things like:
         | 
         | https://en.wikipedia.org/wiki/Year_2000_problem
         | 
         | https://bugs.launchpad.net/ubuntu/+source/cupsys/+bug/255161...
         | 
         | https://en.wikipedia.org/wiki/Year_2038_problem
         | 
         | Testing features like:
         | 
         | - night mode
         | 
         | - calendar 'today' visualisation on different days of month
         | etc.
         | 
         | Cheating like:
         | 
         | https://smartphones.gadgethacks.com/how-to/hacking-time-spee...
         | 
         | https://www.raymond.cc/blog/how-to-extend-the-trial-period-o...
         | 
         | In that last link, #1 is actually (coincidentally, that wasn't
         | in my search) the software submitted here.
        
         | dharmab wrote:
         | When your printer can't print on Tuesdays:
         | https://bugs.launchpad.net/ubuntu/+source/file/+bug/248619
        
         | tom7 wrote:
         | We have proprietary software that was registered until X date
         | and the company went bust. Changing the date allows the
         | software to run.
        
           | james_in_the_uk wrote:
           | If you don't need to worry about updates or litigation, just
           | reverse engineer the date check and crack it.
        
             | dharmab wrote:
             | Sounds like a use case for Ghidra to be sure.
        
         | curiousgal wrote:
         | Back in school we used to use it to run SAS 9.4
        
           | IggleSniggle wrote:
           | Timed license or something? I've heard of SAS but have never
           | used it. Any good?
        
             | curiousgal wrote:
             | Yeah, a free trial.
             | 
             | It's a niche statistical analytics programming language.
             | Used by banks and pharmaceutical companies mostly because
             | it makes it easier to audit things. The open source
             | alternative would be R.
        
         | kazinator wrote:
         | You might be able to obtain reproducible behavior from a tool
         | that insists on putting time stamps into its output, and has no
         | options for reproducibility.
         | 
         | You might be able to get an indefinite extension for running
         | some time-limited trialware.
        
       | tialaramex wrote:
       | Several people have asked in existing threads why you'd want
       | this, so, let's give a _very real_ example that we can guess
       | probably at least one HN reader will be grateful for:
       | 
       | At the end of next month (September 2021) the root CA certificate
       | for DST Root CA X3 expires.
       | 
       | When a new CA comes into existence in the Web PKI they face a
       | significant problem, even if all the brand new shiny software
       | trusts their excellent new CA root, almost everybody at least
       | sometimes needs old software that might not have the latest
       | updates. So, they get an existing trusted CA to sign to say that
       | _they_ trust this new CA.
       | 
       | The charity that provides Let's Encrypt, ISRG, has a root CA
       | named ISRG Root X1 (and a newer one named ISRG Root X2 but that's
       | another matter) but they also sought such cross signatures from
       | IdenTrust, who had bought the Digital Signature Trust and with it
       | DST Root CA X3 in order to "bootstrap" trust on older systems.
       | 
       | So up until late September, a device that has no idea who ISRG
       | are or what Let's Encrypt is, still trusts Let's Encrypt
       | certificates, because it trusts DST Root CA X3. And then the
       | self-signed certificate for DST Root CA X3 expires.
       | 
       | Tools like RunAsDate allow you to test your software to see
       | whether it will still work _after_ that expiry date. It wasn 't
       | really practical to run such tests a few months ago, because if
       | in say May you tell the computer it's now the 1st of October all
       | your perfectly _good_ Let 's Encrypt certificates issued in April
       | have expired by October, so that's why nothing works. However,
       | since early July it has been possible to have certificates that
       | will not be expired when DST Root CA X3 expires and perform such
       | tests.
       | 
       | Lots of maintainers probably look after systems where they can't
       | (or at least, daren't) add a newer root like ISRG Root X1 and
       | would value knowing in advance that the system will blow up
       | completely at the end of September, rather than being blind-sided
       | when it inevitably happens. RunAsDate (and similar tools on other
       | systems) enable them to find that out with a few weeks left to
       | fix or at least mitigate the problem.
        
         | monkpit wrote:
         | I would assume the reason most people would use this is to
         | spoof simple "trial period" checks on older software. I
         | remember, as a kid, setting the clock back on shareware in
         | order to run the full version. This would make it more
         | convenient since you don't have to alter system time.
        
       | svnpenn wrote:
       | I would like to take this opportunity to note that all NirSoft
       | tools are closed source.
       | 
       | Its nice that "Nir" or whoever has made them freely available,
       | but when the day comes that they are not updated anymore, because
       | of lack of interest, or life changes or whatever, all the effort
       | that went into making them is lost to history. No one will be
       | able to fork the project, or continue on with the work, as the
       | source code was never released.
        
         | thesuperbigfrog wrote:
         | It is "Nir" or whoever's work and choice about what license to
         | use.
         | 
         | If you wrote a book and some of your readers demanded that you
         | let them write the sequels, you might be quite annoyed.
         | 
         | Creators have rights and it is respectful and just to honor
         | their choices.
         | 
         | Maybe "Nir" or whoever will release the tools under an open
         | source license upon retirement or something, but that is up to
         | them.
        
           | guenthert wrote:
           | It isn't disrespectful to point out that choice and in fact
           | helpful to us consumers who might chose not to bother with
           | such software as all too often such became abondonware. I
           | recall cases where the author had a disk crash, no back-up
           | and then gave up out of frustration or another case where the
           | author died untimely.
        
       | theden wrote:
       | Is there an equivalent tool for *nix OSes?
        
         | jarenmf wrote:
         | faketime '2008-12-24 01:15:43' /bin/date
        
           | marcodiego wrote:
           | I like differences between OS philosophies. It allows us to
           | see how some things can be done way simpler and highlights
           | strengths and weaknesses of different ideas.
           | 
           | Not being a windows guy for a long time, I was impressed that
           | windows users were happy when chrome implemented the "print
           | to pdf" feature, I said "CUPS let me print to ps or pdf a
           | decade ago". Another moment like that was when I showed the
           | 'time' command to a student as a crude benchmark for
           | algorithms and also using LD_PRELOAD to easily show that his
           | code had leaks, then complemented it with valgrind and leak
           | sanitizer.
           | 
           | Leak sanitizer is multi-platform, valgrind can be replaced by
           | drmemory and, of course, windows has many advantages that
           | made it earn the desktop but, at the time, nothing like that
           | was close on windows as a quick apt-get.
           | 
           | A trick I usually do these days is when someone argues about
           | developing something new. I think about a somewhat similar
           | package and "apt-get build-dep" and "apt-get source" it. In a
           | matter of minutes I have dependencies for a package, its
           | source code, compile and install it. People always get
           | impressed at how easy it can be.
        
           | efficax wrote:
           | faketime is great. I use it in continuous integration tests
           | for some software that needs to work correctly in temporal
           | edge cases (near midnight, leap days, etc.)
        
           | amelius wrote:
           | Can it also slow down the clock?
        
             | jarenmf wrote:
             | Indeed, you can: faketime -f '+2y x0.1' /bin/bash -c 'date;
             | while true; do echo $SECONDS ; sleep 1 ; done'
        
       | orliesaurus wrote:
       | Used this back in the day, solid tool! Thanks Nirsoft
        
       | lanerobertlane wrote:
       | I'd just like to use this comment to show appreciation of
       | Nirsoft's stuff. Great useful single function utilities for
       | practically anything, for free, without any catch.
       | 
       | Many times I've needed to do something that seems simple but
       | isn't exposed easily, and rather than figure it out myself
       | there's a gui or cli app that just does exactly what I need.
        
         | folkhack wrote:
         | It's so difficult to find trustworthy independent publishers in
         | the Windows world and Nirsoft nails it. Tools that are designed
         | to empower users with zero strings attached - seriously helpful
         | stuff.
        
       | tgtweak wrote:
       | Nir's applications are gems. They are extremely lightweight, sane
       | and well documented, static, cost nothing and receive regular
       | updates (19 released updates since July...) - all by one guy who
       | actually answers his emails and blogs excellent content with
       | regular frequency (reached out about a library based on one of
       | his apps and he took the time to reply and explain the reasoning
       | for not publishing as a library).
       | 
       | Really, the only other (windows) applications I can sing the same
       | praise for are the sysinternals suite.
        
         | artiszt wrote:
         | agreed. on that platform, forced to use it, NirSoft is
         | indispensable and like an much appreciated breeze of fresh air
         | -- much like Hexfiend and alike, Filebuddy, and BBEdit were
         | already under Apple's Classic OS
        
         | myself248 wrote:
         | Make use of the "donate" link in the sidebar!
         | 
         | I have no idea how much he brings in from thankful folks like
         | us who recognize how much time he's saved us, but it's surely
         | not as much as it should be. I set aside a chunk of money every
         | year for supporting software authors, and Nir comes up in my
         | list every few years.
        
         | sundvor wrote:
         | He's like the Stephen King of programming - just extremely
         | prolific.
         | 
         | His full list of tools is jaw dropping:
         | 
         | https://www.nirsoft.net/utils/index.html
         | 
         | (The IP tools have been very helpful in the past. I've got a
         | new install now and that's a reminder for myself to get set up
         | again; will use the donate link too.)
        
         | gompertz wrote:
         | This is such a gem indeed! Websites like these, with small,
         | bloat free utilities, are gone with the wind it seems. Can
         | anyone recommend other similar websites?
        
         | [deleted]
        
       ___________________________________________________________________
       (page generated 2021-08-08 23:02 UTC)