Posts

Adding Verbal Warnings and Time Quotas Configurable by Account for Forced Logouts in Programmatic MacOS Parental Controls

Building upon the original Restoring Forced Logouts Removed from MacOS Parental Controls , the original refinements , and the New Year updates to them, I have since added code to add the following features. Give two verbal warnings about (approximate) time remaining before forced logout; and Make the minutes allowed per day a configurable property which can be customized for individual accounts. The first was added as a courtesy to our boys. The second was added to allow cutting back or eliminating hours for each boy individually if they didn't complete their list of basic daily tasks to be done to be allowed the full amount of computer time for the following day, or to increase it for sick days and the like. Making it a property also allows changing it on the fly, without having to alter the code, and also eliminates some very inconvenient hard-coded values. The properties were added to the end of the application.properties file. At the same time, I added a missing J...

Sara Sleep Talking Quotes, Part 27

Hey, where are you going? Come here. - Sara, November 15, 2018

Website FINALLY Adapted to Apple Silicon

Back in March, I took advantage of a sale at Costco, advanced the inevitable update, and bought a blue-colored iMac. With its Apple M1 chip , after reinstalling essential packages using Homebrew , I had to make multiple changes to the Apache and Tomcat server configurations to allow my website, and the Tomcat server serving the biking weather suitability forecast application, to work properly again. Since these explorations - including a dead end trying to switch from using Apache to Nginx for the web server, given what seems to be the trend and the latter's apparent strength being reverse proxy work - were done very sporadically, it took me until this month finally to get it right. One thing I am glad I did relatively early in the process was to make the new configuration folders git repositories, so I could review the history of document changes and, more importantly, reverse them if needed. This was done using the following steps for the Apache (httpd) folder: cd /...

My Java Version of the Original "Oregon Trail" Game

I have completed coding of a Java port of the original "Oregon Trail" text-based computer game, based on the 1978 BASIC source code. More details and the source code may be found at my github page for the project .

Further New Year Updates for Forced Logouts in Programmatic MacOS Parental Controls

Early this January, 2022, Sara and I noticed that it seemed like the boys could stay on the computer much longer than what the forced time quotas my refined program enforced. Investigating the code revealed something I should have anticipated, having been part of a " Y2K readiness team" earlier in my career. The problem was that my "UserLoginTime" objects were obtained given the output from the bash shell's "who" command, which only shows the login time for users using a two-digit month and two-digit day, but no year. When I constructed UserLoginTimes that were holdovers from old logins at the end of December 2021, the code was assuming that it was December of the current year - nearly a year in  the future. So, when checking whether the total time online for the boys was greater than the specified value, the code was subtracting a future date and time from the current date and time, resulting in a negative "elapsed time", thus never timi...

Sara Sleep Talking Quotes, Part 26

[giggles] What's going on? - Sara, October 29, 2018

Adding a Dark Theme to the Biking Weather Suitability Forecast Application

