commit 86aff00a55d156a0a9a81c04ec2c110f4bd441a3
parent d38a8c9412c48b1feb7e48010d465f1256bf1112
Author: Jack Sangdahl <jack@pngu.org>
Date: Sun, 18 Jan 2026 09:57:19 -0700
Fix code block rendering and some more content ish
Diffstat:
8 files changed, 65 insertions(+), 156 deletions(-)
diff --git a/gpg_key_git.html b/gpg_key_git.html
@@ -15,20 +15,14 @@
I spent much time trying to figure out the following error when trying to
sign a commit:
</p>
- <pre>
- <code>
-gpg: skipped "Foo Bar <FooBar@baz>": No secret key[GNUPG:] INV_SGNR 9 FooBar <FooBar@baz>[GNUPG:] FAILURE sign 17
-gpg: signing failed: No secret key
- </code>
- </pre>
+ <pre><code>gpg: skipped "Foo Bar <FooBar@baz>": No secret key[GNUPG:] INV_SGNR 9 FooBar <FooBar@baz>[GNUPG:] FAILURE sign 17
+gpg: signing failed: No secret key</code></pre>
<p>
After searching and coming up empty handed, one thing stood out. The name
and email in <code>~/.gitconfig</code> must match exactly to the name and
email associated with the GPG key:
</p>
- <pre>
- <code class="language-shell">
-$ gpg --list-secret-keys --keyid-format=long
+ <pre><code class="language-shell">$ gpg --list-secret-keys --keyid-format=long
/home/foo/.gnupg/pubring.kbx
-----------------------------
sec rsa4096/FC53C827D09C7050 2019-03-24 [SC]
@@ -40,9 +34,7 @@ $ head -n 4 .gitconfig
[user]
<strong>name = Foo Bar
email = Foo_Bar@baz</strong>
- signingkey = FC53C827D09C7050
- </code>
- </pre>
+ signingkey = FC53C827D09C7050</code></pre>
<script src="frame.js"></script>
</body>
</html>
diff --git a/hardware_key.html b/hardware_key.html
@@ -26,12 +26,8 @@
tool is somewhat broken with the latest FIDO2 library, meaning it must be
installed explicitly at 0.9.3.
</p>
- <pre>
- <code class="language-shell">
-$ pip install solo1
-$ pip install fido2==0.9.3
- </code>
- </pre>
+ <pre><code class="language-shell">$ pip install solo1
+$ pip install fido2==0.9.3</code></pre>
<p>
After building, I didn't use it much, as many services don't support
security keys quite yet, or required a paid subscription (I.e. Bitwarden).
@@ -54,13 +50,9 @@ $ pip install fido2==0.9.3
>
if you choose however.
</p>
- <pre>
- <code class="language-shell">
-$ mkdir ~/.config/Yubico
+ <pre><code class="language-shell">$ mkdir ~/.config/Yubico
$ pamu2fcfg > ~/.config/Yubico/u2f_keys
-Enter PIN for /dev/hidraw2:
- </code>
- </pre>
+Enter PIN for /dev/hidraw2:</code></pre>
<p>
Assuming all has been successful, you can configure PAM services to use
the device. The following configures
@@ -69,13 +61,9 @@ Enter PIN for /dev/hidraw2:
line can be added in other files where needed (eg. display manager,
<code>system-local-login</code>, etc.)
</p>
- <pre>
- <code>
-auth sufficient pam_u2f.so cue pinverification=0
+ <pre><code>auth sufficient pam_u2f.so cue pinverification=0
auth include system-auth
-...
- </code>
- </pre>
+...</code></pre>
<p>
Above, <strong>sufficient</strong> indicates that authentication from the
device alone is enough to fully authenticate. Use
@@ -95,9 +83,7 @@ auth include system-auth
<a href="https://pamtester.sourceforge.net" target="_blank">pamtester</a>
to test for authentication success.
</p>
- <pre>
- <code class="language-shell">
-#!/bin/bash
+ <pre><code class="language-shell">#!/bin/bash
if [ "$1" == "lock" ]; then
# lock system (e.g. gtklock -d)
@@ -106,21 +92,15 @@ else
# kill lock program
fi
fi
-exit 0
- </code>
- </pre>
+exit 0</code></pre>
<p>
Now, a custom udev rule that lives in
<code>/etc/udev/rules.d/70-solokey.rules</code>
and looks for a matching VID/PID and executes this script when found with
the appropriate argument.
</p>
- <pre>
- <code>
-ACTION::"remove", ENV{DEVTYPE}::"usb_device", ENV{PRODUCT}::"0483/a2Ca", RUN+:"/usr/local/sbin/keyauth.sh lock"
-ACTION::"add", ENV{DEVTYPE}::"usb_device", ENV{ID_BUS}::"usb", ENV{PRODUCT}::"0483/a2Ca", RUN+:"/usr/local/sbin/keyauth.sh unlock"
- </code>
- </pre>
+ <pre><code>ACTION::"remove", ENV{DEVTYPE}::"usb_device", ENV{PRODUCT}::"0483/a2Ca", RUN+:"/usr/local/sbin/keyauth.sh lock"
+ACTION::"add", ENV{DEVTYPE}::"usb_device", ENV{ID_BUS}::"usb", ENV{PRODUCT}::"0483/a2Ca", RUN+:"/usr/local/sbin/keyauth.sh unlock"</code></pre>
<script src="frame.js"></script>
</body>
</html>
diff --git a/programs.html b/programs.html
@@ -22,52 +22,45 @@
A fancy <code>cat</code> alternative with line numbers and syntax
highlighting. The <code>--all</code> flag is especially helpful for
showing spaces, tabs, and line endings in files.
- </p>
- <pre>
- <code class="language-shell">
-$ cat .zshrc
-─────┬──────────────────────────────────────────
- │ File: .zshrc
-─────┼──────────────────────────────────────────
- 1 │ #!/bin/zsh
- 2 │
- 3 │ if [ "$(tty)" = "/dev/tty1" ]; then
- 4 │ exec dbus-run-session sway
- 5 │ fi
- </code>
- </pre>
- <p>
The only configuration really needed is setting the theme and perhaps
more preferentially, an alias that also disables paging, like normal
<code>cat</code> output:
</p>
- <pre>
- <code>
-export BAT_THEME="base16"
-alias cat="bat --paging=never"
- </code>
- </pre>
+ <pre><code>export BAT_THEME="base16"
+alias cat="bat --paging=never"</code></pre>
</li>
<li>
<a href="https://direnv.net" target="_blank">direnv</a>
<p>
Allows for a shell script to be run upon entering a directory. This is
particularly useful for automatically activating Python virtual
- environments.
+ environments. Configuration consists of creating the <code>.envrc</code> file that is sourced at entry, and allowing this to happen by running <code>direnv allow</code> within the directory.
+ <pre><code class="language-shell">if [ -f ".venv/bin/activate" ]; then
+ source .venv/bin/activate
+fi</code></pre>
</p>
</li>
- <li><a href="https://github.com/junegunn/fzf" target="_blank">fzf</a></li>
- <li><a href="https://github.com/lsd-rs/lsd" target="_blank">lsd</a></li>
- <li><a href="https://neovim.io" target="_blank">neovim</a></li>
- <ul>
- <li>npm required for some plugins</li>
- </ul>
+ <li><a href="https://github.com/lsd-rs/lsd" target="_blank">lsd</a>
+ <p>A fancy <code>ls</code> alternative that mostly provides intuitive colours and icons. As for configuration, I found it beneficial to <a href="https://git.pngu.org/dots/tree/.config/lsd/config.yaml" target="_blank">trim down</a> some of the default output, and <a href="https://git.pngu.org/dots/tree/.config/lsd/colors.yaml" target="_blank">configure colours</a> accordingly.</p>
+ </li>
+ <li><a href="https://neovim.io" target="_blank">neovim</a>
+ <p>My Neovim configuration is based on <a href="https://nvchad.com" target="_blank">Nvchad</a>, and configured with my desired language servers, formatters, and plugins. The following packages are installed through <a href="https://mason-registry.dev" target="_blank">Mason</a>:</p>
+ <ul>
+ <li><a href="https://docs.astral.sh/ruff" target="_blank">Ruff</a>: Python formatter and linter</li>
+ <li><a href="https://github.com/python-lsp/python-lsp-server" target="_blank">Python LSP</a>: what it says on the tin</li>
+ <li><a href="https://prettier.io" target="_blank">Prettier</a>: formatter for HTML and CSS (for me at least). This package unfortunately requires <code>npm</code> to be installed on the host system.</li>
+ <li><a href="https://github.com/LuaLS/lua-language-server" target="'_blank">Lua LSP</a>: also what it says on the tin</li>
+ <li><a href="https://github.com/JohnnyMorganz/StyLua" target="_blank">Stylua</a>: Lua formatter</li>
+ <li><a href="https://github.com/chipsalliance/verible" target="_blank">Verible</a>: SystemVerilog language server, formatter, and linter</li>
+ </ul>
+ </li>
<li>
<a href="https://github.com/BurntSushi/ripgrep" target="_blank"
>ripgrep</a
>
+ <p>An incredibly robust <code>grep</code> alternative, which I am quite sure I do not use to its full potential. Things like omitting directories are especially useful, and also intuitive — e.g. <code>rg -g '!dir/' foo</code>.</p>
</li>
- <li><a href="https://starship.rs" target="_blank">starship</a></li>
+ <li><a href="https://starship.rs" target="_blank">starship</a><p>An alternative terminal prompt to <code>$</code> that has extensive customisation and functionality regarding current working directory. </p></li>
<li>
<a href="https://github.com/XAMPPRocky/tokei" target="_blank">tokei</a>
</li>
diff --git a/ssh_agent.html b/ssh_agent.html
@@ -20,17 +20,13 @@
file (e.g.
<code>~/.zshrc</code>).
</p>
- <pre>
- <code class="language-shell">
-if [ ! -S $HOME/.ssh/ssh_auth_sock ]; then
+ <pre><code class="language-shell">if [ ! -S $HOME/.ssh/ssh_auth_sock ]; then
eval "$(ssh-agent)"
ln -sf "$SSH_AUTH_SOCK" $HOME/.ssh/ssh_auth_sock
fi
export SSH_AUTH_SOCK=$HOME/.ssh/ssh_auth_sock
-ssh-add -l > /dev/null || ssh-add
- </code>
- </pre>
+ssh-add -l > /dev/null || ssh-add</code></pre>
<p>
Then, just copy the needed key between machines with
<code>ssh-copy-id -i ~/.ssh/id_xxx.pub name@host</code>.
@@ -39,14 +35,10 @@ ssh-add -l > /dev/null || ssh-add
MacOS however, has its own provision for this. The following can simply be
added to your <code>~/.ssh/config</code> file:
</p>
- <pre>
- <code>
-Host *
+ <pre><code>Host *
UseKeychain yes
AddKeysToAgent yes
- IdentityFile ~/.ssh/id_ed25519
- </code>
- </pre>
+ IdentityFile ~/.ssh/id_ed25519</code></pre>
<script src="frame.js"></script>
</body>
</html>
diff --git a/style.css b/style.css
@@ -85,9 +85,9 @@ code {
}
pre {
+ font-size: inherit;
white-space: pre-wrap;
overflow-x: auto;
overflow-y: hidden;
display: block;
- font-size: smaller;
}
diff --git a/synacor.html b/synacor.html
@@ -49,61 +49,43 @@
</p>
<h4>Code 1</h4>
<p>This one is found in plain text in the <code>arch-spec</code> file.</p>
- <pre>
- <code>
-== hints ==
+ <pre><code>== hints ==
- Start with operations 0, 19, and 21.
-- Here's a code for the challenge website: <CODE>
- </code>
- </pre>
+- Here's a code for the challenge website: <CODE></code></pre>
<h4>Code 2</h4>
<p>
After implementing a basic interpreter that supports the first subset of
opcodes (<code>out</code>, <code>noop</code>, and <code>halt</code>), this
one is found in the output of program itself.
</p>
- <pre>
- <code>
-Welcome to the Synacor OSCON 2012 Challenge!
+ <pre><code>Welcome to the Synacor OSCON 2012 Challenge!
Please record your progress by putting codes like
-this one into the challenge website: <CODE>
- </code>
- </pre>
+this one into the challenge website: <CODE></code></pre>
<p>
Just for fun, this one can also be spotted early on in the hexdump of the
binary file:
</p>
- <pre>
- <code>
-00000210 13 00 20 00 13 00 49 00 13 00 6d 00 13 00 6f 00 |.. ...I...m...o.|
+ <pre><code>00000210 13 00 20 00 13 00 49 00 13 00 6d 00 13 00 6f 00 |.. ...I...m...o.|
00000220 13 00 46 00 13 00 7a 00 13 00 74 00 13 00 57 00 |..F...z...t...W.|
00000230 13 00 51 00 13 00 43 00 13 00 76 00 13 00 78 00 |..Q...C...v...x.|
-00000240 13 00 6a 00 13 00 0a 00 13 00 0a 00 13 00 45 00 |..j.............|
- </code>
- </pre>
+00000240 13 00 6a 00 13 00 0a 00 13 00 0a 00 13 00 45 00 |..j.............|</code></pre>
<h4>Code 3</h4>
<p>
To retrieve this code, the interpreter must be fully implemented and must
pass the initial self-tests. If those conditions are met, the third code
is printed.
</p>
- <pre>
- <code>
-Executing self-test...
+ <pre><code>Executing self-test...
self-test complete, all tests pass
-The self-test completion code is: <CODE>
- </code>
- </pre>
+The self-test completion code is: <CODE></code></pre>
<h4>Code 4</h4>
<p>
Now, the adventure aspect of the challenge begins. Pay attention to the
things of interest, and <code>take</code>/<code>use</code> them as needed,
like the tablet here.
</p>
- <pre>
- <code>
-What do you do?
+ <pre><code>What do you do?
take tablet
Taken.
@@ -112,9 +94,7 @@ What do you do?
use tablet
You find yourself writing <CODE> on the tablet. Perhaps it's some
-kind of code?
- </code>
- </pre>
+kind of code?</code></pre>
<h4>Code 5</h4>
<p>
This appears to be a maze puzzle after several entries of some cardinal
@@ -123,29 +103,21 @@ kind of code?
<a href="https://zork.fandom.com/wiki/Grue" target="_blank">Grue's</a>
numerous times.
</p>
- <pre>
- <code>
-What do you do?
+ <pre><code>What do you do?
east
Chiseled on the wall of one of the passageways, you see:
- <CODE>
- </code>
- </pre>
+ <CODE></code></pre>
<h4>Code 6</h4>
<p>
The next puzzle is a maths problem. There will be some coins each with a
numeric value that you can inspect to see. The coins must be arranged in a
specific order to satisfy the equation on the wall.
</p>
- <pre>
- <code>
-There is a strange monument in the center of the hall with circular slots and unusual symbols. It reads:
+ <pre><code>There is a strange monument in the center of the hall with circular slots and unusual symbols. It reads:
-_ + _ * _^2 + _^3 - _ = 399
- </code>
- </pre>
+_ + _ * _^2 + _^3 - _ = 399</code></pre>
<ul>
<li>Red coin: 2</li>
<li>Blue coin: 9</li>
@@ -165,16 +137,12 @@ _ + _ * _^2 + _^3 - _ = 399
completing this, a previously locked door opens and our next code is
revealed.
</p>
- <pre>
- <code>
-What do you do?
+ <pre><code>What do you do?
use teleporter
You activate the teleporter! As you spiral through time and space, you think you see a pattern in the stars...
- <CODE>
- </code>
- </pre>
+ <CODE></code></pre>
<h4>Code 7</h4>
<p>
This is by far the most clever puzzle in this challenge. There's a strange
@@ -196,15 +164,11 @@ You activate the teleporter! As you spiral through time and space, you think yo
this. Once set to the correct value (25734 in my case), the seventh code
is shown.
</p>
- <pre>
- <code>
-You wake up on a sandy beach with a slight headache. The last thing you remember is activating that teleporter... but now you can't find it anywhere in your pack. Someone seems to have drawn a message in the sand here:
+ <pre><code>You wake up on a sandy beach with a slight headache. The last thing you remember is activating that teleporter... but now you can't find it anywhere in your pack. Someone seems to have drawn a message in the sand here:
<CODE>
-It begins to rain. The message washes away. You take a deep breath and feel firmly grounded in reality as the effects of the teleportation wear off.
- </code>
- </pre>
+It begins to rain. The message washes away. You take a deep breath and feel firmly grounded in reality as the effects of the teleportation wear off.</code></pre>
<h4>Code 8</h4>
<p>
This puzzle looks to be some sort of arrangement of tiles, each with a
@@ -220,16 +184,12 @@ It begins to rain. The message washes away. You take a deep breath and feel firm
to achieve this. After inputting the appropriate cardinal directions, we
see the final code in a mirror. Of course, it is entered in reverse.
</p>
- <pre>
- <code>
-You gaze into the mirror, and you see yourself gazing back.
+ <pre><code>You gaze into the mirror, and you see yourself gazing back.
But wait!
It looks like someone wrote on your face while you were unconscious on the beach!
Through the mirror, you see <CODE> scrawled in charcoal on your forehead.
-Congratulations; you have reached the end of the challenge!
- </code>
- </pre>
+Congratulations; you have reached the end of the challenge!</code></pre>
<script src="frame.js"></script>
</body>
</html>
diff --git a/template.html b/template.html
@@ -13,9 +13,7 @@
<hr />
<p>Some text on a web page00.</p>
<p>Along with a <code>function()</code>.</p>
- <pre class="language-c">
- <code>
-int function(int x) {
+ <pre class="language-c"><code>int function(int x) {
return x * x;
}
@@ -23,9 +21,7 @@ int main() {
int x = 42;
printf("%d\n", function(x) + function(x) + function(x) + function(x) + function(x) + function(x));
return 0;
-}
- </code>
- </pre>
+}</code></pre>
<script src="frame.js"></script>
</body>
</html>
diff --git a/wpa_supplicant.html b/wpa_supplicant.html
@@ -12,9 +12,7 @@
<p><i>2022-11-26</i></p>
<hr />
<p>Frequently forgotten usage of the <code>wpa_cli</code> tool.</p>
- <pre>
- <code>
-$ wpa_cli
+ <pre><code>$ wpa_cli
> scan
...
<3>CTRL-EVENT-SCAN-RESULTS # wait for this to appear
@@ -28,9 +26,7 @@ bssid / freq / sig lvl / flags / ssid
# or if no password:
> set_network 5 key_mgmt NONE
> enable_network 5
-> save_config
- </code>
- </pre>
+> save_config</code></pre>
<p>
However, one should strongly consider moving
<a