I got to play with shell scripts a few times over the past few weeks, thought I’d talk about them:
Wordle Helper
I have a script I use to help me make my guesses when I play Wordle; it basically generates a list of available words based on my results, analyzes these available words (by checking the overall letter frequency, then scoring the words based on which letters they contain), and returns the word list with their scores, sorted by word score. This is especially helpful as a process of elimination, and most especially in the first rounds — I can confirm or eliminate the most common letters and quickly narrow down my choices (well, usually).
I decided at a certain point that multi-letter combinations might be even more useful, so I wrote another script to score words based on the frequency of two-letter combinations. This worked well enough that I wrote a three-letter scoring script, and then realized that I should just write something generic that would score based on however many letters I would want in my combinations.
For some reason I brought my laptop on vacation, and when things got quiet I broke it out and wrote the multiple-letter scoring script — it works like a charm. What I found though, is that there are diminishing returns for the letter combinations: there is no real advantage to use more than two letters. Still, this is a script that I use every day.
Getting SSL
Every 90 days I have to get a new SSL certificate for this website, so I can use the more secure “https” rather than plain “http.” This was once a pretty easy process, until my (free) certificate-generating organization got taken over by someone else. I found a much more onerous (but still free) web-based method and have used it for years, but I knew there had to be a better way.
I eventually found something called getssl
, a bash script that automates the process used by that onerous web-based approach. Ufortunately it’s meant to be run on the computer where the website resides, rather than on my local machine which is what I preferred, so I never really messed with it… Then one day I just set it up and ran it, and it basically did 99% of the work, generating the certificates and storing them on my laptop. All I had to do myself was install them manually, which was pretty easy. Awesome! The whole process went from an hour to about a minute, and I’ve been using getssl
for almost a year now.
But it still bothered me that I couldn’t get the whole process automated, and then last week I found an extra feature in getssl
that would get me that final one percent; the only problem was that the extra feature would need to be modified to run on my machine rather than remotely. (This modification turned out to be fairly straightforward, which was a bit of a surprise actually.) I managed to make the code change just a few days ago — again, while out of town with my laptop — and my current certificate was installed, fully automatically, using the modified feature.
Neither of these little projects were hard, but it’s so seldom that I do anything like this anymore that I was pretty proud of my accomplishments.