Image
Having read a few articles online about offering a dark theme as part of improving accessibility for certain people, I decided to add a dark theme option both for my website overall, and for the Biking Weather Suitability Forecast application. I will discuss what steps I took to add this to my web application; similar changes needed to be made for overrides to the default theme CSS and script files for the general website. The easiest thing to do was to download the dark version of the "Powered by Dark Sky" icon. This will likely need to be removed in a few months, after Dark Sky stops their "grandfathered" API support at the end of 2022. Next, I added some overrides at the bottom of my main.css file for the case when the user-specified preferred color scheme is dark , such as when choosing "dark mode" on an iPhone or Mac. /* Dark mode color scheme */ @media(prefers-color-scheme: dark) { body, .card, .table, caption { background-color: black; color:...

Refining Forced Logouts in Programmatic MacOS Parental Controls

It did not take long for the more math- and computer-oriented of our twin sons to figure out the loophole I mentioned at the end of my original post, " Restoring Forced Logouts Removed from MacOS Parental Controls ": Crafty minds can probably already spot one loophole with how this works. The kids will only get logged out from their current session if the current session has been an hour or more. There is nothing checking their usage for the day. So, if they want to get the most time, they could log in for, say, 50 minutes, and then log in a few minutes later for another 50 minutes or so, and so forth. The fix will involve a more complex refinement. I think I will need to create a small database of total minutes logged in per day and user (for the monitored kids, not the adults), and add 5 minutes for every time they show up as being logged in by the every-5-minute-run of LogTimerApp. Then, if the total time for the day hits the hour limit, then do the logout. So, I ...

Restoring Cron Job Functionality in MacOS

I have used cron jobs to do database backups and other maintenance on servers I have run at home, previously on versions of Ubuntu and Linux Mint, and currently on MacOS. Some change that happened to MacOS between the "Mojave" and "Big Sur" versions broke cron jobs that had worked for years. A cron job that would create a database restore query was suddenly creating an empty file on its daily scheduled run. The job that was supposed to update my SSL certificate when it was due for renewal never succeeded in updating it. As I searched for a solution to this problem, I came across multiple recommendations for two different items, and the combination of the two of them has resulted in my cron jobs working again. Make sure the full path is specified for all programs and script files executed, both within the cron job itself, and within the script files that it calls. This is probably the true solution, of the two items. Make sure that cron has "Full Disk ...

Beware "Morally Superior" Food

One thing you learn when living with celiac disease and are forced to shell out the additional funds for the less tasty gluten-free versions of foods, is that the packaging of several gluten-free foods also like to broadcast their "moral superiority" with a lot of buzzwords and catch phrases. You can pretty much count on seeing "organic". "Nut free" or "dairy free" don't quite fall into this category, since they address other dietary allergies, but it does often seem that the more things of which the food is "free", the more likely it will also be fairly "taste-free". I have learned to be especially on guard whenever a food is advertised as being "vegan". If the packaging tells about the family members that own the company or gives a short biography of the free trade farmer who harvests the grains for the resulting product, but doesn't say anything about the taste of the product, there is usually a reason. ...

Restoring Forced Logouts Removed from MacOS Parental Controls

At some point between the release of MacOS "Mojave" and MacOS "Big Sur", one of the key features that I liked about the parental controls — the ability to force logouts from the Mac after the time quota for the day was met — was removed. This is my least favorite removal of a previous feature of the Mac operating system since the removal of the photo mosaic screen saver with the change from Lion to Mountain Lion (see this old video for an example of what it used to look like). While I know the focus now is on screen time specific to various apps across all devices, we really only have the one Mac that our boys use and which we want to limit their time on, and we don't want them to use up their allotted hour on, say, Minecraft, and then spend another hour browsing YouTube videos in a web browser. Since I could not find any way to force logouts after a time using the current "Screen Time" settings in MacOS Big Sur, I decided I would have to come up wi...

Sara Sleep Talking Quotes, Part 25

Oh, no! [hums "Flight of the Valkyries"] - Sara, October 21, 2018

Sara Sleep Talking Quotes, Part 24

Then Spidey gave Pence an amazing pencil.... - Sara, September 21, 2018

Sara Sleep Talking Quotes, Part 23

Don't play with that. It's been on the floor. - Sara, August 16, 2018

A Simple Example of Using Spring Aspect Oriented Programming to Log the Beginning and End of All Methods in All Classes in a Package

I have often seen, in development work, certain types of code fragments that get repeated many times throughout the code, which would seem a prime use case for Aspect Oriented Programming (AOP). I thought I would try creating an aspect to do debug logging in my Biking Weather Suitability Forecast application as follows: Do the following debug logging items for all methods in all classes in the biz.noip.johnwatne.bikingweather.service package. Log the start of a method's execution, including the name of the method and listing the parameters passed to it. For methods that return an Object or value, log the item returned. For void methods, indicate the end of the method's execution. Allow toggling the enabling of the aspect's code based on the value of a property in the application's properties file. This allows temporarily enabling the logging while testing new development, then disabling it, or, alternatively, having environment-specific properties files that woul...