Jekyll date off by one - jekyll

I recently added a post to my Jekyll blog, and noticed that the date was off by one.
Instead of
http://www.tianxiangxiong.com/2016/09/24/dont-be-a-hacker.html
I ended up with
http://www.tianxiangxiong.com/2016/09/25/2016-09-24-dont-be-a-hacker.html
It's curently around 10:30 PM in California (5:30 AM UTC). Is this a time zone problem? If so, why does Jekyll care about any date aside from the one I specify in the file name?

Looks like the post is actually broken due to the quotes in your front matter:
excerpt: "Hacking" is not a satisfactory way of writing software
Should be:
excerpt: '"Hacking" is not a satisfactory way of writing software'
The timezone issue could be some sort of unintentional follow on behaviour from that, since the title and permalink are also messed up.
In any case, you could always set your timezone in _config.yml.
timezone: America/New_York
From https://jekyllrb.com/docs/configuration/:
Time Zone
Set the time zone for site generation. This sets the TZ environment variable, which Ruby uses to handle time and date creation and manipulation. Any entry from the IANA Time Zone Database is valid, e.g. America/New_York. A list of all available values can be found here. The default is the local time zone, as set by your operating system.

Related

What is the best way to store timezone in Laravel Migrations

I need to store client's timezone.
Haven't found a way to write it to DB using migration (laravel 8.5).
The purpose is like just display current time depends on what timezone user have selected.
What is the best practice to store client's timezone?
Usually the better way is to use UTC timezone in app.config.php , save registered user's timezone in database and display the result accordingly.
Just check this nice blog https://qcode.in/managing-users-timezone-in-laravel-app/

Wildfly - behaviour when reading configuration files

We have been updating configuration files for standalone deployed applications inside a number of directories like this:
[wildfly]\modules\system\layers\base\com\\configurations\main\
But when we do so we create a copy of the previous version with a time and date stamp, for example:
appname\env-setup.properties
appname\env-setup_201912201230.properties
We have been advised this is not a good idea because these date and time stamped files will also be read and result in values being set incorrectly.
Is this correct? Where can we learn more regarding how these settings are read?

How do I get time zone support for MySQL?

I've just begun attempting to use UTC on MySQL and it seems that my download did not include a timezone file and doesn't support it (it shows up as NULL).
I've looked around the MySQL website for a way to get timezone support loaded, but I can't seem to find anything.
Can someone walk me through the process or tell me whether there's a file I should import? I've already seen the manual pages, but it doesn't seem to apply to my situation.
Thanks!
What exactly are you trying to do?
The usual way would be to ignore timezone issues when you're storing things in the database. Put them in as timestamps, which will be timezone-agnostic (i.e., they'll be the time in UTC). When you want to display something in your application, you will need to retrieve the timestamp from the database and display it according to the appropriate timezone for the machine it's running on.

How to sign data in MySQL database revision safe (trusted timestamping)?

I am currently planning a project in which revision safety of the database data is important. This means: we want to be able to proof that the data in the database was not tempered with since it was imported - no user changed the value, no db admin logged into the database and changed it.
What is the best way to achieve this?
Till now, I like the idea of signing the database row best: I create a MD5 hash of all the fields in the row, then send it to a timestamping signing server (have a look on wikipedia) and store the created signature with the row. From this time on, we can prove that no one changed the row since this stamp was created.
Any better ideas? And, if you like the idea as much as I do, what timestamp server should I use and how can I access it? The Verisign Timestamp Server seems to be used a lot, but I could not find any documentation on how to use it "raw", e.g. without the Microsoft code signer tools etc.
Thank you!
Time stamp servers are usually not free-to-use.
Alternatively you may use an HMAC-MD5 (or HMAC-SHA1) instead and use a password that is only known to the authorized user. The password is of course not directly used, better via PKCS#5 or at least hashed with a seed. Without the password noone can verify or recreate the HMAC-MD5

What is the best way to create 'versions' of uploaded files?

In my application people will upload resumes and they can update the resumes I am storing. The resumes use a file stream in a database. That is working fine. But now I want to track versions of the uploaded resumes to find the latest and previous resume.
What is the best way to do this?
What I would do if I were you, would be to add a versionNumber column to the table, and when the "Update" their resume, I would just write a new entry to the database. You should then have a column called ResumeActive or something similar as a Bit field. just mark the most recent resume as the active and mark all the others as inactive.
Should they wish to rollback their resume to a previous version, just mark that as active and mark all the others as inactive. I hope this helps and that I understood your question correctly.
You could also use a storage engine that is aware of document versions and this be able to not only track versions but also quickly switch between them and view differences. If you're using windows for your solution you could investigate Sharepoint ($) or Sharepoint Portal Services (free)
Use a normal or binary diff, and on each change, store the result of the diff in the database, with the version number. So if a user wants to revert back, apply all the diffs upto that version. This will take up lesser space than storing each version of the whole file.