Compare commits

...

10 commits

Author SHA1 Message Date
7d3a51cdfd update Mastodon link 2025-10-21 15:55:29 -07:00
3820726136 remove more cruft 2025-08-01 07:55:40 -07:00
40e256c48f remove old social stuff 2025-08-01 07:54:23 -07:00
11abc83110 add tracking using Umami 2024-05-31 19:42:29 -07:00
50e00e8cd2 update about me page 2022-07-11 16:40:55 -07:00
eda7c79437 add some tags 2022-07-11 16:36:57 -07:00
e0152e2970
[post] cheating at wordle with grep (#9)
* [post] cheating at wordle with grep

* trim whitespace

* touch up

* break lines
2022-07-11 16:06:48 -07:00
7ec1af8a5e add rel=me to Mastodon link 2022-04-25 16:53:21 -07:00
7fe385c919 add a link to the wiki 2022-02-20 08:32:28 -08:00
35f2ccc54a fix things which aren't tags 2021-01-08 22:01:20 -08:00
5 changed files with 72 additions and 41 deletions

View file

@ -5,15 +5,14 @@ slug: about
--- ---
![jawn](/media/img/nick.jpg) ![jawn](/media/img/nick.jpg)
By day I'm a Site Reliability Engineer on the Cluster Operations team at By day I'm a Site Reliability Engineer on the Fleet Automation team at
[Dropbox](https://dropbox.com), where I help provide the tools and services to [Dropbox](https://dropbox.com), where I help provide the tools and services to
automate our datacenters, things such as server provisioning, serve repair automate our datacenters, things such as server provisioning, OS installation,
validation, asset management, etc. server repair validation, asset management, etc.
Outside of work I'm usually found riding bikes (sometimes for long distances Outside of work I'm usually found riding bikes (sometimes for long distances
carrying camping gear), wrenching on bikes, drinking too much coffee, drinking carrying camping gear), wrenching on bikes, playing around with ham radio,
not-too-much beer, brewing the former two, or writing code to support my drinking too much coffee, or writing code to support my hobbies.
hobbies.
I'm a huge proponent of free open-source software and maintaining control of I'm a huge proponent of free open-source software and maintaining control of
your data. your data.

View file

@ -43,11 +43,6 @@ Links: [Project page](/cpu-usage-meter/), [Linux source](/media/projects/cpu_met
LEDs on the front of my computer case displaying the CPU load. LEDs on the front of my computer case displaying the CPU load.
### Serial IR Receiver (2006)
Links: [Project page](/ir-receiver/)
A simple serial-based LIRC-compatible IR reciever.
### ServCheck (PHP) ### ServCheck (PHP)
Links: [servCheck.tar.gz](/media/projects/servCheck.tar.gz) Links: [servCheck.tar.gz](/media/projects/servCheck.tar.gz)
@ -55,19 +50,3 @@ A simple service checker written in PHP. Attempts to open a socket with the
configured hosts and ports, and outputs an HTML file showing which services configured hosts and ports, and outputs an HTML file showing which services
are up and down. I originally wrote this for the TerminalUnix site to show what's are up and down. I originally wrote this for the TerminalUnix site to show what's
working and what isn't. working and what isn't.
### TerminalUnix (PHP)
A PHP and MySQL driven site, functioning as a web front-end and community site for
the TerminalUnix server. I started it because I was sick of all of these Content
Management Systems having features that I didn't want. I sat down during Spring Break
of 2006 and coded a PHP login system, not knowing about the wonders of some of the PHP
features. Eventually I coded nice things in such as MySQL access (instead of a flat
text file), a user adminstration system, and even a news sytem.
Unfortunately I don't plan on releasing the source code since it's a big hard-coded mess.
### N-Queens solver (C++)
Links: [nqueens.tar.gz](/media/projects/nqueens.tar.gz)
Another Data Structures homework assignment. This solves (brute-forces) the
[N-Queens Problem](https://www.google.com/search?q=n-queens+problem) using recursion and backtracking.

View file

@ -41,7 +41,7 @@ ACTION=="remove", \
``` ```
The VENDOR_ID and MODEL_ID can be found by running the `lsusb` command, which The VENDOR_ID and MODEL_ID can be found by running the `lsusb` command, which
shows this as "ID <vendor id>:<model id>", for example "ID 6b62:6869". shows this as "ID vendor_id:model_id", for example "ID 6b62:6869".
And of course, here's the script `/usr/local/bin/kvm-udev` which takes care of And of course, here's the script `/usr/local/bin/kvm-udev` which takes care of
the auto-connecting. It takes two parameters, first either being "attach" or the auto-connecting. It takes two parameters, first either being "attach" or

View file

@ -0,0 +1,58 @@
date: 2022-07-11
title: 'Cheating at Wordle with grep'
tags:
- linux
---
I usually try to make a good effort at
[Wordle](https://www.nytimes.com/games/wordle/index.html), but sometimes I get
down to the last one or two chances and need some help. Instead of anything
fancy-pants, I usually turn to a dictionary file and my friend, `grep`.
So, first thing's first, you need a dictionary file, which is just a file with
a bunch of words one-per-line. These are usually found in `/usr/share/dict`. I
happen to have `cracklib-small` on my machine so we'll use that.
First, you'll want to get all the five-letter words out of the file. I use the
regex `^\w{5}$`, which is `^` for the start of the line, `\w` for an
alphanumeric character, `{5}` saying that there are 5 of them, and `$` for the
end of the line. The beginning and end of line markers are important, otherwise
you'll get words that contain 5 or more letters.
```
grep -E '^\w{5}$' /usr/share/dict/cracklib-small
```
At this point, I've already made some guesses and have a few letters in the
right spot, and some letters which are correct but in the wrong spot. We'll
bucket these into two `grep`s.
For letters in the right spot, I stick those right into a regex. For example,
let's say I know the word starts with 'f' and 'a':
```
grep -E 'fa\w\w\w'
```
For the right letters in the wrong spot, I simply use the letter as the regex.
If I have multiple letters, I can chain those together by piping grep like so:
```
grep s | grep t
```
So chaining them all together:
```
$ grep -E '^\w{5}$' /usr/share/dict/cracklib-small \
| grep -e 'fa\w\w\w' \
| grep s | grep t
facts
fasts
fates
faust
```
You could eliminate words that have letters you've already eliminiated by
chaining `grep -v <letter>` to the end, but I find that pretty cumbersome.
There's only a handful of possible words at this point, so I think it's easier
to just remove them in my head.

View file

@ -16,6 +16,8 @@
<link rel="stylesheet" href="{{ "css/font-awesome.css" | media_url }}" /> <link rel="stylesheet" href="{{ "css/font-awesome.css" | media_url }}" />
<link rel="stylesheet" href="{{ "css/index.css" | media_url }}" /> <link rel="stylesheet" href="{{ "css/index.css" | media_url }}" />
<script defer src="https://webstats.nickpegg.com/script.js" data-website-id="45f9e233-7863-478e-bbf1-39393bbde614"></script>
</head> </head>
<body> <body>
<div class="page-header"> <div class="page-header">
@ -45,6 +47,11 @@
</li> </li>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
<li>
<a href="https://wiki.nickpegg.com">
Wiki
</a>
</li>
<li> <li>
<a href="/rss.xml"> <a href="/rss.xml">
<i class="fa fa-rss-square"></i> <i class="fa fa-rss-square"></i>
@ -62,23 +69,11 @@
</a> </a>
</li> </li>
<li> <li>
<a href="https://mastodon.social/@nickpegg"> <a rel="me" href="https://sfba.social/@nickpegg">
<i class="fa fa-comments"></i> <i class="fa fa-comments"></i>
Mastodon Mastodon
</a> </a>
</li> </li>
<!--<li>
<a href="https://instagram.com/nickpegg0">
<i class="fa fa-instagram"></i>
Instagram
</a>
</li>-->
<li>
<a href="https://twitter.com/nickpegg">
<i class="fa fa-twitter-square"></i>
Twitter
</a>
</li>
<li> <li>
<a href="https://linkedin.com/in/nick-pegg"> <a href="https://linkedin.com/in/nick-pegg">
<i class="fa fa-linkedin-square"></i> <i class="fa fa-linkedin-square"></i>