I noticed that Freemarker1 does not yet support the Java SE 8 Date and Time2. I noticed this, because I tried it. It just tries to parse the toString() and it fails.
There's already blogs about it.
So I had to add a little dependency to provide this, courtesy of Jakob Vad Nielsen3.
Since git 2.8 it is possible to work with "Worktrees". These are extra maps you can use to checkout a branch. This is instead of changing your current working directory contents by checking out a different branch (and by extention messing up your build targets and artifacts and stuff).
At work, unfortunately, we are using Fedora Core 25 (a little old, but we are sure to update any day now).
So I decided to install git from source1. Apparently we're already up to version 2.23.0
At home, I do not use worktrees2, and I managed to avoid it at work too. But the situation has progressed in such a fashion that the branches are starting to differ soo much that a reset maven profiles/clean/rebuild/redeploy is required when switching branches, costing me valuable development time.
Creating a new worktree from the master
git worktree add -b feature_branch ../new_folder
Creating a new worktree from the master from an existing branch
git worktree add ../new_folder feature_branch
Use --detach instead of -b branch to create a worktree without a branch.
Gebruik --detach ipv -b branch om een losgekoppelde worktree aan te maken zonder een branch.
Removal of a worktree
rm -rf ../new_folder && git worktree prune
It all seems easy enough.
For some reason the new git also enables me to simply checkout the svn repo (we're still using SVN at the moment) without any pains like in the past (for example bombing out because it takes too long). Perhaps something has changed in our SVN setup, I don't know.
In this blogpost I mentioned a python script that automatically renews certificates for payara2. Unfortunately, it's not quite a perfect fit for me, as I do not run payara on port 80, which the script requires.
My setup has an nginx running on port 80, that basically forwards all requests to the https version of the website.
So I could simply turn off nginx, re-certify and turn nginx back on.
This simple bash script is as follows:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/home/payara/payara5/bin/asadmin --user=admin --passwordfile=passwordfile.txt set server.network-config.network-listeners.network-listener.http-listener-2.enabled=false
echo ---- Enabling http listener...
/home/payara/payara5/bin/asadmin --user=admin --passwordfile=passwordfile.txt set server.network-config.network-listeners.network-listener.http-listener-2.enabled=true
Congratulations, all renewals succeeded. The following certs have been renewed:
/etc/letsencrypt/live/www.mrbear.org/fullchain.pem (success)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
---- Adding certificates...
/home/payara/payara5/glassfish/domains/production/config/keystore.jks
Private key with alias [s1as] added to keystore /home/payara/payara5/glassfish/domains/production/config/keystore.jks.
Command add-pkcs8 executed successfully.
---- Disabling http listener...
server.network-config.network-listeners.network-listener.http-listener-2.enabled=false
Command set executed successfully.
---- Enabling http listener...
server.network-config.network-listeners.network-listener.http-listener-2.enabled=true
Command set executed successfully.
---- Done.
And your certificate is renewed. I am most pleased that this is soo easy in Payara/Glassfish.
In order to properly automate this, the master password must be stored somehow, and it's possible to do this via the --passwordfile=passwordfile.txt commandline parameter.
I found a good blogpost on how to do this at .Lost in Coding3.
And also the blogpost on [4] to get me started on how to do this.
Verifying that the keystore contains the appropriate stuff, can be done as follows:
# keytool -list -keystore /home/payara/payara5/glassfish/domains/production/config/keystore.jks
Enter keystore password:
Keystore type: jks
Keystore provider: SUN