Online application timestamped by local PC instead of Server - timestamp-with-timezone

Is there a way to have my online application get the time and date from the user local machine instead of the server it resides on? The point is that there are users in different time zones and it will not make sense to have the standard UTC time stamp on their files. Thanks in advance fo ryour help.

Yes, with JavaScript new Date().

Related

How to email time-out notice from Google Cloud Storage?

I have a gsutil script that that periodically backs up data to Google Could Storage.
The gsutil backup script runs on my local box.
I would like to run a script (or service) on Google Could Storage, that emails a warning to the administrator when no backup has been made in 24 hours.
I am new to cloud services. Please point me in the right direction.
Where would such a script be located? Is there a similar example script?
Thank you.
There's no built-in feature that accomplishes this. However, you could accomplish something like this with another monitor program.
For example, I might edit my backup script such that after successfully completing a backup, it writes the current time to a "last_successful_backup.txt" file. Then, I'd put a cronjob wherever I keep my monitors and alerting systems that would check the "last_successful_backup.txt" file every few hours and set off an alarm if the time it contains is older than 24 hours.
What about to spin up Google VM and send emails from the instance? Using, say, SendGrid, Mailgun, or Mailjet

Rstudio AMI linkDropbox() gives no link

It is not the first time I use the Rstudio AMI from Louis Aslett on Amazon EC2, but this time the linkDropbox() function drives me crazy and I could not find any help on Google: it just doesn't give any link !
> linkDropbox()
Launching Dropbox client, please wait ...
Dropbox launched. Please visit the following URL in your browser now to link the server to your Dropbox account:
isn't
waiting (please do this now or linking may fail) ...
I don't know what this isn't do here, but there should be a link. Any one has had the same problem?
EDIT
It appears that the function gets stucks into the loop and return:
"This computer isn't linked to any Dropbox account..."
The best solution I came up with was to launch a new instance from a previous working image/snapshot - obviously not ideal if your existing instance has many packages/versions you need, but I found when I created a new AMI from Louis Aslett's site (after having trouble re-starting an old instance and updating Dropbox), I could not replicate behavior from February 2018 (except by using a snapshot of that previously functioning AMI). I am writing this in September 2018, so it is possible that the AMI's on Aslett's site will be updated and this won't be a problem anymore.
Good luck, future readers...
I had this problem, and realized that the security settings for the instance didn't allow outbound traffic on my current IP. I updated my security settings, ran unlinkDropbox(), and then ran linkDropbox() again, and it worked this time.

Move records from Development to Production in CloudKit

I did something silly and made hundreds of records in Development environment in CloudKit. A previous thread mentioned that the records could be downloaded into a file and re-uploaded to the Production environment. Is there any other way I could do this, and if not, how would I go about downloading in records and storing it into a file?
Thanks in advance!
There is no option do do it in one run. You need one app that is connected to the development environment for reading your records. Then if you want to write to the production environment, you can only do that by re-signing your app. So indeed you first need to download all data, store them somewhere, and then writing them back to your production database.
Since the CKRecord complies to the NSCoding protocol you can write the results of your query directly to a file using:
NSKeyedArchiver.archiveRootObject(records, toFile: filePath)
Then if you want to read that file you can use:
result = NSKeyedUnarchiver.unarchiveObjectWithFile(filePath)

Automatic script Codeigniter

How to make sure that every 24 hours run script automatically, which compares the current time with the time that is stored in the database, and if the current time is greater then I need to make changes to the database. I use Codeigniter.
CRON Jobs is the solution, but it is not script, it's server based application that runs every given time. You can setup it from hosting panel, but not all of the hosting providers support it :(

How can you set time zone setting per user?

Is there a way to set the time zone information to be unique for each Windows user? Like, a registry setting specific to that user.
For example, I want John to be CST and Mary to be PST. If John opens a program it says 5pm. If Mary opens a program it says 6pm.
Additional information: These users don't need to actually log in. I want to create two users, one for CST and one for PST, and use their credentials to run a program. The program will inherit their time zone settings and display the correct time.
More info: I plan on using these users in IIS for app pools so that different applications in the website can be run in different time zones and locales.
Thanks.
The only way Windows supports this is through Terminal Services, which won't help you. The time-zone settings are kept in the HKLM hive, and Terminal Services has a special setting that allows the Terminal Server to take a time-zone supplied by the incoming client-session and display that instead.
A better plan would be to use the timezone offsets in your code. StackOverflow is a better place to ask about that.
I haven't tried, but perhaps via cygwin you can use the TZ Environmental variable like under Unix/Linux. Env variables can be set on the command line by placing them before the command called - eg TZ=UTC xxxx.

Resources