6 ms·
RunAsDate – Run a program with the specified date/time (2019)
- janci 5y agoI started Firefox with it set to 2000 and all webpages now have blinking and scrolling text!
- sombremesa 5y agoThose are the Google “warning” banners trying to switch you to Chrome. I get them even in 2021!
- 1f60c 5y agoWhen would this be useful?
- 0xEFF 5y agoUnit testing.
- pletnes 5y agoOr better, integration test where multiple executables are involved, making regular in-process mocking unusable.
- ghoward 5y agoTesting. Maybe a bug only appears around midnight, or near Easter. This makes that easier to reproduce.
- myself248 5y agoGimme gimme gimme? ;)
- ghoward 5y agoYep! You got my reference. For all others, see [1] and [2] . [1]: https://unix.stackexchange.com/questions/405783/why-does-man-print-gimme-gimme-gimme-at-0030 https://unix.stackexchange.com/questions/405783/why-does-man... [2]: https://news.ycombinator.com/item?id=15747313 https://news.ycombinator.com/item?id=15747313
- kburman 5y agoRun some trail software forever.
- ape4 5y agoBut 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 5y agoI would need RunAsTimezone
- deleted 5y ago[deleted]
- kelnos 5y agoOn 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.
- OJFord 5y agoFixing things like: https://en.wikipedia.org/wiki/Year_2000_problem https://en.wikipedia.org/wiki/Year_2000_problem https://bugs.launchpad.net/ubuntu/+source/cupsys/+bug/255161/comments/28 https://bugs.launchpad.net/ubuntu/+source/cupsys/+bug/255161... https://en.wikipedia.org/wiki/Year_2038_problem 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-speed-up-game-clocks-your-android-device-for-faster-farming-0140383/ https://smartphones.gadgethacks.com/how-to/hacking-time-spee... https://www.raymond.cc/blog/how-to-extend-the-trial-period-of-a-software/ 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 5y agoWhen your printer can't print on Tuesdays: https://bugs.launchpad.net/ubuntu/+source/file/+bug/248619 https://bugs.launchpad.net/ubuntu/+source/file/+bug/248619
- curiousgal 5y agoBack in school we used to use it to run SAS 9.4
- IggleSniggle 5y agoTimed license or something? I’ve heard of SAS but have never used it. Any good?
- curiousgal 5y agoYeah, 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 5y agoYou 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.
- fiftyacorn 5y agoFinancial quarter ends or year ends
- boba10 5y agoWe have program registered till date. The software company went bust. You run the software with correct time and it runs.
- tom7 5y agoWe 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 5y agoIf you don't need to worry about updates or litigation, just reverse engineer the date check and crack it.
- dharmab 5y agoSounds like a use case for Ghidra to be sure.
- theden 5y agoIs there an equivalent tool for *nix OSes?
- jarenmf 5y agofaketime '2008-12-24 01:15:43' /bin/date
- amelius 5y agoCan it also slow down the clock?
- jarenmf 5y agoIndeed, you can: faketime -f '+2y x0.1' /bin/bash -c 'date; while true; do echo $SECONDS ; sleep 1 ; done'
- marcodiego 5y agoI 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.
- Too 5y agoWhat is the difference in philosophy here? RunAsDate also has an equivalent cmdline interface, if that is what you are referring to?
- lanerobertlane 5y agoI'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 5y agoIt'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 5y agoNir'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 5y agoagreed. 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 5y agoMake 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 5y agoHe'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 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.)
- deleted 5y ago[deleted]
- gompertz 5y agoThis 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?
- vxNsr 5y agoAside from the trial thing, what’s the use case for this?
- biryani_chicken 5y agoGames 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 5y agoAmong other things, I assume for testing your code with date handling edge cases like leap years, leap seconds, 2038, etc.
- svnpenn 5y agoI 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 5y agoIt 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 5y agoIt 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.
- FounderBurr 5y agoBy most measures these programs are more “free” than any gpl software.
- svnpenn 5y agoIt seems you dont know what open source means.
- orliesaurus 5y agoUsed this back in the day, solid tool! Thanks Nirsoft
- rasz 5y ago2007
- tialaramex 5y agoSeveral 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 5y agoI 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.
- tgtweak 5y agoCaveat - timestamp servers are a thing... Having your certificate cross-signed by a timestamp server ensures that even if the root certificate expires your application can continue to run provided that a timestamp server was in fact used at the moment of signing, and thusly vetted the certificate authority at that time. This allows for windows applications signed long before their cert expired can continue to run until a new signed version is deployed. This doesn't take into account certificate revocation. Regardless, moving the date up is a good way to test.
- weinzierl 5y agoNirSoft 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 5y agoMost likely flagged as a generic malware from heuristics because of the API calls their tools use.
- zinekeller 5y agoNot the real reason in some cases. Some malware actually uses NirSoft tools (and even SysInternal tools) for, uhm, malware stuff :( I mean, I can't fault some of the antivirus for these, especially since "regular"* users they don't really know about these powerful tools, but I agree that clicking a standalone executable that is otherwise safe shouldn't automatically trigger an antivirus. * "Regular" at least as viewed by antivirus companies, like picture a grandma, but I think that's not representative of the real world today.
- msaharia 5y agoWhat 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).
- aaaaaaaaaaab 5y agoHmm, I wonder if there's a way to do this for a whole Docker container?
- CyberShadow 5y agoTime 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 5y agoRelated 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"?
- rossy 5y agoA fun fact about Windows is that you can just pluck the system time out of a known memory location (0x7ffe0014). It's unlikely that a tool like this could patch that and I wouldn't be surprised if it's one of the techniques that shareware can use to detect tampering with the system time. I wouldn't be surprised if video games used it to prevent cheating either. What did surprise me is that the Go runtime appears to use it too.
- compsciphd 5y agoI'd assume one would just set a breakpoint on memory read of that location and return a different value to the application?
- nly 5y agoLinux has something similar, where the gettimeofday function is commonly made available via a VDSO https://en.m.wikipedia.org/wiki/VDSO https://en.m.wikipedia.org/wiki/VDSO