hrbrmstr's Daily Drop

Share this post

2022-04-19.01

dailyfinds.hrbrmstr.dev

2022-04-19.01

Grepping "The Game" (a.k.a. Solving Wordle); Nmap for the Forgetful🐘 (a.k.a. nmapAutomator); Aliases

boB Rudis
Apr 19, 2022
2
1
Share this post

2022-04-19.01

dailyfinds.hrbrmstr.dev

Grepping "The Game" (a.k.a. Solving Wordle)

Since the launch,Ā Wordle, or as I call itĀ "The Game", has consumed grey mater cycles of large sections of the English-speaking/reading populace. You all know the premise:guess a word in six or fewer steps with hints as to how accurate your letter posits were.

I suspect most humans try to solve the daily puzzle with just their built-in gray matter. However, just like in theĀ crossword puzzle solving world, a subset of creative folks have crafted bespoke tools toĀ help solve Wordles. SomeĀ use "AI"; others applyĀ brute forceĀ or useĀ entry optimization.

One of the moreĀ interesting approachesĀ I've seen recently involved usingĀ regular expressions(regex) andĀ grepĀ to narrow down possible words from theĀ official Wordle word listĀ (which has changed a bit since the NYTimes absconded with the app).

The linked article is short, but I excerpt a bit of the technique a here (especially because I'm linking to another Wordle post by the same author at the end of the section).

For use of the starting word "LATER":

later
Source: Dr. Drang’s Blog

the idea is to ultimately craft a regular expression that gets to the a set of choices for the final solution.

[Starting] withĀ L:

$ egrep l

I figured the second letter had to be a vowel. AlthoughĀ LLAMAĀ is a legitimate word, I refused to believe Wordle would be so evil as to have two repeated letters. And even if it were, the A had already been eliminated. So that set the second slot:

$ egrep l[iouy]

The third slot couldn’t be a T or any of the eliminated letters:

$ egrep l[iouy][^aert]

Now I was faced with the T being in either the fourth or fifth position. Instead of trying to come up with a complicated pattern that handled both cases, I decided to use two simple patterns: one with the T in the fourth spot and one with it in the fifth. With the T in fourth spot the full command was

$ egrep l[iouy][^taer]t[^aers] scrabble5.txt
linty
lofty
lusty

where you’ll notice that I didn’t allow S in the last spot. This is because, despite what I said about the prevalence of plurals in Scrabble words, a month of playing Wordle has led me to believe that plurals aren’t used. They’re allowed in guesses, of course, but I’ve never seen a plural solution.

I doubt that Wordle would useĀ LINTY, butĀ LOFTYĀ andĀ LUSTYĀ are pretty good words. So I’d already disproved my hypothesis aboutĀ LIGHT. Continuing on with the pattern that had T in the final position,

$ egrep l[iouy][^taer][^aer]t scrabble5.txt
licht
licit
light
limit

LICHTĀ is beyond the pale, and I had my doubts about Wordle usingĀ LICIT, butĀ LIMITĀ is a perfectly good word. So that’s three or four words other thanĀ LIGHTĀ that could have been the solution. I just wasn’t thinking straight when I convinced myself that my first guess had locked inĀ LIGHT.

I suspect the results are even better when using the official word list vs. a list of legit five-letter Scrabble words.

The author also has anotherĀ neat way to solve these puzzles.

I wonder if this is another example of when to possiblyĀ use a regex vs. machine learning.

Nmap for the Forgetful 🐘 (a.k.a. nmapAutomator)

I amĀ #NotAFanĀ of theĀ "… for Dummies"Ā series of books, mostly due to the titles. While it's fairly likely that those who consume said tomes realize the "dummies" part is just self-deprecation (which is something thatĀ isn't all that emotionally greatĀ for us), the truth is that we look for certain book idioms that fill a knowledge gap.

The same is true for tools that help us wield powerful frameworks such asĀ Nmap. We'll let Nmap'sĀ manual page define itself:

Nmap (ā€œNetwork Mapperā€) is an open source tool for network exploration and security auditing. It was designed to rapidly scan large networks, although it works fine against single hosts. Nmap uses raw IP packets in novel ways to determine what hosts are available on the network, what services (application name and version) those hosts are offering, what operating systems (and OS versions) they are running, what type of packet filters/firewalls are in use, and dozens of other characteristics. While Nmap is commonly used for security audits, many systems and network administrators find it useful for routine tasks such as network inventory, managing service upgrade schedules, and monitoring host or service uptime.

Nmap is aĀ powerfulĀ tool withĀ scads of command-line options, overĀ 600 scripts, and nearlyĀ 140 libraries. Needless to say, it can be a bit, er,Ā daunting, even to the experience wielder. Thus, entersĀ nmapAutomator.

Mark Zenman does a great jobĀ introducing nmapAutomatorĀ over on theĀ scip AG blog, so I won't steal his thunder, just give you an overview of they key points that are covered.

  • Simpler commands, and more verbose help than regular nmap

  • Nice, human-readable output during operation

  • Limited default scans, although easy to change

  • Recommendations are based on a static list

  • nmapAutomator has very few dependencies

If you're new to Nmap or would just like to simply use of it on occasion, definitely give Mark's overview a read.

Aliases

Since I had two "also known as"" entries in today's installment, I thought closing with a look at the use of aliases (a.k.a courtesy name, code name, pseudonym/pen name, stage name, nickname, secret identity, handle) might be a fun, non-techincal diversion.

One of my all-time favorite novel series is "The Expanse", which is written under the pseudonym, "James, S. A. Corey", and the two authors behind that pen name are hardly the first to ever publish under a different name, or human to take on an alternate name in different contexts. I mean, even I answer to the phonic incantation of "hrbrmstr" as much as I do my real first name.

  • Charles Dickens used "Boz" as a pseudonym for a bit

  • C. S. Lewis is a pseudonym for "Clive Hamilton and N. W. Clerk"

  • Theodor Seuss Geisel is our (generally) beloved "Dr. Seuss"; and

  • Mark Twain was Samuel Clemens IRL

  • Norma Jeane Mortenson is the infamous "Marilyn Monroe"

  • "Michael Caine" is an alias for IRL "Maurice Joseph Micklewhite" (which is all kinds of an awesme IRL name IMO)

  • Nicolas Kim Coppola is known to us as "Nicolas Cage" (which I hopedĀ his recent movieĀ used somewhere)

  • Sting's original nom de plume was "Gordon Sumner"

  • Edward Teach pirated the (fairly boring) name "Blackbeard", and

  • The Sundance Kid sure sounds cooler than "Harry Alonzo Longabaugh"

I did not know that many fictional characters most of us are familiar with are, in fact, aliases as well:

  • "Cap’n Crunch" is "Horatio Magellan Crunch"

  • "Cookie Monster" was originally "Sid"

  • "Shaggy", from Scooby-Doo is really "Norville Rogers"

  • The "Wizard of Oz" is Oscar Zoroaster Phadrig Isaac Norman Henkle Emmannuel Ambroise Diggs (which I don't believe was expanded upon in the films.)

There areĀ tons more examplesĀ via Your Dictionary, as well as aĀ solid Wikipedia article on pseudonyms; plus aĀ 2011 bookĀ on why — especially authors — use these misdirections.

FIN

What are some of your favorite aliases from stage, screen, books, fiction, or social media?

If you do answer that question or interact in the comments, the only rule is kindness. ☮

1
Share this post

2022-04-19.01

dailyfinds.hrbrmstr.dev
1 Comment
Richard Careaga
Writes Richard’s Newsletter
Apr 19, 2022

I help my wife when she gets stuck on W. I have the old list as the search space, use her rejects and inclusions to narrow, then any good or off positions to narrow, usually to a handful of candidates all with good old grep. /s/ Silence Dogood, AKA B. Franklin

Expand full comment
ReplyCollapse
TopNewCommunity

No posts

Ready for more?

Ā© 2023 boB Rudis
Privacy āˆ™ Terms āˆ™ Collection notice
Start WritingGet the app
SubstackĀ is the home for great writing